Skip to content

Instantly share code, notes, and snippets.

Working from home

David Norman deekayen

Working from home
View GitHub Profile
SCRIPT=$(basename "$0")
exitWithError () {
echo -e "$1" 1>&2
exit 1
usage () {
mutin-sa /
Last active Feb 20, 2021
List of Top Public Time Servers

Google Public NTP [AS15169]:

krider2010 / .profile
Last active Nov 29, 2017
Git Signed Commits - OSX and GUIs
View .profile
# This would go into .bash_profile, .bashrc, .zshrc, etc.
# Script to start the gpg-agent - in it's own file as it is also used when the machine starts up
# Be sure to update the path to wherever you place this file!
# Note, depending on shell you may not need this line enabling, if the global daemon is already running
# OK. Some shells complain, others don't!
if [ -f "${HOME}/.gpg-agent-info" ]; then
jacobsalmela /
Created Mar 7, 2016
Displays a dialog with three checksums to prevent the installation of malware
osascript <<EOT
display dialog "MD5:
$(openssl md5 $1 | awk '{print $2}')
$(openssl sha1 $1 | awk '{print $2}')
$(openssl dgst -sha256 $1 | awk '{print $2}')" with title "$(basename $1)" with icon Caution
shionryuu /
Created Feb 21, 2016
pull all git repositories in a directory
# pull all git repositories in a directory
pull_repo() {
echo "pulling $1 ..."
if git pull; then # >/dev/null 2>&1
echo -e "pulling $1 succeed\n"
echo -e "pulling $1 failed\n"

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:

anonymous / trim_drupal_node_revisions.sql
Created Oct 3, 2014
Delete revisions from the Drupal 7 node_revisions table such that only the newest 3 revisions remain for each node. It joins on the node table to make sure that the current, active vid assigned in the node table doesn't get deleted.
View trim_drupal_node_revisions.sql
DELETE FROM node_revisions WHERE vid IN (
SELECT subquery.vid FROM (
SELECT @row_num := IF(@prev_value=nr.nid,@row_num+1,1) AS RowNumber
,@prev_value := nr.nid
FROM node_revisions nr,
(SELECT @row_num := 1) x,
(SELECT @prev_value := '') y
nocturnalgeek / MailinatorAliases
Last active Feb 19, 2021
A list of alternate domains that point to
View MailinatorAliases
garlandkr /
Last active May 19, 2020
Clean-up an Amazon EC2 instance before creating an AMI
# Run this script with:
# bash <(curl -s
function print_green {
echo -e "\e[32m${1}\e[0m"
print_green 'Clean Yum'
View CrashPlan Pause-Resume.scpt
set isCrashPlanRunning to false
set pid to do shell script ¬
"sudo launchctl list | grep com.crashplan.engine" user name "username" password ¬
"password" with administrator privileges
set isCrashPlanRunning to true
end try
if isCrashPlanRunning then
log "CrashPlan is already running: " & pid