Skip to content

Instantly share code, notes, and snippets.

View thirtythreeforty's full-sized avatar

George Hilliard thirtythreeforty

View GitHub Profile
@thirtythreeforty
thirtythreeforty / CouponScrapper
Created June 27, 2016 02:35 — forked from mxrss/CouponScrapper
Uses powershell to scrape website content for coupon sites using their json api's.
# this grabs offers from stater bros.com
$coupons = $null
$json = Invoke-WebRequest -Uri "http://coupons.staterbros.com/Coupons/Index?pageSize=600&currentPage=1&filter=0&sort=1&couponType=4&brandName=AllBrands&_=1383513834477" | select-object -Property Content
$StaterBriosrawObj = ConvertFrom-Json $json.Content
$StaterBriosrawObj.CouponsGrid | Group-Object { $_.Name } | Sort-Object -Descending Count
$staterCoupons = $StaterBriosrawObj.CouponsGrid
$coupons += $staterCoupons | Select-Object @{Name="Brand"; Expression={ $_.Name.tolower() -replace "[^A-Za-z0-9_.\$@ ]","" }}, #-replace [char]174, '' -replace [char]8482, '' } },
@{Name="Category";Expression={ "N/A"}},
@thirtythreeforty
thirtythreeforty / gist:09b92c5a3a6811841932eeecbf0dd6df
Last active August 17, 2018 19:18
OpenWRT imagebuilder commands for my customized firmware
# Tiny imagebuilder required as of OpenWRT 18.06. Sub tl-wr841-v9 as needed:
make image PROFILE='tl-wr841-v11' PACKAGES=' \
luci \
luci-app-ddns libustream-mbedtls \
luci-app-wireguard luci-proto-wireguard \
-luci-proto-ppp -ppp -ppp-mod-pppoe \
-opkg \
'
make image PROFILE='archer-c7-v2' PACKAGES=' \
@thirtythreeforty
thirtythreeforty / gist:9f0b2bebd9ab129af719f7c4f065857d
Last active October 23, 2017 23:24
zfs 0.7 feature flags for 0.6-compatible pool
zpool create [...] \
-o feature@extensible_dataset=disabled \
-o feature@userobj_accounting=disabled \
-o feature@large_dnode=disabled \
-o feature@sha512=disabled \
-o feature@skein=disabled \
-o feature@edonr=disabled \
-o feature@multi_vdev_crash_dump=disabled
@thirtythreeforty
thirtythreeforty / deadlock.patch
Created August 5, 2014 20:43
stun_sock.c patch to fix callback deadlock
Index: pjnath/src/pjnath/stun_sock.c
===================================================================
--- pjnath/src/pjnath/stun_sock.c (revision 424)
+++ pjnath/src/pjnath/stun_sock.c (working copy)
@@ -317,7 +317,10 @@
pj_activesock_cfg_default(&activesock_cfg);
activesock_cfg.grp_lock = stun_sock->grp_lock;
activesock_cfg.async_cnt = cfg->async_cnt;
- activesock_cfg.concurrency = 0;
+ // this was set to 0 and whole_data was true, causing it to disallow concurrency. This change was made in bugfix #460.
@thirtythreeforty
thirtythreeforty / deadlock.patch
Created June 26, 2014 18:28
Patch to icedemo.c that causes PJLIB to deadlock
diff --git a/pjsip-apps/src/samples/icedemo.c b/pjsip-apps/src/samples/icedemo.c
index 8dbba21..ed6fba9 100644
--- a/pjsip-apps/src/samples/icedemo.c
+++ b/pjsip-apps/src/samples/icedemo.c
@@ -72,6 +72,8 @@ static struct app_t
} icedemo;
+pj_mutex_t *application_mutex;
+
@thirtythreeforty
thirtythreeforty / tcphole.py
Last active August 29, 2015 14:00
A TCP hole puncher
#!/usr/bin/python3
# tcphole.py
# By George Hilliard ("thirtythreeforty")
# A simple TCP hole puncher for a firewall accepting only ESTABLISHED,RELATED packets
# This currently binds to the localhost address, although that's easy to fix by changing
# the bind() calls.
# This is based on the theory found at http://www.bford.info/pub/net/p2pnat/index.html#sec-tcp.
# You may use this software under the terms of the Creative Commons CC-0 license.