Check These Out
I just added the args [arp-scan --localnet] which works for Debian users, because the package 'arp' has name 'arp-scan', and it doesn't works with the argument 'arp'.
Useful when you're trying to unmount a volume and other sticky situations where a rogue process is annoying the hell out of you.
Converts any number of seconds into days, hours, minutes and seconds.
sec2dhms() {
declare -i SS="$1"
D=$(( SS / 86400 ))
H=$(( SS % 86400 / 3600 ))
M=$(( SS % 3600 / 60 ))
S=$(( SS % 60 ))
[ "$D" -gt 0 ] && echo -n "${D}:"
[ "$H" -gt 0 ] && printf "%02g:" "$H"
printf "%02g:%02g\n" "$M" "$S"
}
I like to label my grub boot options with the correct kernel version/build.
After building and installing a new kernel with "make install" I had to edit my grub.conf by hand.
To avoid this, I've decided to write this little command line to:
1. read the version/build part of the filename to which the kernel symlinks point
2. replace the first label lines of grub.conf
grub.conf label lines must be in this format:
Latest [{name}-{version/build}]
Old [{name}-{version/build}]
only the {version/build} part is substituted.
For instance:
title Latest [GNU/Linux-2.6.31-gentoo-r10.201003]
would turn to
title Latest [GNU/Linux-2.6.32-gentoo-r7.201004]"
Shows all block devices in a tree with descruptions of what they are.
Will redirect output of current session to another terminal, e.g. /dev/pts/3
Courtesy of bassu, http://www.commandlinefu.com/commands/by/bassu
After downloading an ISO image, assuming you have QEMU installed, it’s possible to boot an ISO image in a virtual machine and then install that ISO from within the virtual machine directly to a physical drive, bypassing the need to reboot. Simply pass the ISO image as the -cdrom parameter, followed by “format=raw,file=/dev/sdb” (replace /dev/sdb with the drive you want to install to) as the hard drive parameter (making absolutely certain to specify the raw format, of course).
Once you boot into the ISO image with QEMU, just run the installer as if it were a virtual machine — it’ll just use the physical device as an install target. After that, you’ll be able to seamlessly boot multiple distros (or even other operating systems) at once.