Skip to content

Instantly share code, notes, and snippets.

@hanshasselberg
hanshasselberg / dnsperf_install.sh
Last active August 18, 2021 09:25
Install dnsperf on ubuntu
sudo apt-get install -y bind9utils libbind-dev libkrb5-dev libssl-dev libcap-dev libxml2-dev
curl ftp://ftp.nominum.com/pub/nominum/dnsperf/2.0.0.0/dnsperf-src-2.0.0.0-1.tar.gz -O
tar xfvz dnsperf-src-2.0.0.0-1.tar.gz
cd dnsperf-src-2.0.0.0-1
./configure
make
sudo make install
@benkolera
benkolera / Main.hs
Last active June 9, 2017 19:12
Websocket <-> TCP Proxy : First Go
module Main where
import Prelude hiding (mapM_)
import Control.Concurrent (forkIO)
import Control.Concurrent.STM (STM,atomically)
import Control.Concurrent.STM.TQueue
( TQueue
, newTQueue
, readTQueue
, writeTQueue )
@alesleoignis
alesleoignis / gist:5404612
Created April 17, 2013 14:12
URL Extraction
http://n3t.awardspace.us/content/tcpdump-url-extraction
#!/bin/bash
#
# reset variables
myhost="";
myurl="";
tcpdump -s 0 -w - -l $@ | strings |
@klausbrunner
klausbrunner / SimpleFuture.java
Created November 19, 2012 11:34
A very simple implementation of the Java Future interface, for passing a single value to some waiting thread. Uses a CountdownLatch to ensure thread safety and provide blocking-with-timeout functionality required by Future. Cancellation isn't supported.
public final class ResultFuture implements Future<Result> {
private final CountDownLatch latch = new CountDownLatch(1);
private Result value;
@Override
public boolean cancel(boolean mayInterruptIfRunning) {
return false;
}
@Override
@finack
finack / application.rb
Created March 17, 2012 06:18
Example Chef Deploy Revision for Rails 3+
app = node[:rails][:app]
rails_base app[:name] do
ruby_ver app[:ruby_ver]
gemset app[:gemset]
end
%w{config log pids cached-copy bundle system}.each do |dir|
directory "#{app[:app_root]}/shared/#{dir}" do
owner app[:deploy_user]