Oct 23 2008

[javascript regex] nach = wort in ” ” wenn in <* > uiuiuiu

eingabe: <ASD asd=SDf SDA=F sad=F dsaf =SDAf =s daf=SDA f=SA Df=><P style=”border:2px solid lightblue;padding:10;text-align:center;color:royalblue;background:aliceblue width = = 123″><B>Welco

ausgabe: <ASD asd=”SDf” SDA=”F” sad=”F” dsaf=SDAf=”s” daf=”SDA” f=”SA” Df=><P style=”border:2px solid lightblue;padding:10;text-align:center;color:royalblue;background:aliceblue” width==”123″><B>Welco

<TEXTAREA id=n rows=10 cols=100></TEXTAREA>
<SCRIPT>
//a='<A href=  asdsad name1 =    aus1 name2 = \’aus2\’ asdsad =       “32wq”>lkh</A>\n<asd=wqer<>><ASD asd=SDf SDA=F sad=F dsaf =SDAf =s daf=SDA f=SA Df=><P style=”border:2px solid lightblue;padding:10;text-align:center;color:royalblue;background:aliceblue”><B>Welco’

a='<ASD asd=SDf SDA=F sad=F dsaf =SDAf =s daf=SDA f=SA Df=><P style=”border:2px solid lightblue;padding:10;text-align:center;color:royalblue;background:aliceblue width =   = 123″><B>Welco’
document.getElementById(‘n’).value=a+”\n\n”
document.getElementById(‘n’).value+=a.replace(/ ?= */g, “=”).replace(/[“‘]/g,””).replace(/(=)([^=><]+)([> ])/gi, “$1\”$2\”$3”)

 

</SCRIPT>


Oct 21 2008

[javascript] search replace

a='<p align=center><i>text</i></p><b>bold</b><img src=><a href=sdasdadasdasda</a></img>’

a.replace(/<([/]?)([a-zA-Z]{1,8})(\ ?)/gi, function(m){return m.toUpperCase()} )
//b=a.replace(/<([/]?)([a-zA-Z]{1,8})(\ ?)/gi, ‘<$1($2)$3’)

ausgabe:
<P align=center><I>text</I></P><B>bold</B><IMG src=><A href=sdasdadasdasda</A></IMG>


Oct 13 2008

[bash – sed] after 70 chars one enter

 cat lo | sed -e “s/\(.\{70\}\)/\1\n/g” 


Oct 12 2008

[bash – sed] del begin to last space, show rest of space

cat as|sed -e ‘s/^.*\ \(.*\)$/\1/1’

 

to  search for last space, and swap it to begining

cat usercase_workingfile| grep “View top”|sed -e “s/^.*- \(.*\)<.*$/\1/”| sed -e ‘s/^\(.\{,25\}\).*$/\1/g’|sed -e ‘s/^\(.*\)\ \(.*\)$/\2 – \1/’

 

 


Oct 12 2008

[bash – sed] show 1st 5 chars, del rest

 sed -e ‘s/^\(.\{,5\}\).*$/\1/g’


Oct 9 2008

ffmpeg auf webserver installieren mit lame

 

./configure –enable-libmp3lame –enable-static –libdir=/{MEIN-HOME}/lib –incdir=/{MEIN-HOME}/include –shlibdir=/{MEIN-HOME}/lib –extra-ldflags=-L/{MEIN-HOME}/lib –extra-cflags=-I/{MEIN-HOME}/include

vorher lame installieren:

./configure –prefix={home}/arbeitsverzeichnis/ 

und nciht vergessen, bei ffmpeg ist noch ne .sh datei, die auf +x gesetzt werden muss

dann mit 

../bin/bin/ffmpeg -i denim.wmv -ar 44100 -s cif -b 500kbit/s denim.flv

konvertieren


Oct 6 2008

[bash] search empty folder and mv to ./empty

find ./ -depth -type d -empty -exec mv “{}” ./empty/  \;

test:

find ./ -depth -type d -empty -exec echo “{}” ./empty/  \;