Skip to content

Instantly share code, notes, and snippets.

@vbajpai
vbajpai / md2tex.py
Created July 11, 2012 09:22
Convert a Directory Listing of Markdown Files to LaTeX using Pandoc.
>> export MDEXT='.md'
>> python -c "import os; \
filelist = os.listdir(os.getcwd()); \
print [os.system('echo executing: %s;pandoc --listings %s -o %s.tex'%(f, f,os.path.splitext(f)[0])) \
for f in filelist if os.path.splitext(f)[1] == os.environ['MDEXT']]"
@vbajpai
vbajpai / ft2ftz.bash
Created July 16, 2012 15:54
Create Compressed Flow-Tools Traces from a List of Uncompressed Ones.
>> export FTEXT='.ft'
>> python -c "import os; list = os.listdir(os.getcwd()); \
print [os.system('echo converting: %s && flow-cat %s -z 9 > %sz'%(file, file,file)) \
for file in list if os.path.splitext(file)[1] == os.environ['FTEXT']]"
@vbajpai
vbajpai / kv2v
Created July 18, 2012 09:31
Strip out Values from the KV pair in a Text File
>> cat input.txt
k1:v1 k2:v2 k3:v3 ...
...
>> cat input.txt | python -c "import sys; \
lines = sys.stdin.readlines(); \
values = [[i.split(':')[1] for i in item] for item in \
[line.split() for line in lines]]; \
import os; [os.system('echo %s'%v) for v in \
['\t'.join(value) for value in values]]" > output.txt
@vbajpai
vbajpai / run_pylist
Created July 18, 2012 13:46
Run All the Python Files in the Current Directory
>> ls | while read file; do python $file; done
@vbajpai
vbajpai / gnuplot.gp
Created July 19, 2012 08:13
Pretty GnuPlots
>> cat gnuplot.gp
set terminal push
set terminal postscript eps font "Times" mono dashed
plot '$0' using 1:2:xtic(4) title "..." smooth csplines with lines, \
'$0' using 1:2 with points notitle pointtype 5 pointsize 1, \
'$0' using 1:3:xtic(4) title "..." smooth csplines with lines, \
'$0' using 1:3 with points notitle pointtype 5 pointsize 1
@vbajpai
vbajpai / gcc47-lion
Created July 31, 2012 13:25
Install GCC 4.7 on Mac OS X
>> bash
>> brew tap homebrew-dupes
>> brew install --use-lvm gcc
@vbajpai
vbajpai / JACOBS
Created August 24, 2012 12:49
netcfg configuration for JACOBS Public Access Point
CONNECTION='wireless'
DESCRIPTION='A simple opened wireless connection'
INTERFACE='wlan0'
SECURITY='none'
ESSID='JACOBS'
IP='dhcp'
@vbajpai
vbajpai / eduroam
Created August 24, 2012 12:56
netcfg configuration for eduroam
CONNECTION='wireless'
INTERFACE='wlan0'
SCAN='no'
SECURITY='wpa-config'
ESSID='eduroam'
IP='dhcp'
TIMEOUT='30'
WPA_CONF='/etc/wpa_supplicant.conf'
@vbajpai
vbajpai / homebrew
Created September 10, 2012 20:49
My Homebrews
ack
atk
autoconf
autojump
automake
bash
binutils
c-ares
cairo
cmake
@vbajpai
vbajpai / README.md
Last active December 10, 2015 15:19
OpenWRT on TP-Link TLWR703N

OpenWRT on TP-Link TLWR703N

The image is a nightly build of OpenWRT, codenamed Barrier Breaker. The image was built on Jan 3, 2013 and was successfully flashed on TLWR703N router with firmware version v1.6.

The image was downloaded from OpenWRT downloads page (1). I assume the nightly builds are not archived but replaced each day with a newer image. Therefore I am putting a copy of the image I used here.