Skip to content

Instantly share code, notes, and snippets.

lukechilds /
Created Aug 9, 2016
Shell - Get latest release from GitHub
get_latest_release() {
curl --silent "$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
# Usage
# $ get_latest_release "creationix/nvm"
# v0.31.4
aolkin /
Last active Aug 16, 2020
Quick library to read from the MLX90614 with python on a Raspberry Pi, using the Adafruit_I2C library

Note that the following code must be run at every boot for this to work, because of the repeated-start requirement:

sudo su -c 'echo "Y" > /sys/module/i2c_bcm2708/parameters/combined'

miek / GSG case
Last active May 29, 2022
Unofficial case for YARD Stick One and Ubertooth One from Great Scott Gadgets -
View debian-wvdial-ppp0-interface-autossh.markdown

Reverse proxy over 3G modem (draft)

We will explain how to configure a cubieboard running debian as a reverese proxy. The modules that will be used are wvdial and autossh

Credits goes to:

bmaupin / gist:1b59abbf30406ed1eb82
Last active Apr 2, 2021
Parse installed packages from /var/log/apt/history.log
View gist:1b59abbf30406ed1eb82
import re
history_snippet = '''Start-Date: 2014-08-25 12:52:37
Commandline: apt-get install -y openjdk-6-jdk openjdk-7-jdk icedtea-7-plugin
Install: openjdk-6-jre-lib:amd64 (6b32-1.13.4-4ubuntu0.14.04.1, automatic), icedtea-netx-common:amd64 (1.5-1ubuntu1, automatic), openjdk-6-jdk:amd64 (6b32-1.13.4-4ubuntu0.14.04.1), libxcb1-dev:amd64 (1.10-2ubuntu1, automatic), ttf-dejavu-extra:amd64 (2.34-1ubuntu1, automatic), icedtea-6-jre-cacao:amd64 (6b32-1.13.4-4ubuntu0.14.04.1, automatic), icedtea-7-plugin:amd64 (1.5-1ubuntu1), libxau-dev:amd64 (1.0.8-1, automatic), openjdk-6-jre-headless:amd64 (6b32-1.13.4-4ubuntu0.14.04.1, automatic), x11proto-core-dev:amd64 (7.0.24-1, automatic), libxt-dev:amd64 (1.1.4-1, automatic), openjdk-7-jdk:amd64 (7u65-2.5.1-4ubuntu1~, libx11-dev:amd64 (1.6.2-1ubuntu2, automatic), x11proto-kb-dev:amd64 (1.0.6-2, automatic), openjdk-6-jre:amd64 (6b32-1.13.4-4ubuntu0.14.04.1, automatic), xtrans-dev:amd64 (1.3.2-1, automatic), libxdmcp-dev:amd64 (1.1.1-1, automatic), icedtea-netx:a
m14t /
Created Jul 5, 2012
Convert HTTPS github clones to use SSH
#-- Script to automate
REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'`
if [ -z "$REPO_URL" ]; then
echo "-- ERROR: Could not identify Repo url."
echo " It is possible this repo is already using SSH instead of HTTPS."