Skip to content

Instantly share code, notes, and snippets.

@tehmaze
tehmaze / check-key.sh
Created July 10, 2011 17:32
OpenVPN Yubikey authentication
#! /bin/bash
# _______
# ____________ _______ _\__ /_________ ___ _____
# | _ _ \ _ | ____\ _ / | |/ _ \
# | / / / / | | | /___/ _ | | / /
# |___/___/ /___/____|________|___ | |_| |___|_____/
# \__/ |___|
#
# (c) 2011 Wijnand Modderman-Lenstra <[email protected]>
# MIT License
@tehmaze
tehmaze / try_connect_ssh.sh
Created July 13, 2011 10:14
zsh/bash "command not found" handler that will use ssh if $1 resolves
#
# _______
# ____________ _______ _\__ /_________ ___ _____
# | _ _ \ _ | ____\ _ / | |/ _ \
# | / / / / | | | /___/ _ | | / /
# |___/___/ /___/____|________|___ | |_| |___|_____/
# \__/ |___|
#
#
# Put this in your ~/.zshrc or ~/.bashrc:
@tehmaze
tehmaze / vmdump.sh
Created July 31, 2011 16:37
tcpdump for VMWare Fusion
#!/bin/bash
if echo ${1} | grep -q '^vmnet[0-9]$'; then
ERRCOUNT='0'
PIDSNIFF='0'
PIDTDUMP='0'
CAPINTF="${1}"
CAPFILE="$(mktemp -t capture)"
@tehmaze
tehmaze / knoopje.sh
Created July 31, 2011 22:15
Tie together two VMWare (Fusion) serial pipes
#! /bin/sh
#
# Tie together two serial pipes in VMWare (Fusion)
#
# 1st:
# serial1.present = "TRUE"
# serial1.fileType = "pipe"
# serial1.yieldOnMsrRead = "TRUE"
# serial1.startConnected = "TRUE"
# serial1.fileName = "ax25-1"
@tehmaze
tehmaze / tsocks-1.8_macosx.patch
Created August 8, 2011 20:11
tsocks-1.8 patch for Mac OSX
diff -Nur tsocks-1.8.org/Makefile.in tsocks-1.8/Makefile.in
--- tsocks-1.8.org/Makefile.in 2002-03-16 11:12:40.000000000 +0100
+++ tsocks-1.8/Makefile.in 2011-08-08 22:17:27.000000000 +0200
@@ -1,6 +1,7 @@
# Makefile used by configure to create real Makefile
CC=@CC@
+SHLIB_EXT=@SHLIB_EXT@
prefix=@prefix@
exec_prefix = @exec_prefix@
@tehmaze
tehmaze / tmux.conf
Created August 11, 2011 08:32
tmux configuration
# c-b .. really?
set-option -g prefix C-a
# c-a c-a for the last active window
bind-key C-a last-window
# command sequence for nested tmux sessions
bind-key a send-prefix
# start window numbering at 1
@tehmaze
tehmaze / hamlib-libusb-1.0.patch
Created April 16, 2012 15:06
hamlib-1.2.15 patch to look for libusb-1.0 rather than libusb
diff -ur hamlib-1.2.15.org/configure hamlib-1.2.15/configure
--- hamlib-1.2.15.org/configure 2012-02-03 03:47:07.000000000 +0100
+++ hamlib-1.2.15/configure 2012-04-16 17:05:11.000000000 +0200
@@ -19863,12 +19863,12 @@
pkg_cv_LIBUSB_CFLAGS="$LIBUSB_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libusb >= 0.1\""; } >&5
- ($PKG_CONFIG --exists --print-errors "libusb >= 0.1") 2>&5
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libusb-1.0 >= 0.1\""; } >&5
@tehmaze
tehmaze / .tmux.conf
Created July 23, 2012 23:08
tmux configuration, inspired on vim-powerline
# c-b .. really?
set-option -g prefix C-a
# c-a c-a for the last active window
bind-key C-a last-window
# command sequence for nested tmux sessions
bind-key a send-prefix
# start window numbering at 1
@tehmaze
tehmaze / cp437.py
Created September 13, 2012 13:47
cp437 in python
#!/usr/bin/python
# _______
# ____________ _______ _\__ /_________ ___ _____
# | _ _ \ _ | ____\ _ / | |/ _ \
# | / / / / | | | /___/ _ | | / /
# |___/___/ /___/____|________|___ | |_| |___|_____/
# \__/ |___|
#
#
# (c) 2009-2012 Wijnand Modderman-Lenstra <[email protected]>
@tehmaze
tehmaze / i3status-maze.py
Last active September 12, 2021 22:08
i3status script
#!/usr/bin/env python2
# -*- coding: utf8; -*-
import json
import glob
import multiprocessing
import os
import sys
import time