Skip to content

Instantly share code, notes, and snippets.

@nelsnelson
nelsnelson / latency.markdown
Created October 25, 2012 22:07 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Syscall on Intel 5150 ...................... 105 ns
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Context switch on Intel 5150 ............. 4,300 ns  =   4 µs

Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs

@nelsnelson
nelsnelson / lxc-minimal.sh
Created March 17, 2014 15:54
Template for LXC intended to provide a minimal rootfs and ran as a daemon
#!/bin/bash
#
# lxc: linux Container library
# Authors:
# Daniel Lezcano <daniel.lezcano@free.fr>
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@nelsnelson
nelsnelson / solarized.css
Created July 15, 2019 18:17
solarized.css
body { background: #002b36; color: #839496; }
a { color: #90939b; }
a:link, a:visited { color: #90939b; }
a:hover, a:active, a:focus { color: #90939b; }
hr { border-bottom: 1px solid #454c5c; border-top: 1px solid #002b36; }
@nelsnelson
nelsnelson / solarized-dark.css
Last active April 22, 2019 14:57
solarized-dark.css
/* @-moz-document regexp("https://[^./]*\\.slack\\.com/(?!pricing)(?!security).*") { body { background: #002b36; color: #a1adad; } */
body { background: #002b36; color: #a1adad; }
a { color: #268bd2; }
a:link, a:visited { color: #268bd2; }
a:hover, a:active, a:focus { color: #dc322f; }
hr { border-bottom: 1px solid #002b36; border-top: 1px solid #002b36; }
h1, h2, h3, h4 { color: #a1adad; }
h1 a { color: #a1adad; }
h1 a:active, h1 a:hover, h1 a:link, h1 a:visited { color: #a1adad; }
.bordered { border: 1px solid #00232c; }
// Solarized color palette
// Taken from ethanschoonover.com/solarized
$base03: #002b36;
$base02: #073642;
$base01: #586e75;
$base00: #657b83;
$base0: #839496;
$base1: #93a1a1;
$base2: #eee8d5;
$base3: #fdf6e3;
@nelsnelson
nelsnelson / public_dns_servers.md
Created April 23, 2018 16:07
Public DNS Servers
@nelsnelson
nelsnelson / support_chat_transcript.txt
Created November 29, 2018 15:51
Google Fi cell phone plan privacy
Stephen
9:40 AM
Thanks for contacting Google Support. My name is Stephen.
Stephen
9:40 AM
Hi Nels!
Stephen
9:40 AM
How may we help you today?
Nels Nelson
@nelsnelson
nelsnelson / sblack_night_mode.css
Last active June 29, 2018 16:35
sblack_night_mode.css
html {
background: #222 !important;
}
body {
background: #222 !important;
color: #e6e6e6;
}
a {
color: #949494;
}
@nelsnelson
nelsnelson / faviconized-bookmarks.css
Created February 2, 2018 21:18
Bookmarks displayed on toolbars appear as favicons
/*
* When bookmarks are displayed on a toolbar, they appear as favicons. (Text is hidden)
*
* Screenshot: https://s26.postimg.org/lnb9akmbd/Faviconized-bookmarks.png
*
* Tested on Firefox 55, Windows 7
* Contributor(s): Okamoi
*/
/* Hides bookmark text for all bookmarks displayed in a toolbar */
@nelsnelson
nelsnelson / image-upload-glance.py
Last active October 18, 2017 21:07
Example of how to use python 3.6 requests to register/upload/create an image through an Openstack Glance API
#! /usr/bin/env python3.6
import json
import os
import requests
import urllib
import sys
region = 'DFW'