Skip to content

Instantly share code, notes, and snippets.

Avatar

Frederick Ding frederickding

View GitHub Profile
@frederickding
frederickding / traefik
Created Jul 10, 2021
Basic openrc init file for traefik (/etc/init.d/traefik)
View traefik
#!/sbin/openrc-run
LOG_FILE=/var/log/traefik.log
name="traefik"
command="/usr/local/bin/traefik"
command_args=" --log"
pidfile="/run/${RC_SVCNAME}.pid"
output_log=${LOG_FILE}
error_log=${LOG_FILE}
@frederickding
frederickding / ibi-lite.txt
Created Dec 10, 2020 — forked from alanhuang122/ibi-lite.txt
Sample IBI Lite barcode translation
View ibi-lite.txt
Sourced from https://patents.google.com/patent/US7882036B1
Field # Length Offset Name
1 1 0 Indicia Version Number
2 4 1 Piece Counter
3 1 5 IBI Vendor/Model
4 3 6 PSD Serial Number
5 3 9 Postage Value (in 1/10s of a cent)
6 2 12 Intelligent Mail Service
7 6 14 HMAC Message Digest
View gpg2-vmimage.sh
#!/bin/bash
## Usage: gpg2-vmimage.sh FILENAME
##
## FILENAME can be:
## - a tar archive (in which case this script will apply zstd
## compression before encrypting & signing with GnuPG)
## - an already-compressed OVA file (in which case this script
## will not further compress)
##
## The output will be a .zstd.gpg or .gpg of the input file and
View local-storage-debug-script.js
Object.defineProperty(window, 'localStorage', {
configurable: true,
enumerable: true,
value: new Proxy(localStorage, {
set: function (ls, prop, value) {
console.log(`direct assignment: ${prop} = ${value}`);
debugger;
ls[prop] = value;
return true;
},
View gist:db61dca30ec022be5caa9454f7e520f9
system type : UBNT_E300
machine : Unknown
processor : 0
cpu model : Cavium Octeon III V0.2 FPU V0.0
BogoMIPS : 2000.00
wait instruction : yes
microsecond timers : yes
tlb_entries : 256
extra interrupt vector : yes
hardware watchpoint : yes, count: 2, address/irw mask: [0x0ffc, 0x0ffb]
@frederickding
frederickding / .bashrc
Created Jul 18, 2018
Share a ssh-agent between WSL bash instances, but kill it when the last instance closes
View .bashrc
# add to .bashrc
# Set up ssh-agent
SSH_ENV="$HOME/.ssh/environment"
function start_ssh_agent {
echo "Initializing new SSH agent..."
touch $SSH_ENV
chmod 600 "${SSH_ENV}"
/usr/bin/ssh-agent | sed 's/^echo/#echo/' >> "${SSH_ENV}"
View handbrake-20180514.log
HandBrake Nightly 20180507165526-801d3ed (2018050701) - 64bit
OS: Microsoft Windows NT 10.0.17666.0 - 64bit
CPU: Intel(R) Xeon(R) CPU E3-1245 v6 @ 3.70GHz
Ram: 16271 MB,
GPU Information:
Intel(R) HD Graphics P630 - 23.20.16.4973
Screen: 3840x2160
Temp Dir: C:\Users\Frederick\AppData\Local\Temp\
Install Dir: C:\Program Files\HandBrake Nightly
Data Dir: C:\Users\Frederick\AppData\Roaming\HandBrake Team\HandBrake\1.2.0.0
View qemu-dm-wrapper.e1000.patch
--- qemu-dm-wrapper.bak 2014-07-18 16:49:42.000000000 -0400
+++ qemu-dm-wrapper 2014-07-18 20:38:46.000000000 -0400
@@ -97,6 +97,11 @@
write_dm_pid(domid, os.getpid())
os.dup2(1, 2)
+
+ for i in range(len(qemu_args)):
+ if qemu_args[i].find('macaddr=') > 0:
+ qemu_args[i] = qemu_args[i].replace('rtl8139', 'e1000')
@frederickding
frederickding / gist:8d0c9e892160f07dbe03
Created Dec 5, 2014
MAJOR PENNNET OUTAGE 2014-12-04T19:22:05-05:00
View gist:8d0c9e892160f07dbe03
Date: Thursday, December 4, 2014 EST
Start time: 4:00 pm
Duration: Unknown
Building(s) Affected: Entire Campus
Service(s) Affected: ALL
View keybase.md

Keybase proof

I hereby claim:

  • I am frederickding on github.
  • I am frederickding (https://keybase.io/frederickding) on keybase.
  • I have a public key whose fingerprint is 9347 E154 320F 7CA0 6682 2EBC 1EEB BDF4 31D5 1E20

To claim this, I am signing this object: