Pages

Everything you need to know about Jupyter Notebook

To start a notebook 
In terminal, run

jupyter-notebook 

Now, the notebook will be opened in your default browser.

To change the current line as comment

Ctrl + /   (this will change the current line in to a comment. To convert multiple lines of code in to a comment, select the lines that you want to convert and then hit Ctrl + /

Running different programs in Jupyter-Notebook

You can run Bash comments in jupyter-notebook. In any cell, type %%bash then that shell can be used to to bash comments. Similarly, other programming languages also can be run. A detailed post will be written on this topic.   

E-Book Reader

Now, the e-books are published more often with .epub format. To read the e-book in linux, install fbreader.

To install in Ubuntu,

sudo apt-get install fbreader




A simple way to create a quantum entangled state? Take a deep breath.

Reversible adsorption of CO and O2 molecules with heme is an important process taking place in our body. Using a DFT+DMFT study, researchers have revealed that to describe this interaction, one need to include strong correlation effects. This strong correlation effect comes from the transition metal 'iron'. The original study is by Cédric Weber titled "Importance of Many-Body Effects in the Kernel of Hemoglobin for Ligand Binding and published in prestigious Physics journal PRL.

The associated news is:

"Take a deep breath, you just created a quantum entangled state!"



(to be updated)

Compressing using Zip package in Linux

To zip individual files:

zip Figures.zip Figure1 Figure2 Figure3

To zip a directory:

zip -r Figure.zip DirName

To unzip:

unzip Figures.zip

Converting files ( to .eps or pdf) format

For scientific publications, figures are often asked in .eps format.

To do this (from formats like .tif/.jpg/.png), in linux, the package "convert" can be used.

Try this for a file name Figure1.tif

convert Figure1.tif Figure1.eps

This will produce a Figure1.eps file in the current directory.


Some times, you may want to convert a text file (like code) which is written using vim/emacs editor.

This can be done using LibreOffice (a open source) application.

In terminal, 

libreoffice --convert-to "pdf" fileName.txt
The output will be filename.pdf 
Or, open the file in LibreOffice and save as pdf.


If all these doesn't work, some times, I use following online site to convert to eps.

https://image.online-convert.com/convert-to-eps

In this site, you can specify dpi and many attributes of the output file.







Using specific routines in LAPACK library pacakge


How to run specific modules in LAPACK in a Fortran code?

With the title "Using LAPACK library in fortran codes" in this forum, it is clearly explained.


Use call option to find the solution for the A*X = B lenear equations using the routine DGESV

call DGESV()

Compile the code by

gfortran -o output codeName -L. -lliblapack


From LAPACK page, 

"DGESV computes the solution to a real system of linear equations
    A * X = B,
 where A is an N-by-N matrix and X and B are N-by-NRHS matrices.

 The LU decomposition with partial pivoting and row interchanges is
 used to factor A as
    A = P * L * U,
 where P is a permutation matrix, L is unit lower triangular, and U is
 upper triangular.  The factored form of A is then used to solve the
 system of equations A * X = B. "

Terminal browsers

It would be a challenging task to use only the terminal for browsing through the internet.
Here is the list for Terminal-based browser.
  1. lynx  
  2. w3m 
  3. googler (from Git repository)

The iterm 1 and 2 can be installed using apt-get and the source code for googler may be obtained from Git repository.


Error in mounting sda problem in Ubuntu 16.04 (sda5)

This is a series of posts on problems and issues in using Ubuntu /Windows10 Parallel installation

This is a common problem that occur when you want to access files from Ubuntu OS (which is paralelly installed) stored in Windows 10 OS in the same hardware.

Suppose, you want to access sda5. Then, to fix this quickly, in terminal, run following command.

sudo ntfsfix /dev/sda5

Then type the password.

[sudo] password for UserName: 

This will display follwing lines.

Mounting volume... The disk contains an unclean file system (0, 0).
Metadata kept in Windows cache, refused to mount.
FAILED
Attempting to correct errors... 
Processing $MFT and $MFTMirr...
Reading $MFT... OK
Reading $MFTMirr... OK
Comparing $MFTMirr to $MFT... OK
Processing of $MFT and $MFTMirr completed successfully.
Setting required flags on partition... OK
Going to empty the journal ($LogFile)... OK
Checking the alternate boot sector... OK
NTFS volume version is 3.1.
NTFS partition /dev/sda5 was processed successfully.

Finally, if above line is displayed, you can now access files from Ubuntu.



dpkg, apt, apt-get and aptitude - what are these?


  • dpkg - the core that does the actual installs. It doesn't manage all of the packages. The others are built off it.
  • apt - a package manager that manages repositories, dependencies etc.
  • apt-get - a CLI that is used to do installs through apt.
  • aptitude - a featured command line interface and an equivalent of powerful GUI software center.

You may be interested in these posts

Error in image file conversion: convert-im6.q16: not authorized `test.eps' @ error/constitute.c/WriteImage/1037.

This error is because of the vulnerability. This allows remote execution of code using image formats. So, some Linux distributions by defaul...