Skip to content

Instantly share code, notes, and snippets.

Brian L. Troutwine blt

Block or report user

Report or block blt

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
@blt
blt / .gitignore
Last active Sep 29, 2018
cov experiment
View .gitignore
*.o
*.a
example_cc
example_rs
View keybase.md

Keybase proof

I hereby claim:

  • I am blt on github.
  • I am troutwine (https://keybase.io/troutwine) on keybase.
  • I have a public key ASA7ED3F_HArLA08CgrbzXJqASlFHbPd8ilNmvM49OS7DQo

To claim this, I am signing this object:

View emit_graphite.py
#!/usr/bin/env python2.7
import time
import socket
import sys
def graphite_metric(sock, name, value):
timestamp = int(time.time())
sock.send("%s %f %d\n" % (name, value, timestamp))
def main():
View transaction.scala
case object transaction {
import java.sql.Connection
def apply[T](query: => T):Option[T] = {
val conn:Connection = play.db.DB.getConnection
val auto:Boolean = conn.getAutoCommit
try {
conn.setAutoCommit(false)
Some(query)
} catch {
View thc-ssh-crack-fork
/*
* 2012 -- updated to make use of an 8-core machine by Brian L. Troutwine
*
* THC/2003
*
* Simple ssh-private key cracker. Tries to brute force (dictionary
* attack) almost any ssh private key file format.
*
* This is just a quick tool from THC. Using OpenSSL is not really
* fast...
@blt
blt / hello.erl
Last active Mar 12, 2017
What should be the standard Erlang "Hello, world!"
View hello.erl
-module(hello).
-export([hello/1]).
hello(robert) ->
io:format("Hello, Mike.");
hello(joe) ->
io:format("Hello, Robert.");
hello(mike) ->
io:format("Hello, Joe.").
@blt
blt / book_list.md
Last active Dec 24, 2016
A list of my favorite books, in no particular order and with no particular applicability in mind.
View book_list.md

A List of my Favorite Books

I've categorized the books--roughly--by Big Theme: the header to each sub-list.

The Idea of America

  • "Debate on the Constitution, Vol. I and II", various (Library of America)
  • "The Praire Traveler", Randolph B. Marcy
  • "An American Tragedy", Theodore Dreiser
  • "The Great Gatsby", F. Scott Fitzgerald
View lib.rs
#![cfg_attr(test, feature(plugin))]
#![cfg_attr(test, plugin(quickcheck_macros))]
#![allow(dead_code)]
#![allow(unused_imports)]
#[cfg(test)]
extern crate quickcheck;
/// This is an implementation of the algorithm presented in Cormode, Korn,
View reverse.rs
#![cfg_attr(test, feature(plugin))]
#![cfg_attr(test, plugin(quickcheck_macros))]
#[cfg(test)]
extern crate quickcheck;
fn reverse<T: Clone>(xs: &[T]) -> Vec<T> {
let mut rev = vec!();
for x in xs {
rev.insert(0, x.clone())
View generic_intro.md

Lunar Base Airlock Problem

Your goal is to design a control-system for a lunar base, this one:

Overview

In particular, we're going to focus on the airlock system, consisting of three doors A, B and C. Each internal segment AB and BC may be variably pressurized.

Airlock Detail

You can’t perform that action at this time.