Skip to content

Instantly share code, notes, and snippets.

Kenneth Finnegan PhirePhly

View GitHub Profile
@PhirePhly
PhirePhly / init
Last active Apr 4, 2020
Init script to go in the root of a Debian install for booting entirely from the initrd file
View init
#!/bin/sh
# Kenneth Finnegan, 2020
# https://blog.thelifeofkenneth.com/
# Huge thanks to Gandi.net for most of this code
set -x
set -e
# Create the mount points for all of the virtual file systems which don't
# actually map to disks, but are views into the kernel
View prettypatterns.bas
5 DEF FNA(Z) = 30 * EXP(-Z*Z/100)
100 CLS
105 PRINT:PRINT:PRINT
110 FOR X = -30 TO 30 STEP 1.5
120 L = 0
130 Y1 = 5 * INT(SQR(900-X*X)/5)
140 FOR Y = Y1 TO -Y1 STEP -5
150 Z = INT(25 + FNA(SQR(X*X+Y*Y))-.7*Y)
160 IF Z<=L THEN 190
170 L = Z
@PhirePhly
PhirePhly / dns-catalog-hash.py
Last active Sep 20, 2019
Conf files for BIND catalog files example
View dns-catalog-hash.py
#!/usr/bin/env python3
import dns.name
import hashlib
import sys
print (hashlib.sha1(dns.name.from_text(sys.argv[1]).to_wire()).hexdigest())
@PhirePhly
PhirePhly / etc_default_tayga
Last active Feb 4, 2019
Files for running a NAT64 daemon
View etc_default_tayga
# Defaults for tayga initscript
# sourced by /etc/init.d/tayga
# installed at /etc/default/tayga by the maintainer scripts
# Change this to "yes" to enable tayga
RUN="yes"
# Configure interface and set the routes up
CONFIGURE_IFACE="yes"
@PhirePhly
PhirePhly / bind_irr_demo.sh
Created Jan 16, 2019
A shell script fragment to generate a BIND ACL from an IRR object
View bind_irr_demo.sh
#!/bin/bash
#
# Using IRR and BGPQ3 to auto-generate BIND ACLs
# Kenneth Finnegan, 2019
# The IRR aut-num or as-set to generate the ACL off of
ACL_AS_SET='AS7034:AS-DNS'
(
@PhirePhly
PhirePhly / quads.txt
Last active Jun 26, 2018
PTR records for all the quad octet IP addresses
View quads.txt
kenneth@shell:~$ for I in `seq 1 223`; do host $I.$I.$I.$I | grep -Ev '(^;;|NXDOMAIN|SERVFAIL)'; done
1.1.1.1.in-addr.arpa domain name pointer 1dot1dot1dot1.cloudflare-dns.com.
8.8.8.8.in-addr.arpa domain name pointer google-public-dns-a.google.com.
9.9.9.9.in-addr.arpa domain name pointer dns.quad9.net.
14.14.14.14.in-addr.arpa domain name pointer host14-14-14-14.tvm.ne.jp.
16.16.16.16.in-addr.arpa domain name pointer ldtools.gre.hp.com.
23.23.23.23.in-addr.arpa domain name pointer select.zone.
31.31.31.31.in-addr.arpa domain name pointer 31.31.31.31.dyn.idknet.com.
41.41.41.41.in-addr.arpa domain name pointer host-41.41.41.41.tedata.net.
45.45.45.45.in-addr.arpa domain name pointer modemcable045.45-45-45.mc.videotron.ca.
@PhirePhly
PhirePhly / dedupe.py.diff
Created Apr 2, 2018
Adding caching to dedupe queries for Newgrabber
View dedupe.py.diff
diff --git a/dedupe.py b/dedupe.py
index 26230a6..1e346ff 100644
--- a/dedupe.py
+++ b/dedupe.py
@@ -11,6 +11,10 @@ import warcio
from warcio.archiveiterator import ArchiveIterator
from warcio.warcwriter import WARCWriter
+proxies = {
+ 'http': 'http://127.0.0.1:8080',
View Jessie_Shelfie.tsv
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 3 columns, instead of 2. in line 1.
Designing Distributed Systems Brendan Burns http://amzn.to/2FUZr57
BASIC IBM
Computer Design Development: Principal Papers Earl Swartzlander Jr http://amzn.to/2D27VUX
Compiler Construction Indecipherable
Assembly Language Subroutines for MS-DOS Computers Leo Scanlon http://amzn.to/2FkbPL7
Principles of Compiler Design (Dragon Book) Aho, Ullman http://amzn.to/2FWnwsg
Linear System Theory: The State Space Approach Zadeh, Desoer http://amzn.to/2FW3HBq
The Anatomy of a Compiler Lee http://amzn.to/2G0mtru
Computer Dictionary and Handbook Sippl http://amzn.to/2Fj1iiW
His Life Work Knuth http://amzn.to/2FWTGE5
@PhirePhly
PhirePhly / create_raspbian_mirror.sh
Last active Jan 16, 2018
Mirroring script for Raspbian repos
View create_raspbian_mirror.sh
#!/bin/bash
#
#
## Setting variables with explanations.
# Set root working directory for where you want to store your mirrors
MIRRORBASE=/home/kenneth/mirror
mkdir -p $MIRRORBASE
#
@PhirePhly
PhirePhly / dnsmasq.conf
Created Aug 2, 2017
Config files for Raspberry Pi BlackFlower Server
View dnsmasq.conf
# /etc/dnsmasq.conf
# Specify what the local domain is
local=/eventlan.net/
domain=eventlan.net
# Hardcode the LAN domain to point at the CAD server
address=/eventlan.net/10.44.4.1
# Bind to the wlan0 interface specifically
You can’t perform that action at this time.