Copying to usb is quite troublesome in linux, whereby the "cp" command or file manager reports that the file has been copied successfully, but if your usb drive has LED, you can see that the LED is flashing frantically as if it is doing some hard work in the background.
Monday, February 10, 2020
Expediting Files Copy to USB
Monday, December 16, 2019
Replacing Single Line Spacing with Double Line Spacing in VIM
Thanks to this post, I learned on how to replace blank lines in my text document into 2 blank lines, to make it neat and clear.
The original document, with single line spacing
My objective is to replace all single blank lines representing new lines, into 2 new lines instead. To do that in vim, I just need to press "escape" to enter command mode and type the command below, which is ":%s/^$/\r/g", where
%s is to replace all occurrence of the selection in a line
^$ for single blank lines
\r carriage return, which will print double blank lines
Tuesday, October 22, 2019
Upgrading ubuntu server 16.04 to 18.04
The process is very simple, but quite time consuming, and a fast internet will help speed up the process.
Thursday, October 17, 2019
SSH Too many authentication failures error
I encountered this error while trying to ssh into one of my client's machine, one day.
$ ssh web
Received disconnect from 192.168.0.36 port 22:2: Too many authentication failures
Disconnected from 192.168.0.36 port 22
Tuesday, October 1, 2019
Adding GPU as Resource for Slurm
To make a GPU part of resource that can be managed by Slurm, create /etc/slurm-llnl/gres.conf file with definitions of GPUs available on the node. GRES stands for generic resources, and need to be declared so that slurm can manage it.
Below example is for a node with nvidia tesla v100 gpu. Name - name of the resource, can be gpu, nic or mic
Type - arbitrary string identifying the type of device
File - Fully qualified pathname of the device files associated with a resource
Cores - specific cpu core numbers, which can use this resource
$ sudo cat /etc/slurm-llnl/gres.conf
Name=gpu Type=v100 File=/dev/nvidia0 Cores=0,1
Add GresTypes and gres resources in slurm.conf.
The format for gres resources is grestype:optional-type:number-of-resource
$ sudo cat /etc/slurm-llnl/slurm.conf
...
GresTypes=gpu
NodeName=mynode CPUs=12 RealMemory=64091 Sockets=1 CoresPerSocket=6 ThreadsPerCore=2 State=UNKNOWN Gres=gpu:v100:1
...
Restart slurm services to have the changes take effect
$ sudo systemctl restart slurmd
Check the availability of the gres
$ scontrol show node


