Skip to content

Instantly share code, notes, and snippets.

View indradhanush's full-sized avatar

Indradhanush Gupta indradhanush

View GitHub Profile
@indradhanush
indradhanush / gist:ba89e403650f2b9147ba
Last active August 29, 2015 14:05 — forked from mitchellh/gist:1277049
Fix for Internet connectivity issue on Vagrant + Ubuntu/Mint as host OS
Vagrant::Config.run do |config|
# ...
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end
From 8ab91751069e391a95151c6716a546b1732ade92 Mon Sep 17 00:00:00 2001
From: JP <twitter:canoeberry>
Date: Sun, 19 Jan 2014 11:58:54 +0000
Subject: [PATCH] partial memleak fix
This patch was created by JP (twitter: @canoeberry) based on a memleak fix by Dirk (emacs committer) below:
https://github.com/mirrors/emacs/commit/57ae6509a3b6a274f89b9caea0284c6156470625
This memory leak is fixed in the trunk as of now and will be in the next official release: 24.4.
@indradhanush
indradhanush / service-checklist.md
Created September 20, 2016 11:41 — forked from acolyer/service-checklist.md
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
@indradhanush
indradhanush / latency.txt
Created March 13, 2017 04:24 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
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 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@indradhanush
indradhanush / codesign_gdb.md
Created June 21, 2017 20:29 — forked from hlissner/codesign_gdb.md
Codesign gdb on OSX

If you are getting this in gdb on OSX while trying to run a program:

Unable to find Mach task port for process-id 57573: (os/kern) failure (0x5).
 (please check gdb is codesigned - see taskgated(8))
  1. Open Keychain Access
  2. In menu, open Keychain Access > Certificate Assistant > Create a certificate
  3. Give it a name (e.g. gdbc)
@indradhanush
indradhanush / checkboxes.md
Created November 13, 2017 11:24 — forked from germanny/checkboxes.md
Markdown checkboxes
  • checkbox is done with the two brackets next to the P key
  • checkbox is done with the two brackets next to the P key
  • checkbox is done with the two brackets next to the P key
  • checkbox is done with the two brackets next to the P key
@indradhanush
indradhanush / tmux-cheatsheet.markdown
Created January 2, 2018 08:47 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@indradhanush
indradhanush / install-kubectl.sh
Created April 20, 2018 10:14 — forked from wellsie/install-kubectl.sh
Install kubectl (amd64)
#!/bin/bash -eux
ARCH=${ARCH:-linux}
K8S_VER=${K8S_URL:-v1.1.8}
K8S_URL=https://storage.googleapis.com/kubernetes-release/release
curl -Lo /usr/local/bin/kubectl ${K8S_URL}/${K8S_VER}/bin/$ARCH/amd64/kubectl
chmod +x /usr/local/bin/kubectl
@indradhanush
indradhanush / jessfraz.md
Created July 30, 2018 12:27 — forked from acolyer/jessfraz.md
Containers, operating systems and other fun things from The Morning Paper
@indradhanush
indradhanush / iptables_color.txt
Created August 8, 2018 07:29 — forked from nega0/iptables_color.txt
colorize your `iptables` output
## based on the blogpost here: http://blog.sjas.de/posts/colored-iptables-output.html
iptables --line-numbers -vnL |\
sed -E 's/^Chain.*$/\x1b[4m&\x1b[0m/' |\
sed -E 's/^num.*/\x1b[33m&\x1b[0m/' |\
sed -E '/([^y] )((REJECT|DROP))/s//\1\x1b[31m\3\x1b[0m/' |\
sed -E '/([^y] )(ACCEPT)/s//\1\x1b[32m\2\x1b[0m/' |\
sed -E '/([ds]pt[s]?:)([[:digit:]]+(:[[:digit:]]+)?)/s//\1\x1b[33;1m\2\x1b[0m/' |\
sed -E '/([[:digit:]]{1,3}\.){3}[[:digit:]]{1,3}(\/([[:digit:]]){1,3}){0,1}/s//\x1b[36;1m&\x1b[0m/g' |\
sed -E '/([^n] )(LOGDROP)/s//\1\x1b[33;1m\2\x1b[0m/'|\