This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Set up a route to the be used when logged into | |
# AWS SoftEther VPN | |
# VPN IP addresses should be in the 192.168.99 subnet after connection is made. | |
# The gateway for the route is usually set to the address received via DHCP. | |
# On Mac OSX the route sent by DHCP is ignored and must be set manually | |
echo "Setting up routing for AWS VPN interface....." | |
INTFC=$(/sbin/ifconfig | grep ppp | awk -F: '{print $1}') | |
if [ -z $INTFC ]; then | |
echo "No ppp interface found. Check VPN connection" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# NOTE: this is hugely simplified from the previous version, just using the | |
# existing pipe between popen and Ruby to handle communication, and passing | |
# data from one process to the next | |
# | |
# | |
# Use popen to create a subprocess connected to Ruby through a pipe: | |
# optionally sends results to the pipe, receives results from the pipe | |
# | |
# Send to pipe (no initial piped in data): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* (Released under MIT License, copyright Phil Ayres, see LICENSE file for full license) | |
Convert HTML5 input pattern attribute to a jQuery-Mask-Plugin compatible mask. | |
This follows some basic common regex patterns, but by no means all that could be applied to | |
HTML5 inputs. It is sufficient for simple cases. | |
Obviously you will need the jQuery-Mask-Plugin | |
Get it from: https://github.com/igorescobar/jQuery-Mask-Plugin | |
Usage: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
gem 'eventmachine' | |
gem 'eventmachine_httpserver', :require => 'evma_httpserver' | |
gem 'mysql2' | |
gem 'httpclient', :git=>'https://github.com/philayres/httpclient.git' | |
gem 'hashie' | |
gem 'connection_pool' | |
gem 'logger' | |
gem 'excon' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is how I'm creating the alpaca form | |
_re = {}; | |
_re.utils = { | |
form_auth_token: function(){ | |
var autht = $('meta[name="csrf-token"]').attr('content'); | |
var authh ='<div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓"><input name="authenticity_token" type="hidden" value="'+autht+'"></div>'; | |
return authh; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Include the following functions to override those in the appropriate places in the Alpaca.js code */ | |
//Alpaca.ControlField = { | |
validationList: function(){ | |
var list = this.schema.enum; | |
if(!list) list = this.schema.list; | |
return list; | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'digest' | |
class ApiAuth | |
# Pass params as hash, a secret used to salt the hash, action and controller, and any additional options | |
def self.generate_ottoken params, secret, action, controller, options={} | |
uri_set = [] | |
sign_params = params.to_a | |
sign_params.sort! {|x,y| x <=> y } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Unity indicator for evolution-less clock and date display | |
# author: phil ayres | |
# 24 Oct 2011 | |
import gobject | |
import gtk | |
import appindicator | |
import os, sys | |
import time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'barby/barcode' | |
class UpcSupplementalForBarby < Barby::Barcode1D | |
@data = nil | |
attr_reader :data | |
START = '1011' | |
STOP = '' | |
INTER_CHAR = '01' |