Posts

Showing posts from April, 2016

Featured Post

jboss listen interface on any port

       was doing some practicals on my local jboss server , thinking of binding jboss with multiple interfaces like ipv6 and ipv4 here is solution for this <interfaces> <interface name="management"> <inet-address value="127.0.0.1"/> </interface> <interface name="public"> <inet-address value="127.0.0.1"/> </interface> <!-- IPv4 --> <interface name="any"> <any-ipv4-address/> </interface> </interfaces> <!-- Use the any interface --> <socket-binding-group name="standard-sockets" default-interface="any"> <socket-binding name="http" port="8080"/> <socket-binding name="https" port="8443"/> <socket-binding name="jmx-connector-registry" port="1090"/> <socket-binding name="jmx-connector-server" port="1091...

SED command to replace strig i multiple files

Basic Format grep -rl matchstring somedir/ | xargs sed -i 's/string1/string2/g' Note: The forward slash '/' delimiter in the sed argument could also be a different delimiter (such as the pipe '|' character). The pipe delimiter might be useful when searching through a lot of html files if you didn't want to escape the forward slash, for instance. matchstring  is the string you want to match, e.g., "football"  string1  would ideally be the same string as matchstring, as the matchstring in the grep command will pipe only files with matchstring in them to sed.  string2  is the string that replace string1. There may be times when you want to use grep to find only files that have some matchstring and then replace on a different string in the file than matchstring. For example, maybe you have a lot of files and only want to only replace on files that have the matchstring of 'phonenumber' in them, and then replace '555-5555' with ...