Archive

Archive for February, 2011

How to download all videos from youtube playlist

26/02/2011 4 comments
#!/bin/sh
n=1
for i in 1 26 51 76 101
do
for video in $(curl -s http://gdata.youtube.com/feeds/api/playlists/PLAYLISTID?start-index="$i" | grep -o "url='http://www.youtube.com/watch?v=[^']*'")
do
id=$(echo $video | sed "s|url\='http://www.youtube.com/watch?v=\(.*\)&.*'|\1|")
wget http://www.youtube.com/watch?v=$id -qO- | sed -n "/fmt_url_map/{s/[\'\"\|]/\n/g;p}" | sed -n '/^fmt_url_map/,/videoplayback/p' | sed -e :a -e '$q;N;5,$D;ba' | tr -d '\n' | sed -e 's/\(.*\),\(.\)\{1,3\}/\1/' | wget -i - -O $n.flv
n=$(( $n + 1 ))
done
done

where PLAYLISTID is a ID taken from playlist url (ex.: http://www.youtube.com/my_playlists?p=1EC20BA340CD627B)

Categories: Bash, Linux, Useful commands

rsync with custom ssh port

24/02/2011 Leave a comment

rsync -r -h –partial –progress -e “ssh -p 43213” napi@9.9.9.9:/home/napi/files/* .

Categories: Bash, Linux, Useful commands

How to download files from fileserve.com premium with wget

24/02/2011 9 comments

First we need check if we have “Direct Download” option checked in:

Edit account / Advanced Features

Now we need to get a cookie, im using curl for that:

curl --cookie-jar cookies.txt --data "loginUserName=login" --data "loginUserPassword=password" --data "autoLogin=checked" --data "loginFormSubmit=Login" http://www.fileserve.com/login.php

where:

login is your login name, and password is you password for fileserve.com

next we need to create our list with links to download. Use pico, vi or another favorite editor.

Now the final part:

wget -c --load-cookies /home/napi/cookies.txt -i /home/napi/links
Categories: Bash

Rename jpg files to exif creation date

19/02/2011 1 comment

exiv2 mv -r %Y%m%d_%H%M%S_:basename: *.jpg

Categories: Useful commands

Przepis na bigos

17/02/2011 Leave a comment

3kg kapusty kiszonej

1kg kiełbasy drobiowej

30dkg boczku

0,5kg cebuli

5-8 ziele angielskie

4-5 liść laurowy

pieprz w ziarnach

przecier

 

pokroić kapustę, wrzucić do garnka, gotować 5h.

 

 

 

Categories: Przepisy