Skip to content

Instantly share code, notes, and snippets.

### grub configuration for alyzon
#
# I run FreeBSD/amd64 with root-on-ZFS on a Lenovo ThinkCentre M83,
# which has UEFI. At the moment, this configuration is basically
# unsupported (although it's coming soon), but I want to be able to
# use my system. I've had prior experience with Lenovo UEFI boxes
# before (Arch on my ThinkPad T440), and I hate autogenerated GRUB
# configs, so I appropriated my hand-written GRUB config, and extended
# it.
#
@sehe
sehe / Makefile
Created July 4, 2012 14:57
lispy spirit demo
all:test
test: display.o eval.o
CPPFLAGS+=-std=c++0x
CPPFLAGS+=-g -O0
CPPFLAGS+=-I ~/custom/boost/
# CPPFLAGS+=-fopenmp
# CPPFLAGS+=-march=native
@aphyr
aphyr / -log
Last active December 22, 2015 02:19
In http://www.datastax.com/dev/blog/row-level-isolation and
http://www.datastax.com/dev/blog/atomic-batches-in-cassandra-1-2, Datastax
asserts that batch updates to multiple cells in a single row are
guaranteed to be isolated from concurrent batches:
"Cassandra 1.1 guarantees that if you update both the login and password in the
same update (for the same row key) then no concurrent read may see only a
partial update."
"...the guarantee is that the new login cannot be persisted without the new
@bixu
bixu / circonus_httptrap_push.sh
Created January 28, 2016 17:07
Send a key:value pair to a Circonus HTTPTrap endpoint
#!/bin/bash
# Note that the -k flag here means we are ignoring cert warnings.
# If security matters you should use the Circonus cert provided
# here: http://login.circonus.com/pki/ca.crt
KEY=$1
VALUE=$2
ENDPOINT_URL=$3
@justincampbell
justincampbell / upvote_gifs.md
Last active March 17, 2016 18:47
Upvote gifs

package locktest
import (
"sync"
"testing"
)
var l sync.Mutex
func dLock() {
@andelf
andelf / cookiejar.go
Last active June 20, 2017 05:13
A golang in memory cookiejar
// MIT license (c) andelf 2012
type InMemoryCookieJar struct{
storage map[string][]http.Cookie
}
// buggy... but works
func (jar InMemoryCookieJar) SetCookies(u *url.URL, cookies []*http.Cookie) {
for _, ck := range cookies {
path := ck.Domain
@szaydel
szaydel / io-size-through-zil-by-file.d
Last active September 21, 2017 23:17
Dtrace snippets for observing behaviour of ZIL
dtrace -qn '
/* Add a number greater than 0 after the script on the command line, to
* tell the script how often to print results to screen. If no value is
* given, script will fail immediately. Value must be positive and is in
* seconds. Results will be printed "this many" seconds apart, but will
* be normalized to a per-second result.
*/
int ts;
BEGIN { ts = timestamp; }
sdb-sde are 64G zvols on a striped zpool of 8 mirrors
fio was created by:
lvcreate -L 240G -i4 -I64 -n fio TestVolGroup
guest command:
doas cpuset -c -l 16-31 -n ft:1 -- grub-bhyve -S -m /chyves/storage/guests/ubi0/device.map -r hd0,msdos1 -c /dev/nmdm52A -M 32G chy-ubi0; doas cpuset -c -l 16-31 -n ft:1 -- bhyve -A -H -P -S -c 16 -U ec30b988-f5aa-11e7-a76c-ac1f6b0a8cd2 -m 32G -s 0,hostbridge -s
4,ahci-hd,/dev/zvol/storage/chyves/guests/ubi0/disk0 -s 5,virtio-net,tap52 -s 6,kvirtio-net,mtu=1500,queues=4,intf=cc0,mac=00:07:43:3d:92:d1 -s 7,ahci-hd,/dev/zvol/storage/chyves/guests/ubi0/disk1 -s 8,ahci-hd,/dev/zvol/storage/chyves/guests/ubi0/disk2 -s 9,ahci-hd,/dev/zvol/storage/chyves/guests/ubi0/disk3 -s 10,ahci-hd,/dev/zvol/storage/chyves/guests/ubi0/disk4 -l com1,/dev/nmdm52A -s 31,lpc chy-ubi0
ARC MAX 8G (in use 8G)
@ioguix
ioguix / btree_bloat.sql
Last active March 28, 2018 18:12
B-tree index bloat estimation
/* The bloat estimation queries moved to this respository:
* https://github.com/ioguix/pgsql-bloat-estimation
*/