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
// server | |
ws = require('ws'); | |
wss = new ws.Server({ port: 8033 }); | |
wss.on('connection', function(s) { | |
console.log("got connection", s); | |
s.on('message', function incoming(message) { | |
console.log("received", message); | |
}); | |
}); |
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
tce-load -wi net-usb-4.9.22-piCore-v7 | |
modprobe cdc_ether | |
modprobe usbnet | |
ifconfig -a | |
ifconfig usb0 up | |
sudo /sbin/udhcpc -b -i usb0 -x hostname:$HOSTNAME -p /var/run/udhcpc.usb0.pid |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta content="width=device-width, initial-scale=1" name="viewport"> | |
<style> | |
body { | |
font-family: Arial, Sans-serif; | |
max-width: 600px; | |
margin: 1em auto; |
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
echo -n $'d1:ad2:id20:\x23\x71\x0c\x1c\xb4\x50\x7d\x87\x29\xb8\x3f\x87\x2c\xc6\xa2\xa4\x4c\x39\x73\x67e1:q4:ping1:t1:01:y1:qe' | nc -u router.utorrent.com 6881 |
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 | |
# two hex encoded strings coming in on stdin | |
# will get xored and output as a hex encoded string | |
import fileinput | |
lines = [l for l in fileinput.input()] | |
print hex(int(lines[0], 16) ^ int(lines[1], 16)).replace("0x", "").rstrip("L") |
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 webbrowser | |
import subprocess | |
def git(*args): | |
return subprocess.check_output(["git"] + list(args)) | |
remote, branch = git("rev-parse", "--abbrev-ref", "--symbolic-full-name", "@{u}").split("/") | |
repo = git("config", "--get", "remote." + remote + ".url").split(":").pop().replace(".git", "").strip("\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
#!/usr/bin/awk -f | |
# Usage: | |
# zcat -f access.log.* | ./extract-latest-log-date.awk > latest-log.txt | |
BEGIN { | |
# pre-compute months field lookup | |
m=split("Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec",d,"|") | |
for(o=1;o<=m;o++){ | |
months[d[o]]=sprintf("%02d",o) |
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
#!/bin/sh | |
# get broadcast addresses for each network | |
net=`ifconfig | grep -o -E "Bcast:(.*?) " | cut -f2 -d":"` | |
# loop over networks running the scan | |
for n in $net; | |
do | |
# first find SSH machines silently to prime the arp table | |
nmap -T4 -n -p 22 --open --min-parallelism 100 "$n/24" | grep -e "scan report for" -e "ssh" > /dev/null |
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
#!/bin/sh | |
while true; | |
do | |
if ! make -q "$@"; | |
then | |
echo "#-> Starting build: `date`" | |
make "$@"; | |
echo "#-> Build complete." | |
fi |
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 [hy.models.expression [HyExpression]]) | |
(defn print-expression [expr] | |
(+ "(" (.join " " (list-comp (if (= (type x) HyExpression) (print-expression x) (str x)) [x expr])) ")")) | |
(defmacro print-eval [expr] | |
(quasiquote (do | |
(print (unquote (print-expression expr))) | |
(unquote expr)))) |