Multiprocessing Niceness in Python

Quick and dirty one that tripped me up. Recently I’ve been doing lots of multiprocessing and joblib-based parallel processing, with loooong simulation times. In an effort to make sure that my machine was still useable during these runs, I changed the ’niceness’ value of the spawned processes… or so I thought. import os ... def thread_mask(args): # Properly Parallel RNG #http://stackoverflow.com/questions/444591/convert-a-string-of-bytes-into-an-int-python myid=current_process()._identity[0] np.random.seed(myid^struct.unpack("<L",os.urandom(4))[0]) os.nice(5) return long_simulation(args) First part is a handy way to make sure that your subprocess simulations actually use different random numbers…. which for Monte Carlo style simulation is pretty damned important… ...

Andrew Bolster

SNMP Monitoring and Configuration for Networks and Linux Host Monitoring

TL:DR: Setting up Observium to perform autodiscovery with dynamic DNS, and sample snmp configs to manage Linux servers This week I’ve taken a ‘break’ from the academics since I nearly killed myself sorting out some research for TrustCom (Fingers crossed), and I’ve been engrossed in redoing the network here in our University of Liverpool research lab. Good network and system monitoring tools are hard to come by, especially for free and with decent OSS tendencies. ...

Andrew Bolster

Unattended Updates in Linux Mint

There’s several very valid tutorials and guides around about getting Ubuntu, Debian and Mint to automatically update and upgrade, but they don’t do much explaining/checking. This is a short post filling in the gaps I observed. Get the package sudo apt-get install unattended-upgrades -y Enable the package scheduler File Being Messed With: /etc/apt/apt.conf.d/20auto-upgrades Log File Being Watched: /var/log/unattended-upgrades/unattended-upgrades.log I’ve got no idea why this isn’t automatic; possibly that in other environments, you only want security level upgrades to core system components rather than updating all regular applications. (Not doing this left me scratching my head for a while wondering why the logs kept saying No packages found that can be upgraded unattended when apt was telling me something completely different. Anyway, put the following into a new file named above. ...

Andrew Bolster