Skip to content

Instantly share code, notes, and snippets.

View josephabrahams's full-sized avatar

Joseph Abrahams josephabrahams

View GitHub Profile
@josephabrahams
josephabrahams / config
Last active September 22, 2016 15:39
Make Boto use the AWS CLI config
[profile foo]
region=us-east-1
output=json
[profile bar]
region=us-east-1
output=json
; use if no profile specified
[default]
@josephabrahams
josephabrahams / .gitconfig
Last active January 19, 2021 15:44
Kaleidoscope Git Configuration
[diff]
tool = Kaleidoscope
[difftool]
prompt = false
[difftool "Kaleidoscope"]
cmd = ksdiff --partial-changeset --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\"
[merge]
tool = Kaleidoscope
keepBackup = false
[mergetool]
@josephabrahams
josephabrahams / gulp-debug.js
Last active August 29, 2015 14:07
Debug gulp streams
var gulp = require('gulp'),
through = require('through2'),
util = require('gulp-util');
gulp.src('client/js/**/*.js')
.pipe(through.obj(function(file,enc,cb) {
util.log('cwd : '+file.cwd);
util.log('base: '+file.base);
util.log('path: '+file.path);
util.log('\n');
@josephabrahams
josephabrahams / header.html
Last active August 29, 2015 14:08
Web Font Loader script
<!doctype html>
<html lang="en-US">
<head>
<title></title>
<meta charset="utf-8">
<script src="//ajax.googleapis.com/ajax/libs/webfont/1.5.3/webfont.js"></script>
<script>
WebFont.load({
custom: {
families: ['My Font']
@josephabrahams
josephabrahams / footer.html
Created October 24, 2014 16:59
Avoid `console` errors in browsers that lack a console.
@josephabrahams
josephabrahams / .profile
Last active August 29, 2015 14:08
Simple [ba]sh start-up file
# colorize the prompt
PS1="\u@\h:\[\e[1;34m\]\w\[\e[0m\]\\$ "
# colorize `ls`
if ls --color > /dev/null 2>&1; then
# GNU
alias ls='ls --color=auto'
else
# BSD
alias ls='ls -G'
@josephabrahams
josephabrahams / .bashrc
Last active August 29, 2015 14:08
.bashrc for Ubuntu Server
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
@josephabrahams
josephabrahams / histdel.sh
Created November 3, 2014 22:30
Delete previous line in .bash_history
#!/bin/sh
hist=$(history | tail -1 | awk '{ print $1 }'); history -d $hist; history -d $(expr $hist - 1); unset hist
@josephabrahams
josephabrahams / dyndns53.py
Last active August 29, 2015 14:12 — forked from vrypan/dyndns53.py
Route53 Dynamic DNS Updater
#!/usr/bin/env python
# Adapted from http://joseph.is/1HPHiOE
import sys
import inspect
from datetime import datetime
from syslog import syslog, LOG_ERR
from area53 import route53
from boto.route53.exception import DNSServerError
@josephabrahams
josephabrahams / authorized_keys
Created January 9, 2015 03:25
Block root SSH access
no-port-forwarding,no-agent-forwarding,no-X11-forwarding,command="echo 'Please login as the user \"foo\" rather than the user \"root\".';echo;sleep 10" ssh-rsa AAAAB3Nza...LiPk== [email protected]