Monday, 17. August 2009, 07:27:46
cli, bash
Seems I am getting disconnected from the world of the cl.
ls | sort -g
*sigh* busadm == Windows-World...
Sunday, 16. August 2009, 16:10:06
cli, bash
EIN -- FUER -- ALLE -- MAL!
i=$(($i+1))
Friday, 27. March 2009, 13:46:22
cli, bash
Bought a book explaining mental arithmetic and wrote a quick bash script to pose subtraction-questions:
while (true); do clear; pause=6;divisibleBy=1; max=999; min=11; rnumber1=$(((RANDOM%(max-min+divisibleBy))/divisibleBy*divisibleBy+min)); echo $rnumber1; max=$[${rnumber1}-1]; rnumber2=$(((RANDOM%(max-min+divisibleBy))/divisibleBy*divisibleBy+min)); echo $rnumber2; echo $rnumber1 "minus" $rnumber2 | festival --tts; sleep $pause; result=$[$rnumber1-$rnumber2]; echo "-------"; echo $result; echo "======="; echo $result | festival --tts; echo ""; done
Random code taken from
http://tldp.org/LDP/abs/html/randomvar.html
Sunday, 21. December 2008, 13:04:00
scripts, running, sport, cli
I have used
http://code.google.com/intl/de-DE/apis/youtube/1.0/developers_guide_php.html to download the metadata of the great track&field video "channel" by
http://www.youtube.com/1981aLaN and stored Title, ID, URL, description and duration in a csv file.
I will now use this data to download all videos with
http://www.arrakis.es/~rggi3/youtube-dl/Read more...
Tuesday, 9. September 2008, 04:59:08
cli, bash
bash $IFS ls -1
find $dir -name '*.foo' | while read f;do echo $f;done
Wednesday, 13. September 2006, 18:07:25
regexp, regex, bash, cli
...
egrep "image.*s.*(Los|sport)" /var/log/apache2/access_log | awk '{print $1}' | sort -n | uniq -c | sort -rn
Monday, 7. August 2006, 19:15:24
imagemagick, cli, scripts
mplayer -nosound -vo jpeg my_video_file.avi
montage *jpg join.jpg
montage.exe -tile 10x10 -geometry 160x84+2+2 -label '%f' 0000* join.jpg
mplayer -ss 1:00:23 -nosound -vo jpeg:outdir=foobar my_video_file.avi
Wednesday, 3. May 2006, 09:38:23
bash, cli, imagemagick, scripts
I know that I know nothing.
And I especially know that I always forget `imagemagick`s command line options :( So here is a tagged remedy:
for f in `ls *JPG`; do echo $f; convert -resize 800x800 $f $f; done
And to rename based on exif tags:
for f in `ls *.JPG`; do echo $f; create_date=""; create_date=`exiftime "$f" 2>&1 | grep -i image\ created | cut -d" " -f3 | sed -e 's/:/-/g'`;if [ "$create_date" != "" ];then echo $create_date;fi;done
Wednesday, 18. January 2006, 21:54:04
sudoers, cli, scripts, bash
...
NOPASSWD: /bin/sh, /path/to/script.sh
script.sh chmod 6755
Friday, 16. December 2005, 17:43:37
opera, cli
Extract links from session file:
sed.exe -n 's/^..\(http.*jpg\)/\1/p' < tamper.win | grep -v google |sort | uniq > tamper.url
process tamper.url (in parent dir)
for f in `cat ../tamper.url`;do echo $f; f2=`../urlencode.php $f`;f3="coffee_tamper_`date --iso-8601`_${f2}";curl $f -o $f2; convert -resize '360x360>' $f2 $f3;cp $f3 /path/to/htdocs/images/ ;done
urlencode.php
cpr@1300:~$ cat urlencode.php
#!/usr/bin/php
<?php
echo urlencode($argv[1]);
?>