This post will provide how to calculate the largest prime number of a 96 bit number. This was chosen as a starting point. As you can see, it took almost 27 minutes (1614 seconds) to calculate on a dual core…
Category: Python
Searching splunk and analyzing results with PyDbLite
We had a need to analyze how often a web shopper used more than one device to manage her shopping cart within a given time tolerance. We store our Apache access logs in Splunk, so this post is simply a…
Unexpected end of file from server
The “java.net.SocketException: Unexpected end of file from server” exception is thrown in the HTTPClient class, as well as others. This article simply provides an example of how to generate it for testing purposes. We start with a client class that…
Market Basket Analysis with python
Very elegant example at http://blog.derekfarren.com/2015/02/how-to-implement-large-scale-market.html. What is below is just a complete script with what the link above provides, along with example of our output. Our file was formatted slightly differently, so we had to change the split command. We…
Weblogic stuck thread printer
This is a useful script for crawling the Weblogic domain logs and printing threads that have been stuck, as well as the duration they were stuck. It doesn’t include the initial ten minute (default) window before a log entry is…
wireshark, python, and Excel for graphing TCP window sizes
Filter the packets in which you are interested. In this case, we filter on the source IP… …then export the packets to a CSV file… …which we then parse in python to produce another CSV file… f = open(“good.csv”,”w”) for…
What is the most likely dice roll?
Probably common sense, but this statistically supports the most common roll of the dice. Of course, this assumes physical normalcy of the die, not loaded, etc. 🙂 [root@cmhlcanlyodb01 ~]# cat rand.py import random d = dict() for i in range(1,100001):…
Reading random lines with python
Technically, this isn’t random, but it met my needs. I wanted to read an arbitrary number of lines from a 4GB text file to spot check data we had loaded. What is below does the following: 1) get the file…