Linux documentation

Bunch of linux documentation

.ssh/config file

vim /home/$USER/.ssh/config
Host <name>
    Hostname <ip>
	User <user>
	Port <PORT>
	IdentityFile /home/<USER>/.ssh/id_ecdsa
 ssh-keygen -t ecdsa -b 521
ssh-copy-id -i /home/$USER/.ssh/id_ecdsa $SSH_USER@$IP

Extend disk with vsphere

Add disk space to the vm on vsphere first then run:

fdisk –l

Enter then follow the instruction bellow to format the newly space added:

[root@ubuntu ~]# fdisk /dev/sda
 Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
 Be careful before using the write command.

Command (m for help): n
 Partition type:
    p   primary (3 primary, 0 extended, 1 free)
    e   extended
 Select (default e): p
 Selected partition 4
 First sector (62914560-104857599, default 62914560):
 Using default value 62914560
 Last sector, +sectors or +size{K,M,G} (62914560-104857599, default 104857599):
 Using default value 104857599
 Partition 4 of type Linux and of size 20 GiB is set
 
 Command (m for help): t
 Partition number (1-4, default 4):
 Hex code (type L to list all codes): 8e
 Changed type of partition 'Linux' to 'Linux LVM'

Command (m for help): w
 The partition table has been altered!
 
 Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
 The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8)
 Syncing disks.

Then add this new space to the partition

fdisk -l
partprobe
vgdisplay
vgextend <vg> <partition>
pvscan
lvextend /dev/mapper/<lv> <partition>

Exclude package from update

To Exclude

apt-mark hold <package>

To unexclude

apt-mark unhold <package>

To list on hold package

dpkg --get-selections | grep "hold"

Extend / partition

FOR UBUNTU

To extend the size of / partition just follow the commands below:

sudo vgdisplay
sudo cfdisk /dev/sdaX
# selectionner la partion a augmenté puis cliquer sur rezise puis write puis quit
sudo pvresize
sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv