Archive for the ‘Programming’ Category

Script day: grep in jar (or zip) files

Here is another script I wrote for work and I thought it will be interesting enough to share:

Say you want to check which JAR files (or ZIP files for that matter, as Java ARchive files are just ZIP files with a different extension) contain files that contain some text. grep is the obvious answer, but how to grep files in JARs?


The Insanity of Upstream

Sometimes the Java community, or more specifically the people that write Java open source software, drive me nuts!

For the past couple of week I’ve been trying to build a new version for the Jetty package based on the current Jetty6 package from JPackage1, and in the process combating its hellish dependency tree and the way open source Java projects build opon each other in a complicated, confusing and often circular manner.


  1. an excellent excellent project that is operated by talented people in what I can only guess is what little free time they have []

Script day – Shutting down multiple servers at once

A system administrator in my company recently approached me with a problem – how to shutdown multiple Linux servers at the same time from a central location. Apparently this is something that people in the MS-Windows world use all kinds of applications, like the Remote Shutdown Tool from Microsoft (though I don’t understand how they handle the authentication – this tools doesn’t seem to require any authentication so it appears that any person with network access can shutdown any computer).

Anyway, apparently searching the web for “Linux remote shutdown” yields no useful results (or so I’ve been told), but frankly – when you have standard UN*X tools at your fingertips, a remote shutdown tool is simply typing ssh root@server shutdown -r now at your local console. But still, for people who want a “tool” – read on.


פניני קוד

מדי פעם יוצא לי לתחזק התקנת PHP Nuke ממש ישנה, ואני כל פעם מופתע מחדש מה”איכות” של הקוד: PHP Nuke הוא הדוגמה לכל מה שגרוע ב-PHP – זו טכנולוגיה לא רעה שהביאה את תכנות ה-Web להמוני אנשים שלא היתה להם דרך אחרת להתחיל, אבל זה גם הצד הרע שלה – PHP הביאה את התכנות להמוני אנשים שאין להם מושג בתכנות ואז אתה מקבל דברים כמו קוד שמביא פריטים מעץ הירארכי בעזרת הפונקציות GetKids ו-GetBabies (שקוראות אחת לשניה בלולאה), או את הקוד המבריק הזה:

Spam prevention powered by Akismet