Skip to content

Instantly share code, notes, and snippets.

View Supermathie's full-sized avatar
🏠
Working from home, before it was cool

Michael Brown Supermathie

🏠
Working from home, before it was cool
View GitHub Profile
OpenSSL::HMAC.hexdigest('SHA1', '8544E3B47ECA58F9583043F8'.scan(/../).map(&:hex).pack('c*'), '3CECEF000000'.upcase.scan(/../).map(&:hex).pack('c*'))[0..23].upcase.scan(/..../).join('-')
@Supermathie
Supermathie / BBEscreenUnlock.py
Created May 21, 2021 21:38
BlackBerry e-screen unlock
#!/usr/bin/env python
import hmac
import hashlib
import optparse
import sys
parser = optparse.OptionParser(
"usage: %prog -p PIN -a 'APP VERSION' -u UPTIME [-d DURATION]")
parser.add_option('-p', '--pin', help='Device PIN', dest='pin')
#!/usr/bin/env ruby
#
# Proof of concept by Michael Brown (@supermathie)
require 'colorize'
require 'json'
require 'net/http'
REALM = ENV.fetch('POE_REALM', 'pc')
LEAGUE = ENV.fetch('POE_LEAGUE', 'Harvest')
@Supermathie
Supermathie / resize-java-iKVM-viewer
Created January 18, 2019 20:07 — 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
#!/bin/bash
# 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
Supermathie / BBM killed
Created June 3, 2018 14:29
BBM on Android dammit
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
PID USER PR NI VIRT RES SHR S[%CPU] %MEM TIME+ ARGS
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 com.android.systemui
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.
○ → host forum.audulus.com 8.8.8.8
Using domain server:
Name: 8.8.8.8
Address: 8.8.8.8#53
Aliases:
forum.audulus.com has address 208.113.169.12
forum.audulus.com is an alias for audulus1.hosted-by-discourse.com.
audulus1.hosted-by-discourse.com has IPv6 address 2001:470:1:669::87
forum.audulus.com is an alias for audulus1.hosted-by-discourse.com.
@Supermathie
Supermathie / check_taint.py
Created January 8, 2018 22:42
linux: check taint
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(f.read()))[2:]))))))
for taint_bit in taint_bits:
if taint_bit == 0: # 'P' - Proprietary module has been loaded.
pass
elif taint_bit == 1: # 'F' - Module has been forcibly loaded.
pass
elif taint_bit == 2: # 'S' - SMP with CPUs not designed for SMP.
pass
@Supermathie
Supermathie / gist:1fe384a61280abbdf3ced26fac695675
Created June 1, 2017 16:04
ISC DHCP PXE architecture switching example
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";
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";
}
}
@Supermathie
Supermathie / 50fix
Created February 7, 2017 16:32
fix apt
# /etc/apt/apt.conf.d/50fix_apt
APT {
Install-Recommends "false";
Install-Suggests "false"; AutoRemove {
SuggestsImportant "false"; RecommendsImportant "false";
}
}