Skip to content

Instantly share code, notes, and snippets.

@mping
mping / zsh.md
Last active September 1, 2016 21:26 — forked from tsabat/zsh.md
Getting oh-my-zsh to work in Ubuntu

Prereq:

apt-get install zsh
apt-get install git-core

installation

Getting zsh to work in ubuntu is weird, since sh does not understand the source command. So, you do this to install zsh

@mping
mping / instructions.md
Last active June 14, 2016 11:34 — forked from nicerobot/jstatd.sh
Run jstatd w/o error 'access denied (java.util.PropertyPermission java.rmi.server.ignoreSubClasses write)'

Socks Proxy

image

Add Remote Host

image

Add Jstad Connection

image

(def ^:dynamic *indent* 0)
(alter-var-root
#'clojure.core/load
(fn [orig]
(fn [& paths]
(let [t (System/nanoTime)
r (binding [*indent* (inc *indent*)]
(apply orig paths))]
(binding [*out* *err*]
(println (apply str (repeat *indent* " ")) (/ (- (System/nanoTime) t) 1000000.0) paths)
@mping
mping / gist:eaba0d73c9902763b6cc
Last active August 29, 2015 14:20 — forked from debasishg/gist:8172796
Probabilistic Data Structures
  1. General Background and Overview
@mping
mping / latency.txt
Created November 8, 2013 12:00 — forked from jboner/latency.txt
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 4K randomly from SSD* 150,000 ns 0.15 ms
@mping
mping / deploy.sh
Created October 25, 2012 14:26
Minimal Race-free Deployment
#!/bin/sh
# deploy.sh
N="`readlink \"$1\"`"
mv -T "$1.stage" "$1"
ln -s "$N" "$1.stage"
rm -rf "$N"
cp -aH "$1" "$N"
@mping
mping / cors-nginx.conf
Created June 9, 2012 12:01 — forked from michiel/cors-nginx.conf
Wide-open CORS config for nginx
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' 'http://10.140.10.40';
#