Skip to content

Instantly share code, notes, and snippets.

deed02392 / foo{1..6}.bar.baz.scpt
Last active Jun 14, 2019
AppleScript for iTerm2 which SSHs into multiple hosts with split panes across two rows
View foo{1..6}.bar.baz.scpt
-- Save me in ~/Library/Application Support/iTerm2/Scripts, then restart iTerm2 and find me in the Scripts menu
set hostnames to {"", "", "", "", "", ""}
tell application "iTerm"
create window with default profile
tell current tab of current window
tell current session
write text "ssh " & (item 1 of hostnames)
View main.go
package main
import ""
import "fmt"
import "bytes"
import "bufio"
import "strings"
import "log"
//import ""
//import ""
deed02392 / gist:7570930cdaaeba247ae88750f75c0b58
Last active Jan 10, 2018
Find and replace file names and leave softlink behind
View gist:7570930cdaaeba247ae88750f75c0b58

The following command will replace match with replace for all files in the cwd, and create a soft link to the new file name using the old file name.

$ find . -name '*.mkv' -type f -exec bash -c 'mv "$1" "${1/match/replace.}" && ln -s "${1/match/replace.}" "$1"' -- {} \;


ls -l
total 27477872
-rw-r--r--. 1 george media_ 3517838477 Jan  9 20:04 match04e01.mkv
deed02392 / gist:a82cc86c2a6f9b23b6861de3f29e2847
Created Dec 20, 2017
Send OS X Mail Digitally Signed without Password
View gist:a82cc86c2a6f9b23b6861de3f29e2847
If you want to digitally sign your e-mail but not provide a password to unlock your keychain every time (for example, because you want to send Automator e-mails) you can do this in a few easy steps.
1. Open Keychain Access
2. Under the Keys category, find the private key associated with your e-mail certificate
3. Double click on it to open its info
4. Open the Access Control tab, providing credentials if asked
5. Select the Allow all applications to access this item radio button and then click Save Changes
Your mail client will no longer need to elevate privileges to access the private key and will therefore be able to sign and decrypt your mail messages without password.
deed02392 /
Created Jul 22, 2017
no urllib2.URLError property called 'code'
# send the request to pushover
req = urllib2.Request(API_URL)
handle = urllib2.urlopen(req, data)
except urllib2.HTTPError as e:
logger.log(u'PUSHOVER: HTTPError: %s' % e.args, logger.ERROR)
except urllib2.URLError as e:
# HTTP status 404 if the provided email address isn't a Pushover user.
logger.log(u'PUSHOVER: URLError: %s' % e.reason, logger.ER
View gist:dd1715ba9050dc00ac717b825eb1ada5
openssl req -new -sha256 -nodes -out \* -newkey rsa:2048 -keyout \* -config <(
cat <<-EOF
default_bits = 2048
prompt = no
default_md = sha256
req_extensions = req_ext
distinguished_name = dn
[ dn ]
View TV Episode Highlights!.md

Ray Donovan

You're so crass

Fish and Bird - 4x06 - 21:38

Tom and Jerry

I Love You - It is a Burning Flame

The Zoot Cat - 1940x13 - 4:44

Le Bureau des Légendes

deed02392 / Send-Email.ps1
Created Sep 3, 2015
PowerShell cmdlet that sends an e-mail via Outlook, with address and subject as arguments and message body from pipe
View Send-Email.ps1
Function Global:Send-Email {
Param (
View jsbin.difuz.css
body {
font-family: arial;
cursor: crosshair;
h1 {
color: #00FF00;
text-align: center;
h2 {
border: thin dotted green;
View jsbin.voliz.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>JS Bin</title>
<h1>Things I Like</h1>