Skip to content

Instantly share code, notes, and snippets.

Blake Caldwell wblakecaldwell

Block or report user

Report or block wblakecaldwell

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@wblakecaldwell
wblakecaldwell / fastbit-deadlock.txt
Created Sep 28, 2015
Fastbit deadlocking code path
View fastbit-deadlock.txt
** This is from a modified fork of Fastbit 1.3.8, so the line numbers will be off by a little.
Description
-----------
Deadlock is caused by `ibis::fileManager::getFile` (#7 below) locking the fileManager's mutex, and then the constructor
at `ibis::fileManager::storage::storage` (#4 below) locking it in the same thread, when it realizes it needs to make
some room in the cache first. There seem to be many similar code paths where this sort of deadlock will arise, all when
the cache size is near or over `maxBytes`.
@wblakecaldwell
wblakecaldwell / README.md
Last active Aug 29, 2015 — forked from leehambley/README.md
Simple bash script to wire up Grafana 2.x with InfluxDB 0.8
View README.md

Simple bash script to wire up Grafana 2.x with InfluxDB 0.8

This Bash script exposes a few functions to create a Grafana data source, and setup the InfluxDB database behind that. It has some configuration functions in the top. It is a continuation of the Python script offered in this Grafana issue comment.

Usage

$ ./grafana-influxdb-wiring.sh name_of_database
View .vimrc
"
" Jesse Nelson <spheromak@gmail.com>
" ab
"-------------------------------------------------------------------------------
"
"
set nocompatible " be iMproved
scriptencoding utf-8
set encoding=utf-8
@wblakecaldwell
wblakecaldwell / cylon.py
Created Feb 24, 2015
cylon.py - Pulse an LED bar like a Cylon - Raspberry Pi
View cylon.py
#
# Pulse an LED bar like a Cylon
#
# This is my Raspberry Pi "Hello World".
#
import RPi.GPIO as GPIO
import time
View gist:ed43ad11271200403f5e
**** whoa, interesting
goroutine 23885395 [syscall, 228 minutes, locked to thread]:
net._C2func_getaddrinfo(0x1924010, 0x0, 0xc2087a9278, 0xc2087a91c8, 0x301befcd00000000, 0x0, 0x0)
/usr/src/go/src/net/:26 +0x55
net.cgoLookupIPCNAME(0xc208bd45c0, 0x15, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/usr/src/go/src/net/cgo_unix.go:96 +0x1c5
net.cgoLookupIP(0xc208bd45c0, 0x15, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc2080da240)
/usr/src/go/src/net/cgo_unix.go:148 +0x65
net.lookupIP(0xc208bd45c0, 0x15, 0x0, 0x0, 0x0, 0x0, 0x0)
/usr/src/go/src/net/lookup_unix.go:64 +0x5f
@wblakecaldwell
wblakecaldwell / json_sensitive_fields.go
Last active Aug 29, 2015
JSON Encoding in Go: Dealing with Sensitive Fields
View json_sensitive_fields.go
//
// Golang example: Handling sensitive struct fields when JSON encoding.
//
// Blog Post: http://blakecaldwell.net/blog/2015/1/20/json-encoding-in-go-dealing-with-sensitive-fields.html
//
// Try this in the Go Playground: https://play.golang.org/p/Du5ztx6zjC
//
// Author
// ------
//
@wblakecaldwell
wblakecaldwell / google_io_puzzle.py
Last active Aug 29, 2015
Google I/O secret invite code finder
View google_io_puzzle.py
#
# Google I/O 2014 secret invite code finder
#
# Blake Caldwell, 2014
#
# Blog Post: http://blakecaldwell.net/blog/2014/4/23/solving-a-2014-google-io-secret-invite-puzzle.html
#
# Repeatedly hit https://developers.google.com looking two-colored "I/O" on the page,
# with a secret code in comments below it. Using the color codes of the "I" and "O",
# calculate the 6-character Google URL-shortened link code, and print the code out.
@wblakecaldwell
wblakecaldwell / ClassLoggerFactory.java
Last active Dec 27, 2015
Java Logger Factory that uses the stack trace to infer the logger name, allowing copy/paste.
View ClassLoggerFactory.java
package net.blakecaldwell.safehibernate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Factory for log messages, picking the enclosing class as the
* logger. This is safe from copypasta.
*
* Use: private static Logger logger = ClassLoggerFactory.make();
You can’t perform that action at this time.