Skip to content

Instantly share code, notes, and snippets.

@gsathya
gsathya / http.lua
Last active December 23, 2015 18:39
local http = require("socket.http")
HttpRequestExperiment = {}
HttpRequestExperiment.__index = HttpRequestExperiment
function HttpRequestExperiment.create(urls)
local experiment = {}
setmetatable(experiment, HttpRequestExperiment)
experiment.urls = urls
return experiment
#include <linux/module.h>
#include <linux/netfilter.h>
#include <linux/skbuff.h>
#include <linux/netfilter_ipv4.h>
#include <linux/udp.h>
#include <linux/ip.h>
#include <linux/netdevice.h>
static char *interface = "eth0";
/* net filter hook option struct */
1) Install docker on ubuntu -
http://docs.docker.io/en/latest/installation/ubuntulinux/
2) Download the ooni vm image -
$ wget http://codesurfers.net/~gsathya/ooni.tar
3) Import the image to docker
$ cat ooni.tar | docker import - ooni
4) Start the image
@gsathya
gsathya / status.py
Last active December 20, 2015 15:08
from datetime import datetime
from willie import module
# use this to separate different parts of the status
DELIMITER = ";"
@module.commands('status')
def status(bot, trigger):
status_msg = []
# add name
- Write a `chutney check` - #8530
- Sending and receiving Tor data - #8531
- Test tor features
- Coverage of succeding testing things on Linux using Chutney - code coverage by running chutnet for 10-15 mins
- Hidden services
- Write a daemon
+ control all tors
+ get unified log
+ easily change tors confs
- tors confs won't get written to file
diff --git a/app/controllers/register_controller.rb b/app/controllers/register_controller.rb
index a53db23..64fdd74 100644
--- a/app/controllers/register_controller.rb
+++ b/app/controllers/register_controller.rb
@@ -10,10 +10,10 @@ class RegisterController < ApplicationController
@users = @search.results
unless @users.blank?
@user = @users[0]
- @college = CollList.college(@user.college).coll_name
@gsathya
gsathya / flashproxy-gadget.md
Created January 9, 2013 19:02
set up a flashproxy mediawiki gadget
  • Log in to en.wikipedia.org
  • Go to Preferences -> Appearance -> Custom JavaScript
  • You will end up editing common.js; insert the following code and save it -
$('#p-personal ul').append('<li><iframe src="//crypto.stanford.edu/flashproxy/embed.html" width="80" height="15" frameborder="0" scrolling="no"></iframe></li>')
  • Refresh the page, you will be able to see a slightly confusing dark blue flashproxy badge near the "Log Out" link.
FAIL: test_cached_microdesc_consensus
----------------------------------------------------------------------
Traceback:
File "/Users/sathya/Documents/stem/test/integ/descriptor/networkstatus.py", line 81, in test_cached_microdesc_consensus
self.fail()
AssertionError: None
# usage - $python trainglewords.py words.txt
import sys
from math import *
file = open(sys.argv[1], 'r')
data = file.read()
file.close()
alpha = {}
class MicrodescriptorExitPolicy:
def __init__(self):
self.ports = []
self.policy = None
# assume it's an accepted list of ports
self.is_accept = True
self.is_policy = False
def __str__(self):