Generate Password

Command to generate a random password…

openssl rand -base64 6

Watch for Ubuntu 9.10 Launch

This script will run check for ubuntu launch once every 5 mins and let you know if there is an launch.

while [ 1 ]; do if [ -z "`curl -I ""|grep "404"`" ]; then kdialog --msgbox "9.10 Released"; exit; fi; sleep 300;  done

Command to Find Current Ubuntu Version

Run this command to find the installed version of Ubuntu…

cat /etc/lsb-release

top in Batch Mode

Run top in batch mode

top -b -d 10 -n 3

Trasfer over the network

Transfer stdin and stdout to and from machines over the network

ssh remote_machine 'cat - > file' < file

Add Line Numbers

Use this command to add line numbers to a text file…

sed = filename.txt | sed 'N;s/\n/\t/' > filename_number.txt

Install Package List

Install a list of packages from a text file.

cat packages.txt | xargs apt-get install

Rename Command

Different way to use the rename command.

rename 's/.html$/.php/' *.html

Get a Random Futurama Quote

Useless – but fun – get a random Futurama Quote

curl -Is | egrep '^X-(F|B)' | cut -d \- -f 2

Create Random Password

Use this command to create a random password

< /dev/urandom tr -dc A-Za-z0-9_ | head -c8

Also see…