Skip to content

Instantly share code, notes, and snippets.

View acoulton's full-sized avatar

Andrew Coulton acoulton

View GitHub Profile
@acoulton
acoulton / Gemfile
Last active August 11, 2017 12:08
Reproduction case for slow chefignore performance
source 'https://rubygems.org'
gem 'chefspec', '~> 7.0'
gem 'chef', '~>13.2'
@acoulton
acoulton / vagrant_putty.bat
Created September 14, 2016 10:16
Launch putty for a vagrant machine, including converting key with winscp
@echo off
echo Launching Putty SSH connection to vagrant in %cd%
set VAGRANT_DIR=%cd%\.vagrant\machines\default\virtualbox
IF NOT EXIST %VAGRANT_DIR% goto novagrant
echo Locating vagrant forwarded SSH port
vagrant port --guest 22 > "%VAGRANT_DIR%\ssh_port"
if %errorlevel% neq 0 goto error
set /p SSH_PORT=<"%VAGRANT_DIR%\ssh_port"
@acoulton
acoulton / composer.json
Created September 2, 2014 15:31
Fix mime-type of existing S3 files
{
"require": {
"aws/aws-sdk-php": "*"
}
}
@acoulton
acoulton / cronic
Last active August 27, 2021 05:49
An enhanced version of [cronic - a cure for cron's chronic email problem](http://habilis.net/cronic/) that supports logging task output to a file for situations where you want to keep history on the server for further inspection but only want to be emailed if your task fails.
#!/bin/bash
# Cronic v2 - cron job report wrapper
# Copyright 2007 Chuck Houpt. No rights reserved, whatsoever.
# Amended 2013 Andrew Coulton.
# Public Domain CC0: http://creativecommons.org/publicdomain/zero/1.0/
# Basic usage, to run a task and discard the output unless it fails or outputs to STDERR
# cronic /run/my/task
#
@acoulton
acoulton / github-connect.sh
Created March 4, 2012 01:22
Create and register an SSH key for your github account
#!/bin/bash
# github-connect.sh
# -----------------
# Copyright 2012 Andrew Coulton - released under the BSD licence
#
# A simple command line script to set up and register an SSH key against a
# user's github account - for example when provisioning a new virtual
# machine for a developer.
#