This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
net = require('net') | |
tls = require('tls') | |
stream = require('stream') | |
if process.argv.length != 4 | |
console.log 'Usage: https_proxy host port' | |
process.exit(1) | |
class Printer extends stream.Transform | |
_transform: (chunk, encoding, done) => |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.koofr.finagle.thrift.stats | |
import com.twitter.finagle.SimpleFilter | |
import org.apache.thrift.protocol.TBinaryProtocol | |
import com.twitter.finagle.Service | |
import org.apache.thrift.transport.TMemoryInputTransport | |
import play.modules.statsd.api.Statsd | |
import com.twitter.finagle.thrift.ThriftClientRequest | |
import play.api.Logger |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// sudo apt-get install libfuse-dev pkg-config | |
// gcc -Wall deny.c `pkg-config fuse --cflags --libs` -o deny | |
// mkdir foo | |
// ./deny foo | |
#define FUSE_USE_VERSION 26 | |
#include <fuse.h> | |
#include <stdio.h> | |
#include <string.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import threading | |
from functools import wraps | |
from UserDict import UserDict | |
state = threading.local() | |
class DictProxy(UserDict, object): | |
def __init__(self, getter, dict=None, **kwargs): | |
object.__setattr__(self, 'getter', getter) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from glob import glob | |
for file in glob('*-script.py'): | |
exe = file.replace('-script.py', '.exe') | |
bat = file.replace('-script.py', '.bat') | |
ax = filter(os.path.exists, [exe, bat]) | |
print file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try: | |
from twisted.internet import pollreactor | |
pollreactor.install() | |
except: pass | |
from twisted.internet import protocol, reactor, defer, task | |
from twisted.web import http, proxy, resource, server | |
from twisted.python import log | |
import sys | |
import time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Volume up | |
"amixer sset Master 5+ unmute" | |
m:0x0 + b:9 | |
#Volume down | |
"amixer sset Master 5- unmute" | |
m:0x0 + b:8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from collections import OrderedDict | |
from lxml import objectify | |
def xml_to_py(el): | |
if len(set([x.tag for x in el.getchildren()])) == 1: | |
return [xml_to_py(x) for x in el.getchildren()] | |
if hasattr(el, 'pyval'): | |
return el.pyval |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/expect | |
trap { | |
set rows [stty rows] | |
set cols [stty columns] | |
stty rows $rows columns $cols < $spawn_out(slave,name) | |
} WINCH | |
spawn "/bin/bash" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:window.location = document.getElementsByTagName('frame').length?document.getElementsByTagName('frame')[1].src:$('object').attr('data'); |
OlderNewer