Skip to content

Instantly share code, notes, and snippets.

@bign8
bign8 / mysql2sqlite.sh
Last active December 13, 2022 09:30 — forked from esperlu/mysql2sqlite.sh
Combining many of the forks to build a simple script that works
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is chosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
@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 / .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 April 1, 2018 12:35 — forked from ncr/README
jQuery plugin to allow single and double click handlers on an element

Code

$("button").single_double_click(function () {
  alert("Try double-clicking me!")
}, function () {
  alert("Double click detected, I'm hiding")
  $(this).hide()
})
@bign8
bign8 / .gitignore
Last active February 20, 2018 20:28
CSCI-540: Chapter 8: C code
*.so
*.o
Rplots.pdf
@bign8
bign8 / .gitignore
Last active February 12, 2017 01:59
CSCI-566 Project 1
out
*_m.*
.*
!.gitignore
CSCI_566_proj_1
results
@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 / 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) {