Skip to content

Instantly share code, notes, and snippets.

@tzarskyz
tzarskyz / gist:6475742
Created September 7, 2013 13:53 — forked from ph/gist:4133409
# ~/.osx — http://mths.be/osx
###############################################################################
# General UI/UX #
###############################################################################
# Set computer name (as done via System Preferences → Sharing)
scutil --set ComputerName "MacBookPro"
scutil --set HostName "MacBookPro"
scutil --set LocalHostName "MacBookPro"
@tzarskyz
tzarskyz / pw
Created September 7, 2013 11:16 — forked from PhilT/pw
#!/bin/bash
# https://gist.github.com/2371406
# version 0.1 - Not much error handling yet.
# version 0.2 - Added --edit command
#
# Add to ~/bin/pw and chmod +x it.
# See bottom of file for usage.
PASSWORD_FILE=~/Documents/.passwords.csv
#!/usr/bin/env python
from __future__ import print_function, absolute_import
import csv
import re
import sys
from subprocess import Popen, PIPE
LSREGISTER = ('/System/Library/Frameworks/CoreServices.framework/Versions/A'
@tzarskyz
tzarskyz / build.sh
Created September 7, 2013 11:15 — forked from nickstenning/build.sh
#!/bin/sh
set -eu
status () {
echo "---> ${@}" >&2
}
abort () {
echo "$@" >&2
Vagrant.configure("2") do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.provider :vmware_fusion do |f, override|
override.vm.box = "precise64_vmware_fusion"
override.vm.box_url = "http://files.vagrantup.com/precise64_vmware_fusion.box"
end
#!/bin/sh
#
# gpgedit: edit an encrypted file with an associated list of recipients
#
# $ gpgedit secrets.gpg [gpg args]
#
# gpgedit needs the companion file "secrets.rcp" to exist, and contains a list
# of intended recipients, one per line. The recipient file can contain end-of-
# line comments, starting with the "#" character.
"""
Will either compute a passwordmaker style key from `sha256(mp + site +
username)` or open a symmetrically keyed gpg file and lookup a specific
site-key for the username and password. The keyfile must follow the following
format::
foobar.com:
username: johnuser
password: megaleet
# Dynamically load virtualenvwrapper functions to reduce shell startup
# time.
#
# Copyright 2012 Aron Griffis <[email protected]>
# Released under the GNU GPL v3
#######################################################################
# Python virtualenvwrapper loads really slowly, so load it on demand.
if [[ $(type -t workon) != function ]]; then
virtualenv_funcs=( workon deactivate mkvirtualenv )
#!/bin/sh
#
# gpgedit: edit an encrypted file with an associated list of recipients
#
# $ gpgedit secrets.gpg [gpg args]
#
# gpgedit needs the companion file "secrets.rcp" to exist, and contains a list
# of intended recipients, one per line. The recipient file can contain end-of-
# line comments, starting with the "#" character.
function tabname {
# Will use current dir name if called without arg.
printf "\e]1;${1-$(basename `pwd`)}\a"
}
function winname {
# Will use current dir name if called without arg.
printf "\e]2;${1-$(basename `pwd`)}\a"
}
function tab {
# Will cd into current dir if called without arg.