Skip to content

Instantly share code, notes, and snippets.

View fd0's full-sized avatar

Alexander Neumann fd0

View GitHub Profile
#!/bin/bash
exec_target() {
TARGET=$1
shift
if ping -c 1 -W 1 $TARGET > /dev/null; then
"$@" "$TARGET"
else
echo "$TARGET unreachable"
fi
package main
import (
"encoding/binary"
"fmt"
"io"
"os"
"strings"
)
@fd0
fd0 / gist:6951577
Created October 12, 2013 15:54
i3 multi monitor config snippet
# assign workspaces to screens
workspace 1 output DVI-I-1
workspace 2 output DVI-I-1
workspace 3 output DVI-I-1
workspace 4 output DVI-I-1
workspace 5 output DVI-I-1
workspace 6 output HDMI-0
workspace 7 output HDMI-0
workspace 8 output HDMI-0
workspace 9 output HDMI-0
@fd0
fd0 / foo.py
Created November 4, 2013 18:26
#!/usr/bin/env python
import os.path
dir = os.path.dirname(__file__)
db = os.path.join(dir, 'foobar.sqlite')
print __file__
print dir
print db
[ 3208.621296] skbuff: skb_under_panic: text:ffffffff816c255a len:74 put:14 head:ffff880427d13800 data:ffff880427d137f2 tail:0x3c end:0xc0 dev:eth2
[ 3208.640991] ------------[ cut here ]------------
[ 3208.652201] Kernel BUG at ffffffff817231d4 [verbose debug info unavailable]
[ 3208.665711] invalid opcode: 0000 [#1] SMP
[ 3208.676303] Modules linked in: ip6t_REJECT(F) ip6table_filter(F) ip6table_nat(F) nf_conntrack_ipv6(F) nf_defrag_ipv6(F) nf_nat_ipv6(F) ip6table_mangle(F) ip6_tables(F) ipt_REJECT(F) xt_limit(F) xt_LOG(F) xt_pkttype(F) iptable_filter(F) xt_nat(F) xt_REDIRECT(F) xt_tcpudp(F) xt_conntrack(F) iptable_nat(F) nf_conntrack_ipv4(F) nf_defrag_ipv4(F) nf_nat_ipv4(F) nf_nat(F) xt_TCPOPTSTRIP(F) xt_HL(F) xt_TEE(F) nf_conntrack(F) iptable_mangle(F) ip_tables(F) x_tables(F) bnep(F) rfcomm(F) bluetooth(F) adt7475(F) hwmon_vid(F) nouveau(F) snd_hda_codec_realtek(F) snd_hda_intel(F) snd_hda_codec(F) usb_storage(F) snd_hwdep(F) mxm_wmi(F) hid_generic(F) snd_pcm(F) usbhid(F) video(F) ttm(F) hid(F) snd_page
@fd0
fd0 / -
Created November 10, 2013 20:41
! adapted neverland color scheme
URxvt*foreground: #CCCCCC
URxvt*background: #111111
!black
URxvt*color0: #222222
URxvt*color8: #666666
!red
URxvt*color1: #E84F4F
URxvt*color9: #D23D3D
!green
$ tcpdump -n -r dump-20131110-013426-300s.pcap "tcp[tcpflags] & tcp-syn == tcp-syn" | cut -d' ' -f3 | cut -d'.' -f1-4 | sort | uniq -c | sort -g
1 10.22.10.172
1 10.22.11.55
1 10.22.15.11
1 10.22.19.102
1 10.22.2.132
1 10.22.21.50
1 10.22.2.153
1 10.22.26.100
1 10.22.26.114
$ tcpdump -n -r dump-20131110-012926-300s.pcap "tcp[tcpflags] & tcp-syn == tcp-syn" | cut -d' ' -f3 | cut -d'.' -f1-4 | sort | uniq -c | sort -g
1 10.22.10.101
1 10.22.10.169
1 10.22.11.55
1 10.22.2.132
1 10.22.21.42
1 10.22.2.153
1 10.22.21.70
1 10.22.24.31
1 10.22.26.104
TARGETS=$(patsubst %.S,%,$(wildcard *.S))
TARGETS_BIN=$(patsubst %,%.bin,$(TARGETS))
TARGETS_LST=$(patsubst %,%.lst,$(TARGETS))
TARGETS_HEX=$(patsubst %,%.hexdump,$(TARGETS))
AS=msp430-as
OBJCOPY=msp430-objcopy
OBJDUMP=msp430-objdump
.PHONY: all clean clean-all
$ export board=facedancer21
$ ./goodfet.monitor listapps
GoodFET with f26f MCU
Clocked at 0x8fa6
Build Date: 2013-01-23 16:28
Firmware apps:
Monitor
SPI
MAXUSB