This file contains hidden or 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
# Plain OLD | |
iptables -t nat -A PREROUTING -s IP -p udp --dport 53 -j REDIRECT --to-port 5300 | |
ptables -t nat -A PREROUTING -s IP -p tdp --dport 53 -j REDIRECT --to-port 5300 | |
# IP Based DNS Redirection | |
ipset -N restricted nethash | |
iptables -t nat -A PREROUTING -m set --match-set restricted src -p udp --dport 53 -j REDIRECT --to-port 5300 | |
iptables -t nat -A PREROUTING -m set --match-set restricted src -p tcp --dport 53 -j REDIRECT --to-port 5300 | |
ipset -A restricted IP |
This file contains hidden or 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/bash | |
sudo rm /etc/localtime | |
sudo ln -s /usr/share/zoneinfo/US/Central /etc/localtime | |
sudo rm /etc/timezone | |
echo "US/Central" | sudo tee /etc/timezone |
This file contains hidden or 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 > /etc/pihole/local.list | |
chown root:root /etc/pihole/local.list | |
pihole restartdns |
This file contains hidden or 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/bash | |
# CloudFlare as Dynamic DNS | |
# From: https://letswp.io/cloudflare-as-dynamic-dns-raspberry-pi/ | |
# Based on: https://gist.github.com/benkulbertis/fff10759c2391b6618dd/ | |
# Original non-RPi article: https://phillymesh.net/2016/02/23/setting-up-dynamic-dns-for-your-registered-domain-through-cloudflare/ | |
# Update these with real values | |
auth_email="[email protected]" | |
auth_key="global_api_key_goes_here" | |
zone_name="example.com" |
This file contains hidden or 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 | |
### BEGIN INIT INFO | |
# Provides: pfclient | |
# Required-Start: $local_fs $remote_fs $network $time $syslog | |
# Required-Stop: $local_fs $remote_fs $network $time $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: planefinder.net ads-b decoder | |
# Description: pfclient decodes ADS-B data and shares to planefinder.net | |
### END INIT INFO |
This file contains hidden or 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
// keepDoingSomething will keep trying to doSomething() until either | |
// we get a result from doSomething() or the timeout expires | |
func keepDoingSomething() (bool, error) { | |
timeout := time.After(5 * time.Second) | |
tick := time.Tick(500 * time.Millisecond) | |
// Keep trying until we're timed out or got a result or got an error | |
for { | |
select { | |
// Got a timeout! fail with a timeout error | |
case <-timeout: |
NewerOlder