2013
08.22

so i wrote a little script for dumping some stats to a graphite server.

script is located here.

all you have to do to get this working:
ensure nc is installed
ensure vmstat is installed
change gserver and gport to matching graphite server and port
and cron this to run every minute or so.

it will graph :
cpu.idle
cpu.systime
cpu.usertime
cpu.wait-IO
swap.swapped-in
swap.swapped-to
mem.buffers
mem.cache
mem.virtfree
mem.virtswap
disk.free
disk.total
disk.used
load.1-minute
load.5-minutes
load.15-minutes
mem.free
mem.total
mem.used
swap.free
swap.total
swap.used
users

2013
08.22

so i needed to add things to a couple of boxes without completely killing off the existing crontab from a script. i came up with this:

TMP_FILE=$(mktemp --tmpdir cron.$$.XXXXXXXXXX)
crontab -l > ${TMP_FILE}
echo '# * * * * * script' >> ${TMP_FILE}
crontab ${TMP_FILE}
rm -rf ${TMP_FILE}

it will take a copy of the existing crontab, then append the new line at the end, then push the temp file to cron. its a hacky way of doing it but it can be refined.

if you need to blow away your crontab and just add one line, you can do that by doing this:
echo '# * * * * * script' | crontab -
this will remove your existing crontab and replace it with whatever you specify.

2013
08.11

so for my day to day usage, i run as minimalistic a window manager as possible (evilwm or in gentoo : x11-wm/evilwm), but every now and then i have to debug or test things in other wm’s which is a pain in the ass depending on what login manager you are using or just depending on the configuration you are using.

but if you have your X Windows compiled with Xnest support (in gentoo, use flag +xnest), you can start another window manager inside of your default (standard) window manager just by doing this :

% Xnest :1 -ac &
% export DISPLAY=:1
% urxvt &
% spectrwm

breakdown of the lines:
% Xnest :1 -ac &
Xnest : starts the nested X server
:1 : display to it in
-ac : disable access control restrictions
& : background

export DISPLAY=:1
this line is setting DISPLAY to run in session 1

urxvt &
urxvt & : is to start a term (i use urxvt, substitute with whatever) to use in xnest

spectrwm
spectrwm : is the secondary window manager that i ran for this, substitute with whatever.

screenshot of spectrwm running in an Xnest window inside of evilwm. spectrwm has 3 tmux’d windows open with the bar on top, evilwm has two terms stacked on the right:
2013-08-11-231334_1440x900_scrot
click to enlarge

2013
08.07

so after picking up a usb rubber ducky from HAK5 at defcon, i wanted to see if i could replicate a pin brute force tool using a teensy for android phones. i love the usb rubber ducky, but i figure if i have arduino’s to spare, why not use them ?

here is what i have come up with

its pretty straight forward and tested on android 4.1 & 4.2. confirmed not working in android 4.2 though.

2013
08.05

black hat usa 2013:
IMG_20130725_154820
click image to enlarge

Defcon:
IMG_20130804_230602
click image to enlarge