programming

A 8-post collection


RSS feed of posts tagged programming

IP subnet filtering with Python

In this blog post I want to share, and talk about, Python program I wrote to solve problem of filtering out child prefixes. Contents Problem description Solution Naïve algorithm Patricia »

Compute largest summary prefix-length with Python

I'm sure many of you had to compute summary network given a number of subnets. It's one of those rare occasions when you have to dust off binary maths skills »

PyTips 2 - Use itertools.product to replace nested loops

Nested loops, we all love them. Or do we? Five levels of indentation later you are not so sure. Your code starts to look ugly and you wish there was »

PyTips 1 - Get loop counter with enumerate()

In PyTips I'll be talking about Python features, standard libraries, and interesting packages found on PyPi. The idea is to have a short write up and accompanying code snippets for »

Python - sort IP addresses from the Linux shell

Have you ever found yourself needing to quickly sort IP addresses directly from the Linux shell? You just ran grep against all of your configs looking for IPs in some »