Skip to content

Instantly share code, notes, and snippets.

View notmyname's full-sized avatar

John Dickinson notmyname

View GitHub Profile
@pauldardeau
pauldardeau / gist:0081c7ccf2e58ad4d52fd609a9051cd0
Created January 4, 2017 23:11
all your loopback device space r belong to swift mp3
this is related to my dinky cloud jukebox (https://github.com/pauldardeau/cloud-jukebox). that's a fancy
way of saying a bunch of mp3 files stored in swift.
i run it on a vps (droplet!) with 2gb ram and 40gb disk
i continue to work on my cloud jukebox thingie
primarily by adding more of my music collection to my little saio swift cluster on a vps
as part of my goal of moving completely away from itunes
i’ve been doing a lot more of that lately, and i completely filled up (100%) my loopback storage device
it’s configured with standard 3 replicas (default)
import logging
import keystoneauth1.loading
import keystoneauth1.session
import swiftclient.client
use_v1 = True
do_preauth = False
bad_preauth = False
if use_v1:
dfg@saio4:~/go/src/github.com/openstack/swift/go/bench$ hummingbird dbench
Usage: [configuration file]
The configuration file should look something like:
[dbench]
address = http://localhost:6010/
concurrency = 15
object_size = 131072
num_objects = 5000
num_gets = 30000
do_replicates = false
@carlynorama
carlynorama / WiFiChecker.ino
Last active July 28, 2016 22:28
This stand alone sketch checks the WiFi functionality of an Arduino board with the WiFi shield or an Intel Galileo board.
/*
// This code is to test WiFi function on Arduino Boards
// It was complied from various examples which can be found:
//
// http://arduino.cc/en/Tutorial/ConnectNoEncryption
// http://arduino.cc/en/Tutorial/ConnectWithWPA
// http://arduino.cc/en/Tutorial/WiFiWebClientRepeating
// http://arduino.cc/en/Reference/WiFiClientConnect
//
// Carlyn Maw 2014
@jboner
jboner / latency.txt
Last active April 26, 2024 03:40
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
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
@vishvananda
vishvananda / bp.sh
Last active October 2, 2015 07:58
Script for backporting OpenStack branches
#!/usr/bin/env bash
# This little script is to make backporting patches easier.
# Instructions
# ------------
# Make sure that <btranch> exists:
# git branch -D <branch>
# git checkout -b <branch> origin/<branch>
# Grab the file and stick it in your <project> directory:
# curl -OL https://raw.github.com/gist/2206428/bp.sh
# Make sure the script is runnable:
@olivierlacan
olivierlacan / An_example.markdown
Created February 18, 2012 05:40 — forked from renz45/An_example.markdown
Re-style Sublime Text 2 sidebar to a darker theme

This re-styles your sublime text 2 sidebar to be darker, so it doesn't blind you when using a dark theme.

Dark sublime text 2 sidebar

Save the Default.sublime-theme file into packages/Theme - Default, make a backup of your original if you want to be able to go back easily.