Skip to content

Instantly share code, notes, and snippets.

View smashwilson's full-sized avatar
🤖
HAPPINESS IS MANDATORY

Ash Wilson smashwilson

🤖
HAPPINESS IS MANDATORY
  • GitHub Staff
  • 05:46 (UTC -04:00)
View GitHub Profile
#!/usr/bin/env bash
key=$1
infile=$2
outfile=$3
openssl rsautl -decrypt -inkey $key -in $infile -out $outfile
@smashwilson
smashwilson / azure-deploy.sh
Last active December 31, 2015 18:59
This is how I do deployments on `git push` for azurefire.net.
# ${HOME}/bin/azure-deploy
#!/bin/sh
#
# Deployment script for azurefire.
AZURE_HOME="/var/webapp/azurefire"
export PATH=${PATH}:${HOME}/.rbenv/bin:${HOME}/.rbenv/shims
AZURE_GIT="--git-dir ${AZURE_HOME}/.git --work-tree ${AZURE_HOME}"
require 'fog'
require 'base64'
service = Fog::Compute.new(
provider: 'rackspace',
rackspace_username: ENV['RAX_USERNAME'],
rackspace_api_key: ENV['RAX_API_KEY'],
rackspace_region: :ord
)
@smashwilson
smashwilson / fog-copy.rb
Created January 29, 2014 16:37
Perform a server-side copy of a file in Cloud Files.
require 'fog'
# To connect to ServiceNet, this needs to run from a Cloud Server in the same datacenter as your
# Cloud Files containers.
service = Fog::Storage.new(
provider: 'rackspace',
rackspace_username: ENV['RAX_USERNAME'],
rackspace_api_key: ENV['RAX_API_KEY'],
rackspace_region: :ord,
rackspace_servicenet: true

Keybase proof

I hereby claim:

  • I am smashwilson on github.
  • I am smashwilson (https://keybase.io/smashwilson) on keybase.
  • I have a public key whose fingerprint is E4AE B392 BCBF 7F83 41A6 53A9 61F7 489B 6751 9BF6

To claim this, I am signing this object:

@smashwilson
smashwilson / socket-io-ssl.apacheconf
Last active August 29, 2015 13:57
An Apache configuration that works with socket.io 0.9.x.
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
@smashwilson
smashwilson / vagrant-rackspace-output
Created March 18, 2014 15:40
vagrant-rackspace-plugin output.
Bringing machine 'default' up with 'rackspace' provider...
==> default: Finding flavor for server...
==> default: Finding image for server...
==> default: Launching a server with the following settings...
==> default: -- Flavor: 512MB Standard Instance
==> default: -- Image: CentOS 6.5 (PVHVM)
==> default: -- Name: ash-vagrant-rackspace
==> default: Waiting for the server to be built...
==> default: Waiting for SSH to become available...
==> default: The server is ready!
[x, ourRef, ourText, theirText, theirRef] = m.match
console.log "Match range: #{m.range}"
[baseRow, baseCol] = m.range.start.toArray()
console.log "baseRow = #{baseRow}, baseCol = #{baseCol}"
ourLines = ourText.split /\n/
ourRowStart = baseRow + 1
ourRowEnd = ourRowStart + ourLines.length - 1
console.log "baseRow = #{baseRow}, ourRowStart = #{ourRowStart}"
@smashwilson
smashwilson / bench.rb
Last active August 29, 2015 13:58
excon case-insensitive header access benchmarks
#!/bin/env ruby
#
# Benchmark any performance degredation associated with moving to case-
# insensitive HTTP header access.
require 'benchmark'
require './lib/excon'
resp = Excon::Response.new
resp.headers = {}
Date/Time: 2014-04-11 14:05:25 -0400
OS Version: 10.9.2 (Build 13C64)
Architecture: x86_64
Report Version: 18
Command: Atom
Path: /Applications/Atom.app/Contents/MacOS/Atom
Version: 0.84.0 (0.84.0)
Parent: launchd [266]