Skip to content

Instantly share code, notes, and snippets.

static void
send_dummy(int fd, short event, void *args) {
(void)fd;
(void)event;
circuit_t *circ = args;
crypt_path_t *cpath_layer = NULL;
if (CIRCUIT_IS_ORIGIN(circ)) {
cpath_layer = TO_ORIGIN_CIRCUIT(circ)->cpath->prev;
}
bool dir_stream = false;
if (relay_command == RELAY_COMMAND_DATA || relay_command == RELAY_COMMAND_BEGIN_DIR) {
if (!circ->dir_streams) {
circ->dir_streams = smartlist_new();
}
/* Try to find the list entry for this circuit and stream ID */
SMARTLIST_FOREACH_BEGIN(circ->dir_streams, streamid_t *, sid) {
if (*sid == stream_id) {
@caffeineshock
caffeineshock / browser.xml
Created August 14, 2012 19:45
XML to run browser with scallion
<plugin id="scallion" path="libshadow-plugin-scallion.so" />
<plugin id="filex" path="libshadow-plugin-filetransfer.so" />
<plugin id="browser" path="libshadow-plugin-browser.so" />
<cluster id="browser" bandwidthdown="6000" bandwidthup="1000" />
<cluster id="server" bandwidthdown="100000" bandwidthup="100000" />
<link id="link-browser-browser" clusters="browser browser" latency="30" jitter="11" packetloss="0.0">
<link id="link-server-browser" clusters="server browser" latency="50" jitter="11" packetloss="0.0" />
<link id="link-browser-server" clusters="browser server" latency="50" jitter="11" packetloss="0.0" />
@caffeineshock
caffeineshock / solarized.css
Created July 23, 2012 21:34 — forked from scotu/solarized.css
Solarized Light Pygments CSS
.highlight { background-color: #ffffcc }
.highlight .c { color: #586E75 } /* Comment */
.highlight .err { color: #93A1A1 } /* Error */
.highlight .g { color: #93A1A1 } /* Generic */
.highlight .k { color: #859900 } /* Keyword */
.highlight .l { color: #93A1A1 } /* Literal */
.highlight .n { color: #93A1A1 } /* Name */
.highlight .o { color: #859900 } /* Operator */
.highlight .x { color: #CB4B16 } /* Other */
.highlight .p { color: #93A1A1 } /* Punctuation */
@caffeineshock
caffeineshock / pygments.css
Created July 23, 2012 21:34 — forked from zmanji/pygments.css
Solarized Pygments Dark CSS
.highlight{background-color:#073642;color:#93a1a1}.highlight .c{color:#586e75 !important;font-style:italic !important}.highlight .cm{color:#586e75 !important;font-style:italic !important}.highlight .cp{color:#586e75 !important;font-style:italic !important}.highlight .c1{color:#586e75 !important;font-style:italic !important}.highlight .cs{color:#586e75 !important;font-weight:bold !important;font-style:italic !important}.highlight .err{color:#dc322f !important;background:none !important}.highlight .k{color:#cb4b16 !important}.highlight .o{color:#93a1a1 !important;font-weight:bold !important}.highlight .p{color:#93a1a1 !important}.highlight .ow{color:#2aa198 !important;font-weight:bold !important}.highlight .gd{color:#93a1a1 !important;background-color:#372c34 !important;display:inline-block}.highlight .gd .x{color:#93a1a1 !important;background-color:#4d2d33 !important;display:inline-block}.highlight .ge{color:#93a1a1 !important;font-style:italic !important}.highlight .gr{color:#aa0000}.highlight .gh{color:#586e
@caffeineshock
caffeineshock / download.rb
Created June 25, 2012 16:32
Tool chain to create shadow configs from the most popular sites according to Alexa
# ruby download.rb <hosts-file>
IO.foreach(ARGV[0]) do |l|
name = l[0...-1] # Remove \n
Dir.mkdir(name)
spawn('wget', '-H', '-p', "http://#{name}", :chdir => name)
end
Process.waitall
@caffeineshock
caffeineshock / pygmentize
Created June 25, 2012 06:47 — forked from michih57/pygmentize
Ugly wrapper around pygmentize to speed up pdflatex using the minted package for syntax highlighting
#!/bin/bash
# An ugly hack to speed up pdflatex using the minted package
# place this file with the name 'pygmentize' somewhere on your
# path before the 'real' pygmentize, such that this file gets
# executed and can act as a wrapper around the 'real' pygmentize.
# This script computes a hash-value (md5sum) of the input file
# from minted and caches the output of pygmentize.
# The working directory is used to store the cached files (it's an ugly hack...)
# The real pygmentize command, may need customization to work on your system.
@caffeineshock
caffeineshock / Makefile
Created May 24, 2012 12:53
App to download an html document and the contained objects like a browser
#############################################################################
#
# Generic Makefile for C/C++ Program
#
# License: GPL (General Public License)
# Author: whyglinux <whyglinux AT gmail DOT com>
# Date: 2006/03/04 (version 0.1)
# 2007/03/24 (version 0.2)
# 2007/04/09 (version 0.3)
# 2007/06/26 (version 0.4)
@caffeineshock
caffeineshock / Rakefile
Created April 28, 2012 21:44
LaTeX Building Rakefile
# encoding: utf-8
def config
# in this Rakefile we can allow that
$config ||= Hash.new
end
# main TeX file without extension
config['main'] = 'thesis'
@caffeineshock
caffeineshock / app.rb
Created November 11, 2011 11:41
Sinatra App, um zwei Web-Services zu orchestrieren.
require 'rubygems'
require 'bundler/setup'
require 'savon'
require 'savon_model'
require 'sinatra'
require 'bank'
require 'location'
get '/' do