Skip to content

Instantly share code, notes, and snippets.

Avatar

Jim Montgomery jimmont

View GitHub Profile
@antronic
antronic / iphone-usb_tethering-to-rpi.md
Last active Oct 4, 2020
iPhone USB Tethering to RPi
View iphone-usb_tethering-to-rpi.md

iPhone Tethering to Raspberry Pi

Instruction

On RPi

  • sudo apt-get install usbmuxd
  • connect iPhone

On iPhone

  • Trust

@mohakshah
mohakshah / Instructions.md
Last active Aug 17, 2020
Builing ZFS on Raspberry Pi 3 running Rasbpian
View Instructions.md

Introduction

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.

Steps

  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
ziluvatar / token-generator.js
Last active Nov 13, 2020
Example of refreshing tokens with jwt
View token-generator.js
/**
* Example to refresh tokens using https://github.com/auth0/node-jsonwebtoken
* 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');
@brianherman
brianherman / jessie-mssql.md
Last active Jun 15, 2018
Debian Jessie and mssql-server
View jessie-mssql.md

Download mssql from the microsoft website.

wget https://packages.microsoft.com/ubuntu/16.04/mssql-server/pool/main/m/mssql-server/mssql-server_14.0.1.246-6_amd64.deb

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

The next command will install dependancies.

sudo apt-get -f install 
@indrayam
indrayam / create-jwt-using-unix-commands-on-mac.md
Last active Nov 17, 2020
Create JWT Token Header Using Unix Command line tools ONLY!
View create-jwt-using-unix-commands-on-mac.md

Pseudocode:

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:

scotch.io

@jkullick
jkullick / openssl-generate-htpasswd.md
Last active Nov 4, 2020
Generate .htpasswd with OpenSSL
View openssl-generate-htpasswd.md
printf "$USER:$(openssl passwd -crypt $PASSWORD)\n" >> .htpasswd
@sultanqasim
sultanqasim / zram.sh
Created Jun 21, 2016
ZRAM config for Raspberry Pi 3
View zram.sh
#!/bin/bash
# Raspberry Pi ZRAM script
# Tuned for quad core, 1 GB RAM models
# put me in /etc/init.d/zram.sh and make me executable
# then run "sudo update-rc.d zram.sh defaults"
modprobe zram
echo 3 >/sys/devices/virtual/block/zram0/max_comp_streams
echo lz4 >/sys/devices/virtual/block/zram0/comp_algorithm
@formigarafa
formigarafa / Google-DNS-over-HTTPS.md
Last active Mar 15, 2017
Basic to get google dns over https working.
View Google-DNS-over-HTTPS.md
@ebidel
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.
@spiralx
spiralx / computed-property.js
Created Jan 26, 2016
Use ES6 Proxy to attach computed properties
View computed-property.js
'use strict';
const VALUE = Symbol.for('value')
function addComputedProperty(obj, name, func) {
let _computed = func(obj)
return new Proxy(obj, {
get(target, key, receiver) {
if (key === name) {
You can’t perform that action at this time.