Posts Tagged ‘tips’

Create a wav file from an exotic audio format

Saturday, July 5th, 2008

When you need to retrieve a sound from a ugly format (like realaudio, windows media audio, and other proprietary things), mplayer is your best friend :

mplayer -ao pcm:file=output.wav your_file_or_url

It works fine with rtsp: and other bad protocols.

Playlist : Take care with .ram files and other playlist formats. In this case, the url content is only a text with the stream url. mplayer provides again a solution :

mplayer -ao pcm:file=output.wav -playlist file_or_url_playlist

Video : Add the option -vo null if the initial document contains video, the video part will be ignored.

Compress resulted file : The created wav file must be compressed cautiously. Most of the time, you’ve retrieved a sound already very compressed. If you create a ogg file with a low quality, you may experience problems. Use a lossless compression when possible, like flac.

“En shell dans le texte”

Tuesday, May 27th, 2008

Unix Command Line Kung-Fu is 33 interesting pages with a lot of shell tips (linked today by Larry Wright). My small selection with “customized” examples :


$ !!:p
$ !!


$ iwconfig
zsh: command not found: iwconfig
$ /sbin/!!


$ e app/model/user.rb
$ svn diff !$


$ ./script/generate rspec_controler user
$ ^user^session


$ seq -w 1 12


$ awk '{ print $1 }' access.log | sort | uniq -c | sort -rn | head -5


$ less -r +G log/test.log

Some of my own favorites :


$ sudo du -s /home/* | sort -rn | head


$ echo 2048 | sudo tee /proc/sys/vm/min_free_kbytes


$ sudo sh -c "ls /var/archives/*home*"
$ sudo find /var/archives -name "*home*"


$ pgrep nm-applet | head -n -1 | xargs kill


$ alias ifconfig='/sbin/ifconfig'


$ alias myps='ps -u $USER'