Skip to content

Instantly share code, notes, and snippets.

View dweinstein's full-sized avatar

David Weinstein dweinstein

View GitHub Profile
#!/usr/bin/env bash
jarsigner -verbose -keystore ~/.android/debug.keystore \
-storepass android -keypass android -digestalg SHA1 -sigalg MD5withRSA \
-sigfile CERT -signedjar $1.signed \
$1 androiddebugkey%
@dweinstein
dweinstein / index.sh
Created December 10, 2013 00:24
index a directory of apks by creating symlinks named by apk's sha1
find $1 -name '*.apk' -exec shasum -a1 {} \; | awk '{print $2 " " $1}' | xargs -r -n2 ln -s
#!/bin/sh
PROXY_HOST=$(ifconfig en0 | grep "inet " | awk '{print $2}')
PROXY_PORT=8080
function adb_shell {
cmd="$1"
adb shell "${cmd}"
}
@dweinstein
dweinstein / android-tcpdump.sh
Last active July 21, 2023 23:40
Easier tcpdump setup for Android (make sure tcpdump binary is in /data/local/tmp/xbin/tcpdump). Assumes socat and wireshark are installed on your system and that you're on OS X. Easily tweaked for other platforms...
#!/usr/bin/env bash
TCPDUMP_PID=""
SOCAT_PID=""
OUTPUT_FILE=""
PORT=12345
TMPDIR="."
TCPDUMP_PATH="/data/local/tmp/xbin/tcpdump"
NETCAT_PATH="/data/local/tmp/nc"
HOST_INTERFACE="en0"
@dweinstein
dweinstein / example.rkt
Created January 2, 2014 17:25
Distributed Places with Racket
;;; Distributed Places re: http://con.racket-lang.org/2012/tewk-slides.pdf
(require racket/place
racket/place/distributed)
(provide hello-world)
(define (hello-world ch)
(printf/f "hello-world received: ∼a\n"
(place-channel-get ch))
(place-channel-put ch "Hello World\n")
@dweinstein
dweinstein / .slate
Created January 3, 2014 14:17 — forked from lmullen/.slate
# GLOBAL CONFIGURATIONS
# -------------------------------------------------------------------
# See https://github.com/jigish/slate/wiki/Global-Configs
config defaultToCurrentScreen true
config secondsBeforeRepeat 0.4
config secondsBetweenRepeat 0.1
config keyboardLayout "qwerty"
config nudgePercentOf screenSize
config resizePercentOf screenSize
@dweinstein
dweinstein / LogUtil.java
Last active October 4, 2017 08:59
chunked logcat logging for Android
package android.injection.logging;
import android.util.Log;
import java.util.Random;
import utils.HexDump;
public class LogUtil {
#!/bin/sh
# Start-up script for JEB (MacOS)
JAVA=`which java`
if [ ! -f "$JAVA" ];
then
echo "JEB requires a Java runtime environment, please install one."
exit -1
fi
#!/usr/bin/env python
import capstone
import binascii
import sys
class Data(object):
def __init__(self):
pass
def slurp(self):
@dweinstein
dweinstein / Dockerfile-nodejs
Last active June 29, 2022 16:59
Install node modules before copying over your working code so that node_modules are built (and cached) before you change your service code!
# ...
ADD package.json /tmp/package.json
RUN cd /tmp && npm install && \
mkdir -p /opt/app && cp -a /tmp/node_modules /opt/app/
# ...
WORKDIR /opt/app
ADD . /opt/app