RSSAmplifier

Blog

Said van de Klundert

Words on things

saidvandeklundert.netRSS feed ↗20 posts

Latest posts

Pydantic is awesome!

One of my favorite libraries in Python in Pydantic. I love it and use it all over the place. I regularly try to convince people to use it, and when I do that, I tend to give a presentation where I am in the IDE walking people through examples of...

My first time at AWS re:invent

From November 24th till December 1st, I was in Las Vegas to attend AWS re:invent for the first time. The conference did not start until Monday, but I flew over a bit earlier to meet up with a friend who I worked with earlier in IBM Cloud. Hanging out with...

Testing network configurations using Batfish, Pandas and pytest

Recently, I started looking into testing and validating network configurations leveraging Batfish, Pandas and pytest. Doing something with Batfish has been on my to-do list for quite a while. After playing with it, I can say it is a real pity I did not start using this tool earlier. This...

Extending Python with C

speed up your Python using C - A good deal of Python, or at least CPython, is written in C. The language and the interpreter are implemented in C and in addition to this, you can also find a lot of modules in the Python standard library powered by C. My desire to read some of the...

Building a network configuration

Even though there are a lot of resources on rendering and building network configurations, I was missing content that describes the pattern that I have been using for some time now. This post outlines the pattern I have been using and provides a toy example where that pattern is implemented....

Calling Rust from Python using PyO3

speed up your Python using Rust - Calling Rust code from Python is made easy by PyO3. You can write a Rust library and rely on the combination of PyO3 and maturin, a supporting tool from the PyO3 ecosystem, to compile the Rust library and have it installed directly as a Python module. Among others, PyO3 can...

Calling Rust from Python

speed up your Python using Rust - Python is a fantastic language! At least, in my opinion it is. There is a great ecosystem of libraries that you can use and I find it a very satisfying language to work with. But being the interpreted language that it is, Python is not the fastest. To speed things...

Rust Option and Result

dealing with the Option and Result enum - A thorough understanding of the Option enum and the Result enum are essential to understanding optional values and error handling in Rust. In this ariticle, I will work my way through both of them. Introduction To understand the Option and the Result, it is important to understand the following: the...

Rust vectors

data types - What is a vector: Vectors can be thought of as resizeable arrays. It is a data structure that can be used to store a sequence of elements. The stored elements have to be of the same type. In case you need to be flexible, you could choose to use an...

Rust slice

data types - In Rust, the slice is a primitive type as well as a sequence type. I found slices very confusing at first. In the Rust book, slices are defined as ‘a dynamically-sized view into a contiguous sequence’. But somewhere in the rust-lang Github repo, the slice is defined as follows: Slices...

Rust tuple

data types - The Rust tuple is placed in several categories of types. For starters, the tuple is a primitive type. Among others, this means tuples have the Copy trait implemented, making them pass by value. Together with the array, the tuple also falls into the category of primitive compound types. These types...

Rust SSH

Learning Rust by building a CLI tool - Creating small CLI tools is a fun way to get more familiar with a programming language. If you are coming from an infrastructure background, a CLI tool that you can use to send commands to devices/servers might be considered a neat starting point getting into Rust. This is how I...

Rust arrays

data types - In Rust, the array is the simplest of the sequence types (the others being slices and tuples). The array lives on the stack and has a fixed length. The length you declare an array with is part of it’s type and it is going to remain the same throughout the...

Rust scalar types

data types - Scalar types Scalar types are types representing a single value. In Rust, we can identify the following scalar types: Creating and printing these values in a program can be done as follows: fn main() { let ch: char = 'z'; // four bytes, expresses single Unicode Scalar Value let b:...

GoSNMP

GoSNMP is a very fun package to play with and learn about Go. It is easy to use and it can be made into doing something usefull quickly. The examples in the repo are clear and SNMP offers a fun way to play with channels and retrieving information from devices....

Working with JSON in Go

A little while ago, I decided to start learning Go. One of the things that I wanted to start out with was learning how to work with JSON. Coming from Python, the first thing I noticed was that working with JSON in Go is a bit more involved. The following...

Schedule the boring stuff with Python

The schedule module describes itself as ‘Python job scheduling for humans’. It is a nice package that I use for infrastructure related tasks and activities. The package (currently) prides itself for the following: A simple to use API for scheduling jobs. Very lightweight and no external dependencies. Excellent test coverage....

Navigating Juniper RPC returns using XPATH

Many people dread XML and would rather work with JSON. However, XPATH can be extremely powerful when dealing with the Juniper XML API output. Even though the Juniper API can be made to return JSON instead of XML, I prefer sticking to XML. With little code, I tend to be...

Using Python functions in Jinja templates

In some cases, Jinja templates become too complicated. Lots of deeply nested if statements, clunky ways of working with variables, macros and many other things that hurt the eyes. What might be worth knowing is the fact that you can pass a Python function into your Jinja templates. Doing this...

Nornir

In the search for a framework that would allow me to plug my automations without too much fuss, I came across Nornir. I have been enjoying it so much that I decided to do write down an introduction for others. My hope is that this post will allow others to...