Check These Out
It executes commands as arguments to ssh, avoiding problematic shell expansions, without the need of writing the commands in question to a temporary file, just reading them from STDIN.
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.
Using this command you can track a moment when usb device was attached.
Find files and calculate size with stat of result in shell
If you spot a dubious looking cp command running you can use this command to view what is being copied and to where.
1234 is the PID of the cp command being passed to the lsof utility.
3r.*REG will display the file/directory that is being read/copied.
4w.*REG will display the destination it is being written to.
see the TIME_WAIT and ESTABLISHED nums of the network
Programs for locking and unlocking files and mailboxes.This package includes several programs to safely lock and unlock files and mailboxes from the command line. These include:
lockfile-create
lockfile-remove
lockfile-touchlock
mail-lock
mail-unlock
mail-touchlock
These programs use liblockfile to perform the file locking and unlocking, so they are guaranteed compatible with Debian's file locking policies.
This is useful if you have need to do port forwarding and your router doesn't assign static IPs, you can add it to a script in a cron job that checks if you IP as recently changed or with a trigger script.
This was tested on Mac OSX.
To rip DVD movie to ogg format using ffmpeg, follow these steps.
1) find the vob files on the mounted video DVD in VIDEO_TS that stores the movie itself. There would be a few other VOB files that stores splash screen or special features, the vob files for the movie itself can be identified by its superior size. You can verify these vob files by playing them directly with a player (e.g. mplayer)
2) concatenate all such vob files, pipe to ffmpeg
3) calculate the video size and crop size. The ogg video size must be multiple of 16 on both width and height, this is inherit limitation of theora codec. In my case I took 512x384.
The -vcodec parameter is necessary because ffmpeg doesn't support theora by itself. -acodec is necessary otherwise ffmpeg uses flac by default.
Replace 'csv_file.csv' with your filename.