Check These Out
Adding course name prefix to lecture pdfs
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"
}
$ translate [output-language] [source-language]
1) "some phrase" should be in quotes
2) [output-language] - optional (default: English)
3) [source-language] - optional (default: auto)
$ translate "bonjour petit lapin"
hello little rabbit
$ translate "bonjour petit lapin" en
hello little rabbit
$ translate "bonjour petit lapin" en fr
hello little rabbit
Friday is the 5th day of the week, monday is the 1st.
Output may be affected by locale.
This says if the LHC has destroyed the world. Run it in a loop to monitor the state of Earth. Might not work reliable, if the world has actually been destroyed.
nsacodenamegenerator dot com is no more
outputs random two words together in capital letters
For Linux distributions using rpm (eg Mandriva), this command will find the rpm package name that provides a file.
Several times, I find myself hitting my up arrow, and changing the search term. Unfortunately, I find myself wasting too much time typing:
$ grep kernel /var/log/messages
Redirecting STDIN allows me to put the search term at the end so I less cursor movement to change what I'm searching for:
$ < /var/log/messages grep kernel
If you're using the emacs keyboard binding, then after you press your up arrow, press CTRL+w to erase the word.
If this has already been submitted, I couldn't find it with the search utility.
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.