Check These Out
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"
}
Fix's centos 6.2 yum's error:
could not get metalink https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=x86_64 error was 14: PYCURL ERROR 77 - "Problem with the SSL CA cert (path? access rights?)"
Error: Cannot retrieve metalink for repository: epel-source. Please verify its path and try again
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.