Ruby One Liners: Difference between revisions
m (New page: Parse Awstats html output. <geshi lang="ruby"> ruby -ne 'if $_ =~ /href="http:\/\/www.theeggeadventure.com\/(.*?)".*?([0-9]+).*?([0-9.]+) KB/ then puts "#{$1}\t#{$2}\t#{$3}" end ' \ < aws...) |
mNo edit summary |
||
Line 1: | Line 1: | ||
Find duplicate class files in multiple jars. Tip: run this in your JBoss lib directory. | |||
<geshi lang="ruby"> | |||
# If a class file has a different size in a different jar file you might have a problem on your hands | |||
find . -type f -name "*.?ar" -print -exec jar tvf {} \; \ | |||
| ruby -ne 'BEGIN{ $h={} }; puts $_ if $_ =~ /.*.jar$/; if $_ =~ /([0-9]+).{31}(.*)/ then $h[$2] ||= $1; puts $2 + " size " + $1 + " != " + $h[$2] if $h[$2] != $1; end ' | |||
</geshi> | |||
Parse Awstats html output. | Parse Awstats html output. | ||
<geshi lang="ruby"> | <geshi lang="ruby"> | ||
Line 4: | Line 12: | ||
< awstats.pl | putclip | < awstats.pl | putclip | ||
</geshi> | </geshi> | ||
[[Category:Ruby]] |
Latest revision as of 02:27, 15 September 2008
Find duplicate class files in multiple jars. Tip: run this in your JBoss lib directory.
<geshi lang="ruby">
- If a class file has a different size in a different jar file you might have a problem on your hands
find . -type f -name "*.?ar" -print -exec jar tvf {} \; \ | ruby -ne 'BEGIN{ $h={} }; puts $_ if $_ =~ /.*.jar$/; if $_ =~ /([0-9]+).{31}(.*)/ then $h[$2] ||= $1; puts $2 + " size " + $1 + " != " + $h[$2] if $h[$2] != $1; end ' </geshi>
Parse Awstats html output. <geshi lang="ruby"> ruby -ne 'if $_ =~ /href="http:\/\/www.theeggeadventure.com\/(.*?)".*?([0-9]+).*?([0-9.]+) KB/ then puts "#{$1}\t#{$2}\t#{$3}" end ' \
< awstats.pl | putclip
</geshi>