My pasteblog

This is not my Zettelkasten but a durable .bash_history

Subscribe to RSS feed

Posts tagged with "scripts"

Markup für Texte, nicht gleich so kompliziert wie DocBook

, ,

http://symfony.com/doc/2.0/contributing/documentation/format.html

Ubuntu/Debian: apt-get install python-setuptools
easy-install Sphinx

Im Arbeitsverzeichnix sphinx_quickstart, ergibt:
cpr@foo:~/bar/baz$ ls
_build  conf.py  index.rst  make.bat  Makefile  _static  _templates  


Die Musik spielt in *rst:
http://sphinx.pocoo.org/
http://sphinx.pocoo.org/rest.html



Ja, die Suchfunktion funktion-iert!

LaTeX-Output ist auch erhältlich.

Zeitraffer / time lapse

,

CHDK mit dem Script Time Bandit http://chdk.wikia.com/wiki/UBASIC/Scripts%3ATime_Bandit_1.0

C:\Users\cpr\Desktop\144CANON>"C:\Program Files (x86)\MPlayer-p4-svn-32492\menco
der.exe" mf://*.JPG -vf scale=320:240 -o testtimelapse_320x240.avi -of lavf -ovc
lavc -lavcopts vcodec=mjpeg -lavfopts format=avi

Nice: http://pajukanta.fi/blogs/destruction_preventer/making_time_lapse_videos_with_mencoder/ links to http://www.magnatune.com/

letsrun.com forum threads 2009-08-21 until 2009-09-14

, ,

Regarding http://www.letsrun.com/forum/flat_read.php?thread=3212523 please see attached file for all posts between 2009-08-21 and today, ordered by time of creation, including moderated posts (their respective links won't work though).letsruncomfeed_2009-08-21_2009-09-13.htm

snapshot metadata YouTube 1981aLaN

, , ,

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...

streamripper HR2 Ilias

cpr@1300:~$ crontab -l
30 9 1-30 9 1-4 streamripper ` dog http://hr.streamfarm.net/cms/_v/radio/live/hr2.m3u | grep http` -t -q -l 3900 -d /home/cpr/audio~/Troja/ -a
30 9 1-2 10 1-4 streamripper ` dog http://hr.streamfarm.net/cms/_v/radio/live/hr2.m3u | grep http` -t -q -l 3900 -d /home/cpr/audio~/Troja/ -a

0 22 1-30 9 1-4 streamripper ` dog http://hr.streamfarm.net/cms/_v/radio/live/hr2.m3u | grep http` -t -q -l 3900 -d /home/cpr/audio~/Troja/ -a
0 22 1-2 10 1-4 streamripper ` dog http://hr.streamfarm.net/cms/_v/radio/live/hr2.m3u | grep http` -t -q -l 3900 -d /home/cpr/audio~/Troja/ -a

http://www.hr-online.de/website/radio/hr2/index.jsp?rubrik=38852

one-page webserver with netcat

,

while `netcat -lp 80 -c 'echo -e "HTTP/1.0 200 OK\nContent-Type: text/html\n"; cat index.html'`
echo got connection
done

from https://mlists.in-berlin.de/pipermail/linux-l/msg54026.html

egrep

, , , ...

egrep "image.*s.*(Los|sport)" /var/log/apache2/access_log | awk '{print $1}' | sort -n | uniq -c | sort -rn

a video in a pic

, , ,

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

resizing images

, , ,

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

More bash var chopping

,

http://my.opera.com/cpr/blog/show.dml/206175

Leaving basename() behind by chopping from the end of the variable-string:

$ for f in `ls *gif`;do echo $f; convert.exe $f ${f%.gif}.png;done
first_basic_admin.gif
first_comments_under_post.gif
first_congrats.gif
first_crud.gif
first_crud_layout.gif
first_custom_admin.gif
first_form_validation.gif
first_login.gif
first_routing.gif
first_welcome.gif
bash-3.00$ ls
first_basic_admin.gif          first_crud.png             first_login.gif
first_basic_admin.png          first_crud_layout.gif      first_login.png
first_comments_under_post.gif  first_crud_layout.png      first_routing.gif
first_comments_under_post.png  first_custom_admin.gif     first_routing.png
first_congrats.gif             first_custom_admin.png     first_welcome.gif
first_congrats.png             first_form_validation.gif  first_welcome.png
first_crud.gif                 first_form_validation.png  symfony_favicon.png
$ for p in `ls *png`; do echo \\pgfdeclareimage\{${p%.png}\}{pictures/${p%.png}};done

Caveat: Sanitize underscore in pgfimage handle

IMG_0020.JPG 020.JPG IMG_x020.JPG
IMG_0021.JPG 021.JPG IMG_x021.JPG
IMG_0022.JPG 022.JPG IMG_x022.JPG
IMG_0023.JPG 023.JPG IMG_x023.JPG
bash-3.1$ for f in `ls *JPG`; do mv $f IMG_x${f#IMG_0};  done

ExTracTing

, , ,

<?php

$lines = file('http://www.symfony-project.com/trac/timeline?'.
  'from=04%2F09%2F06&daysback=365&changeset=on&update=Update');

foreach ($lines as $k => $line){
  if(strpos($line, 'h2') === false) unset($lines[$k]);
}//end forezch lines

$data = array();
foreach ($lines as $line){
  $tmp=''; $date = ''; $time = ''; $changeset = ''; $_changeset = false; $author = ''; $_author = false;
  $dom = new domDocument;
  $dom->loadHTML($line);
  $h2 = $dom->getElementsByTagName('h2');
  $date = substr($h2->item(0)->nodeValue,0,8);
  $dts = $dom->getElementsByTagName('dt');
  if($dts){
    preg_match_all('#\[(.*)\]#', $dts->item(0)->nodeValue,$_changeset);
    if($_changeset) $changeset = $_changeset[1];
    preg_match_all('#by (.+)$#', $dts->item(0)->nodeValue, $_author);
    if($_author) $author = $_author[1];
    foreach ($dts as $dt){
      $spans = $dt->getElementsByTagName('span');
      $time = $spans->item(0)->nodeValue;
      //collect the data in an array
      $data[] = array('changeset' => $changeset[0], 'author' => $author[0], 'unixtime' => strtotime("$date $time"));
    }//end foreach
  }//end if
}//end foreach

die(var_dump($data));

?>

shell script via Apache/PHP

, , , ...

NOPASSWD: /bin/sh, /path/to/script.sh
script.sh chmod 6755

autorun scripts in irssi

, ,

~$ ls .irssi/scripts/autorun/
bitlbee_tab_completion.pl chanpeak.pl screen_away.pl
bitlbee_typing_notice.pl grep.pl
February 2012
S M T W T F S
January 2012March 2012
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29