I just had the case that my disk on a Linux VM ran full and I had to make space quickly. I was willing to sacrifice my journald logs in order to make the urgent update work and I was able to free up a few gigabytes of space with the following commands. This drops… Continue reading Cleanup Linux logs
Category: Linux
Wait for host in BaSH
Okay, this one is a little specific, but I recently had this issue and I wanted to share it because knowing this would have saved me one scripting language and a lot of time. I have previously implemented this in PowerShell, but it can easily be done in BaSH as well. The premise was to… Continue reading Wait for host in BaSH
Automate with ssh
Scenario I have a bunch of Linux hosts to perform actions on. Updates, certificates, cleanup, you name it. I do all my work over “ssh” but for that to work the hosts must be trusted. Of course I can use “ssh-keyscan” to get the keys but my own “known_hosts” file gets pretty messed up when… Continue reading Automate with ssh
Zabbix agent deployment and configuration
Installation and configuration of the Zabbix agent, the counterpart of the Zabbix server, that collects and sends data to the server to be shown, is quite easy and can be done with a simple bash script. Now let’s imagine you have 1000 hosts and would have to do that on each and every one of… Continue reading Zabbix agent deployment and configuration
Parse JSON output from an API with Python
As great as PowerShell is with JSON objects you can’t always use it because it is not available on each and every machine with Linux out there. And I don’t know a way of parsing JSON code with plain bash properly. Fortunately a lot of servers come with “python” installed and it can be used… Continue reading Parse JSON output from an API with Python
Run Linux services only as local user
Some time ago I wanted to let services like Apache, application servers, databases and stuff run as “Active Directory” users under Linux. Linux uses a component called “winbind”, which is part of the all famous “Samba” package, to connect to an “Active Directory”. What it does is basically map your AD (short for “Active Directory”)… Continue reading Run Linux services only as local user
Change date modified of files and delete files other than n days
I am working on a backup script on Linux and for that I need test data: Files that are modified on certain dates and that I can scan for. Of course I could create a file every day for the next month, but that would take a little too long. I found out, that one… Continue reading Change date modified of files and delete files other than n days
Creating network bridges without “bridge-utils”
The following network definition cost me some time. I read in an article that the package “bridge-utils” is deprecated and is not required anymore to create network bridges under Debian and it’s derivatives. Let’s start with the code because that’s what I would be interested in, if I was looking for a solution. Code Just… Continue reading Creating network bridges without “bridge-utils”