Skip to content

Instantly share code, notes, and snippets.

View guyhughes's full-sized avatar

guy hughes guyhughes

  • /boot/efi/vmlinuz+0x0
View GitHub Profile
@guyhughes
guyhughes / ooni-api-consumer.py
Created September 17, 2015 22:33
OONI API Reports consumer into python3 dict
#!/usr/bin/env python3.4
import json
import requests
url = 'http://api.ooni.io/api/reports'
r = requests.get(url)
reports = json.loads(r.text)
#!/usr/bin/env python3
# python monogodb example from Hack The North 2015
import pymongo
conn = pymongo.MongoClient()
blog_db = conn["blog"]
posts_col = blog_db["posts"]
post = {
:%s:-af\W:-afg :
:%s:-ax\W:-ala :
:%s:-al\W:-alb :
:%s:-dz\W:-dza :
:%s:-as\W:-asm :
:%s:-ad\W:-and :
:%s:-ao\W:-ago :
:%s:-ai\W:-aia :
:%s:-aq\W:-ata :
:%s:-ag\W:-atg :
@guyhughes
guyhughes / openvpn-client.conf
Last active October 27, 2015 02:48
OpenVPN udp tap - working ;)
client
dev tap
tun-mtu 1500
tun-mtu-extra 32
fragment 1300
mssfix
proto udp
remote 192.168.0.1
@guyhughes
guyhughes / Makefile
Last active November 10, 2015 21:43
makefile for java with run target; now with javadoc
# ___ __ __ ____ ______ _ # < // // / / __ \ / ____/ (_)____ _ _ __ ____ _
# / // // /_ / / / //___ \ / // __ `/| | / // __ `/
# / //__ __// /_/ /____/ / / // /_/ / | |/ // /_/ /
# /_/ /_/ \____//_____/ __/ / \__,_/ |___/ \__,_/
# /___/
# __ ____ _ __
# ____ ___ ____ _ / /__ ___ / __/(_)/ /___
# / __ `__ \ / __ `// //_// _ \ / /_ / // // _ \
# / / / / / // /_/ // ,< / __// __// // // __/
# /_/ /_/ /_/ \__,_//_/|_| \___//_/ /_//_/ \___/
[Unit]
Description=slocker
Before=sleep.target
[Service]
User=gxg
Type=forking
Environment=DISPLAY=:0
ExecStart=/home/gxg/bin/thinklock
[Unit]
Description=Powertop Auto-Tune
[Service]
Type=oneshot
ExecStart=/usr/sbin/powertop --auto-tune
[Install]
WantedBy=multi-user.target
@guyhughes
guyhughes / Makefile
Last active November 30, 2015 00:50
# _
# (_)____ _ _ __ ____ _
# / // __ `/| | / // __ `/
# / // /_/ / | |/ // /_/ /
# __/ / \__,_/ |___/ \__,_/
# /___/
# __ ____ _ __
# ____ ___ ____ _ / /__ ___ / __/(_)/ /___
# / __ `__ \ / __ `// //_// _ \ / /_ / // // _ \
# / / / / / // /_/ // ,< / __// __// // // __/
{
"query":{
"terms": {
"name": ["burger"]
}
}
}
for file in *.json; do
if $(cat $file | json -n); then
printf "\r[OK] $file"
else
echo "[ERROR] $file FAILED"
fi
done