deleting a file with a weird name
Prompts you before deleting any file
rm -i -- *
#!/bin/sh
STG=".local.staging.server"
echo "#"
echo "# Note: This Script is for STG devices"
echo "# Establishing connection to ${1}${STG}"
echo "#"
ssh -i ~/.ssh/private_key user-in-the-cloud@${1}${STG}
sudo du -aBm / 2>/dev/null | sort -nr | head -n10
Add user, delete user
smbpasswd -a tik
smbpasswd -x tik
View users in Samba and identify the Home and path to use in Windows
sudo pbdedit -L -v
Access Windows Share
smbclient -U username '\\IPADDR\FOLDERNAME\'
Make sure to add user in Start > Run > compmgmt.msc
Ping Windows Machine hostname from Ubuntu
sudo apt-get install winbind
sudo apt-get install libnss-winbind
sudo apt-get install libpam-winbind
Add wins in host line in nsswitch.conf
sudo vim /etc/nsswitch.conf
Ping windows machine
$ ping WINDOWS-MACHINE-DESKTOP
Untar a tar.gz file
tar -xvf foo.tar.gz
Secrets of the tee
tee --help
rsync update only
rsync --update -raz --progress /var/www 10.1.1.1:/var
rsync --dry-run --update -raz --progress /var/www 10.1.1.1:/var
more rsync
commands
cycle through reverse-i-search on bash
Ctrl+R
or
command #useful
List all sources list on ubuntu
grep ^ /etc/apt/sources.list /etc/apt/sources.list.d/*
inside a tmux session: $ ctrl+b, d
commands
Start job running for wait network to be configured
Add optional to /etc/netplan/00-xxx.yaml file below (after your eth port):
optional: true
After changes apply it
$ sudo netplan apply
$ shutdown -r now
845 nc -zv 240b:c0e0:102:5de0:1c01:2:0:10 88
846 nc -zv 240b:c0e0:102:5de0:1c01:2:0:10 135
847 nc -zv 240b:c0e0:102:5de0:1c01:2:0:10 389
848 nc -zv 240b:c0e0:102:5de0:1c01:2:0:10 445
849 nc -zv 240b:c0e0:102:5de0:1c01:2:0:10 464
850 nc -zv 240b:c0e0:102:5de0:1c01:2:0:10 636
851 nc -zv 240b:c0e0:102:5de0:1c01:2:0:10 3268
852 nc -zv 240b:c0e0:102:5de0:1c01:2:0:10 3269
853 nc -zv 240b:c0e0:101:5571:1c01:2:0:601 88
854 nc -zv 240b:c0e0:101:5571:1c01:2:0:601 135
855 nc -zv 240b:c0e0:101:5571:1c01:2:0:601 389
856 nc -zv 240b:c0e0:101:5571:1c01:2:0:601 445
857 nc -zv 240b:c0e0:101:5571:1c01:2:0:601 464
858 nc -zv 240b:c0e0:101:5571:1c01:2:0:601 636
859 nc -zv 240b:c0e0:101:5571:1c01:2:0:601 3268
860 nc -zv 240b:c0e0:101:5571:1c01:2:0:601 3269

split file