This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# use line-lite.sh: https://brianin3d.wordpress.com/2008/05/14/scripting-with-ansi-color-codes/ | |
TMPFILE1=`mktemp /tmp/${tempfoo}.XXXXXX` || exit 1 | |
TMPFILE2=`mktemp /tmp/${tempfoo}.XXXXXX` || exit 1 | |
while `true`; do | |
COLS=`stty size | awk '{print $2}'` | |
eval "$@" > $TMPFILE1 | |
clear; | |
# diff -W$COLS -y $TMPFILE1 $TMPFILE2 | |
diff --left-column -W$COLS -y $TMPFILE1 $TMPFILE2 | ~/bin/line_lite.sh ".*|.*" bright ".*<.*" green ".*>.*" red |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
################################################################################ | |
# closes all inaccessible drives that are not snapshots, and which dont exist | |
################################################################################ | |
vboxmanage=VBoxManage | |
while read rawuuid; do | |
uuid=`echo $rawuuid| grep -Eo ' [a-f0-9-]+' | grep -Eo '[a-f0-9-]+'` | |
read rawlocation | |
location=`echo $rawlocation | grep -o "/.*"` | |
echo "$uuid" " to " "$location" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo -en "\033[31m" ## red | |
eval $* | while read line; do | |
echo -en "\033[36m" ## blue | |
echo $line | |
echo -en "\033[31m" ## red | |
done | |
echo -en "\033[0m" ## reset color |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WIREPLAY_HOME=~/wireplay | |
cd /usr/ports/net/libnet11; make install | |
cd $WIREPLAY/libnids-1.23; ./configure --enable-shared --disable-libglib; make | |
cd /usr/ports/lang/ruby18; make install | |
cd $WIREPLAY | |
# uncomment the lib defn in include/config.h (or workaround) | |
# in src/wireplay.c, add #include <sys/socket.h> | |
cat << EOF > makefile.patch | |
Index: Makefile | |
=================================================================== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DEV1=eth4 | |
DEV2=eth5 | |
########################################################################### | |
# install gulp | |
########################################################################### | |
apt-get install libpcap-dev | |
wget http://staff.washington.edu/corey/gulp/gulp.tgz | |
mkdir -p gulp | |
cd gulp && tar xvfz ../gulp.tgz | |
make |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
boxsocket=$1 | |
#boxpty=$2 | |
# host pipe | |
socat UNIX-CONNECT:$boxsocket TCP-LISTEN:8040 & | |
telnet localhost 8040 | |
# host socket | |
socat UNIX-CONNECT:/tmp/$boxsocket PTY,link=$boxpty & | |
screen $boxpty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
ifconfig bridge0 > /dev/null | |
if [ $? != 0 ] ; then | |
ifconfig bridge create | |
fi | |
if1=em0 | |
if2=em3 | |
ifconfig bridge0 addm $if1 addm $if2 up | |
ifconfig $if1 up | |
ifconfig $if2 up |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# simple one, assumes pipe | |
# usage: set_pipe bw delay [errorpercentage] | |
#ipfw pipe 1 config bw $1Kbits delay $(($2/2))ms plr $3 queue $((($1*$2)/8))bytes | |
# | |
# advanced, sets pipe | |
if [ $# "<" 6 ] ; then | |
echo "usage: $0 <Client IP> <Server IP> <fw bw, kbps> <return bw, kbps> <delay, ms> <ber, float>"; | |
fi | |
ipfw -f flush |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python2.7 | |
from itertools import izip | |
from PIL import Image | |
import argparse | |
import os | |
parser = argparse.ArgumentParser() | |
#parser.add_argument("--preserve_case", "-p", action = 'store_true') | |
# parser.add_argument("--file-list", "-f", action = 'store_true') | |
parser.add_argument("files", nargs = 2, type = str, default = None) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Extracts IP content from GRE and writes to arg[1].out | |
# Drops non GRE | |
# requires dpkt gre patch | |
import dpkt | |
import sys | |
fin = open(sys.argv[1]) | |
fout = open(sys.argv[1] + ".out", "w") | |
pcap = dpkt.pcap.Reader(fin) |
OlderNewer