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 …

MariaDB replication not auto reconnecting

A few weeks ago I’ve migrated some services to a new server and this new server was running Debian 9. One of the changes from version 8 to 9 was that the default mysql-server package installed MariaDB instead of MySQL. This should be OK as MariaDB is supposed to be compatible with MySQL. This service …

bash SEGFAULT on chroot

After upgrading do the Kernel 4.18, a chroot I used somewhat frequently stopped working. Everytime I tried to start it I just got that simple, but horrifying message: ~# chroot /path/to/jail /bin/bash -i -l Segmentation Fault As the project I was working on did not depended on that chroot I’ve set this aside until now. …

Upgrading the linux-image in Debian stretch

In the last few days I was trying to make some BPF scripts work and for that I tought I needed to upgrade my Debian to a new kernel. The original version is 4.9 with all the debian patches, and I’ve decided to go for the latest one available, which was 4.18. $ apt-cache search …

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 …

Setting up a UTF-8 environment in linux

Based on this post. Check if the locales package is installed (dpkg -l locales). Then run: dpkg-reconfigure locales and choose the desired locales (en_US.UTF-8, for me). Then, to be sure, export the variables (~/.bashrc) export LC_ALL=en_US.UTF-8 export LANG=en_US.UTF-8 export LANGUAGE=en_US.UTF-8 You should start tmux or screen with the parameters, to be sure: $ tmux -u …