Linux, programming, computers and life

December 30, 2007

Hanlon’s razor - reminder to myself

Filed under: life

“Never attribute to malice that which can be adequately explained by stupidity.”

– read more in wikipedia

Technorati Tags: ,

December 21, 2007

gstreamer basic command line reminder

Filed under: CLI, linux

I recently wanted to record an audio stream. I tried audacity which somehow stopped recording after a while and then found mhwaveedit which did the job. However, i though to myself, how do i do it without GUI?
Gstreamer to the rescue! After examining man gst-launch-0.10 i found the following options.
1. Play a sound:

a: gst-launch-0.10 playbin uri=’file:///mnt/audio/1.mp3′
b: gst-launch-0.10 filesrc location=’1.ogg’ ! decodebin ! alsasink

2. record sound from the sound card

mp3: gst-launch-0.10 alsasrc ! audioconvert ! lame ! filesink location=input.mp3
ogg: gst-launch-0.10 alsasrc ! audioconvert ! vorbisenc ! oggmux ! filesink location=input.ogg

It looks like the library is very versatile but i did not found a good tutorial how to build these command line pipes.

Technorati Tags: , , , , , ,

December 7, 2007

bash completion for atool

Filed under: CLI, linux

More or less two years ago i wrote about atool. I finally managed to do something i wanted to do long ago - to create bash completion for it. In archlinux, create a file named /etc/bash_completion.d/atool, with the following code:

# atool(1) completion by linux4all.blogsome.com
_atool()
{
local cur

COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}

case “$cur” in
-*)
COMPREPLY=( $( compgen -W ‘-l -x -X -a -c- -d -r \
-e -F -D -f -q -v -p -o -E -S –list –extract –extract-to= \
–add –cat –diff –repack –each –format= –subdir –force \
–quiet –verbose –page –null –explain –simulate –config=’ — $cur ) )
;;
*)
_filedir ‘@(rar|RAR|zip|ZIP|tar.gz|tgz|tar.bz|tbz|tar.Z|tZ|tar.lzo|tzo|tar.7z|t7z|tar|jar|JAR|war|lha|lzh|7z|ace|ACE|arj|ARJ|a|arc|ARC|rpm|deb|gz|bz|bz2|Z|lzo|cpio)’
;;
esac

return 0

}
complete -F _atool -o filenames atool

and enjoy custom tab-completion for atool.

Technorati Tags: , , , , ,

pacman ;) with Google chart API

Filed under: internet

Only extremely lazy do not blog about Google chart API. Well, i must too than. Here’s pacman using the API:

Technorati Tags: , , ,

Get free blog up and running in minutes with Blogsome
Theme designed by Gary Rogers