Instant web server with Python!

Have you ever wanted to copy something from one machine to another without having to setup FTP, NFS, Samba etc? Luckily Python offers to help by creating an instant web server in the directory it’s launched from:

Listening on port 8000 (default):
python -m SimpleHTTPServer

Listening on port 8080:
python -m SimpleHTTPServer 8080

Then just use wget from the other machine to download the file(s) you want. Magic!

Record video in Linux with avconv and ffmpeg

Record screen in Linux with avconv (replacement for ffmpeg in Ubuntu):
avconv -f alsa -i pulse -f x11grab -r 25 -s 1920×1080 -i :0.0+0,0 -vcodec libx264 -pre:0 lossless_ultrafast -threads 0 video.mkv

Compress video and make ready for YouTube:
avconv -i video.mkv -c:v libx264 outputfile.mp4

Record screen in Linux with ffmpeg:
jonas@erebus:~$ ffmpeg -f x11grab -r 15 -s 1280*800 -i :0.0 -vcodec libx264 -vpre lossless_ultrafast -threads 4 -y -sameq out.mkv

Compress video and make ready for YouTube:
ffmpeg -i video.mkv -vcodec libx264 -vpre hq -crf 22 -threads 0 video.mp4