Skip to content

Instantly share code, notes, and snippets.

View shauvik's full-sized avatar

Shauvik RC shauvik

View GitHub Profile
@shauvik
shauvik / run-processes.ps1
Created August 16, 2011 22:02
Windows power shell run commands with timeout
$array = "folder1", "folder2"
cd c:\experiments
Foreach ($element in $array) {echo "Processing $element"; `
$p = $(Start-Process java -ArgumentList "-jar script.jar $element" -RedirectStandardOutput $element\out.log -RedirectStandardError $element\err.log -PassThru);`
if ( ! $p.WaitForExit(1800000) )
{ echo "$element did not exit after 30min"; $p.kill() }
}
#!/usr/bin/env python
"""
Parse a HAR (HTTP Archive) and return URLs which resulted in a given HTTP response code
HAR Spec: http://groups.google.com/group/http-archive-specification/web/har-1-2-spec
Copyleft 2010 Ian Gallagher <[email protected]>
Example usage: ./har_response_urls.py foo.har 404
"""
import json
@shauvik
shauvik / OpenAtomHere
Created June 12, 2014 18:06
AppleScript to open current Finder directory in Atom editor
(*
* Finder Open Atom Here - v1.0 - 6/12/2014
* http://shauvik.com/
*
* Copyright (c) 2014 Shauvik Roy Choudhary
* Dual licensed under the MIT and GPL licenses.
* Based on Open iTerm Here script by Ben Alman
*)
tell application "Finder"

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@shauvik
shauvik / Varnish
Created July 31, 2014 06:10
Varnish Issues
When big files resulted in a 503 error, by pass caching in varnish
Use: https://github.com/dreamhost/varnish-vcl-collection/
@shauvik
shauvik / shauvik-DexProcessor2.patch
Last active August 29, 2015 14:05
SwiftHand patch
diff --git a/src/java/edu/berkeley/wtchoi/instrument/DexProcessor/printingVisitor/ApplicationPrintingVisitor.java b/src/java/edu/berkeley/wtchoi/instrument/DexProcessor/printingVisitor/ApplicationPrintingVisitor.java
index 37e98f4..2351b30 100644
--- a/src/java/edu/berkeley/wtchoi/instrument/DexProcessor/printingVisitor/ApplicationPrintingVisitor.java
+++ b/src/java/edu/berkeley/wtchoi/instrument/DexProcessor/printingVisitor/ApplicationPrintingVisitor.java
@@ -67,12 +67,12 @@
}
public ApplicationPrintingVisitor(ApplicationVisitor av, Writer w){
- super(av);
+ super(4, av);
@shauvik
shauvik / shutdown_emu.py
Created August 25, 2014 01:30
Shutdown all Android Emulators.
rm -rf /home/m3user/Desktop/dyno-droid-fse13/apps/*;
rm -rf /home/m3user/Desktop/dyno-droid-fse13/workingDir/*;
rm -rf ~/.android/avd/*;
rm -rf ~/.android/modem-nv-ram*;
python /home/m3user/Desktop/dyno-droid-fse13/shutdown_emu.py