Skip to content

Instantly share code, notes, and snippets.

Jim Montgomery jimmont

Block or report user

Report or block jimmont

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mohakshah
mohakshah / Instructions.md
Last active Jan 24, 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 Feb 4, 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 Feb 19, 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 Oct 19, 2017
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) {
@paulmillr
paulmillr / dropkick.sh
Created Dec 22, 2015
Turn off spy cams in airbnb rentals
View dropkick.sh
#!/bin/bash
#
# DROPKICK.SH
#
# Detect and Disconnect the DropCam and Withings devices some people are using to
# spy on guests in their home, especially in AirBnB rentals. Based on Glasshole.sh:
#
# http://julianoliver.com/output/log_2014-05-30_20-52
#
# This script was named by Adam Harvey (http://ahprojects.com), who also
You can’t perform that action at this time.