commandlinefu.com is the place to record those command-line gems that you return to again and again.
Delete that bloated snippets file you've been using and share your personal repository with the world. 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.
If you have a new feature suggestion or find a bug, please get in touch via http://commandlinefu.uservoice.com/
You can sign-in using OpenID credentials, or register a traditional username and password.
First-time OpenID users will be automatically assigned a username which can be changed after signing in.
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:
umph is parsing video links from Youtube playlists ( http://code.google.com/p/umph/ )
cclive is downloading videos from Youtube ( http://cclive.sourceforge.net/ )
Example:
yt-pl2mp3 7AB74822FE7D03E8
For reverse, there's asc2xml
asc2xml < entitiesfile > utf8file
They come as a part of the html-xml-utils debian package.
PS. Tried to submit sample data, but the site autoconverted the non ascii to html entities. So a bit of imagination is needed.
Gives stereo, 16bit, 44.1kHz (default in Ubuntu/Medibuntu ffmpeg).
-aq 2 = 220-250kbit/s VBR, lower number is better quality. 2 or 3 should be good for most people. If you want the best mp3 q you should remove -aq and use -ab 320k to get 320kbit/s, but that is probably overkill for most .flv videos.
Do you have a large library of flv's you have picked up over the years using FlashGot Firefox plugin?
Do you want to be able to convert them to Ogg Theora (video) at once?
Try out this script...
The pdf is first converted to a bitmap, so change "-density" to match your printer resolution. Also be careful about the RAM required.
In this example rgb(0,0,0) is replaced by rgb(255,255,255), change to suit your needs.
Convert all jpegs in the current directory into ~1024*768 pixels and ~ 150 KBytes jpegs
aliases on each line.
i.e.
txt2html:
recode ..HTML <file.txt >file.html
txt to Base64:
recode ../b64 <file.txt >file.b64
and so on.
find . -type f -iname '*.flac' # searches from the current folder recursively for .flac audio files
| # the output (a .flac audio files with relative path from ./ ) is piped to
while read FILE; do FILENAME="${FILE%.*}"; flac -cd "$FILE" | lame -b 192 - "${FILENAME}.mp3"; done
# for each line on the list:
# FILE gets the file with .flac extension and relative path
# FILENAME gets FILE without the .flac extension
# run flac for that FILE with output piped to lame conversion to mp3 using 192Kb bitrate
Adding the exclamation mark to the image geometry ignores the original aspect ratio.
More info about image geometry:
http://www.imagemagick.org/script/command-line-processing.php#geometry
You can also specify width and height of the resized image (in pixels), as an alternative to using a percentage.
More recent versions of the date command finally have the ability to decode the unix epoch time into a human readable date. This function makes it simple to utilize this feature quickly.
ffmpeg
-i = input file name
-s = set frame size, qcif=176x144
-vcodec = force video codec
-r = frame-rate [default = 25]
-b = bit-rate [200 kb/s]
-acodec = force audio codec
-ab = audio bitrate in bits/s [64k]
-ac = no. of audio channels [1]
-ar = audio sampling frequency [44100 Hz]
optional:
-sameq = use same video quality as source (implies VBR)
-f = force format
-y = overwrite output files