ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update
#!/usr/bin/env sh | |
## update.sh - manage a OpenWRT LetsEncrypt https instalation | |
# HOWTO: | |
# - put update.sh in its own directory (like /root/.https) | |
# - run ./update.sh your.domain.com (that domain needs to point to your router) | |
# * this get an issued cert from letsencrypt.org using the webroot verification method | |
# * also installs curl and ca-certificates packages | |
# - use crontab -e; add the line `0 0 * * * "/root/.https/update.sh" >>/root/.https/log.txt 2>&` | |
# * this runs the update every day, logging everything to log.txt | |
# |
Others have recently developed packages for this same functionality, and done it better than anything I could do. Use the packages instead of this script:
Gargoyle package by @lantis1008
OpenWRT package by @dibdot
In its basic usage, this script will modify the router such that blocked addresses are null routed and unreachable. Since the address blocklist is full of advertising, malware, and tracking servers, this setup is generally a good thing. In addition, the router will update the blocklist weekly. However, the blocking is leaky, so do not expect everything to be blocked.
/** | |
Usage: Just include this script after Marionette and Handlebars loading | |
IF you use require.js add script to shim and describe it in the requirements | |
*/ | |
(function(Handlebars, Marionette) { | |
Marionette.Handlebars = { | |
path: 'templates/', | |
extension: '.handlebars' | |
}; |
#!/usr/bin/python | |
''' Not my script, found on the Internet, and rediscovered on my hard drive | |
''' | |
import sys | |
def cidr_to_regex(cidr): | |
ip, prefix = cidr.split('/') | |
base = 0 | |
for val in map(int, ip.split('.')): |
curl --user-agent "Googlebot/2.1 (+http://www.google.com/bot.html)" -v $@ | |
# enable | |
sudo ipfw pipe 1 config bw 50KBytes/s delay 100ms | |
sudo ipfw add 1 pipe 1 src-port 80 | |
sudo ipfw add 2 pipe 1 dst-port 80 | |
# disable | |
sudo ipfw delete 1 | |
sudo ipfw delete 2 |