Check These Out
Useful for massive files where doing a full diff would take too long. This just runs diff on the first 500 lines of each. The use of subshells to feed STDIN is quite a useful construct.
Benchmark a SQL query against MySQL Server.
The example runs the query 10 times, and you get the average runtime in the output. To ensure that the query does not get cached, use `RESET QUERY CACHE;` on top in the query file.
Shows all block devices in a tree with descruptions of what they are.
requires "youtube-dl" -- sure you can do this with wget and some more obscurity but why waste your time when this great tool is available?
the guts consist of mplayer converting a video to a gif -- study this command and read the man page for more information
$ mplayer video.flv -ss 00:23 -endpos 6 -vo gif89a:fps=5:output=output.gif -vf scale=400:300 -nosound
generates a 6 second gif starting at 23 seconds of play time at 5 fps and a scale of 400x300
start time (-ss)/end time (-endpos) formats: 00:00:00.000
end time should be relative to start time, not absolute. i.e. -endpos 5 == seconds after 0:42 = 0:47 end point
play with fps and scale for lower gif sizes
the subshell is a solution for the -b flag on youtube-dl which downloads the best quality video, sometimes, which can be various video formats $(ls ${url##*=}*| tail -n1)
Trace python statement execution and syscalls invoked during that simultaneously
In this example the command "somecommand" will be executed and sent a SIGALARM signal if it runs for more than 10 seconds. It uses the perl alarm function. It's not 100% accurate on timing, but close enough. I found this really useful when executing scripts and commands that I knew might hang E.g. ones that connect to services that might not be running. Importantly this can be used within a sequential script. The command will not release control until either the command completes or the timeout is hit.
Btrfs reports the inode numbers of files with failed checksums. Use `find` to lookup the file names of those inodes. The files may need to be deleted and replaced with backups.
jrk's aria2 example is incorrect. -s specifies the global connection limit; the per-host connection limit is specified with -x.