Skip to content

Instantly share code, notes, and snippets.

View sforteln's full-sized avatar

Simon Fortelny sforteln

View GitHub Profile
...
/temp/lib/spring-security-taglibs-3.0.0.RELEASE.jar no match
/temp/lib/spring-security-web-3.0.0.RELEASE.jar no match
/temp/lib/spring-tx-3.0.0.RELEASE.jar 3.0.0.RELEASE
/temp/lib/spring-web-3.0.0.RELEASE.jar 3.0.0.RELEASE
/temp/lib/xpp3\_min-1.1.4c.jar no match /temp/lib/xstream-1.3.1.jar no match
...
searchManifests /temp/lib Implementation-Version
function searchManifests() { for jarFile in \`ls $1/\*jar\`; do echo $jarFile;
unzip -p $jarFile META-INF/MANIFEST.MF | perl -e 'while(){
if($\_ =\~ /$ARGV[0]:\\s([\^\\s]\*)\\s/){print " " . $1 . "\\n";exit;}}
print " no match \\n";' $2; done }
{% endhighlight %}
Or a bit more readable
{% highlight bash %}
function searchManifests() {
for jarFile in \`ls $1/\*jar\`;
do echo $jarFile; unzip -p $jarFile META-INF/MANIFEST.MF |
[sfortelny@home blockFinder ]$ unzip -p dist/blockFinder-1.0.jar META-INF/MANIFEST.MF
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: sfortelny
Build-Jdk: 1.6.0\_18
Main-Class: hadoop.utils.BlockFinder
Class-Path: hadoop-core-0.20.2.320.jar commons-cli-1.1.jar
unzip -p example.jar META-INF/MANIFEST.MF
mkdir temp
cp example.jar temp
cd temp
unzip example.jar
less META-INF/MANIFEST.MF
cd ../ rm -rf temp
Trying to connect to hdfs://localhost:9000 as pdadmin,supergroup File:
/tmp/temp-1416832744/tmp154868920/part-r-00000 Replication : 1
Requested block :
Start,End,DataNode
67108864,24546580,localhost
java -cp 'dist/*' hadoop.utils.BlockFinder -h hdfs://localhost:9000
-u superuser,supergroup -f /tmp/temp-1416832744/tmp154868920/part-r-00000
-b 67108864
java -cp 'dist/*' hadoop.utils.BlockFinder -h hdfs://localhost:9000
-u superuser,supergroup -f /tmp/temp-1416832744/tmp154868920/part-r-00000
-b 67108864
Trying to connect to hdfs://localhost:9000 as superuser,supergroup
File: /tmp/temp-1416832744/tmp154868920/part-r-00000 Replication : 1
Block Locations:
Start,End,DataNode
0,67108864,localhost
67108864,24546580,localhost