Linux notes

Copy SSH id

ssh-copy-id  -i ~/.ssh/id_rsa shrysr@s.ragavan.co:~/.ssh/


Installing node js and npm on debian

curl -sL https://deb.nodesource.com/setup_12.x | bash -
apt-get install -y nodejs


Installing Go on debian

cd ~/temp


Verifying the sign

sha256sum ~/temp/go1.12.7.linux-amd64.tar.zg


Change ownership of the file

sudo chown -R ~/temp/go
sudo mv go /usr/local


Change the .profile file

cat >> ~/.profile << EOF
# Adding go to the path


Emacs can be installed via Conda

• Note taken on [2019-08-09 Fri 09:14]
One issue with using Emacs from Conda is that emacs is then no longer available as a program in the command line when you switch to another virtual environment.

The advantage of using conda is being able to quickly install reasonably recent versions of Emacs quickly on Debian type OS’s which often reference older (stable) versions of software packages by default. Using conda would avoid adding PPA’s or hunting for binaries or even compiling from source. Another advantage is that this approach can be used cross platform.

One disadvantage of this method is that the package is installed into the miniconda / anaconda package installation path. Though the instillation script of miniconda adds the path for bash, it has to be manually set for any other shell like zsh. However, once this is done – there appear to be no issues in using Emacs.

conda install -c conda-forge emacs


Virtualbox: resizing virtual disk image – vdi

It does not appear to be possible to expand the size of a fixed format vdi. The floating format has a disadvantage of a read-write overhead for expanding the disk image as it is utilised.

However, as per the documentation, after the hard disk size reaches a stable stage, this overhead becomes negligible on an average.

Therefore the vdi has to be copied (or cloned), and the floating format has to be selected. This is done using the copy option in the virtualbox media manager. Once copied, the expanded vdi image has to be attached to the guest OS.

When the attachment is complete, the hardisk will show up in the virtualbox media manager app. Now the vdi size can be adjusted to the desired value.

The next step is to download the live iso of gparted. This should be loaded as a storage device with the live CD option selected. With this loaded, the existing partitions have to be changed appropriately1. This step has to be done to enable Linux to recognise the expanded harddisk.

Once this has been, the gparted iso can be removed and the guest OS can be booted as usual. However, the UUID of the paritions have to be changed appropriately. If not changed, there will be delay during boot, especially if the swap partition has been modified.

The actual partition setup and the UUIDs can be viewed with:

lsblk -f


The appropriate UUID has to be replaced in the file /etc/fstab. Technically, the fstab file is generated by the command mkinitcpio, but sometimes a manual change is necessary.

Downgrading a single package in Arch linux

From the Arch linux wiki : archive : downgrading via downloading the Package from URL. Find the package you want under /packages and let pacman fetch it for installation. For example:

pacman -U https://archive.archlinux.org/packages/ ... packagename.pkg.tar.xz


pacman -U /var/cache/pacman/pkg/<package-name>