python yum check-update howto

If you are running an rpm based Linux system like CentOS you might want to automatically and regularly check if security-updates are available. You can use existing commandline tools or python scripts. This article is about checking if linux host is up-to-date with python yum module – without scraping the cli tool. The yum commandline […]

python call super constructor

If you want to call the constructor of a parent class you have a couple of options. For example: In this first example we are talking about “new-style” classes. Basically these are classes that inherit from “object” ( class Parent(object) ). In this case you can call the super() method with a reference to Child […]

python call constructor of parent class

sed remove line break vs replace newline with other tools

sed replace newline (or 5 ways to remove line breaks with sed, python, tr, perl, xargs) 1

When you are automating tasks you often come to the point where you have to remove newlines / line breaks from documents or ASCII streams to use this output as parameters for the next steps. There are many options how this can be done. Especially in Big Data streaming you should also consider the performance […]

Simply serve local directory via HTTP with python webserver 1

Sometimes you quickly need to exchange some files between networked machines. A really easy way that mostly also works through firewalls is to serve them via a local webserver. Python offers a really simple module for that: python -m SimpleHTTPServer To serve a local directory just run: [email protected]:~$ python -m SimpleHTTPServer Serving HTTP on […]