Skip to content

Instantly share code, notes, and snippets.


Jim Montgomery jimmont

View GitHub Profile
antronic /
Last active Oct 4, 2020
iPhone USB Tethering to RPi

iPhone Tethering to Raspberry Pi


On RPi

  • sudo apt-get install usbmuxd
  • connect iPhone

On iPhone

  • Trust

mohakshah /
Last active Aug 17, 2020
Builing ZFS on Raspberry Pi 3 running Rasbpian


This is a tutorial for building and installing the latest release version (0.7.3 as of writing) of "ZFS on Linux" on a Raspberry Pi 3 running Raspbian Stretch. Specifically, we'll be building the dkms version of ZoL, which saves you the hassle of re-compiling the kernel modules after every kernel update. Even though ZoL added support for building dkms packages for debian in version 0.7.3, the build process on a Raspberry Pi 3 is not quite straight-forward. Hopefully, these instructions will make it easier.


  1. Install the build dependencies.
$ sudo apt-get update
$ sudo apt-get install build-essential autoconf libtool gawk alien fakeroot
$ sudo apt-get install dkms zlib1g-dev uuid-dev libattr1-dev libblkid-dev libselinux-dev libudev-dev libssl-dev parted lsscsi wget ksh
ziluvatar / token-generator.js
Last active Jan 10, 2021
Example of refreshing tokens with jwt
View token-generator.js
* Example to refresh tokens using
* It was requested to be introduced at as part of the jsonwebtoken library,
* since we feel it does not add too much value but it will add code to mantain
* we won't include it.
* I create this gist just to help those who want to auto-refresh JWTs.
const jwt = require('jsonwebtoken');
stereokai / index.css
Created Jun 18, 2017
Trigonometry in CSS
View index.css
// # Trigonometry in CSS
// - Through Taylor/Maclaurin polynomial representation:
// - Useful if you don't want to use JS.
// - With CSS Variables.
// - `calc()` can't do power (x ^ y) so I used multiplication instead.
brianherman /
Last active Jun 15, 2018
Debian Jessie and mssql-server

Download mssql from the microsoft website.


dpkg -i mssql-server_14.0.1.246-6_amd64.deb 

The next command will install dependancies.

sudo apt-get -f install 
indrayam /
Last active Dec 16, 2020
Create JWT Token Header Using Unix Command line tools ONLY!


Y = Base64URLEncode(Header) + ‘.’ + Base64URLEncode(Payload)
JWT = Y + ‘.’ + Base64URLEncode(HMACSHA256(Y))

The steps called out here should work on a Mac as well. The only thing that might be different is the sed command used below. Instead of using -E, you will have to use -r to run sed with extended regular expression support

Use data from this tutorial:

jkullick /
Last active Nov 4, 2020
Generate .htpasswd with OpenSSL
printf "$USER:$(openssl passwd -crypt $PASSWORD)\n" >> .htpasswd
sultanqasim /
Created Jun 21, 2016
ZRAM config for Raspberry Pi 3
# Raspberry Pi ZRAM script
# Tuned for quad core, 1 GB RAM models
# put me in /etc/init.d/ and make me executable
# then run "sudo update-rc.d defaults"
modprobe zram
echo 3 >/sys/devices/virtual/block/zram0/max_comp_streams
echo lz4 >/sys/devices/virtual/block/zram0/comp_algorithm
formigarafa /
Last active Mar 15, 2017
Basic to get google dns over https working.
ebidel / mo_vs.proxy.js
Last active Feb 28, 2019
MutationObserver vs. Proxy to detect .textContent changes
View mo_vs.proxy.js
This demo shows two ways to detect changes to a DOM node `.textContent`, one
using a `MutationObserver` and the other using an ES2015 `Proxy`.
From testing, a `Proxy` appears to be 6-8x faster than using a MO in Chrome 50.
**Update**: removing the `Proxy` altogether speeds up the MO to be inline with the Proxy.
This has something to do with how the browser queues/prioritizes Proxies over MO.
You can’t perform that action at this time.