čtvrtek 30. ledna 2014

Convert mp4 to mp3 in linux

Convert mp4 video file to wav audio
avconv -i input.mp4 output.wav

Encode wav to mp3
lame --preset standard input.wav output.mp3
For different mp3 quality use another preset mode. Display all preset modes with: lame --preset help

Update mp3 with ID3 tag
eyeD3 --encoding=utf8 -a "Author" -t "Title" -A "Album" --add-image image.jpg:FRONT_COVER input.mp3


Copy out audio from mp4 file as AAC
avconv -i input.mp4 -c:a copy output.aac




sobota 8. června 2013

Multiple screenshots from video with a MPlayer


To take multiple screenshots use a screenshot video filter. Append command with -vf screenshot
> mplayer -vf screenshot movie-filename.avi
If you press 's' a screenshot is taken and it's saved in current directory as shot00001.png file.
To start a screenshot sequence press 'S' (shift+s) and for stop press it again. Multiple files are saved.

čtvrtek 30. května 2013

Vim color scheme

Change vim color simple by typing in vim:

:colorscheme ron (for dark background)
:colorscheme peachpuff (for light background)

Write this color schema as colorscheme  to /etc/vim/vimrc configuration file.

Find information on http://askubuntu.com/questions/24544/what-is-the-default-vim-colorscheme

středa 3. dubna 2013

Transfer files via browser

If you are running on Linux and your college needs to download files from you just run following command in directory with needed files:

python -m SimpleHTTPServer

Your colleges can see all files and subdirectories in browser on the address : and simple download them.


úterý 13. března 2012

WebConsole on Amazon

I manage my linux servers using ssh. From time to time I need to access them from places where ssh connection is not possible, e.g. behind firewall which enables HTTP only. Then I start a remote server with shell accessible via browser.

I use a simple solution using Amazon AWS EC2 service. I just start a prepared EC2 image on cheapest instance. This image contains installed Shell-in-a-box (Web based AJAX terminal emulator) and usage manual.

Shell In A Box implements a web server that can export arbitrary command line tools to a web based terminal emulator. For details see its homepage.

When I don't need the server anymore I just terminate it. The cost is several cents ($0.006/hour for Spot request server).

I you would like to try it the image name is ami-c73ef2ae (currently available only for US East - Northern Virginia).

WebConsole tutorial running on port 80

WebConsole shell running on port 443

středa 13. dubna 2011

Clean Code Talk - part III, Functions

Next talk by Robert C. Martin about one chapter of his book 'Clean Code'. Here is presentation used in video.


Clean Code III: Functions from Mike C. on Vimeo.


Clean-Code-Functions

Clean Code Talk - part I, Arguments

Great talk by Robert C. Martin about one chapter of his great book 'Clean Code'. Here is presentation used in video.


Clean Code I: Arguments from Mike C. on Vimeo.


Clean Code - Part 1, Arguments