Skip to content

Instantly share code, notes, and snippets.

View n8henrie's full-sized avatar

Nathan Henrie n8henrie

View GitHub Profile
@n8henrie
n8henrie / .gitignore
Last active October 6, 2023 18:32
Download and install Golang for Raspberry Pi
go*.linux-armv6l.tar.gz
@n8henrie
n8henrie / strip_whitespace.applescript
Created July 7, 2016 19:32
Quicksilver Action to strip leading and trailing whitespace
property test_block_text : "
this and
that and
asdf
"
on process_text(block_text)
-- AppleScript and Quicksilver are using code "e2 80 a8" as linebreak for some reason
-- inspect by piping to `hexdump -C` and viewing with `echo -e`
set perl to "/usr/bin/perl -0777 -pe 's#(^[[:space:]\\xe2\\x80\\xa8]*)|([[:space:]\\xe2\\x80\\xa8])*$##g' <<<"
@n8henrie
n8henrie / sd_shrink.sh
Last active May 25, 2021 20:40 — forked from Pesticles/gist:d16ad533a09927362a80
SD Card image shrinker
#!/bin/bash
######################################################
# sd_shrink.sh
# Usage: sudo bash sd_shrink.sh /dev/DEVICE FILENAME
# Backs up and shrinks DEVICE to FILENAME_YYYYmmdd.img
######################################################
set -euf -o pipefail
@n8henrie
n8henrie / inputrc
Created April 24, 2016 21:44
My basic inputrc for incremental search
"\e[A": history-search-backward
"\e[B": history-search-forward
set show-all-if-ambiguous on
set completion-ignore-case on
$include /etc/inputrc
@n8henrie
n8henrie / crashplan.service
Created March 28, 2016 19:19
CrashPlan systemd service file for Raspbian Jessie
# /etc/systemd/system/crashplan.service
[Unit]
Description=CrashPlan
After=network-online.target
Wants=network-online.target
[Service]
Type=forking
PIDFile=/usr/local/crashplan/CrashPlanEngine.pid
EnvironmentFile=/usr/local/crashplan/bin/run.conf
@n8henrie
n8henrie / crashplan_setup.sh
Last active March 15, 2024 21:36
Set up CrashPlan on Raspberry Pi (Raspbian Jessie)
#!/bin/bash
#############
# n8henrie's Raspberry Pi CrashPlan installer script
# v0.1.0 :: 20160530
#############
set -e
CP_VERSION="4.8.0"
@n8henrie
n8henrie / alexa-skills-kit-color-expert-python.py
Created March 23, 2016 03:20
Amazon's example Alexa Skills lambda function
"""
This sample demonstrates a simple skill built with the Amazon Alexa Skills Kit.
The Intent Schema, Custom Slots, and Sample Utterances for this skill, as well
as testing instructions are located at http://amzn.to/1LzFrj6
For additional samples, visit the Alexa Skills Kit Getting Started guide at
http://amzn.to/1LGWsLG
"""
from __future__ import print_function
@n8henrie
n8henrie / dbox_sync.py
Last active November 14, 2021 14:44
One-way sync of local directory to Dropbox using Dropbox API V2 and python3.
"""dbox_sync.py
One-way sync of local directory to Dropbox using Dropbox API V2 and python3.
Dependencies:
- dropbox (`pip3 install dropbox`)
Minimal modifications from:
https://github.com/dropbox/dropbox-sdk-python/blob/master/example/updown.py
@n8henrie
n8henrie / folder_action_template.applescript
Last active May 15, 2020 16:40
Template for Folder Actions to allow easy interactive testing in Script Editor, should work seamlessly once activated as Folder Actions.
-- http://n8henrie.com/2016/02/template-for-more-efficient-applescript-folder-actions/
property test_folder : "/path/to/action/folder"
property test_file : "/path/to/action/folder/file.txt"
on main(this_folder, these_items)
tell application "Finder"
-- Uncomment below 2 lines to run on *every* file in the folder when this script runs
-- set list_of_files to every item in this_folder
@n8henrie
n8henrie / .gitignore
Last active May 28, 2021 03:13
Script to clone or pull all of my gists, public and private, to a specified directory
.mypy_cache/