Skip to content

Instantly share code, notes, and snippets.


Jacob Salmela jacobsalmela

Block or report user

Report or block jacobsalmela

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
vertan / ssh_badge
Created Jul 10, 2018
Dynamic Badge depending on environment in iTerm/SSH
View ssh_badge
# Put this in ~/.ssh/config
Host *
LocalCommand echo -e "\033]50;SetProfile=Production\a"
Host *
LocalCommand printf "\033]50;SetProfile=Staging\a\e[0;m"
Host *
PermitLocalCommand yes
# End ~/.ssh/config
immae1 / .var.www.html.pihole.index.js
Last active Jan 28, 2019
This script is to add a random gif into the PIHOLE blockpage
View .var.www.html.pihole.index.js
// on page load, search for & display a random gif matching your search term using the Giphy API and add them to the pihole blockpage
// thanks to the nealrs (github)
// immae1 2017
var x = "Pi-hole: A black hole for Internet advertisements."
document.addEventListener('DOMContentLoaded', function () {
items = ["funny cats","dejay","nerd","beer"]; // tag array
var item = items[Math.floor(Math.random()*items.length)];
foosel /
Last active Oct 21, 2019
Patron Export Helper

Patron Export Helper

Parses CSV Export of patrons from, allows extracting patrons pledging for reward levels provided on command line and rendering them to stdout using a provided jinja2 template file.


Requires unicodecsv, jinja2 and click:

pip install unicodecsv jinja2 click python-dateutil iso3166
sivel /
Last active Dec 18, 2019
Ansible inventory to dynamic inventory JSON output, accepts all inventory input formats
import sys
import json
from ansible.parsing.dataloader import DataLoader
from ansible.inventory.manager import InventoryManager
A24 = True
except ImportError:
from ansible.vars import VariableManager
celly / gist:1591cf9305734812baad
Last active Jan 15, 2020
Personal Deny list for Pi-Hole
View gist:1591cf9305734812baad
# link:
# Add to you /usr/local/bin/ file under sources=
# samsung 'smart tv'
nd-net /
Created Nov 23, 2015
Does an OCR pass over a passed in PDF file and then tries to tag it using fuzzy search
tags = {
"Rechnung": "Rechnung",
"Beleg": "Rechnung"
ocrLanguage = "deu"
verbose = False
import sys, subprocess

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.


Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to:

pudquick /
Last active Jul 30, 2019
Working with SharedFileList (.sfl) files from OSX 10.11 El Capitan in python
from Foundation import NSKeyedUnarchiver
from struct import unpack
# This entire function is black magic of the highest order and I'll blog about it later
def extract_share(bookmark_data):
content_offset, = unpack('I', bookmark_data[12:16])
first_TOC, = unpack('I', bookmark_data[content_offset:content_offset+4])
first_TOC += content_offset
TOC_len, rec_type, level, next_TOC, record_count = unpack('IIIII', bookmark_data[first_TOC:first_TOC+20])
TOC_cursor = first_TOC + 20
# As written, this requires the following:
# - OS X 10.6+ (may not work in 10.10, haven't tested)
# - python 2.6 or 2.7 (for collections.namedtuple usage, should be fine as default python in 10.6 is 2.6)
# - pyObjC (as such, recommended to be used with native OS X python install)
# Only tested and confirmed to work against 10.9.5
# Run with root
somebox /
Last active Jan 15, 2020 — forked from foz/
Set up an OSX machine from zero to awesome. Uses Homebrew (and cask, fonts, etc). Focused on Ruby/Rails development, includes rvm, xquartz, editor fonts, sublime text, and many tools.
# A script to set up a new mac. Uses bash, homebrew, etc.
# Focused for ruby/rails development. Includes many utilities and apps:
# - homebrew, rvm, node
# - quicklook plugins, terminal fonts
# - browsers: chrome, firefox
# - dev: iterm2, sublime text, postgres, chrome devtools, etc.
# - team: slack, dropbox, google drive, skype, etc
You can’t perform that action at this time.