Skip to content

Instantly share code, notes, and snippets.


  • Berlin
Block or report user

Report or block milkpirate

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
milkpirate /
Last active Aug 18, 2018
Force apt(-get) files to be executed with python2 - useful for debian, if you set e.g. python3 as system default
cd /usr/share/python/debpython/
\ls /usr/share/python/debpython/*.py | xargs sed -i.bak '1s|^|#!/usr/bin/env python2\n|'
cd /usr/bin/pycompile
\ls /usr/bin/pycompile | xargs sed -i '1s|^|#!/usr/bin/env python2\n|'
milkpirate / update-alternatives
Last active Mar 28, 2019
Python update alternatives - summary
View update-alternatives
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.7 2
update-alternatives --list python
sudo update-alternatives --config python
sudo update-alternatives --set pager /bin/less
milkpirate /
Created Mar 16, 2017
Icinga plugin - core frequencies
#!/usr/bin/env bash
# Read core number from /proc/cpuinfo and display frequency of each
# count the processor fields and display the number
awk '/processor/ {core_count++} END{print "CPU OK:", core_count, "CPUs;"}' \
# get the frequency for each core and keep track of core id via counter
awk 'BEGIN{printf "| "} /cpu MHz/ {print core_id++ "=" $4}' \
You can’t perform that action at this time.