Tag Archives: bash

Build your own Gentoo Live CD/DVD

Always wanted to create your very own Gentoo disc?  Well now you can.  You can have anything you want e.g. a full gnome/kde... desktop environment to a full customised util/rescue disc.  The script that is here, if left will create a "minimal" cd (288Mb) with the latest "stable" kernel.

The script does NOT have any intelligence and is designed to just run, do it's job and exit.

When editing the script for your needs, there are a few things to keep in mind:

1)  Kernel config included is for 3.0.6.  If the kernel is newer, you will be prompted for any new options.
2) Packages you wish to have MUST be defined in the CHROOT script (approx. line 75)
3) The script MUST be run as root.

Build Script

Happy hacking!

Handy One liners

Diff 2 remote files:
diff <(ssh <user>@<server1> 'cat /path/to/file1') <(ssh <user>@<server2> 'cat /path/to/file2')

If using it in a script you'll need to add a $ like so:
diff <$(ssh <user>@<server1> 'cat /path/to/file1') <$(ssh <user>@<server2> 'cat /path/to/file2')

Video capture your desktop.
ffmpeg -f x11grab -r 25 -s hd1080 -sameq -i :0.0 out.mpg

Convert epoch time in CSV file
for f in `cat | awk -F',' '{print $2}'`; do sed -i "s/"$f"/$(date --date "$f seconds 1 January 1970" +%d-%m-%Y)/" ;done