Skip to content

Instantly share code, notes, and snippets.

Working from home

Michael Brown Supermathie

Working from home
Block or report user

Report or block Supermathie

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
Supermathie /
Created Apr 14, 2014
python CSV example
#!/usr/bin/env python
import csv
import sys
from pprint import pprint
csvreader = csv.reader(sys.stdin)
# Read the header line and extract the column names
header =
Supermathie / resize-java-iKVM-viewer
Created Jan 18, 2019 — forked from thwarted/resize-java-iKVM-viewer
resize-java-iKVM-viewer: find all supermicro Java iKVM Viewer windows and resize them to display all the content
View resize-java-iKVM-viewer
# find all supermicro Java iKVM Viewer windows and resize
# them to display all the content
# for reasons that are beyond sanity, this shitty closed source program
# sets the min and max window sizes to the same values, making it unresizable
# through dragging.
# this wouldn't be so bad if it actually resized the window to display all
# the content. it constantly resizes based on the resolution of the
Supermathie / BBM killed
Created Jun 3, 2018
BBM on Android dammit
View BBM killed
Tasks: 737 total, 1 running, 727 sleeping, 0 stopped, 2 zombie
Mem: 3868764k total, 3380368k used, 488396k free, 143428k buffers
Swap: 1450780k total, 876928k used, 573852k free, 640464k cached
400%cpu 7%user 1%nice 16%sys 370%idle 0%iow 1%irq 4%sirq 0%host
773 shell 20 0 12M 2.8M 1.5M R 7.6 0.0 0:07.98 top
5051 radio 20 0 2.1G 11M 8.2M S 2.0 0.2 0:00.53 com.lge.ipservice
4575 u0_a148 20 0 2.1G 130M 55M S 2.0 3.4 333:05.11
3741 system 18 -2 2.6G 172M 69M S 2.0 4.5 933:21.24 system_server
660 system -2 -8 205M 10M 6.1M S 1.
View gist:fcfbd28b455467a4bd80dcc1029897cd
○ → host
Using domain server:
Aliases: has address is an alias for has IPv6 address 2001:470:1:669::87 is an alias for
with open('/proc/sys/kernel/tainted') as f:
# I'm sure there's a better way to write this, but this is too awesome to not use :D
taint_bits = map(lambda x: x[0], filter(lambda x: x[1] == 1, zip(range(1024),map(int,(reversed(bin(int([2:]))))))
for taint_bit in taint_bits:
if taint_bit == 0: # 'P' - Proprietary module has been loaded.
elif taint_bit == 1: # 'F' - Module has been forcibly loaded.
elif taint_bit == 2: # 'S' - SMP with CPUs not designed for SMP.
Supermathie / gist:1fe384a61280abbdf3ced26fac695675
Created Jun 1, 2017
ISC DHCP PXE architecture switching example
View gist:1fe384a61280abbdf3ced26fac695675
option arch code 93 = unsigned integer 16;
if substring(option vendor-class-identifier, 0, 9) = "PXEClient" {
if option arch = 00:02 { # IA64 EFI boot
filename "/NoopApp.efi"; # not the right image, but we don't care
} else if option arch = 00:06 { # x86 EFI boot
filename "/NoopApp.efi"; # not the right image, but we don't care
} else if option arch = 00:07 { # BC (bytecode) EFI boot
filename "/live-efi/elilo.efi";
} else if option arch = 00:09 { # x64 EFI boot
filename "/live-efi/elilo.efi";
View gist:946c0dad04951ff2ac7c0ffb1a64a563
var pattern = /(MOBI|EPUB|PDF|CBZ|PDF \(HQ\))$/i;
var out = "";
var nodes = document.getElementsByTagName('a');
for (i in nodes) {
var a = nodes[i];
if (a && a.text && pattern.test(a.text.trim())) {
out += a.attributes['data-web'].value;
out += "\n";
View 50fix
# /etc/apt/apt.conf.d/50fix_apt
Install-Recommends "false";
Install-Suggests "false"; AutoRemove {
SuggestsImportant "false"; RecommendsImportant "false";
View gist:7996969
Description of problem:
A specific customer workload is causing abnormally high system load on RHEL6, whereas the code did not cause the same under RHEL4. The abnormal load relates to the dnotify / inotify subsystems.
Version-Release number of selected component (if applicable):
Tests run on 2.6.32-279.2.1.el6.x86_64
How reproducible:
Steps to Reproduce:
Supermathie / sample 1
Last active Dec 30, 2015
raw test data
View sample 1
<html><head></head><body data-blackberry-caret-color=3D"#00a8df" style=3D"b=
ackground-color: rgb(255, 255, 255); line-height: initial;"><div id=3D"BB10=
_response_div" style=3D"width: 100%; font-size: initial; font-family: Calib=
ri, 'Slate Pro', sans-serif; color: rgb(31, 73, 125); text-align: initial; =
background-color: rgb(255, 255, 255);">Let's remember that the information =
in the article was filtered through no less than two people who don't fully=
speak tech. I think I can translate it back:</div> =
<div id=3D"response_div_spacer" style=3D"=
width: 100%; font-size: initial; font-family: Calibri, 'Slate Pro', sans-se=
You can’t perform that action at this time.