Displaying posts tagged: python

Persec python script

No Comments
A while ago I wrote a python script that does a similar job to GNU's watch command. You use it like so: ./persec.py [--interval=<n>] <command> so for example ./persec.py ifconfig Now in a similar way to watch, it executes the command every second, and highlights the differences between each execution. However, in addition to this it ...

Python close_fds issue

No Comments
So I spent the better part of my evening trying to track down a bug, which turns out to be a "feature" of python. I had just installed the GitPlugin for trac but I started to experience problems. When browsing the source inside trac it was taking over 30seconds to load the page and sometimes it ...

Follow HTTP Stream (with decompression)

No Comments
I was using Wireshark to capture an exchange of HTTP packets, however, some of the HTTP responses were using "content-encoding: gzip", which meant I couldn't view them decompressed in the "Follow TCP Stream". Wireshark does decompress them in Packet Details view, but it is hard to follow the full stream like this. The solution was to ...

Autoload symbols for FreeBSD kernel module

No Comments
When debugging FreeBSD kernel modules with GDB, you have to tell GDB the correct symbols for the module, and the location the module is loaded in RAM. This is helpfully explained in the FreeBSD Developers' Handbook. First you must load the module, then run kldstat, note down the address the module is loaded at, and finally ...