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
var fs = require('fs'); | |
var https = require('https'); | |
var httpProxy = require('http-proxy'); | |
if (!process.env.PROXY_TO_HOST) { | |
throw new Error('Must set environment variable PROXY_TO_HOST with destination address'); | |
} | |
if (!process.env.PROXY_TO_PORT) { | |
throw new Error('Must set environment variable PROXY_TO_PORT with destination port'); |
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/env python | |
import sys | |
import gevent | |
from gevent import socket | |
# lazy global variable for storing results | |
results = [] | |
# greenlet worker | |
def worker(name): |
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 sys | |
import requests | |
# define an array to hold our hosts | |
hosts = [] | |
# open the file as the variable f | |
# this will close the file as soon we're done | |
with open(sys.argv[1]) as f: | |
# this is called a list comprehension. it's neat way to loop over |
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/env ruby | |
content = File.open(ARGV[0]).read | |
# sub escaped double quote for single quote | |
content.gsub!(/\\\"/, "'") | |
# sub double quote for decimal double quote | |
content.gsub!(/\"/, '" & Chr(34) & "') | |
# add cmd.exe for execution | |
content = '"cmd.exe /C ' + content | |
# split every 200 chars and then rejoin with newline and string continuation |
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 main | |
import ( | |
"bufio" | |
"crypto/tls" | |
"time" | |
"net" | |
"fmt" | |
"os" | |
) |
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 main | |
import ( | |
"runtime" | |
) | |
func main() { | |
n := runtime.NumCPU() | |
runtime.GOMAXPROCS(n) |
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
var Cylon = require('cylon'); | |
var EventEmitter = require('events').EventEmitter; | |
var Hapi = require('hapi'); | |
var bot = new EventEmitter(); | |
var on = false; | |
Cylon.robot({ | |
connections: { | |
arduino: { |