Run multiple recoverabele sessions with screen

Sometime you nee to run a script or something like that on a remote host and you can’t be sure, that the remote session will preserve until the script has finished. Another case is mobile working. Sometimes you need the possibility to start a script on one place, send your disconnect the ssh client and open […]

Get free disk space and partitions

Show free disk space for all existing partitions (disk free): $> df -haT Example output: Filesystem Type Size Used Avail Use% Mounted on /dev/mapper/ubuntu–vg-root ext4 227G 177G 39G 83% / proc proc 0 0 0 – /proc sysfs sysfs 0 0 0 – /sys none tmpfs 4,0K 0 4,0K 0% /sys/fs/cgroup none fusectl 0 0 0 […]

Samba fileserver

All tricks round about samba fileserver goes here. Print Status: $> smbstatus -L Add User Steps to add a new samba user: add Linux-User(m creates a homedirs under /home/): $> useradd abrandt -d /home/abrandt -c “Annika Brandt” -G users -g users -m set Password: $> passwd abrandt set Samba-Password $> smbpasswd -a abrandt Samba reload […]

Sync files with rsync

To sync filesystems over ssh (with port): $> rsync -azvu –exclude-from=’./exclude.txt’ -e ‘ssh -p 26 -o StrictHostKeyChecking=no’ user@host:/PATH/TOREMOTE/FILE/ORFOLDER/ /PATH/TO/LOKAL/FILEORFOLDER; Useful parameters -o StrictHostKeyChecking=no –  tells the the source host to accept the ssh-key from the destination host –exclude-from=’./exclude.txt’ – in exclude.txt each line specifies a path to ignore through synchronization –dry-run – only simulate what would have been […]

Send a mail over a linux shell

Installation: $> sudo apt-get install sendmail $> sudo apt-get install mailutils $> sudo apt-get install postfix Send messages using the mail-command To check If  postfix is installed and ready to work on your system, you can try: $> mail info@ask-sheldon.com Subject: TEST TESTETST EOT (Shortcut: ctrl + shift + d) Reconfiguration of postfix on Debian […]

Get information about the installed linux distribution, kernel and version

Get the kernel version $> uname -a Example output: Linux bravehartk2-ThinkPad-W520 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux Or: $> uname -r Example output: 3.13.0-32-generic You can even use the following command to get the kernel version. It will also serve you information about the build date and a […]

Upload File via FTP on shell

To upload a file on the shell via FTP (https://en.wikipedia.org/wiki/File_Transfer_Protocol) you can use the wput command. Therefor you have to install it with your systems package manager (aptitude in this example): $> sudo apt-get install wput Now you can upload files like that: $> wput loacalfiletoupload ftp://user:password@host/path/to/target/on/remote/host Attention: The target path have to be relative to […]