Skip to content

Instantly share code, notes, and snippets.

View PhirePhly's full-sized avatar

Kenneth Finnegan PhirePhly

View GitHub Profile
@PhirePhly
PhirePhly / gist:4b14480280ea7fcd3b69084f1ef8398d
Created April 1, 2023 03:49
Diff between original Twitter the-algorithm repo and what they force pushed later that afternoon
[kenneth@kwflap2 twitter]$ diff -U 3 -r the-algorithm-pre/ the-algorithm-post/
diff -U 3 -r the-algorithm-pre/follow-recommendations-service/server/src/main/scala/com/twitter/follow_recommendations/services/FollowRecommendationsServiceWarmupHandler.scala the-algorithm-post/follow-recommendations-service/server/src/main/scala/com/twitter/follow_recommendations/services/FollowRecommendationsServiceWarmupHandler.scala
--- the-algorithm-pre/follow-recommendations-service/server/src/main/scala/com/twitter/follow_recommendations/services/FollowRecommendationsServiceWarmupHandler.scala 2023-03-31 20:48:32.453704411 -0700
+++ the-algorithm-post/follow-recommendations-service/server/src/main/scala/com/twitter/follow_recommendations/services/FollowRecommendationsServiceWarmupHandler.scala 2023-03-31 20:47:59.307705724 -0700
@@ -24,10 +24,6 @@
extends Handler
with Logging {
- /**
- * this would need to be added to src/main/resources/client_whitelist.yml
@PhirePhly
PhirePhly / Notes.txt
Created May 26, 2022 18:23
Script to check x86-64 instruction set level for EL9 support
https://developers.redhat.com/blog/2021/01/05/building-red-hat-enterprise-linux-9-for-the-x86-64-v2-microarchitecture-level
// Kenneth Finnegan, 2021
//
// Atmega328P on breadboard with 8MHz crystal. Use the mini pro 3.3V 8MHz board
//
// Pin 11 is the LED output
// Digital Pins 2-5 are DIP switch for time config on boot
// Reset button restarts the timer
// Using https://github.com/LowPowerLab/LowPower
#include <LowPower.h>
@PhirePhly
PhirePhly / init
Last active December 21, 2020 02:51
Init script to go in the root of a Debian install for booting entirely from the initrd file
#!/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
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 September 20, 2019 03:45
Conf files for BIND catalog files example
#!/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 February 4, 2019 06:38
Files for running a NAT64 daemon
# 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 January 16, 2019 05:56
A shell script fragment to generate a BIND ACL from an IRR object
#!/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 June 26, 2018 05:05
PTR records for all the quad octet IP addresses
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 April 2, 2018 01:02
Adding caching to dedupe queries for Newgrabber
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',