Wiping and shutting down a headless linux server over SSH.
Copies zeros over the whole disk.
dd if=/dev/zero of=/dev/sdaX
Where sdaX is the device you want to wipe. Read discussion at security.stackexchange.
Since the shutdown command will be trashed by the wiping, we need to force shutdown in another way.
echo 1 > /proc/sys/kernel/sysrq
echo o > /proc/sysrq-trigger
Don’t try this at home.
Perfect for long running batch jobs on a remote server over unreliable connections or if you want to bring your laptop home (instead of keeping that terminal running).
Log in and run
screen -t title_of_your_choice
Do the same thing again if you want to create another window.
All the following screen commands are preceeded by Ctrl-a (i.e. first press ctrl-a then the shortcut below)
- 0-9 – switch to window by id
- Ctrl-n – next window
- Ctrl-a – previous window
- d – quit screen (leaving it running)
- k – kill window
The next day, log in as usual and attach to the screen session using
Check the man page for screen for other options and shortcuts.
Using Linux, to get the number of files in the current directory, use:
ls -1 | wc -l
To count the number of files recursively in the current and all directories below it, use:
find . -type f | wc -l
Incremental encrypted remote backup using Amazon S3: Duplicity
Incremental backup to another (remote) directory: rdiff-backup
Easily available on Ubuntu using:
sudo apt-get rdiff-backup
Nice instructions for automating and scheduling backups.
Simple backup by simply tar’ing everything, instructions on Ubuntu Forums.