Skip to content

Instantly share code, notes, and snippets.

@bign8
bign8 / .Countdown.md
Last active July 28, 2021 01:50
Countdown helper utilities

Countdown

A british TV series about leters and number problems.

Use ./nums to help with the numbers rounds, and ./words for everything else.

@bign8
bign8 / fakegps
Last active November 3, 2020 21:20
I have an OLD GPS receiver, and need to force it past the last gps 10 bit week rollover
#!/usr/bin/env python3
# /opt/fakegps
"""
TL;DR: I have an OLD GPS receiver, and need to force it past the last gps 10 bit week rollover
TEST OUTPUT SITE: http://freenmea.net/decoder
WHY THIS IS A PROBLEM: https://gpsd.gitlab.io/gpsd/hacking.html#y2k1
INFO: https://github.com/rnorris/gpsd/blob/master/www/gpsd-time-service-howto.txt
MAN PAGE: http://manpages.ubuntu.com/manpages/trusty/man8/gpsd.8.html
# Uninstall un-needed packages
sudo apt remove \
pi-bluetooth \ # cmon...
ed \ # worst text editor ever
nano \ # nvm, found a worse one
# ... more to come
sudo raspi-config
# localization: en_us.UTF8 UTF8
# timezone: America / Winnipeg (CENTRAL TIME... yeah ... idk geography)
@bign8
bign8 / README.md
Last active February 22, 2022 22:46
FreeBSD Jail Permanent Port Forwarding

FreeBSD Jail Permanent Port Forwarding

Configures jail to forward external ports to a different loopback port within a given jail.

vi /etc/ipfw.rules       # Add ipfw.rules from gist
chmod +x /etc/ipfw.rules # Enable script execution
crontab -e               # Add crontab.conf from gist
@bign8
bign8 / 0_reuse_code.js
Created February 11, 2017 15:41
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@bign8
bign8 / .gitignore
Last active February 12, 2017 01:59
CSCI-566 Project 1
out
*_m.*
.*
!.gitignore
CSCI_566_proj_1
results
@bign8
bign8 / index.js
Created January 25, 2017 06:52
Python output streaming
console.log('running');
var child = require('child_process').spawn('python', ['./index.py']);
child.stdout.on('data', function(data) {
console.log('stdout: "' + data.toString().trim() + '"');
});
child.stderr.on('data', function(data) {
console.log('stderr: ' + data);
});
child.on('close', function(code) {
@bign8
bign8 / state.go
Created October 4, 2016 00:10
ESOF-322 State Pattern Notes
package main
import (
"bufio"
"flag"
"fmt"
"math/rand"
"os"
)
package example
type trie map[string]*trie
func (t *trie) Add(parts []string) {
if len(parts) == 0 {
return
}
child, ok := (*t)[parts[0]]
if !ok {
package main
import (
"encoding/json"
"flag"
"fmt"
"net/http"
"os"
)