Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am tmfink on github.
  • I am tmfink (https://keybase.io/tmfink) on keybase.
  • I have a public key whose fingerprint is 9925 9A92 49E0 36B8 49C4 198B 63C3 BB78 1812 D0BF

To claim this, I am signing this object:

@tmfink
tmfink / gen_arch_module_h.sh
Created July 2, 2018 14:41
Capstone C library source generators
#!/bin/sh
# Generate *Module.h include files for Capstone C library
arch_dirs_cs3=$(ls -d arch/* | grep -v M68K)
arch_dirs_cs4=$(ls -d arch/*)
for ARCH in $arch_dirs_cs4;
do
ARCH_N=$(basename $ARCH)
ARCH_GUARD=$(echo "CS_${ARCH_N}_MODULE_H" | tr '[:lower:]' '[:upper:]')
@tmfink
tmfink / my_union.c
Created May 19, 2017 07:18
Stable Rust Bindgen unions
#include <stdio.h>
#include "my_union.h"
void print_foo(struct Foo *foo) {
if (foo == NULL) {
printf("Got NULL pointer");
return;
}
switch (foo->type) {
@tmfink
tmfink / auto_monitor.sh
Created April 11, 2015 20:16
Uses xrandr to detect and setup active outputs
#!/bin/bash
#
# Uses xrandr to detect and setup active outputs
##########
# Set to name of main display
MAIN="eDP1"
##########
ACTIVE_OUTPUTS=$(xrandr | grep -oE '^.+ connected' | cut -d" " -f1)
@tmfink
tmfink / i3audio.sh
Last active August 29, 2015 14:18
Manage audio keys in i3 wm
#!/bin/bash
#
# Manages audio keys on keyboard in i3 wm and launches volnoti window
## Add the following to your i3 config file:
##
## # Media, sound, audio keys
## bindsym XF86AudioRaiseVolume exec ~/.i3/i3audio.sh inc
## bindsym XF86AudioLowerVolume exec ~/.i3/i3audio.sh dec
## bindsym XF86AudioMute exec ~/.i3/i3audio.sh mute

Keybase proof

I hereby claim:

  • I am tmfink on github.
  • I am tmfink (https://keybase.io/tmfink) on keybase.
  • I have a public key whose fingerprint is 9925 9A92 49E0 36B8 49C4 198B 63C3 BB78 1812 D0BF

To claim this, I am signing this object: