Skip to content

Instantly share code, notes, and snippets.

@tjluoma
tjluoma / di-1passwordbeta.sh
Last active August 29, 2015 14:07
Download and install 1Password 5 betas automatically
#!/bin/zsh -f
zmodload zsh/datetime
zmodload zsh/stat
NAME="$0:t:r"
function timestamp { strftime "%Y-%m-%d--%H.%M.%S" "$EPOCHSECONDS" }
LOG="$HOME/Library/Logs/$NAME.log"
@tjluoma
tjluoma / ssh-keygen-prompt.sh
Last active August 29, 2015 14:07
TYPE must be either ‘rsa' or ‘dsa'. FILENAME can be whatever you want, but I suggest making it clear a) which device this is for and b) which app this is for
## The basic format of the `ssh-keygen` command is something like this:
# ssh-keygen -t TYPE -f FILENAME -C "COMMENT"
## Here's What I Used
ssh-keygen -t rsa -f id_rsa_prompt_iphone5s -C "TJ Luoma iPhone 5s"
@tjluoma
tjluoma / make-one-line.sh
Created October 3, 2014 14:48
This is one of those easy things I wish I had done a long time ago: it takes whatever is on the pasteboard, removes any ‘\’ at EOL, changes any tabs or newlines into spaces, and then makes sure that the output does not have more than one consecutive space (to make it nice and even). I invoke this via Keyboard Maestro.
pbpaste | sed 's#\\$##g' | tr -s '\012|\t' ' ' | tr -s ' ' ' '
#!/bin/zsh -f
TARGET_SSID='My Favorite WiFi Network'
NAME="$0:t:r"
AIRPORT='/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport'
if [ ! -x "$AIRPORT" ]
then
@tjluoma
tjluoma / com.tjluoma.flux.plist
Created June 21, 2014 08:55
Save as ~/Library/LaunchAgents/com.tjluoma.flux.plist. To load, either logout/login or, in Terminal, enter: `launchctl load "$HOME/Library/LaunchAgents/com.tjluoma.flux.plist"`
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.tjluoma.flux</string>
<key>LimitLoadToSessionType</key>
<string>Aqua</string>
<key>LowPriorityIO</key>
<true/>

Keybase proof

I hereby claim:

  • I am tjluoma on github.
  • I am tjluoma (https://keybase.io/tjluoma) on keybase.
  • I have a public key whose fingerprint is CD24 F253 A615 7ADE B4CD 849B D1BE BF82 BC7F B1B5

To claim this, I am signing this object:

#!/bin/zsh -f
# Purpose:
#
# From: Tj Luo.ma
# Mail: luomat at gmail dot com
# Web: http://RhymesWithDiploma.com
# Date: 2014-06-07
NAME="$0:t:r"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.tjluoma.sendtodropbox.email-to-url</string>
<key>Program</key>
<string>/usr/local/bin/sendtodropbox-image.sh</string>
<key>QueueDirectories</key>
<array>
#!/bin/zsh -f
NAME="$0:t:r"
export PATH=/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin
(di-xquartz.sh && \
brew update && \
brew upgrade && \
brew doctor) 2>&1 |\
@tjluoma
tjluoma / com.tjluoma.updatebrew.plist
Created June 10, 2014 23:48
`launchd` plist to run `updatebrew.sh` at 3:03 a.m. every night
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin</string>
</dict>
<key>Label</key>