This will dump a raw BGRA pixel stream and WAV which must then be converted to video:
ffmpeg -f rawvideo -c:v rawvideo -s 1280x720 -r 12 -pix_fmt bgra -i "${i%.*}".bgra -c:v libx264 -preset veryslow -qp 0 -movflags +faststart -i "${i%.*}".wav -c:a libfdk_aac -b:a 384k "${i%.*}".mp4 ; rm "${i%.*}".bgra "${i%.*}".wav
Our example generates an x264/720p/12fps/AAC best-quality MP4.
To get dump-gnash, first install the build-dependencies for gnash (this step is OS-specific). Then:
git clone http://git.savannah.gnu.org/r/gnash.git ; cd gnash ; ./autogen.sh ; ./configure --enable-renderer=agg --enable-gui=dump --disable-menus --enable-media=ffmpeg --disable-jemalloc ; make
Useful for big systems with lots of cards. (Update: does not work with USB disks)
Recent hardware may or may not enumerate *both of* these values
Could be dangerous, if you have many packages all beginning with 'foo' or 'bar'. This will easily remove them all from your system.
Periodically run the one-liner above if/when there are significant changes to the files in /usr/
= Before rebooting, add following to /etc/fstab : =
/squashed/usr/usr.sfs /squashed/usr/ro squashfs loop,ro 0 0
usr /usr aufs udba=reval,br:/squashed/usr/rw:/squashed/usr/ro 0 0
No need to delete original /usr/ ! (unless you don't care about recovery). Also AuFS does not work with XFS
So I had this 2TB Seagate external disk/USB enclosure which by default would spin-down its internal drive (it enters a standby mode) after four minutes of inactivity.. Spinning-up the inactive drive was an annoying delay when accessing files and also it severely interfered with NFS.. SCT stands for "Standby Condition Timer".
To completely disable SCT:
sdparm --clear STANDBY -6 /dev/sdb
To return to original (default) SCT settings:
sdparm -D -p 0x1a -6 /dev/sdb
To verify the settings (before and after):
sdparm -a /dev/sdb
No need for vendor-provided MSWIN tools, etc.
Similar to `cpulimit`, although `prlimit` can be found shipped with recent util-linux.
Example: limit CPU consumption to 10% for a math problem which ordinarily takes up 100% CPU:
Before:
bc -l <(echo "1234123412341234^12341234")
See the difference `prlimit` makes:
prlimit --cpu=10 bc -l <(echo "1234123412341234^12341234")
To actually monitor the CPU usage, use `top`, `sar`, etc.. or:
pidstat -C 'bc' -hur -p ALL 1
In this example, the docx gets converted to Open Document .odt format. For other formats, you'll need to specify the correct filter (Hint: see "Comments" link below for a nice list).
Works with *rooted* Android devices. 400x800 are the screen dimensions of a typical handheld smartphone.
Crude, but works. Note for security, /data/ will be inaccessible unless your device has been *rooted*.
On the other hand, if a device has been rooted, its data is now wide open to anyone with a USB cable and the above "one-liner".
`adb` is one of the platform tools in the android SDK.
To get SMS messages:
adb pull /data/data/com.android.providers.telephony/databases/mmssms.db ; sqlite3 -batch <<EOF contacts2.db <CR> .header on <CR> .mode tabs <CR> select * from sms; <CR> EOF
If you have to deal with MS Sharepoint which is (rarely, let's hope) used in e.g. certain corporate environments). This uses Cntlm. For single files, just use cURL -- its NTLM authentication works quite well. # /etc/cntlm.conf: # Username account # Domain domain # Password ############ # Proxy 10.20.30.40 (IP of the sharepoint site) # NoProxy * # Listen 3128
Create a serial console with "socket (named pipe)" of "/tmp/socket", "from:server, to:virtual machine" in vmware player, etc.. gui. Run the above command after you have booted the guest OS (which should also be configured for serial console).
`multipath -ll` requires Device Mapper multipath.conf configuration. And of course, replace "3PARdata,VV" with your disk array's SCSI vendor,LUN name. - GPT partition table allows you to create >2TB partitions
Use `scsi_id` to positively identify which LUNs are which (i.e. compare with the list of LUNs you created on your disk array)
(shown: RHEL5 usage)
Debian usage:
# for i in /dev/sd* ; do wwn=`/lib/udev/scsi_id -g --device $i` ; [ "$wwn" != "" ] && echo -e ${i##*/}'\t'$wwn ;done
Show Sample Output
`blkid` is an interface to libuuid - it can read Device Mapper, EVMS, LVM, MD, and regular block devices. -c /dev/null - Do not use cached output from /etc/blkid.tab or /etc/blkid/blkid.tab (RHEL) -i - Display I/O Limits (aka I/O topology) information (not available in RHEL) -p - Low-level superblock probing mode (not available in RHEL) Show Sample Output
Certain Flash video players (e.g. Youtube) write their video streams to disk in /tmp/ , but the files are unlinked. i.e. the player creates the file and then immediately deletes the filename (unlinking files in this way makes it hard to find them, and/or ensures their cleanup if the browser or plugin should crash etc.) But as long as the flash plugin's process runs, a file descriptor remains in its /proc/ hierarchy, from which we (and the player) still have access to the file. The method above worked nicely for me when I had 50 tabs open with Youtube videos and didn't want to have to re-download them all with some tool.
exec -a $NAME $COMMAND $ARGS
`your_cmd -erase_all_files` is the real process, but harmless-looking getty appears in the process table.
Never actually had a need to do this, but interesting nonetheless... Tested in bash, dash.
-a $NAME
"pass NAME as the zeroth argument to COMMAND", i.e. customise the name of the process (as commonly seen with `ps`)
Show Sample Output
Invoked from within a shell script, this will print the directory in which the script resides. Doesn't depend on external tools, /proc/self/*, etc.. (`echo` is a shell builtin.) To see the *current working* directory of a script, use `pwd`.
This one-liner was useful in helping someone I know to get off of MS Exchange. `mailutil` proved to be a much better alternative than `fetchmail` or `getmail` in this case. It quickly moved all mails to the destination server (a simple Dovecot/Maildir setup), with no need to convert back and forth between mbox/maildir on the user's own system.
Brute force way to block all LSO cookies on a Linux system with the non-free Flash browser plugin. Works just fine for my needs. Enjoy. Show Sample Output
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: