Skip to content

Instantly share code, notes, and snippets.

View mnakama's full-sized avatar

Matthew Nakama mnakama

View GitHub Profile
@mnakama
mnakama / disable-oculus
Created June 21, 2022 16:24
Disable all Oculus Rift devices and sensors
#!/usr/bin/python
'''Disable all Oculus Rift devices and sensors
Run this script as root to disable all Rift sensors so broken websites like Google Meet won't try to use them.'''
import os
import os.path
def main():
basedir = '/sys/bus/usb/devices'
@mnakama
mnakama / pass_qr_chooser
Created May 26, 2021 21:48
password dmenu script for TOTP codes.
#export PASSWORD_STORE_DIR="$HOME/SpiderOak Hive/.password-store"
export PASSWORD_STORE_DIR="$HOME/.password-store"
cd $PASSWORD_STORE_DIR
PASS=`find * -name '*otp.gpg' | sed s/\.gpg// | dmenu -l 10`
[[ -n $PASS ]] || exit
#pass -c $PASS
pass otp $PASS | { read -r pass; printf %s "$pass"; } | xdotool type --clearmodifiers --delay 0 --file -
@mnakama
mnakama / pass_chooser
Created May 26, 2021 21:42
dmenu script for choosing a password
#export PASSWORD_STORE_DIR="$HOME/SpiderOak Hive/.password-store"
export PASSWORD_STORE_DIR="$HOME/.password-store"
cd $PASSWORD_STORE_DIR
PASS=`find * -name '*.gpg' | sed s/\.gpg// | dmenu -l 10`
[[ -n $PASS ]] || exit
#pass -c $PASS
pass $PASS | { read -r pass; printf %s "$pass"; } | xdotool type --clearmodifiers --delay 0 --file -
@mnakama
mnakama / bintest-if.go
Last active March 22, 2021 21:57
bintest-if.go
package main
import (
"flag"
"fmt"
)
func main() {
tests := make([]bool, 8)
@mnakama
mnakama / go-asm-output.txt
Last active March 22, 2021 21:56
very strange Go assembly output
# command-line-arguments
"".main STEXT size=687 args=0x0 locals=0xa0 funcid=0x0
0x0000 00000 (bintest-if.go:8) TEXT "".main(SB), ABIInternal, $160-0
0x0000 00000 (bintest-if.go:8) MOVQ (TLS), CX
0x0009 00009 (bintest-if.go:8) LEAQ -32(SP), AX
0x000e 00014 (bintest-if.go:8) CMPQ AX, 16(CX)
0x0012 00018 (bintest-if.go:8) PCDATA $0, $-2
0x0012 00018 (bintest-if.go:8) JLS 677
0x0018 00024 (bintest-if.go:8) PCDATA $0, $-1
0x0018 00024 (bintest-if.go:8) SUBQ $160, SP

Keybase proof

I hereby claim:

  • I am mnakama on github.
  • I am gnuman (https://keybase.io/gnuman) on keybase.
  • I have a public key ASBpfFH77esLO5Eh9ZIpqtC1C4WuXbGAvP34mT_jqYS2gwo

To claim this, I am signing this object:

#!/bin/python3
import json
import sys
import traceback
# termcolor available via pypi
try:
from termcolor import colored
except Exception as e:
print(e, file=sys.stderr)
#include <unistd.h>
#include <stdio.h>
#include <err.h>
#include <sys/prctl.h>
#include <sys/capability.h>
#define PR_CAP_AMBIENT 47
#define PR_CAP_AMBIENT_IS_SET 1
#define PR_CAP_AMBIENT_RAISE 2
Help on module gw2api:
NAME
gw2api - this is the module doc
DESCRIPTION
this is the first thing in the module.
and this says how to use it, basically.