most of these require logout/restart to take effect
# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false
# Set a shorter Delay until key repeat
#!/bin/sh | |
# | |
# Copyright (C) 2010 Matthias Buecher (http://www.maddes.net/) | |
# | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation; either version 2 of the License, or | |
# (at your option) any later version. | |
# http://www.gnu.org/licenses/gpl-2.0.txt |
#!/usr/bin/env python | |
"""Simple script to merge multiple RRD files together. | |
Accepts any number of RRD file names as arguments. Produces an "rrdtool dump" | |
style file on stdout. The last RRD file should have a slot for every possible | |
record in the resulting merged RRD. | |
Run something like: | |
$ python simple-merge-rrd.py filea.rrd fileb.rrd filec.rrd | \ |
# Load Json into a Python object | |
import urllib2 | |
import json | |
req = urllib2.Request("http://localhost:81/sensors/temperature.json") | |
opener = urllib2.build_opener() | |
f = opener.open(req) | |
json = json.loads(f.read()) | |
print json | |
print json['unit'] |
sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool YES; | |
sudo defaults delete /Library/Preferences/com.apple.windowserver DisplayResolutionDisabled; | |
// by the way, you need to logout and log back in for this to take effect. Or at least that's what | |
// Quartz Debug says. Who knows, maybe it's lying? | |
// P.S. Go to [Apple menu --> System Preferences --> Displays --> Display --> Scaled] after logging | |
// back in, and you'll see a bunch of "HiDPI" resolutions in the list to choose from. |
#!/bin/bash | |
# Sends a Boxcar push notification through the Boxcar HTTP API | |
# Usage examples | |
# $ bc # Just sends a notification with title 'bc' | |
# $ bc "Done" # Sends a notification with title 'Done' | |
# $ echo foobar | bc # Sends a notification with title 'bc' and message body 'foobar' | |
# $ echo foobar | bc "Done" # Sends a notification with title 'Done' and message body 'foobar' | |
# | |
# Expects a file ~/.boxcar to exist with content like |
http { | |
log_format bodylog '$remote_addr - $remote_user [$time_local] ' | |
'"$request" $status $body_bytes_sent ' | |
'"$http_referer" "$http_user_agent" $request_time ' | |
'<"$request_body" >"$resp_body"'; | |
lua_need_request_body on; | |
set $resp_body ""; | |
body_filter_by_lua ' |
@binkmail.com | |
@bobmail.info | |
@chammy.info | |
@devnullmail.com | |
@letthemeatspam.com | |
@mailinater.com | |
@mailinator.net | |
@mailinator2.com | |
@notmailinator.com | |
@reallymymail.com |
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine | |
# This is how I upload my new Sol Trader builds (http://soltrader.net) | |
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash | |
S3KEY="my aws key" | |
S3SECRET="my aws secret" # pass these in | |
function putS3 | |
{ | |
path=$1 |
#!/bin/bash | |
# Thanks @LucaTNT for making the script work on < 10.10 | |
MAJOR_OSX_VERSION=$(sw_vers -productVersion | awk -F '.' '{print $2}') | |
if [[ $MAJOR_OSX_VERSION -ge 10 ]] | |
then | |
DB_PATH=`getconf DARWIN_USER_DIR`com.apple.notificationcenter/db/db | |
else | |
DB_PATH="$HOME/Library/Application Support/NotificationCenter/" | |
DB_PATH=$DB_PATH`ls "$DB_PATH"` |