One liner: get the last field

No Comments

Problem: I need to get a list of all java libraries in our repository so I can create a matrix of when they are being used and what is type of license they are using. I tried using a pure Windows approach but it is taking too much time so I used Cygwin instead. Getting all JAR files is easy with find but I am having difficulty brewing the correct regexp syntax so why prolong the agony and not switch to another tool instead: awk!

find . -name *.jar | awk -F/ ร‚ยด{$NF}' | sort | uniq

where:

– find searches recursively from the current directly for all files that end with ‘.jar’
– all resulting file paths are piped to awk which, using the forward slash as the column delimiter, prints out the last column
– and finally the list of JAR files are sorted alphabetically and duplicates are removed.

This could probably be done in a whole lot of ways (perl, python, sed, etc.) but the beauty of FLOSS is we can use whatever we can to get the same result. ๐Ÿ˜€

ciao!

AHHHHHHHHHHHHHHHH!!!!!!!!!!!!!

No Comments

The unthinkable happened, the redundant storage that holds my site failed and I lost 2 months of blogs. That is around 25 blog posts and I dont remember even half of them. I could get mad at my service provider but I won’t since they had no control on it. It is just my bad luck that I was one of those whose backups were corrupted by the failure.

They wont get a final say from Dell (their contractor) but I am writing those posts off. It is going to be my penance for not finalizing the process for automatically downloading the backup of the databases on my site. I was lulled by the fact that the provider was creating automatic backups but I did not realize that only copies of the 60th day backup is transferred to a different server.

It sucks but you have to go with the flow. In this day of doom I have am clinging to two adages that should give me strength: that which does not kill me only makes me stronger, and it could have been worse. Either way I am not going to write anything up until monday since they might be able to salvage some data up.

ciao!