PS1=‘aj@cchpc:$’
Crop image using Imagemagick:
It removes the white space around the image.
mogrify -trim *.png
Crop image based upon pixel
sh convert input.jpg -crop WxH+L+T output.jpg
where,
W, H= width and height of the figure;
L = Distance between the left edge of the image and left side of cropped area.;
T = Distance between the top of the image and Top of the cropped area.
Changing resolution
pdftk in.pdf cat 2-2 output singlepage.pdf
pdftk in1.pdf in2.pdf cat output joined.pdf
pdftk in.pdf cat 1-12 14-end output out1.pdf
pdfcrop IPFileName.pdf OPFileName.pdf
pdftoppm -jpeg -r 300 input.pdf output
convert -density 150 input.pdf -quality 90 output.png
pdftk broken.pdf output fixed.pdf
Several time we have a code and its executables in a directory (lets call it code directory) and we have a working folder in which we will be performing tests. Lets call it working directory.
The executable files are present as folloing
./a/very/long/path/to/code/directory/executable_file_name
Now, instead of calling code executable each time from the code we can create a soft link in working directory with the following command
link -s path_of executable path_where_to_create link
e.g. to create its link in present folder we can use
link -s a_very_long_path_to_code_dir/exename .
Note: the dot in command (.) represent the current directory.
Sometime the user require to access the software/applications installed at server. This can be easily achieved in following ways depending upon the platform you are using. Assume the following:
1. Username is ‘HarryPotter’
2. Server IP address is 192.168.8.5
STEPS
Open the terminal by “ALT + CTRL + T”.
Use the SSH command as following:
$ssh username@IP_Address
e.g. $ssh HarryPotter@192.168.8.5
After this the server asks for your password. Once you enter the password, you are in.
If you want to see the graphics while accessing the remote terminal then you have to use X11 port forwarding. For this you must do following.
X11Forwarding yes X11DisplayOffset 10 X11UseLocalhost no
Host * ForwardAgent yes ForwardX11 yes
sh $ssh -v -C -X user@host
where,If sending to remote server from computer
scp /file/to/send username@remote:/where/to/put
If receiving from remote server to computer
scp username@remote:/file/to/send /where/to/put
Between a remote source and remote receiver.
scp username@source:/location/to/file username@destination:/where/to/put
To sync the files from server A (having original copy) to server B (where data to be copied).
Install rsync on both servers. apt-get install rsync
Generate SSH key on server B (with defaults). ssh-keygen
The keys can be found in folder: /RootOfServerB/.ssh/id_rsa.pub
Copy contents of key from B to A
Copy contenet in A /RootOfServerA/.ssh/authorized_keys
Start sync by running following command at server B sh rsync -avrt --delete --rsh='ssh -p 22' root@SERVER_A_IP_ADDRESS:/path PathServerB rsync -rh --delete --progress root@IP:~/specfem3d-master ~/Documents
Setup Cron job (repeated job) /etc/crontab */3 * * * * root rsync -avrt --delete --rsh='ssh -p 22' root@SERVER_A_IP_ADDRESS:/path PathServerB/ >/dev/null 2>&1
LAPACK
https://www.assistedcoding.eu/2017/11/04/how-to-install-lapacke-ubuntu/
$ sudo apt install liblapack3
$ sudo apt install liblapack-dev
$ sudo apt install libopenblas-base
$ sudo apt install libopenblas-dev
$ sudo apt install liblapacke-dev
$ sudo apt install liblapack-dev
-lm -lblas -llapack -llapacke
OPENBLAS
$ sudo apt-get install libopenblas-dev
FFTW
sudo apt-get install libfftw3-dev libfftw3-doc