Skip to content

Instantly share code, notes, and snippets.

@jordansissel
jordansissel / README.md
Last active October 7, 2015 06:38
prototype of a 'stdlib sucks so I had to write my own' benchmarking library for ruby

improving ruby benchmarking

stdlib's 'benchmark' is not good, at least, for every use case I've ever had for benchmarking.

So here's some hacking I did tonight.

Benchmarking Sequel

db = Sequel.sqlite("/tmp/example.db")
@retr0h
retr0h / gist:3101078
Created July 12, 2012 21:20
minitest-handler
[2012-07-12T20:55:25+00:00] INFO: Chef Run complete in 6.78975371 seconds
[2012-07-12T20:55:25+00:00] INFO: Running report handlers
Run options: -v --seed 16402
# Running tests:
recipe::minitest_helper::user_for#test_0003_returns_octal_modes = 0.00 s = .
recipe::minitest_helper::user_for#test_0002_returns_the_proper_group = 0.00 s = .
recipe::minitest_helper::user_for#test_0001_returns_the_proper_user = 0.00 s = .
recipe::openssh-config::ssh_config#test_0004_binds_to_proper_port = 0.00 s = .
# screen like C-a vs C-b
unbind-key C-b
set-option -g prefix C-a
# screen like C-a a vs C-b l
bind-key C-a last-window
bind a send-prefix
# large history
set-option -g history-limit 100000
@jordansissel
jordansissel / data.md
Created July 3, 2012 23:36
Compression on large JSON file

The Data

Compression

  • Original: 708MB
  • xz -3: 70MB, 5:41.02 (2.07 mb/sec - 10:1 ratio)
  • bzip2 -3: 74MB, 4:39.11 (2.53 mb/sec - 9.5:1 ratio)
  • gzip -3: 103MB: 0:15.15 (46.73 mb/sec - 6.87:1 ratio)
  • lzop -3: 146MB, 0:06.53 (108.42 mb/sec - 4.85:1 ratio)
@Kami
Kami / gist:2859346
Created June 2, 2012 17:53
luvit traceroute exec
local Emitter = require('core').Emitter
local Error = require('core').Error
local table = require('table')
local childprocess = require('childprocess')
function split(str, pattern)
pattern = pattern or '[^%s]+'
if pattern:len() == 0 then pattern = '[^%s]+' end
local parts = {__index = table.insert}
setmetatable(parts, parts)
@robinsmidsrod
robinsmidsrod / _INSTALL.md
Last active May 21, 2024 06:35
Bootstrapping full iPXE native menu with customizable default option with timeout (also includes working Ubuntu 12.04 preseed install)

Add the following chunk to your existing ISC dhcpd.conf file.

if exists user-class and ( option user-class = "iPXE" ) {
    filename "http://boot.smidsrod.lan/boot.ipxe";
}
else {
    filename "undionly.kpxe";
}

(or see https://gist.github.com/4008017 for a more elaborate setup

Adrian -

I appreciate that you spent time in writing this post. I know I've been up until 2am writing similarly long ones as well. I will take responsibility for having what is likely an irrational response (I blame Twitter for that) to the term "NoOps", but I invite you to investigate why that might be. I'm certainly not the only one who feels this way, apparently, and thus far have decided this issue is easily the largest distraction in my field I've encountered in recent years. I have had the option to simply ignore my opposition to the term, and just let the chips fall where they may with how popular the term "NoOps" may or may not get. I have obviously not taken that option in the past, but I plan to in the future.

You're not an analyst saying "NoOps". Analysts are easy (for me) to ignore, because they're not practitioners. We have expectations of engineering maturity from practitioners in this field of web engineering, especially those we consider leaders. I don't have any expectations from analysts,

@dyoder
dyoder / dispatcher.coffee
Created March 6, 2012 04:55
Go dispatcher, phase 1
http = require('http')
Redis = require("redis")
c = Redis.createClient(@port, @host)
marshal = (req) ->
JSON.stringify
method: req.method
url: req.url
headers: req.headers
body: req.body
@davidcelis
davidcelis / ruby-on-ales.markdown
Created March 1, 2012 17:51
Overview of talks given at Ruby on Ales

Ruby on Ales

Outgrowing the Cloud (Mike Moore)

  • Requests hitting the same load balancer can't handle HTTP and HTTPS at the same time because of SSL issues
  • If you are trying to access an outside resource behind a firewall, you have to tell them every time you get a new webserver so they can whitelist the new IP
  • If you know the IPs of your web servers and database servers, you can have requests hit these directly and bypass the load balancers.
  • Could buy your own data center, but then you have to buy a load balancing router. Those are fucking expensive (tens or hundreds of thousands of dollars)
@jeffsu
jeffsu / gist:1926295
Created February 27, 2012 19:05
iptable
0.0.0.0 10.0.1.1 0.0.0.0 UG 0 0 0 eth0
10.0.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
10.10.10.0 0.0.0.0 255.255.255.0 U 0 0 0 vboxnet0
33.33.33.0 0.0.0.0 255.255.255.0 U 0 0 0 vboxnet1
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0