Skip to content

Instantly share code, notes, and snippets.

@tomhoover
tomhoover / .tmux.conf
Last active August 29, 2015 14:17 — forked from joonty/.tmux.conf
set -g history-limit 5000
set-window-option -g utf8 on # utf8 support
# Open man page in new window
bind / command-prompt "split-window 'exec man %%'"
bind y run-shell "tmux show-buffer | xclip -sel clip -i" \; display-message "Copied tmux buffer to system clipboard"
set -g update-environment -r
# quick view of processes
bind '~' split-window "exec htop"
@tomhoover
tomhoover / manpdf
Created December 5, 2015 15:34 — forked from atomicbird/manpdf
#!/bin/bash
# Convert man pages to PDF and open them in the default PDF viewer.
# PDFs are cached when created.
# By Tom Harrington, tph at atomicbird dot com, 16 March 2005
# Directory to save cached PDFs in
# (if you don't want long-term caching, you could use /tmp/).
CACHEDIR=~/Library/Caches
@tomhoover
tomhoover / com.getsync.bittorrentsync.plist
Created December 5, 2015 15:44 — forked from atomicbird/com.getsync.bittorrentsync.plist
Keep BitTorrent Sync running on OS X. This version launches BitTorrent Sync directly instead of using /usr/bin/open, so that crashes will be detected.
<?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>KeepAlive</key>
<dict>
<key>Crashed</key>
<true/>
<key>SuccessfulExit</key>
<false/>
@tomhoover
tomhoover / homebrew-github-api-token.md
Created February 21, 2016 02:57 — forked from christopheranderton/homebrew-github-api-token.md
Set your Github API Token If you hit a ”GitHub API rate limit exceeded” when searching with Homebrew (http://brew.sh/).

Description

When using Homebrew (http://brew.sh) and searching formulas or pull requests you may get the dreaded error message: Github API Rate limit exceeded

Let's fix that! (yeah!)


Short version

Create a new Personal Token in your Github Account Settings (Sidebar: Applications) and then copy the Token. In the Terminal, use export HOMEBREW_GITHUB_API_TOKEN=YOURAPITOKENWITHFUNKYNUMBERSHERE (change that to your API Token) or add that to your .bash_profile and then do source .bash_profile.

Last updated: 2015-08-11

Searching for Files

Find images in a directory that don't have a DateTimeOriginal

exiftool -filename -filemodifydate -createdate -r -if '(not $datetimeoriginal) and $filetype eq "JPEG"' .

###Output photos that don't have datetimeoriginal to a CSV### Note this can take a long time if you have a lot of jpgs

@tomhoover
tomhoover / Mail_to_Things.scpt
Created March 14, 2016 17:18 — forked from amityweb/Mail_to_Things.scpt
AppleScript to Add Things task from Mail in Apple Mail Folder
on run
tell application "System Events"
set isThingsRunning to (count of (every process whose bundle identifier is "com.culturedcode.things")) > 0
set isMailRunning to (count of (every process whose bundle identifier is "com.apple.mail")) > 0
end tell
if isThingsRunning and isMailRunning then
tell application "Mail"

Keybase proof

I hereby claim:

  • I am tomhoover on github.
  • I am tomhoover (https://keybase.io/tomhoover) on keybase.
  • I have a public key ASDTWb4okyt21v_FMD62kVl6Lz3IBRCpPr0BPogJVpyejQo

To claim this, I am signing this object:

@tomhoover
tomhoover / gist:401cd332904244fcb9010bda4163865b
Created November 2, 2016 14:32 — forked from Bouke/gist:11261620
Multiple Python installations on OS X

Previous versions used homebrew to install the various versions. As suggested in the comments, it's better to use pyenv instead. If you are looking for the previous version of this document, see the revision history.

$ brew update
$ brew install pyenv
$ pyenv install 3.5.0
$ pyenv install 3.4.3
$ pyenv install 3.3.6
$ pyenv install 3.2.6
$ pyenv install 2.7.10

$ pyenv install 2.6.9

@tomhoover
tomhoover / gist:5ff7a7231a802a1495d940db711a8d29
Created October 11, 2019 14:19 — forked from whiskerz007/gist:53c6aa5d624154bacbbc54880e1e3b2a
How to setup a community version of Proxmox VE 5.x-6.x
# Disable Commercial Repo
sed -i "s/^deb/\#deb/" /etc/apt/sources.list.d/pve-enterprise.list
# Add PVE Community Repo
echo "deb http://download.proxmox.com/debian/pve $(grep "VERSION=" /etc/os-release | sed -n 's/.*(\(.*\)).*/\1/p') pve-no-subscription" > /etc/apt/sources.list.d/pve-no-enterprise.list
# Remove nag
echo "DPkg::Post-Invoke { \"dpkg -V proxmox-widget-toolkit | grep -q '/proxmoxlib\.js$'; if [ \$? -eq 1 ]; then { echo 'Removing subscription nag from UI...'; sed -i '/data.status/{s/\!//;s/Active/NoMoreNagging/}' /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js; systemctl restart pveproxy.service; }; fi\"; };" > /etc/apt/apt.conf.d/no-nag-script
apt --reinstall install proxmox-widget-toolkit
# OBJECTIVE: Install Arch Linux with encrypted root and swap filesystems with an ENCRYPTED BOOT and boot from UEFI. We will
also decrypt and mount our entire encrypted system using a single LUKS passphrase entry.
# Note: This method supports both dedicated Arch installs and those who wish to install Arch on a multi-OS-UEFI booting system.
# External USB HDD/SSD Installers Notes: Encrypted Arch installs can be booted and run from an external USB HDD or SSD, but
# only when the installation is correctly set up. There are several necessary changes to my standard procedure you'll want
# to make during the install process. Read my External USB HDD/SSD Installation section below before proceeding.