Check These Out
Adding course name prefix to lecture pdfs
Use this command if you want to rename all subtitles for them to have the same name as the mp4 files.
NOTE: The order of "ls -1 *.mp4" must match the order of "ls -1 *.srt", run the command bellow to make sure the *.srt files will really match the movies after run this command:
paste -d:
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.
Lots of scripts show you how to use socat to send an email to an SMTP server; this command actually emulates an SMTP server!
It assumes the client is only sending to one recipient, and it's not at all smart, but it'll capture the email into a log file and the client will stop retrying.
I used this to diagnose what emails were being sent by cron and subsequently discarded, but you can use it for all sorts of things.
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.
Will automatically take the size of the file but longer, usefull only if in an function.