Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

David Norman deekayen

🏠
Working from home
View GitHub Profile
View saml2awsmget.sh
#!/bin/bash
SCRIPT=$(basename "$0")
exitWithError () {
echo -e "$1" 1>&2
exit 1
}
usage () {
@mutin-sa
mutin-sa / Public_Time_Servers.md
Last active Feb 20, 2021
List of Top Public Time Servers
View Public_Time_Servers.md

Google Public NTP [AS15169]:

time.google.com

time1.google.com

time2.google.com

time3.google.com

@krider2010
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!
~/bin/startup-gpg-agent.sh
# GPG
if [ -f "${HOME}/.gpg-agent-info" ]; then
@jacobsalmela
jacobsalmela / verifyChecksum.sh
Created Mar 7, 2016
Displays a dialog with three checksums to prevent the installation of malware
View verifyChecksum.sh
osascript <<EOT
display dialog "MD5:
$(openssl md5 $1 | awk '{print $2}')
SHA1:
$(openssl sha1 $1 | awk '{print $2}')
SHA256:
$(openssl dgst -sha256 $1 | awk '{print $2}')" with title "$(basename $1)" with icon Caution
EOT
@shionryuu
shionryuu / pull_all.sh
Created Feb 21, 2016
pull all git repositories in a directory
View pull_all.sh
#!/bin/bash
# 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"
else
echo -e "pulling $1 failed\n"
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:

anonymous
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
,nr.nid
,nr.vid
,nr.timestamp
,@prev_value := nr.nid
FROM node_revisions nr,
(SELECT @row_num := 1) x,
(SELECT @prev_value := '') y
@nocturnalgeek
nocturnalgeek / MailinatorAliases
Last active Feb 19, 2021
A list of alternate domains that point to @mailinator.com
View MailinatorAliases
@binkmail.com
@bobmail.info
@chammy.info
@devnullmail.com
@letthemeatspam.com
@mailinater.com
@mailinator.net
@mailinator2.com
@notmailinator.com
@reallymymail.com
@garlandkr
garlandkr / ami-clean.sh
Last active May 19, 2020
Clean-up an Amazon EC2 instance before creating an AMI
View ami-clean.sh
#!/bin/bash
# Run this script with:
# bash <(curl -s https://gist.github.com/garlandkr/e80674b49270b0199fa6/raw/ami-clean.sh
function print_green {
echo -e "\e[32m${1}\e[0m"
}
print_green 'Clean Yum'
View CrashPlan Pause-Resume.scpt
set isCrashPlanRunning to false
try
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