Skip to content

Instantly share code, notes, and snippets.

Why does GitHub need statuses?

Alice wheresalice

Why does GitHub need statuses?
View GitHub Profile
wheresalice / drupal_spec.rb
Created Apr 8, 2010
rspec file to check the basics of a Drupal site
View drupal_spec.rb
require 'rubygems'
require 'watir'
require 'spec'
Watir::Browser.default = 'firefox'
describe "test Drupal frontend" do
before(:each) do
@browser ||=
@domain ||= ''
wheresalice / drupal.rb
Created Apr 8, 2010
Very basic test suite using Watir to ensure a Drupal site is working
View drupal.rb
require "rubygems"
require "test/unit"
require "watir"
$site = ARGV[0]
puts $site
if ($site[-1,1] != "/")
puts "url must end in a slash"
wheresalice / testgoogle.rb
Created Apr 14, 2010
A really simple example of using webrat and rspec for integration testing
View testgoogle.rb
require 'rubygems'
require 'webrat'
require 'spec/test/unit'
include Webrat::Methods
include Webrat::Matchers
Webrat.configure do |config|
config.mode = :mechanize
wheresalice / gist:369822
Created Apr 17, 2010
Mass delete Tumblr posts
View gist:369822
require 'rubygems'
require 'open-uri'
require 'mechanize'
require 'pp'
site_dashboard_url = ''
email = ''
password = 'xxxxxx'
wheresalice / eject.rb
Created Apr 17, 2010
This should theoretically eject most cash drawers, but needs testing with actual hardware
View eject.rb
@printer = "/dev/lp0", "w") do |f|
f.print("#{27.chr}#{112.chr}#{0.chr}#{50.chr}#{250.chr}") # Citizen or Bixolon or IBM or Ithaca or Nexa or Olivetti or Pos-X or Posiflex or Samsung
f.print("#{7.chr}") # Citizen or IBM or Start or Westrex
f.print("#{27.chr}#{112.chr}#{48.chr}#{55.chr}#{121.chr}") # Bixolon or Epson or Samsung
f.print("#{27.chr}#{112.chr}#{0.chr}#{100.chr}#{250.chr}") # TEC or Toshiba or Unisys
f.print("#{27.chr}#{112.chr}#{0.chr}#{48.chr}#{251.chr}") # Axiohm or Fujitsu
f.print("#{27.chr}#{112.chr}#{0.chr}#{25.chr}#{250.chr}") # Epson or Samsung
f.print("#{27.chr}#{112.chr}#{0.chr}#{64.chr}#{240.chr}") # Epson or Samsung
f.print("#{27.chr}#{112.chr}#{1.chr}#{50.chr}#{250.chr}") # Citizen (Drawer 2)
wheresalice / gist:374546
Created Apr 21, 2010
Fixes a bug in hexa-range and adds support for hexa-rand in wfuzz
View gist:374546
diff -uNp --unidirectional-new-file /pentest/web/wfuzz/CHANGELOG wfuzz/CHANGELOG
--- /pentest/web/wfuzz/CHANGELOG 1970-01-01 01:00:00.000000000 +0100
+++ wfuzz/CHANGELOG 2010-04-22 00:04:00.000000000 +0100
@@ -0,0 +1,3 @@
+== 22 April 2010 kaerast <> ==
+ * Added hexa-rand which fuzzes random hex values within a given range rather than consecutive values
+ * Fixed hexa-range to not send out an extraneous % sign
Binary files /pentest/web/wfuzz/dictio.pyc and wfuzz/dictio.pyc differ
Binary files /pentest/web/wfuzz/encoders.pyc and wfuzz/encoders.pyc differ
diff -uNp --unidirectional-new-file /pentest/web/wfuzz/ wfuzz/
wheresalice / aegir_modules.rb
Created Apr 23, 2010
Shows all modules available across all Aegir platforms. Doesn't test if they're in use or not
View aegir_modules.rb
require 'find'
modules = []
Find.find('/var/aegir/platforms') { |file| modules << File.basename(file) if File.basename(file) =~ /\.module$/ }
puts modules.sort.uniq
wheresalice / gist:446055
Created Jun 20, 2010
script for vbackup to support cfbackup so we can copy backup files to rackspace
View gist:446055
# This file is part of vbackup.
# vbackup is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# vbackup is distributed in the hope that it will be useful,
View monkey.php
$foo = array();
$foo['country'] = "united Kindom";
$foo['street'] = "";
$foo['state'] = "ENG";
print_r( $foo);
$bar = array();
$bar['country'] = "Danmark";
$bar['street'] = "";
wheresalice / gist:490373
Created Jul 26, 2010
Switch a Drupal site to syslog logging with level user_6
View gist:490373
/var/aegir/drush/drush.php disable dblog && /var/aegir/drush/drush.php enable syslog
echo 1 | /var/aegir/drush/drush.php variable set syslog_facility 176