Skip to content

Instantly share code, notes, and snippets.

View pwelch's full-sized avatar

Paul Welch pwelch

View GitHub Profile
background do
set_omniauth()
click_link_or_button 'Sign up with Facebook'
end
@pwelch
pwelch / ddwrt_wlan_cron
Created February 9, 2012 14:30
DD-WRT Cron job for WLAN
# Turn DD-WRT wireless radio on for business hours only. Verify wireless interface for your router model.
# Place in WebUI > Administration > Management > Cron
0 18 * * 1,2,3,4,5 root wl -i eth1 radio off
0 6 * * 1,2,3,4,5 root wl -i eth1 radio on
@pwelch
pwelch / print_folder_tk.rb
Created June 26, 2012 18:02
Ruby/Tk script with GUI to print a folder using a system call to lp (CUPS). (Requires cups gem)
#!/usr/bin/env ruby
require 'tk'
require 'tkextlib/tile'
require 'tkextlib/bwidget'
require 'cups'
$dirname = TkVariable.new
root = TkRoot.new {title "Print Folder"}
@pwelch
pwelch / pdf_png.rb
Last active October 7, 2015 12:39
Creates a PNG from the first page of each PDF in a given directory
#!/usr/bin/env ruby
##
# Creates a PNG file from the 1st page of each PDF in a given directory
require 'mkmf'
stop = Proc.new { |msg| puts "\nFailure#{msg}"; exit 1 }
ARGV[0].nil? ? stop.call(': Provide directory of PDF files as first argument') : Dir.chdir(ARGV[0])
%w{gs convert}.each do |cmd|
@pwelch
pwelch / import.zsh
Created December 12, 2012 00:06 — forked from moutten/import.zsh
# This requires you install the command line tools from Amazon, and setup your Amazon credentials appropriately.
# - http://aws.amazon.com/developertools/351/
for region (us-east-1 us-west-1 us-west-2) ec2-import-keypair $USER -f ~/.ssh/id_rsa.pub --region $region
@pwelch
pwelch / chef_syntax_tests.take
Last active October 27, 2015 17:14
Rake tasks for testing .rb or .json files
# Testing tasks
namespace :test do
desc 'Runs ruby or jq syntax check on roles'
task :roles do
puts '===== Running ruby syntax check on roles'
Dir.foreach('roles/') do |file|
if file =~ /.rb$/
sh "ruby -c roles/#{file}"
elsif file =~ /.json$/
@pwelch
pwelch / springer-free-maths-books.md
Created December 28, 2015 20:42 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of maths books available for free, here are the direct links
@pwelch
pwelch / gist:9b9d267a7feccb441d5166e3151266f2
Created May 16, 2016 14:37 — forked from joelparker/gist:0429f8c5547c47ad35a4
IAM Group Policy for Arq4 Backup on S3
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1416260474000",
"Effect": "Allow",
"Action": [
"s3:CreateBucket",
"s3:GetLifecycleConfiguration",
"s3:ListBucket",
@pwelch
pwelch / keybase.md
Created September 21, 2016 13:48
Keybase proof

Keybase proof

I hereby claim:

  • I am pwelch on github.
  • I am pwelch (https://keybase.io/pwelch) on keybase.
  • I have a public key ASA4tZedrR2DZH6QpSNwpdKJZWGxDxEv2al3GbuE7un52go

To claim this, I am signing this object: