Own stuff

How to find strings in BLOB/CLOB/LONG columns of Oracle database tables

Sometimes you've to reverse engineer a database (or an app using a database) and all you've is some piece of data that is used in whatever function(ality) you're looking into. Eg. you see some message/text on a screen of the app and you've to figure out where and how it is used. For this you've to first find the table and the row where that data is stored. Here comes this little PL/SQL procudure handy.

How to find arbitrary data in an Oracle database

Sometimes you've to reverse engineer a database (or an app using a database) and all you've is some piece of data that is used in whatever function(ality) you're looking into. Eg. you see some message/text on a screen of the app and you've to figure out where and how it is used. For this you've to first find the table and the row where that data is stored. Here comes this little PL/SQL procudure handy.

List photos and videos from Picasa Web Albums/Google+ that are over a specified width, height or duration

Google provides free/unlimited storage for both Picasa Web Albums and Google+ users under certain conditions. If you're a Google+ user, you can upload unlimited photos that fit into 2048x2048 pixels and videos not longer than 15 minutes. If you're a Picasa Web Album user without a Google+ registration, you can upload unlimited photos up to 800x800 resolution and videos with a length up to 15 minutes.

Make an ISO image from selected files/directories in Nautilus

Using the attached Nautilus action, you can easily add a custom action in the context menu of Nautilus and create an ISO image from the selected files and/or directories. It works with filenames containing whitespace and supports selection of multiple items. It also remembers the last selected/entered file path + name (in case you create ISO images regularly). Requires genisoimage to be installed.

Flash Performance Optimizer (GreaseMonkey script)

Adobe's Flash Player can eat up quite some CPU power and sometimes the sole reason for the Flash plugin's high CPU usage is badly written embed code. Eg. the wmode=transparent embed parameter is only required if the Flash contains (and uses) transparent sections and it is necessary for correct rendering to utilize transparency. The other performance killer is the quality embed parameter: setting it to best is most of the time an overkill and totally unnecessary. Unfortunately some Flash developers (and website maintainers) lack the knowledge/time/desire to tune their embed code for optimal performance and use these parameters even if they are not needed. Flash Performance Optimizer tries to fix these problems to give you a better user experience.

Convert images to JPEG format in Nautilus

Using the attached Nautilus action, you can easily add a custom action in the context menu of Nautilus and convert the selected files to JPEG. It works with filenames containing whitespace and supports selection of multiple items. Requires ImageMagick to be installed and the convert executable to be available through /usr/bin/convert.

JarDiff - create a diff of the public API of two JAR files

I've written a simple shell script to generate "signatures" of all the *.class files in two JAR files and compare these with diff. The output is pretty well usable to spot the (sometimes accidental) differences between two versions of the same library.

A glimpse at the startup process of a context in Tomcat

Reading through the Servlet API documentation it's quite probable that you'll stumble on a couple of questions you cannot answer ... at least not based on the docs. I always wondered how exactly Tomcat handles the various elements of a webapp that we define in the web.xml deployment descriptor file. To lift all doubts, I've written a small webapp that logs all aspects of the startup process of a Tomcat context. I've chosen to use the good old standard error (System.err.println()), because loggers would have added just unnecessary dependencies, configuration and complications.

Python script to list libvirt domains with their descriptions

Unfortunately neither the virsh command, nor virt-manager give you the option to list your virtual machines with their descriptions. If you've a couple of dozen (or even hundred) VMs, the short VM name is pretty soon going to be not enough to find the given VM you're looking for.

How to find the processes using the most swap space in Linux

There's already a good answer to the question at stackoverflow. They suggested to use the top command, then change the sorting field to "swap" by hitting O and p. Unfortunately (afaik) there's no way to do this in batch mode (using the -b switch) and save the top swap using prorcesses in a file. There's another method: use the ps command.
psres=$(ps -eo rss,vsz,user,pid,tty,time,cmd); set -- $(/bin/echo "$psres" | head -n1); shift; shift; echo "SWAP $*"; echo "$psres" | awk 'BEGIN {ORS=""; getline} {print $2 - $1 " "; for (i=3; i<NF; i++) print $i " "; print $NF "\n"}' | sort -rn | head

Syndicate content