Skip to content

Instantly share code, notes, and snippets.

View microlinux's full-sized avatar
🚒
Bathing in hot sauce

Herr Schnitzel microlinux

🚒
Bathing in hot sauce
  • El Baño
View GitHub Profile
#!/usr/bin/python
from collections import OrderedDict
from glob import glob
from multiprocessing import Process, Queue
from optparse import OptionParser
from os import getuid
from time import sleep
from traceback import format_exc
@microlinux
microlinux / nfcpud.py
Last active May 2, 2018 09:54
OpenVZ container abusive process killer
#!/usr/bin/python
"""
nfcpud: a daemon for killing abusive container processes on openvz nodes
requires: python daemon module (centos: yum install python-daemon)
ncpud measures average process cpu usage over 5 second intervals. based on
parameters defined in config files, processes are killed if they meet any of 3
@microlinux
microlinux / zping.sh
Last active August 28, 2023 13:28
Bash script for storing ping data in RRDs and graphing that data
#!/bin/bash
#
# INSTALL
# -------
# 1.) Create directory structure
# <base_dir>
# <base_dir>\bin
# <base_dir>\etc
# <base_dir>\log
# <base_dir>\rrd
@microlinux
microlinux / sping.sh
Created February 12, 2015 08:02
Ping IPs by subnet and show simple up/down status
#!/bin/bash
# [user@server ~]$ sping.sh 70.120.121.0/29
# 70.120.121.1 down
# 70.120.121.2 up
# 70.120.121.3 up
# 70.120.121.4 up
# 70.120.121.5 up
# 70.120.121.6 up
@microlinux
microlinux / mping.sh
Last active December 10, 2021 16:37
Pings multiple hosts concurrently and prints results in CSV format
#!/bin/bash
# this program is placed into the public domain
# https://gist.github.com/microlinux/77feda4449a8041a19a7
#
# THIS FILE MUST BE IN YOUR SYSTEM PATH
#
# defaults

Keybase proof

I hereby claim:

  • I am microlinux on github.
  • I am microlinux (https://keybase.io/microlinux) on keybase.
  • I have a public key whose fingerprint is 7F58 E84E E0E9 3724 46ED 86F7 8C6D AF17 BA0B ADE8

To claim this, I am signing this object:

@microlinux
microlinux / shif.sh
Created August 25, 2015 02:08
A script to add commands to EdgeOS that show ethernet/vif traffic
#!/bin/bash
# a script to add commands to EdgeOS that show ethernet/vif traffic
#
# default measurement period is 5 seconds
# probably extendable to any interface in /proc/net/dev
# see 'shif.sh -h' for standalone use
#
# install: sudo chmod 755 shif.sh
# sudo ./shif.sh install
@microlinux
microlinux / tello.py
Last active February 14, 2021 02:42
Python interface for the Ryze Tello drone
"""3/21/2018 DEVELOPMENT HAS MOVED TO https://github.com/microlinux/tello"""
"""License.
Copyright 2018 Todd Mueller <firstnamelastname@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
@microlinux
microlinux / tardis.py
Last active August 27, 2018 01:56
Tello Advanced Remote Drone Interface System (TARDIS)
#!/usr/bin/env python
# This program requires the Python Tello module at https://github.com/microlinux/tello
import argparse
import curses
import tello # https://github.com/microlinux/tello
import time
import traceback
@microlinux
microlinux / exabgp.py
Last active September 19, 2021 21:45
def get_command_output(timeout):
"""Reads command output from stdin and returns a list of lines.
Acks ('done' or 'error') are filtered out. Thus, commands
which produce no other output will result in an empty list.
Args:
timeout (int|float): Seconds to wait for output.
Returns: