Change “Decode as…” of a port range in Wireshark

When analyzing a network capture it is common to need to change how a stream is being treated by Wireshark, either because the port assignment is dynamic or is not supported, or both. It is possible to change this, one stream at a time, and each time the whole capture needs to be rescanned. This …

Proxy internet access trough SSH

In a scenario where one machine has access to the internet, and a remote machine does not (due to firewall restrictions), but is accessible via a VPN or something. There is a way to provide internet access for this remote machine. One way this can be achieved with dynamic port forwarding in SSH, at least …

How to override DNS for private networks with BIND RPZ

In our private network we have services that are served to the internet and should also be used by the users sitting inside the network (physically or via VPN). We have a main DNS servers in a cloud provider and it is serving service.example.com pointing to our firewall internet facing address and an internal DNS …

Quick Profiling Python Code

The cProfile is my go-to Python profiler as it is part of the default installation, no extra modules needed. When profilig with cProfile it will generate an output with the call count and spent times for each called fuction. The main way I use it is specifying an output file for later inspection: This will …

Accessing corporate GIT repositories without a VPN

I usually just write here so I can remember these things later, but this time is something to be found by others. So, it is normal to have our git repositories accessible in the public internet (access controlled or not), but it is possible that your repositories are only accessible within your corporate network, and …

Change keyboard Compose behavior

For some time I’ve been wanting to change the default behavior of my keyboard (on an Ubuntu 18.04 machine) when using the composition keys (dead-keys). The default behavior for the double quote key (“) to be a compose key, in order to be able to input charaters like ä (“+a)and ö (“+o), so if I …

Using LDAP to authenticate with a svnserve server

I had this already set up in another server  but we had to set up a new svn server even though we already switch most of our stuff to git… So, after setting the the svnserve daemon, we need to set up LDAP authentication. We are using debian servers so I needed to install sasl2-bin …

Resizing a tmpfs partition without losing the files

Took me just a few seconds of Googleing, but it seems worth taking a note here. To resize a tmpfs filesystem without losing the files. Assuming that /tmp is being mounted in a tmpfs. You can do it so it lasts until next reboot with: mount /tmp -o size=3000M,remount Or you can do it so …

Visualizing thread context switch and schedule timeline in Linux

Recently I needed to see when my threads were executing and in which processor, and it took me a couple of days to get this done. Here is the best solution I’ve found. First of all, we need the kernel to be compiled with some debug features enabled http://www.mjmwired.net/kernel/Documentation/trace/ftrace.txt https://www.kernel.org/doc/Documentation/trace/ftrace.txt We’ll need to mount the …