We had a server that had been behaving oddly since at least April. I finally discovered why. jps returns nothing, which is the first symptom. When we strace, we see it can’t write to /tmp (our setting for java.io.tmpdir), so…
Category: Development
Finding windows OS files modified in time range with python
We had a need to search some text files in Windows modified during a certain time range with a given piece of text. This is a network drive that is not indexed, so we couldn’t quickly rely on a windows…
Does java reuse closed sockets when the host still has one open?
We were curious as to what the handoff is between an application that opens a network socket, and how the Linux OS handles it. Let’s assume we do what is below: import java.net.*; public class checkSocket { public static void…
Crawling all SQL Server tables and columns for a specific value
We had a quick need to search all columns in every table during a data discovery exercise. This is by no means the most efficient, but it does work. It pulls 10,000 rows at a time from each table, and…
Where is a given thread connecting?
We start by getting the PID of our running JVM… -bash-4.1$ jps 29527 Main 3560 Jps …then we print each lightweight process (threads in our JVM) in which we are interested. In our case, these are threads with zafu in…
Comparing web content using python
We have an active/passive data center setup. We replicate the database data using GoldenGate, and maintain the application software through regular build processes. ATG publishing is included in the database data, and the targeter files are maintained via rsync. We…
Association rules in java
Assocation rules are a concept in which relationships between different elements of a common set can be established. For example, a study may be undertaken to determine the impact of one externally employed parent on childrens GPA in a household,…
Python implementation of luhn algorithm
The luhn algorithm, or mod 10, was developed by an IBM scientist in the 1950’s. To a large extent it is still used today to validate credit card numbers in front end applications. If you think back to your high…
Python script to print blocking threads that are not blocked themselves
There are a lot of GUI tools to process the call stacks for a “thread dump” taken on a running JVM. This is just a command line tool to do it, which is normally where I start troubleshooting when there…
Python dig query
Nothing much, just a script to walk the tree for a given name. It starts at a CNAME and walks its way all the way down to the A record and IP address. In the context of larger script that…