Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Mostly on gitlab.com/dweinstein these days...

David Weinstein dweinstein

💭
Mostly on gitlab.com/dweinstein these days...
View GitHub Profile
@dweinstein
dweinstein / dbg.h
Created Nov 14, 2013
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
dweinstein / README.md
Last active Jan 4, 2021
create git repositories and include project info for cgit
View README.md

README

  • 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 README.md commit to the repository
  • this is intended to be used with this project https://github.com/dweinstein/minimal-cgi-server-for-cgit
    • basically this hosts cgit (http://git.zx2c4.com/cgit/) from a minimal python http server so you don't have to go setup lighthttp or apache.

Usage

View Dockerfile
FROM ubuntu
MAINTAINER David Weinstein <david@bitjudo.com>
# install our dependencies and nodejs
RUN echo "deb http://archive.ubuntu.com/ubuntu 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
dweinstein / Data Mining Books.md
Last active Oct 19, 2020
Free Data Mining books
View Data Mining Books.md

Source: http://christonard.com/12-free-data-mining-books/

  • 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
@dweinstein
dweinstein / template.txt
Created Sep 5, 2012
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
dweinstein / Dockerfile-nodejs
Last active Jan 11, 2020
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
View 0001-add-HID-support-to-android-gadget.patch
From c5a7d1115318bd02145a4b41109464d564b37af9 Mon Sep 17 00:00:00 2001
From: David Weinstein <dweinst@insitusec.com>
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(-)
View summary.txt
onMessage
onMessage
automation
onMessage
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
@dweinstein
dweinstein / gist:9550105
Created Mar 14, 2014
Cached docker build
View gist:9550105
Uploading context 4.608 kB
Uploading context
Step 0 : FROM ubuntu
---> 9cd978db300e
Step 1 : MAINTAINER David Weinstein <david@bitjudo.com>
---> Using cache
---> 67aeca8f12ae
Step 2 : RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
---> Using cache
---> be8f73b1204f
View android_direct.sh
#!/bin/sh
set -x
PROXY_HOST=$(ifconfig en0 | grep "inet " | awk '{print $2}')
PROXY_PORT=8080
function adb_shell {
local cmd="$1"
adb shell "${cmd}"
}