Skip to content

Instantly share code, notes, and snippets.


David Weinstein dweinstein

View GitHub Profile
dweinstein / template.txt
Created September 5, 2012 20:42
my org-mode template for exporting to LaTeX/PDF
View template.txt
#+TITLE: Template org-mode document for export to LaTeX/PDF
#+AUTHOR: David Weinstein
#+LaTeX_HEADER: \usepackage[left=1in,top=1in,right=1in,bottom=1.5in]{geometry}
#+LaTeX_HEADER: \usepackage{palatino}
#+LaTeX_HEADER: \usepackage{fancyhdr}
#+LaTeX_HEADER: \usepackage{sectsty}
#+LaTeX_HEADER: \usepackage{engord}
#+LaTeX_HEADER: \usepackage{cite}
#+LaTeX_HEADER: \usepackage{graphicx}
dweinstein /
Created November 19, 2014 18:42
iptable adb android
set -x
PROXY_HOST=$(ifconfig en0 | grep "inet " | awk '{print $2}')
function adb_shell {
local cmd="$1"
adb shell "${cmd}"
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!
View Dockerfile-nodejs
# ...
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
dweinstein / Data Mining
Last active May 25, 2022 16:37
Free Data Mining books
View Data Mining


  • An Introduction to Statistical Learning with Applications in R by James, Witten, Hastie & Tibshirani – This book is fantastic and has helped me quite a bit. It provides an overview of several methods, along with the R code for how to complete them. 426 Pages.
  • The Elements of Statistical Learning by Hastie, Tibshirani & Friedman – This is an in-depth overview of methods, complete with theory, derivations & code. I’d definitely consider this a graduate level text. I’d also consider it one of the best books available on the topic of data mining. 745 Pages.
  • A Programmer’s Guide to Data Mining by Ron Zacharski – This one is an online book, each chapter downloadable as a PDF. It’s also still in progress, with chapters being added a few times each year. Probabilistic Programming & Bayesian Methods for Hackers by Cam Davidson-Pilson – This book is absolutely fantastic. The author explains Bayesian statistics, provides several diverse examples of how to a
View 0001-add-HID-support-to-android-gadget.patch
From c5a7d1115318bd02145a4b41109464d564b37af9 Mon Sep 17 00:00:00 2001
From: David Weinstein <>
Date: Mon, 14 Jan 2013 12:21:37 -0500
Subject: [PATCH] add HID support to android gadget.
drivers/usb/gadget/android.c | 189 ++++++++++++++++++++++++++++++++++++++++++
drivers/usb/gadget/f_hid.c | 8 +-
2 files changed, 194 insertions(+), 3 deletions(-)
dweinstein / Dockerfile
Created March 14, 2014 15:37
View Dockerfile
FROM ubuntu
MAINTAINER David Weinstein <>
# install our dependencies and nodejs
RUN echo "deb precise main universe" > /etc/apt/sources.list
RUN apt-get update
RUN apt-get -y install python-software-properties git build-essential
RUN add-apt-repository -y ppa:chris-lea/node.js
RUN apt-get update
RUN apt-get -y install nodejs
dweinstein /
Last active November 10, 2021 15:49
Android gdb debug scripts for hooking native processes
#!/usr/bin/env bash
if [ -z "$1" ]; then
echo "usage: $(basename $0) <process>"
exit 1
IP=$(adb shell netcfg | grep wlan0 | awk '{print $3}' | cut -d '/' -f1)
if [ $? -ne 0 ]; then
echo "device plugged in?"
exit 1
dweinstein / dbg.h
Created November 14, 2013 20:00
debug macros for C/C++ and maybe JNI android development
View dbg.h
#ifndef __dbg_h__
#define __dbg_h__
#include <stdio.h>
#include <errno.h>
#include <string.h>
// Debug tag
#define DTAG "DBG"
dweinstein /
Last active January 4, 2021 05:26
create git repositories and include project info for cgit


  • This script will generate a bare git repo in your current user's ${HOME} directory
  • it will query you for relevant info that the frontend (cgit) will use and dispay to users
  • it will make an initial commit to the repository
  • this is intended to be used with this project
    • basically this hosts cgit ( from a minimal python http server so you don't have to go setup lighthttp or apache.


View summary.txt
ispy-console 2019-08-27 10:34:23.706613-0500 OfferUp[3150:69885] TIC SSL Trust Error [79:0x1c4376c80]: 3:0
ispy-console 2019-08-27 10:34:23.707447-0500 OfferUp[3150:69885] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813)
2019-08-27 10:34:23.707847-0500 OfferUp[3150:69885] Task <85C2A93B-4CDD-4AE5-98FA-A42808ACDCD2>.<1> HTTP load failed (error code: -1202 [3:-9813])
ispy-console 2019-08-27 10:34:23.708246-0500 OfferUp[3150:70071] Task <85C2A93B-4CDD-4AE5-98FA-A42808ACDCD2>.<1> finished with error - code: -1202