Skip to content

Instantly share code, notes, and snippets.

View jasonrm's full-sized avatar

Jason R. McNeil jasonrm

  • Arizona
  • 20:19 (UTC -07:00)
View GitHub Profile
@jasonrm
jasonrm / grub.conf
Last active July 30, 2019 17:33
MacPro 1,1 boot 64-bit kernel from 32-bit UEFI
set default=0
set timeout=1
# insmod efi_uga
insmod all_video
insmod font
if loadfont ${prefix}/unicode.pf2
then
insmod gfxterm
@jasonrm
jasonrm / mds.sh
Last active February 22, 2019 12:50
ceph encrypted bluestore osd
mkdir -p /var/lib/ceph/mds/ceph-$(hostname -s)/
ceph-authtool --create-keyring /var/lib/ceph/mds/ceph-$(hostname -s)/keyring --gen-key -n mds.$(hostname -s)
ceph auth add mds.$(hostname -s) osd "allow rwx" mds "allow" mon "allow profile mds" -i /var/lib/ceph/mds/ceph-$(hostname -s)/keyring
sudo chown -R ceph:ceph /var/lib/ceph
systemctl enable ceph-mds@$(hostname -s)
systemctl start ceph-mds@$(hostname -s)
import random
from time import sleep
import bizhawk.emu as emu
import bizhawk.gui as gui
from System.Drawing import Pen, Color
pen = Pen(Color.FromArgb(255, 255, 0, 0))
def update():
@jasonrm
jasonrm / pmtud.py
Last active December 11, 2018 06:16
Listen for "unreachable - need to frag" ICMP packets, update local route, and re-broadcast to all interfaces
#!/usr/bin/python2
# Based on: https://tools.ietf.org/html/rfc7690#section-3.2
# More info: https://blog.cloudflare.com/path-mtu-discovery-in-practice/
# Also: https://github.com/cloudflare/pmtud
# Dependencies: python2, netifaces, scapy
from scapy.all import Ether, ICMP, IP, IPerror, TCPerror, sendp, sniff, conf
from subprocess import call
@jasonrm
jasonrm / loop1p10.superblock
Created July 3, 2018 05:41
2010 BWM 328i CIC Hard Drive
Disk /dev/loop1: 74.5 GiB, 80026361856 bytes, 156301488 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x6ad4b821
Device Boot Start End Sectors Size Id Type
/dev/loop1p1 63 156296384 156296322 74.5G 5 Extended
/dev/loop1p5 126 117451214 117451089 56G 4d QNX4.x
@jasonrm
jasonrm / config.gateway.json
Last active May 9, 2018 00:35
UniFi config.gateway.json
{
"firewall": {
"group": {
"network-group": {
"rfc1918_networks": {
"network": [
"192.168.0.0/16",
"172.16.0.0/12",
"10.0.0.0/8"
],
@jasonrm
jasonrm / system-auth
Created May 8, 2018 23:19
old ldap config
#%PAM-1.0
# If LDAP lookup is successful, continue through group checks, otherwise skip
auth sufficient pam_ldap.so minimum_uid=1000
auth required pam_unix.so try_first_pass nullok
auth optional pam_permit.so
auth required pam_env.so
# If LDAP lookup is successful, continue through group checks, otherwise skip
account [success=ok default=2] pam_ldap.so minimum_uid=1000
account sufficient pam_succeed_if.so user ingroup posixSystemAdministrators
@jasonrm
jasonrm / clima-spindump
Created October 27, 2017 18:53
Clima.app is great, until it uses 100% CPU for extended periods of time for no reason
Thread 0x19b5941 Thread name "Threadpool worker" 1000 samples (1-1000) priority 31 (base 31) cpu time 9.974
907 thread_start + 13 (libsystem_pthread.dylib + 12429) [0x7fffa14de08d]
907 _pthread_start + 286 (libsystem_pthread.dylib + 14471) [0x7fffa14de887]
907 _pthread_body + 180 (libsystem_pthread.dylib + 14651) [0x7fffa14de93b]
907 start_wrapper + 675 (Clima + 2274083) [0x10fd3b323]
907 worker_thread + 353 (Clima + 2232337) [0x10fd31011]
907 worker_callback + 928 (Clima + 2241792) [0x10fd33500]
907 do_runtime_invoke + 88 (Clima + 1970888) [0x10fcf12c8]
907 mono_jit_runtime_invoke + 1316 (Clima + 1150308) [0x10fc28d64]
907 ??? [0x1169d9fe2]
@jasonrm
jasonrm / 01-cmd.sh
Created October 1, 2017 20:05
zfsonlinux change-key panic
❯ dd if=/dev/urandom of=/etc/zfs/initcpio-keys.d/rpool.key bs=32 count=1
❯ zfs change-key -o keyformat=raw -o keylocation=file:///etc/zfs/initcpio-keys.d/rpool.key rpool
@jasonrm
jasonrm / override-riot-typescript.js
Last active July 11, 2017 05:41
Use typescript instead of typescript-simple with RiotJS
var typescriptConfig = require('./tsconfig.json');
var typescript = require('typescript');
var riot = require('riot');
// Override typescript compiler
newTypescriptCompiler = function (js) {
return typescript.transpile(js, typescriptConfig);
};
defaultReq = riot.parsers._req;
riot.parsers._req = (name) => {