-- listen for console connection with the given secret key
-- controlSocket("0.0.0.0")
-- setKey(please generate a fresh private key with makeKey())
-- start the web server on port 8083, using password 'set a random password here'
-- webserver("0.0.0.0:8083", "set a random password here")
-- accept DNS queries on UDP/5200 and TCP/5200
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
| package main | |
| import ( | |
| "crypto/md5" | |
| "fmt" | |
| "io" | |
| "net/http" | |
| "os" | |
| "strconv" | |
| "text/template" |
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
| // curl -X POST -H "Content-Type: application/octet-stream" --data-binary '@filename' http://127.0.0.1:5050/upload | |
| package main | |
| import ( | |
| "fmt" | |
| "io" | |
| "net/http" | |
| "os" | |
| "time" |
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
| package main | |
| import ( | |
| "fmt" | |
| "io/ioutil" | |
| "os" | |
| "path/filepath" | |
| "strings" | |
| ) |
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
| # The general procedure here is adapted from the 7->8 guide here. https://www.tecmint.com/upgrade-centos-7-to-centos-8/ | |
| # | |
| # It is a curated list of my bash history. I entered other commands so hopefully I got the right ones here. | |
| yum upgrade | |
| reboot | |
| dnf install epel-release | |
| dnf install rpmconf | |
| dnf install yum-utils | |
| rpmconf -a # answer "n" to both things |
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
| # https://serverfault.com/questions/545441/nginx-geo-location-module-configuration-using-geo-database | |
| # http://nginx.org/en/docs/http/ngx_http_geo_module.html#directives | |
| # https://www.howtoforge.com/nginx-how-to-block-visitors-by-country-with-the-geoip-module-debian-ubuntu | |
| # https://dev.maxmind.com/geoip/legacy/geolite/ | |
| geoip_country /usr/share/GeoIP/GeoIP.dat; | |
| map $geoip_country_code $backend { | |
| default US; | |
| US US; | |
| CN DE; |
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
| require 'math' | |
| math.randomseed(os.time()) | |
| dns_providers = { | |
| { -- Quad9 | |
| {'9.9.9.9', hostname='dns.quad9.net', ca_file='/usr/local/etc/kresd/DigiCertECCSecureServerCA.pem'}, | |
| {'149.112.112.112', hostname='dns.quad9.net', ca_file='/usr/local/etc/kresd/DigiCertECCSecureServerCA.pem'} | |
| }, | |
| { -- Cloudflare | |
| {'1.1.1.1', hostname='cloudflare-dns.com', ca_file='/usr/local/etc/kresd/DigiCertECCSecureServerCA.pem'}, |
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
| events {} | |
| http { | |
| server { | |
| listen 8080; | |
| server_name a.com; | |
| location / { | |
| proxy_pass http://127.0.0.1:8888; | |
| } |
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
| -- Refer to manual: https://knot-resolver.readthedocs.io/en/latest/daemon.html#configuration | |
| -- Listen on all interfaces (localhost would not work in Docker) | |
| net.listen('0.0.0.0') | |
| net.listen('0.0.0.0', 853, {tls=true}) | |
| -- Auto-maintain root TA | |
| trust_anchors.file = '/data/root.keys' | |
| -- Load Useful modules |
https://software.opensuse.org//download.html?project=home%3ACZ-NIC%3Aknot-resolver-latest&package=knot-resolver