Skip to content

Instantly share code, notes, and snippets.

:atom:
Thinking

Jacob Salmela jacobsalmela

:atom:
Thinking
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
vertan / ssh_badge
Created Jul 10, 2018
Dynamic Badge depending on environment in iTerm/SSH
View ssh_badge
# Put this in ~/.ssh/config
Host *.production.host.net
LocalCommand echo -e "\033]50;SetProfile=Production\a"
Host *.staging.host.net
LocalCommand printf "\033]50;SetProfile=Staging\a\e[0;m"
Host *
PermitLocalCommand yes
# End ~/.ssh/config
@immae1
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
foosel / README.md
Last active Oct 21, 2019
Patron Export Helper
View README.md

Patron Export Helper

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

Setup

Requires unicodecsv, jinja2 and click:

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

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.

Requirements

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
pudquick / recentServersSFL.py
Last active Jul 30, 2019
Working with SharedFileList (.sfl) files from OSX 10.11 El Capitan in python
View recentServersSFL.py
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
View reorder_wifi_alt.py
#!/usr/bin/python
# 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
somebox / osx-setup.sh
Last active Jan 15, 2020 — forked from foz/osx-setup.sh.md
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.
View osx-setup.sh
#!/bin/bash
# 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.