Archive for November, 2006
Downloading from the web [advanced]
Posted by JohannesTheDeveloper in fun with Linux on November 13th, 2006
Please don’t just execute the following!!! Read them and try to understand them if you are interested.
URL=http://www.swiss.ai.mit.edu/classes/6.001/abelson-sussman-lectures/ wget $URL -O - |grep -oE '[^"]+\.torrent' | while read line; do echo $URL$line; done | xargs ktorrent
wget http://joyoftech.com/joyoftech/index.html -O - --quiet | grep "http://joyoftech.com/joyoftech/$i -O todayscomic; done; kuickshow todayscomic
seq --format http://www.rapcheck.de/home/module/hc_download_out.php?DLID=%g 1 5000 >urls1.txt wget -i urls1.txt --referer=http://www.rapcheck.de/home/index.php grep -i ' urls2.txt wget -i ../urls2.txt --continue -nc
File urls2.txt is attached: urls2.txt (txt, 228 KB).
Btw: UserFriendly doesn’t like suckers … they seem to have banned me ;-)
I don’t like the ordering in find, but bashs!
Posted by JohannesTheDeveloper in fun with Linux on November 13th, 2006
[user@thiscomputer linux]$ find -name "dvorak" /var/ /usr/ find: paths must precede expression Usage: find [-H] [-L] [-P] [path...] [expression] [user@thiscomputer linux]$ !:0 !:4 !:3 !:1 !:2 find /usr/ /var/ -name "dvorak"
Folgen und Reihen
Posted by JohannesTheDeveloper in fun with Linux on November 13th, 2006
{ seq 3 40|while read i; do echo -n $((10000/2**$i)) "+"; done; echo 0; }|bc
Get a nice pic for your desktop every day
Posted by JohannesTheDeveloper in fun with Linux on November 13th, 2006
Gets a daily picture from a site and sets the softlink “newest” to it.
Needs executable rights on the shellscript and a
The shell script next.sh:
DATE=$(date +%y%m%d)
SERVER=antwrp.gsfc.nasa.gov
URL=http://${SERVER}/apod/ap${DATE}.html
NEWIMG=${DATE}.img
[ -e $NEWIMG ] && exit;
rm -rf *.jpg *.png *.gif
wget --recursive --level=1 $URL --accept jpg,png,gif --no-clobber --no-directories --tries=0
FIRST=$( ls -U *_f.* *_big.* *.jpg *.png *.gif 2>/dev/null|head -n 1 );
if [[ "$FIRST" != "" ]]; then
cp $FIRST $NEWIMG
unlink newest
ln -s $NEWIMG newest
fi
If you want a cronjob for that, use e.g.:
0,30 * * * * cd bgimg/astro/data; sh ../next.sh
Don’t forget to set the background image of your window manager to the link … obviously
Thats one crazy shell script
Posted by JohannesTheDeveloper in fun with Linux on November 13th, 2006
Its a download manager, more or less.
while sleep 600; do ps -A|grep wget|cut -d " " -f 1|sort -n|while read i; do kill -STOP $i; done; ps -A|grep wget|cut -d " " -f 1|sort -n|head -n 4|while read i; do kill -CONT $i; done; done
3rd line: Stops all wget processes.
4th line: Continues the first 4 (number can vary).
Recent Comments