What is below proves the card holder PAN is in the clear in the dump… public class memSecurity { public static void main (String args[]) throws Exception { String c = “1234567887654321”; Thread.sleep(180000); } } Compile and run what is…
Category: Development
Calculating gaps between full CMS cycles
While troubleshooting a performance issue, we had a need to graph the number of seconds between full collections. We used what is below. This assumes you have added -XX:+PrintGCDetails and -XX:+PrintGCDateStamps as well as a file location for -Xloggc: to…
Examples of connecting to kerberos hive in JDBC
We had a need to authenticate user requests against AD in a kerberos enabled cluster, and allow “local” hive sessions to use only a keytab. Below are the examples of each. First, we show how to connect over a binary…
Dump heap programatically
This is one way you can dump the heap of a running JVM from within a page. This is not something you would place in a running production system, as you don’t want random GET’s to keep dumping the heap…
JDBC batch re-processing
I have always wanted to duplicate how GoldenGate handles batch failures. In GoldenGate, you can set the parameter “batchsql BATCHTRANSOPS 2000”, for example, to send 2000 statements at a time to the database for execution. In general, this is far…
JAAS with Client/Server socket example
What is below is a hack on the same example floating all around the internet for using JAAS with Kerberos (Active Directory, in this case). This extends the example to send the ticket over a network socket to the server.…
Determining the order of java classes called
I thought this was pretty interesting, and perhaps incredibly useful. While attempting to understand the call stack (and being too lazy to read through reams of source code), I found that calling a java class will result in stat() system…
Querying Active Directory from java
This is just a stub I often use when configuring AD authentication for various applications. Invariably, I can use this to quickly determine why a given application configuration may be failing. import java.util.Hashtable; import javax.naming.*; import javax.naming.directory.*; class TestAD {…
Python, cookies, and session management
While working with an external vendor, we had a need to understand how to manage HTTP session cookies with python. This is simply how we did it… import urllib, urllib2, cookielib, re cj = cookielib.CookieJar() opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj)) home =…
Determine the number of active sessions from the JBOSS access log
While planning for holiday shopper traffic, we realized that we did not record the number of active sessions at any given time during holiday 2013. To come up with something that would get us close, we wrote what is below…