Using TCP-LP with pycurl in Python

Intro TCP-LP (low priority) is a TCP congestion control algorithm that is meant to be used by TCP connections that don’t want to compete with other connections for bandwidth. Its goal is to use the idle bandwidth for file transfers. The details of TCP-LP are here. With Linux’ plugable congestion control algorithms, it is possible …

Continue reading ‘Using TCP-LP with pycurl in Python’ »

pyOpenSSL and invalid certificates

I was trying to import some X509v3 certificates that were created with pyOpenSSL to a MikroTik router (RouterOS 6.1) but they were always being imported with an invalid validity period (not before 1970 and not after 1970). Eventually I found out that this is because pyOpenSSL stores the validity field in an invalid format. Here’s …

Continue reading ‘pyOpenSSL and invalid certificates’ »

Verify that a private key matches a certificate with PyOpenSSL

Verify that a private key matches a certificate using PyOpenSSL and PyCrypto: The idea is to get the modulus from the two DER structures and compare them. They should be the same. Note: You can use the above under the MIT license. If it doesn’t fit your needs let me know. My intention is to …

Continue reading ‘Verify that a private key matches a certificate with PyOpenSSL’ »

Verifying an SSL certificate with python

This one took me a considerable amount of time and had to figure some parts from scratch. Unfortunately there doesn’t seem to exist an easy (out-of-the-box) way for checking whether a certificate is signed by another certificate in python. After days of searching and despair, here is a solution without using M2Crypto: Note: You can …

Continue reading ‘Verifying an SSL certificate with python’ »

DNSSEC key tag (keyid) and DS signature calculation in python

This one took me a considerable amount of hours to figure out so here it is. While trying to automate DNS zone generation I had to calculate some of the values programmatically. Two of the auto-generated values had to do with DNSSEC entries: The key tag (or keyid) and the DS record’s signatures. The required …

Continue reading ‘DNSSEC key tag (keyid) and DS signature calculation in python’ »

A fast interpreted language

How can one claim that an interpreted language is fast? Easily. If you implement the language using itself and the resulting interpreter is faster than the original then this means that the interpreted language manages to imprint the prorgammer’s intentions to the C language (or assembly) better than the programmer herself. For example, I may …

Continue reading ‘A fast interpreted language’ »

World’s smallest IPv6 compatible web browser program

For a long time now I’ve become a fan of the python+Qt combination. It is great to have an easy to learn, easy to use language with great portability and minimalistic syntax. The following program has become my favorite showcase for python. To my knowledge, it is the smallest, easier to understand, portable, IPv6 compatible …

Continue reading ‘World’s smallest IPv6 compatible web browser program’ »

KAutostart and python

This one took me many hours to debug: For KDE 4 and python there can be a hard to debug problem with KAutostart usage. Suppose you have a window class class MyWindow(KDialig, Ui_Dialog): def __init__(self): self.kas = KAutostart(‘myapp’) self.kas.setAutostarts(True) You may find that the setAutostarts() doesn’t actually work. This is because MyWindow references kas and …

Continue reading ‘KAutostart and python’ »