Linux/Unix

on my laptop UBUNTU 22.04.2 LTS I have installed ifort (installed the free version form this file: 

(l_fortran-compiler_p_2023.1.0.46348_offline.sh) Approx 845 MB file

running ifort command shows this error:


ld: /usr/local/lib/liblapack.a(xerbla.o): in function `xerbla_':

xerbla.f:(.text+0x55): undefined reference to `_gfortran_st_write'

ld: xerbla.f:(.text+0x60): undefined reference to `_gfortran_string_len_trim'

ld: xerbla.f:(.text+0x77): undefined reference to `_gfortran_transfer_character_write'

ld: xerbla.f:(.text+0x87): undefined reference to `_gfortran_transfer_integer_write'

ld: xerbla.f:(.text+0x8f): undefined reference to `_gfortran_st_write_done'

ld: xerbla.f:(.text+0x9a): undefined reference to `_gfortran_stop_string'

ld: /usr/local/lib/liblapack.a(dormtr.o): in function `dormtr_':

dormtr.f:(.text+0x2dc): undefined reference to `_gfortran_concat_string'

ld: dormtr.f:(.text+0x476): undefined reference to `_gfortran_concat_string'

ld: dormtr.f:(.text+0x4d9): undefined reference to `_gfortran_concat_string'

ld: dormtr.f:(.text+0x521): undefined reference to `_gfortran_concat_string'

ld: /usr/local/lib/liblapack.a(dormql.o): in function `dormql_':

dormql.f:(.text+0x5a7): undefined reference to `_gfortran_concat_string'

ld: /usr/local/lib/liblapack.a(dormql.o):dormql.f:(.text+0x6e4): more undefined references to `_gfortran_concat_string' follow



Use of rsync command in linux and to see the progress :

somenath@fermi:~/Documents/college-Physics$ rsync -av --progress * /media/somenath/finder/somenath/Documents/college-Physics/

Here I am copying all the files and folders (that is why * is added) to  the destination folder /media/somenath/finder/somenath/Documents/CollegePhysics/ 

folder..

Install SCILAB in Ubuntu 22.04 LTS

These are the steps:

alias scilab='LIBGL_ALWAYS_SOFTWARE=1 /usr/local/bin/scilab'

source .bashrc

Ubuntu 22.04LTS was facing problem to get my print out done from HP Laser Jet 1020 plus printer.

What I did is just typed

hp-help

in the terminal and  followed the instruction from screen. It worked..


Install Ubuntu 22.04 LTS in my Lenovo Thinkpad E430


https://ubuntu.com/tutorials/install-ubuntu-desktop#1-overview


Problem: 

When I launch SCILAB from terminal it shows 

Gtk-Message: Failed to load module "canberra-gtk-module"

The Solution is :

sudo apt-get install libcanberra-gtk-module


How to copy from Libre Office Calc and paste it in Ubuntu LibreOffice writer ?


In almost all online form fill up process, you need to upload images and signatures in JPEG format with definite file size. Lets say, 50KB. So here is the simplest and easiest way to do it in Ubuntu. (My OS is Ubuntu 18.04.5 LTS ) : Type this thing in Linux/Ubuntu terminal:

convert -resize 50% old-pict.jpg new-pic.jpeg


check the new file produced to see the size . What the command does, it reduces the original file old-pic.jpeg to its 50% and make the new-pic.jpeg.


Very painful experience

how to reduce size of pdf file

pdf2ps file.pdf

ps2pdf file.ps

it worked and helped

"open" command like Mac OS

gfortran lapack problem in my Ubuntu 12.04 LTS

Slow SSH (remote login in Ubuntu 12.04)

Solved:

Open terminal

edit /etc/ssh/ssh_config file as root.

then  comment out the last two lines in that file like this

#    GSSAPIAuthentication yes

#    GSSAPIDelegateCredentials no

And then you are done

CentOS : Adding Username and password through terminal


How to make my own command:


#!/bin/sh

latex "$1".tex

dvipdf "$1".dvi


then in the terminal type

chmod +x mycommand

sudo cp mycommand /usr/bin

this will make the mycommand file executable and copying the mycommand file inside /usr/bin which is root restricted. So we have used sudo. No we can open a new terminal and check whether the mycommand is updated as a new unix command.

Thanks,

{updated on 7th Jan 2013}


remote login

Today 07 April 2012

I face a problem like this:

The new computers in phd lab 138 were installed. So when I tried to remotely log in into "binder" machine with the host name "somenath@xxx.xx.xx.xxx" is said something like this:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!

Someone could be eavesdropping on you right now (man-in-the-middle attack)!

It is also possible that the RSA host key has just been changed.

The fingerprint for the RSA key sent by the remote host is

5c:9b:16:56:a6:cd:11:10:3a:cd:1b:a2:91:cd:e5:1c.

Please contact your system administrator.

Add correct host key in /Users/user/.ssh/known_hosts to get rid of this message.

Offending key in /Users/user/.ssh/known_hosts:1

RSA host key for server1.example.com has changed and you have requested strict checking.

Host key verification failed.

=====================================================================

What I dis is this. I searched it in google.

Got a forum.

typed in the terminal

---------------------------------------------------

ssh-keygen -R somenath@xxx.xx.xx.xxx

-------------------------------------------------

Hurrey. Its done. Now I can log into the machine down there.

OK Now sometimes you may miss the basic thing.

Open terminal

type

cd .ssh/

then delete all the things in the file known_hosts

then save the file. Do not delete that file. Just clean it.

Then try to log-in

My Colorful terminal. This is the .bashrc file

somenath@Kanaad~$vi .bashrc 

export PATH=/opt/alps/bin/:$PATH

CLICOLOR="YES"

export CLICOLOR

LSCOLORS="bxbccxdxexfxDxhbadExBx"

#

# a = black

# b = red

# c = green

# d = brown

# e = blue

# f = magenta

# g = cyan

# h = light gray

# x = default

#

export LSCOLORS

alias q="exit"

alias math="/Applications/Mathematica.app/Contents/MacOS/MathKernel"

alias bose="ssh -X somnath@xxx.xx.xx.xxx"

alias gf="/usr/bin/gfortran"

alias grace="/Applications/Grace.app/Contents/Resources/grace/bin/xmgrace"

alias gnuplot="/Applications/Gnuplot.app/Contents/Resources/bin/gnuplot"

# PS1="\[\033[4;34m\]\u@\h\[\033[4;33m\]\W\$\[\033[00m\]"

PS1="\[\033[4;30m\]\u@\h\[\033[46m\]\W\$\[\033[00m\]"

# xtblk='\e[0;30m' # Black - Regular

# txtred='\e[0;31m' # Red

# txtgrn='\e[0;32m' # Green

# txtylw='\e[0;33m' # Yellow

# txtblu='\e[0;34m' # Blue

# txtpur='\e[0;35m' # Purple

# txtcyn='\e[0;36m' # Cyan

# txtwht='\e[0;37m' # White

# bldblk='\e[1;30m' # Black - Bold

# bldred='\e[1;31m' # Red

# bldgrn='\e[1;32m' # Green

# bldylw='\e[1;33m' # Yellow

# bldblu='\e[1;34m' # Blue

# bldpur='\e[1;35m' # Purple

# bldcyn='\e[1;36m' # Cyan

# bldwht='\e[1;37m' # White

# unkblk='\e[4;30m' # Black - Underline

How to run code using make file

We want to learn today how not to enter password again and again when we are doing remote log-in

Steps:

1. Open the terminal

2. 

3. We typed 

ssh-keygen -t rsa

4. And press enter. Then don’t write or enter any passphase when these tow lines come

Enter passphrase (empty for no passphrase): 

Enter same passphrase again:

5. Now write this 

somenath@Kanaad~$ssh somenath@ip mkdir -p .ssh

and this will come

somenath@ip's password: 

6. Then write this

cat .ssh/id_rsa.pub | ssh somenath@ip 'cat >> .ssh/authorized_keys'

7. this will come. enter the password for the last time

somenath@ip's password:

When you are inside the 105’th machine and logout from there you will come back to your own somenath@Kanaad~$ machine.

And from now on if you want to log in to 105 it will not ask for any password. But what I faced is little bit interesting. 

I had to do this inside the 105 machine.

Auto ssh

somenath@Binder~$cd .ssh/

somenath@Binder.ssh$ls

authorized_keys known_hosts

somenath@Binder.ssh$chmod 640 authorized_keys

somenath@Binder.ssh$

somenath@Binder.ssh$cd ../

somenath@Binder~$chmod 700 .ssh

somenath@Binder~$exit

logout

Connection to xxx.xx.xx.xx closed.

somenath@Kanaad~$

somenath@Kanaad~$ssh somenath@xxx.xx.xx.xxx

Last login: Sat Jun 9 14:20:52 2012 from xxx.xx.xx.local

somenath@Binder~$

See, I did not have to put any password.

Hurray !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Now to add more machine in this auto login arena, you do not do

ssh-keygen again

Just type in the terminal:

ssh -X machine2@xxxxxxxxx mkdir -p .ssh

And then

that cat command.

You are done

                                           

How to make terminal in Mac OS look colorful and your slave?

Here is the solution. Write your .bashrc file in home directory. And, then write this:

alias q="exit" 

[this is for shortcut of exit. Just type "q" and enter. You will be come out of the terminal. No need to write "exit"]

export CLICOLOR="true"

export LSCOLORS="gxfxcxdxbxegedabagacad"

(this whole thing you have to write for making colorful terminal when you use vi editor to write something..)

PS1="\[\033[4;31m\]\u@\h\[\033[4;32m\]\w\$\[\033[00m\] " [makes the terminal colorful]

                                            

Classical Monte-Carlo. Ising model simulation on a square lattice (2D). The stability I have checked by plotting Binder cumulant.

Quantum Monte-Carlo very little.

---- in the process of updating...

Exact Diagonalization (I am now in the process of learning it. I am only concentrating on Spin systems.)

DMRG is must to learn. As one says DRMG ED and QMC are the triad to learn to be able to do something in the world of recent progress in Physics as its the computer world now, and most of the problems are saturated and too tough to do analytic work. One must have to learn some numerical techniques. 

Fortran programming. I follow a book by “Stephen J Chapman” and lots of googling. Some links I will update here for further information.

LaTex. This method of writing I started to learn in my M.Sc 4th Semester and stll amazed by its style and capabilities. Beamer I have used for presentation. But I prefer Keynote presentation as it gives me more freedom.

Plotting Softwares:

GNUplot. This is my ex-girl-friend. Plot 0.997 (because I use MAC OS). XMGrace.

I should mention that I have learned how to install Linux (Fedora, Ubuntu, Red Hat EL, Scientific Linux) and Windows OS (XP). I work on Mac Pro (Workstation). I don't try to play with it as its very expensive. Here I should mention that in our SPS departments there are lots of guys who are computer giants. Ravi Prakash is one of them whom I admire.


Join two .mp4 file using linux terminal

hope you have ffmpeg install

then write

 ffmpeg -i concat:"video1.mp4|video2.mp4" -codec copy output.mp4



Uninstall LibreOffice

type in the terminal:

sudo apt-get remove --purge libreoffice

sudo apt-get clean

sudo apt-get autoremove

If you want to clean the old templates which you fucked up during making your own templates...

go to .config folder hidden inside your /home

then see the libreoffice folder

delete them all to completely remove any signature of old libreoffice


Join multiple pdf files via terminal

pdftk file1.pdf file2.pdf file3.pdf cat output finaloutputfile.pdf



To join multiple jpeg file into one pdf file (which I did to make a single file of all my scanned certificates into a single pdf file) 

convert file1.jpeg file2.jpeg newonefile.pdf



Open terminal here

sudo apt-get install nautilus-open-terminal 

nautilus -q   



Make a pendrive bootable from Mac or Ubuntu to install a Linux version

On your mac

------------------------

1. Download the .iso file (lets say mylinux.iso) of any Linux OS

2. Open terminal

3. To convert .iso file to .img file type in the terminal

hdiutil convert -format UDRW mylinux.img mylinux.iso

4. type in the terminal

diskutil list

5. insert your pendrive

6. type in the terminal

diskutil list

7. find your pendrive (lets say /dev/disk2)

8. type in the terminal

diskutil unmountDisk /dev/disk2

9. type in the terminal

sudo dd if=mylinux.img of=/dev/rdisk2 bs=1m

10. type in the terminal

diskutil eject /dev/disk2

You are done. Take the pendrive from your Mac computer. And the pendrive in you hand contained bootable Linux distribution.

==========================================

On your Linux

------------------------

1. Hope you are using Ubuntu

2. insert a pendrive

2. type

sudo fdisk -l

3. see the pendrive as (example) /dev/sdb1

4.type

sudo dd if=mylinux.iso of=/dev/sdb1