Skip to content

Instantly share code, notes, and snippets.

View indradhanush's full-sized avatar
🎆
Writing code

Indradhanush Gupta indradhanush

🎆
Writing code
View GitHub Profile

Keybase proof

I hereby claim:

  • I am indradhanush on github.
  • I am indradhanush (https://keybase.io/indradhanush) on keybase.
  • I have a public key ASCrADGNepl1q3bvGdu8se73WTMMBaxddyPS8Ej7nJ-9EQo

To claim this, I am signing this object:

@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 / 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 / rotate-aws-iam-keys.sh
Last active October 16, 2019 08:43
AWS Access Key rotation
#!/bin/bash
#
# This script rotates your aws access keys by creating
# a new one and deleting the older one.
# Requirements
# You must have a working aws cli configured already
# Run `aws configure` otherwise first before running this script.
# Installation & Usage
@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 / test_output
Last active November 22, 2015 14:47
Weird output for Pull sock.
// Run 1
dhanush@Indradhanushs-MacBook-Pro:~/golang/src/github.com/zeromq/gogozmq$ go test -v -run TestPullSockSingleConnection
=== RUN TestPullSockSingleConnection
got incoming &{{0xc8200bc000}}
--- PASS: TestPullSockSingleConnection (0.00s)
sock_test.go:46: new pull
sock_test.go:54: new push
sock_test.go:60: push hello
read bytes: 7
PASS
@indradhanush
indradhanush / gogozmq.go
Last active November 22, 2015 14:49
Attempt to get zmq handshake working
type Conn interface {
net.Conn
Connect(endpoint string) error
CurrentIdx() int
Serve() error
handleConnection(conn net.Conn) error
}
type Sock struct {
conns []net.Conn
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 / 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
@indradhanush
indradhanush / sync.py
Last active August 29, 2015 14:05
Using mock
class ZMQSynchronizer(Synchronizer):
"""
Extends leap.soledad.client.sync.SoledadSynchronizer
"""
syncing_lock = Lock()
def _sync(self, autocreate=False, defer_decryption=True):
"""
Overrides SoledadSynchronizer._sync
"""