Skip to content

Instantly share code, notes, and snippets.

View bleything's full-sized avatar
🤡
Computerin'

Ben Bleything bleything

🤡
Computerin'
View GitHub Profile
@bleything
bleything / index.html
Last active January 28, 2019 01:39
Laser Swatch SVG
<svg width="100mm" height="100mm" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1">
<style type="text/css">
#cut {
stroke: black;
fill: none;
}
line {
stroke: black;
}
#!/bin/sh
msg=$(git log --format=format:"%s %b, for real" HEAD^..HEAD)
git commit -a -m "${msg}"
@bleything
bleything / homedir.rake
Created January 2, 2013 00:32
Stick this in your homedir repo. Run rake. Watch in amazement as it symlinks everything.
require 'find'
BLACKLIST = %w[
.git
.gitignore
Rakefile
]
task :default do
Find.find('.') do |path|
@bleything
bleything / results.rb
Created November 7, 2012 05:38
pull current election results
#!/usr/bin/env ruby
require 'nokogiri'
require 'csv'
require 'open-uri'
require 'pp'
BASE_URL = "http://vote.wa.gov/results/current/"
SHIT_I_CARE_ABOUT = /74|502|1185|Governor|Attorney General|Congressional District 1/
Version 1.96 ------Sequential Output------ --Sequential Input- --Random-
Concurrency 4 -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP
db01 193736M 790 99 66142 8 227980 27 2683 85 655455 31 358.8 68
Latency 15846us 2271ms 1682ms 162ms 582ms 35860us
Version 1.96 ------Sequential Create------ --------Random Create--------
db01 -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP
16 2218 9 +++++ +++ 4101 11 3624 15 +++++ +++ 4114 11
Latency 2496ms 667us 948us 936us 160us 453us
Version 1.96 ------Sequential Output------ --Sequential Input- --Random-
Concurrency 4 -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP
db01 193736M 802 98 63279 8 178785 22 3465 97 337376 17 400.9 79
Latency 16370us 2252ms 12813ms 12908us 237ms 71381us
Version 1.96 ------Sequential Create------ --------Random Create--------
db01 -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP
16 1843 9 +++++ +++ 2541 8 2493 12 +++++ +++ 2524 8
Latency 1999ms 644us 49961us 14533us 25us 32424us
threads total_time num_events event_execution_time per_req_min per_req_avg per_req_max per_req_perc events_avg events_dev exec_time exec_dev
1 94.5742 10000 94.5732 9.35 9.46 20.18 9.51 10000.0000 0.00 94.5732 0.00
2 46.9850 10000 93.9581 9.35 9.40 15.76 9.36 5000.0000 10.00 46.9791 0.00
3 31.3795 10000 94.1288 9.35 9.41 12.16 9.38 3333.3333 22.17 31.3763 0.00
4 23.5431 10000 94.1518 9.35 9.42 12.22 9.38 2500.0000 19.70 23.5379 0.00
5 19.4184 10000 97.0659 9.35 9.71 12.83 9.85 2000.0000 26.96 19.4132 0.00
6 16.7657 10000 100.5685 9.49 10.06 12.78 12.65 1666.6667 54.01 16.7614 0.00
7 14.2533 10000 99.7485 9.84 9.97 12.78 9.97 1428.5714 39.97 14.2498 0.00
8 12.4934 10000 99.9180 9.62 9.99 12.75 11.55 1250.0000 37.56 12.4897 0.00
9 11.7928 10000 106.1004 9.76 10.61 16.87 14.32 1111.1111 129.55 11.7889 0.00
$ sudo gem install raindrops
Building native extensions. This could take a while...
ERROR: Error installing raindrops:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for mmap() in sys/mman.h... yes
checking for munmap() in sys/mman.h... yes
checking for mremap() in sys/mman.h... no
checking for getpagesize() in unistd.h... yes
@bleything
bleything / tinydns.zone
Created March 20, 2011 17:30
simple djbdns zonefile
.bleything.net::dns1.sascrotch.com
.bleything.net::ns1.skylab.org
=bleything.net:198.145.180.87
+blog.bleything.net:198.145.180.87
+www.bleything.net:198.145.180.87
Ccalendar.bleything.net:ghs.google.com
Cdocs.bleything.net:ghs.google.com
=== CPU cache information ===
CPU /sys/devices/system/cpu/cpu0 Level 1 Cache: 32K (Data)
CPU /sys/devices/system/cpu/cpu0 Level 1 Cache: 32K (Instruction)
CPU /sys/devices/system/cpu/cpu0 Level 2 Cache: 256K (Unified)
CPU /sys/devices/system/cpu/cpu0 Level 3 Cache: 12288K (Unified)
CPU /sys/devices/system/cpu/cpu1 Level 1 Cache: 32K (Data)
CPU /sys/devices/system/cpu/cpu1 Level 1 Cache: 32K (Instruction)
CPU /sys/devices/system/cpu/cpu1 Level 2 Cache: 256K (Unified)
CPU /sys/devices/system/cpu/cpu1 Level 3 Cache: 12288K (Unified)
CPU /sys/devices/system/cpu/cpu10 Level 1 Cache: 32K (Data)