My pasteblog

This is not my Zettelkasten but a durable .bash_history

Subscribe to RSS feed

Posts tagged with "cli"

HP ProLiant Debian

,

If you think the fans are loud, wait until they REALLY spin up!
Looking for cheap colocation! *g*

Concise way to install HPs additional software:
wget http://downloads.linux.hp.com/SDR/downloads/bootstrap.sh
sh bootstrap.sh -r stable ProLiantSupportPack
wget http://downloads.linux.hp.com/SDR/psp/GPG-KEY-ProLiantSupportPack -O - | apt-key add -
apt-get update
apt-get install hp-health
apt-get install hp-snmp-agents


Links I found useful:
http://downloads.linux.hp.com/SDR/downloads/ProLiantSupportPack/Debian/dists/squeeze/current/non-free/binary-amd64/Packages
http://blog.space2place.de/2011/07/05/probleme-mit-shared-libraries-debian-squeeze-lenny/
http://hq.pingdynasty.com/blog/2011/04/08/debian-on-hp-proliant/
http://cciss.sourceforge.net/
http://wiki.debian.org/HP/ProLiant
http://jreypo.wordpress.com/2011/02/16/hp-proliant-servers-management-with-hpasmcli/

VirtualBox did not want to boot a guest netinst-CD:
This kernel requires an x86-64 CPU, but only detected an i686 CPU. 

AMD V (virtualization) is not enabled available on G4.
A guest with 32bit does work though. NATting the network (the default) worked without problems.

Updating the BIOS:
http://www.solo-technology.com/blog/2009/11/29/the-easy-way-to-update-proliant-firmware/

Using Java to execute a Kettle transformation

, ,

There are two blog posts out there explaining VERY well how to execute a Kettle transformation from Java. Took me a while to find them though. As a Java newbie I was challenged with basic Java stuff. So here is the amalgation:

http://ameethpaatil.blogspot.com/2011/08/hello-world-with-pentaho.html
http://pentahodev.blogspot.com/2009/08/developdebug-kettle-plugin-in-eclipse.html

cd /cygdrive/c/Users/foo/blogpost/
wget http://heanet.dl.sourceforge.net/project/pentaho/Data%20Integration/4.2.0-stable/pdi-ce-4.2.0-stable.zip
unzip pdi-ce-4.2.0-stable.zip 
cp -r data-integration/lib .
mkdir libext
cp -R data-integration/libext/commons libext/
cp -R data-integration/libext/pentaho libext/
cp -R data-integration/libext/*jar libext/
# http://ameethpaatil.blogspot.com/2011/08/hello-world-with-pentaho.html
vi Test.java #http://files.myopera.com/cpr/files/Programming/Test.java
vi first_transformation.ktr #http://files.myopera.com/cpr/files/Programming/first_transformation.ktr
# http://pentahodev.blogspot.com/2009/08/developdebug-kettle-plugin-in-eclipse.html
C:\foo>"C:\Program Files (x86)\Java\jdk1.7.0\bin\javac.exe" -cp .;lib\kettle-engine.jar;lib\kettle-core.jar;libext\*;libext\pentaho\*;libext\commons\*;lib\kettle-db.jar Test.java
C:\foo>"C:\Program Files (x86)\Java\jdk1.7.0\bin\java.exe" -cp .;lib\kettle-engine.jar;lib\kettle-core.jar;libext\*;libext\pentaho\*;libext\commons\*;lib\kettle-db.jar Test


Result:

C:\foo>"C:\Program Files (x86)\Java\jdk1.7.0\bin\java.exe" -cp .;lib\kettle-engine.jar;lib\kettle-core.jar;libext\*;libext\pentaho\*;libext\commons\*;lib\kettle-db.jar Test

INFO  09-10 21:06:17,957 - first_transformation - Dispatching started for transformation [first_transformation]
INFO  09-10 21:06:18,099 - Generate Rows - Finished processing (I=0, O=0, R=0, W=10, U=0, E=0)
INFO  09-10 21:06:18,129 - Write to log -
------------> Linenr 1------------------------------
Test = Hello World!

====================
INFO  09-10 21:06:18,133 - Write to log -
------------> Linenr 2------------------------------
Test = Hello World!

====================
INFO  09-10 21:06:18,133 - Write to log -
------------> Linenr 3------------------------------
Test = Hello World!

====================
INFO  09-10 21:06:18,135 - Write to log -
------------> Linenr 4------------------------------
Test = Hello World!

====================
INFO  09-10 21:06:18,138 - Write to log -
------------> Linenr 5------------------------------
Test = Hello World!

====================
INFO  09-10 21:06:18,140 - Write to log -
------------> Linenr 6------------------------------
Test = Hello World!

====================
INFO  09-10 21:06:18,140 - Write to log -
------------> Linenr 7------------------------------
Test = Hello World!

====================
INFO  09-10 21:06:18,143 - Write to log -
------------> Linenr 8------------------------------
Test = Hello World!

====================
INFO  09-10 21:06:18,145 - Write to log -
------------> Linenr 9------------------------------
Test = Hello World!

====================
INFO  09-10 21:06:18,148 - Write to log -
------------> Linenr 10------------------------------
Test = Hello World!

====================
INFO  09-10 21:06:18,155 - Write to log - Finished processing (I=0, O=0, R=10, W=10, U=0, E=0)

C:\foo>

Install Pentaho Data Integration remotely

, , ,

On a Debian system this worked:

http://sourceforge.net/projects/pentaho/files/Data%20Integration/4.2.0-RC1/pdi-ce-4.2.0-RC1.tar.gz/download

mv download pdi-ce-4.2.0-RC1.tar.gz

tar xvf pdi-ce-4.2.0-RC1.tar.gz

cd data-integration

./spoon.sh #(forwarded via ssh -X to my local machine)

mplyaer avi to Youtube-recignized swf

,

mencoder start.avi -ffourcc FLV1 -oac mp3lame -of lavf -ovc lavc -lavcopts \
vcodec=flv:acodec=mp3:vbitrate=500:abitrate=56 -srate 22050 -o finish.swf




C:\Users\cpr\Desktop>"c:\Program Files (x86)\MPlayer-p4-svn-32492\mencoder.exe"
-forceidx -of lavf -oac mp3lame -lameopts abr:br=56 -srate 22050 -ovc lavc -lavc
opts vcodec=flv:vbitrate=250:mbd=2:mv0:trell:v4mv:cbp:last_pred=3 -vf scale=360:
240 -o Disponiervorschlaege.flv Disponiervorschlaege.avi

MP3 and IDE3

, ,

http://www.id3.org/
http://www.richardfarrar.com/alternative-id3-tags-for-adding-artwork-to-mp3-files/
http://www.mp3tag.de/en/screenshots.html
http://www.wer-weiss-was.de/theme12/article2012834.html

Declared ID3v2 frames
AENC Audio encryption
APIC Attached picture
COMM Comments
COMR Commercial frame
ENCR Encryption method registration
EQUA Equalization
ETCO Event timing codes
GEOB General encapsulated object
GRID Group identification registration
IPLS Involved people list
LINK Linked information
MCDI Music CD identifier
MLLT MPEG location lookup table
OWNE Ownership frame
PRIV Private frame
PCNT Play counter
POPM Popularimeter
POSS Position synchronisation frame
RBUF Recommended buffer size
RVAD Relative volume adjustment
RVRB Reverb
SYLT Synchronized lyric/text
SYTC Synchronized tempo codes
TALB Album/Movie/Show title
TBPM BPM (beats per minute)
TCOM Composer
TCON Content type
TCOP Copyright message
TDAT Date
TDLY Playlist delay
TENC Encoded by
TEXT Lyricist/Text writer
TFLT File type
TIME Time
TIT1 Content group description
TIT2 Title/songname/content description
TIT3 Subtitle/Description refinement
TKEY Initial key
TLAN Language(s)
TLEN Length
TMED Media type
TOAL Original album/movie/show title
TOFN Original filename
TOLY Original lyricist(s)/text writer(s)
TOPE Original artist(s)/performer(s)
TORY Original release year
TOWN File owner/licensee
TPE1 Lead performer(s)/Soloist(s)
TPE2 Band/orchestra/accompaniment
TPE3 Conductor/performer refinement
TPE4 Interpreted, remixed, or otherwise modified by
TPOS Part of a set
TPUB Publisher
TRCK Track number/Position in set
TRDA Recording dates
TRSN Internet radio station name
TRSO Internet radio station owner
TSIZ Size
TSRC ISRC (international standard recording code)
TSSE Software/Hardware and settings used for encoding
TYER Year
TXXX User defined text information frame
UFID Unique file identifier
USER Terms of use
USLT Unsychronized lyric/text transcription
WCOM Commercial information
WCOP Copyright/Legal information
WOAF Official audio file webpage
WOAR Official artist/performer webpage
WOAS Official audio source webpage
WORS Official internet radio station homepage
WPAY Payment
WPUB Publishers official webpage
WXXX User defined URL link frame]



Selected individual sections:
ETCO:
$00 padding (has no meaning)
$01 end of initial silence
$02 intro start
$03 mainpart start
$04 outro start
$05 outro end
$06 verse start
$07 refrain start
$08 interlude start
$09 theme start
$0A variation start
$0B key change
$0C time change
$0D momentary unwanted noise (Snap, Crackle & Pop)
$0E sustained noise
$0F sustained noise end
$10 intro end
$11 mainpart end
$12 verse end
$13 refrain end
$14 theme end
$15-$DF reserved for future use
$E0-$EF not predefined sync 0-F
$F0-$FC reserved for future use
$FD audio end (start of silence)
$FE audio file ends
$FF one more byte of events follows (all the following bytes with the value $FF have the same function)

APIC:
$00 – Other
$01 – 32×32 pixels ‘file icon’ (PNG only)
$02 – Other file icon
$03 – Cover (front)
$04 – Cover (back)
$05 – Leaflet page
$06 – Media (e.g. label side of CD)
$07 – Lead artist/lead performer/soloist
$08 – Artist/performer
$09 – Conductor
$0A – Band/Orchestra
$0B – Composer
$0C – Lyricist/text writer
$0D – Recording Location
$0E – During recording
$0F – During performance
$10 – Movie/video screen capture
$11 – A bright coloured fish
$12 – Illustration
$13 – Band/artist logotype
$14 – Publisher/Studio logotype


Artwork editor: http://hcware.110mb.com/mp3art/
(or a script, check http://www.id3.org/Implementations )

http://code.google.com/p/php-reader/wiki/ID3v2 seems to work fine.

keyboard shortcuts unicode

Bash Leerzeichen

,

ls | while read i; do echo $i; done

ls *jpg | while read f; do i=$(($i+1)); printf "%02d" $i; echo " $f";done

bash sort integer

,

Seems I am getting disconnected from the world of the cl.

ls | sort -g

*sigh* busadm == Windows-World... sad

bash Variable inkrementieren increment

,

EIN -- FUER -- ALLE -- MAL!
i=$(($i+1))

mathmagicians

,

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

Mastering The Linux Shell - Bash Shortcuts Explained

,

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

bash spaces filename

,

bash $IFS ls -1
find $dir -name '*.foo' | while read f;do echo $f;done

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

shell script via Apache/PHP

, , , ...

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

session file pictures to gallery-directory

,

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]);
?>
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