Replacing a piece of XML with awk

This script searches for an initial tag and and closing one and replaces the content. # !/bin/bash awk ‘ BEGIN {pr = 1;one = 0} /<Name>OPENING<\/Name>/ {pr = 0;} { if (pr) print } { if (!pr && !one) {print (“\t\t <Name>OPENING</Name> \n \t\t\t <Value>false</Value> \n \t\t<Type>STOPHERE</Type> \n ” ); one =1 ;}} /<Type>STOPHERE<\/Type>/ {pr…

Track ftp password from tcpdump Linux

Very nice and simple: tcpdump port ftp -l -A | egrep -i ‘pass=|pwd=|log=|login=|user=|username=|pw=|passw=|passwd=|password=|pass:|user:|username:|password:|login:|pass |user ‘ –color=auto –line-buffered -B20 nJoy  😉

Adding all new files and subdirs to svn

Sometimes you find yourself catching up with some devs who did not care to add all the stuff they should to SVN or you want to make sure all files are in SVN. Well here’s a hand script : svn status | awk ‘{if ($1 == “?”) print $2 }’ | xargs svn add nJoy…