Install (copy & paste):
curl -sL raw.github.com/gist/1676577/travis.rb > ~/bin/travis \
&& chmod +x ~/bin/travis
gem install hub | tail -2
ruby -e 'require "json"' 2>/dev/null || gem install json
pool = WebDriverPortPool.new(8) | |
port = pool.get | |
driver = Selenium::WebDriver::Driver.new(NoLockFirefoxBridge.new(:port => port)) | |
# do some work | |
driver.quit | |
pool.release port | |
Important places to check before travelling: | |
* http://en.wikivoyage.org | |
* http://www.auswaertiges-amt.de/EN | |
* http://www.seatguru.com/ | |
* https://yourkarma.com/coverage | |
* http://www.clubmate.de/international.html |
# This the bash script to handle up-and-runnig VM created through Vagrant | |
#!/usr/bin/env bash | |
# PRIVATE: error level message | |
error_message () { | |
echo "$(tput setaf 1)ERROR: $1$(tput sgr0)" | |
} | |
time ruby pinger.rb | |
192.168.1.4 | |
192.168.1.59 | |
192.168.1.90 | |
192.168.1.100 | |
192.168.1.101 | |
192.168.1.102 | |
192.168.1.103 | |
192.168.1.105 | |
192.168.1.107 |
# specs and cukes results are stored in JUnit format under test-reports | |
if (grep 'failures="[^0]"' test-reports/* || grep 'errors="[^0]"' test-reports/*); then | |
curl -H "Authorization: token MY_TOKEN" --request POST --data '{"state": "failure", "description": "Failed!", "target_url": "${bamboo.buildResultsUrl}"}' https://api.github.com/repos/USER/REPO/statuses/${bamboo.repository.revision.number} > /dev/null | |
else | |
curl -H "Authorization: token MY_TOKEN" --request POST --data '{"state": "success", "description": "Success!", "target_url": "${bamboo.buildResultsUrl}"}' https://api.github.com/repos/USER/REPO/statuses/${bamboo.repository.revision.number} > /dev/null | |
fi |
#!/bin/bash | |
# Script for placing sudoers.d files with syntax-checking | |
if [ -z "$1" ]; then | |
# Making a temporary file to contain the sudoers-changes to be pre-checked | |
TMP=$(mktemp) | |
cat > $TMP <<EOF | |
Cmnd_Alias VAGRANT_EXPORTS_ADD = /bin/su root -c echo '*' >> /etc/exports | |
Cmnd_Alias VAGRANT_NFSD = /etc/init.d/nfs-kernel-server restart | |
Cmnd_Alias VAGRANT_EXPORTS_REMOVE = /bin/sed -e /*/ d -ibak /etc/exports |
# in features/support/env.rb | |
require 'selenium/webdriver' | |
# we need a firefox extension to start intercepting javascript errors before the page | |
# scripts load | |
Capybara.register_driver :selenium do |app| | |
profile = Selenium::WebDriver::Firefox::Profile.new | |
# see https://github.com/mguillem/JSErrorCollector | |
profile.add_extension File.join(Rails.root, "features/support/extensions/JSErrorCollector.xpi") | |
Capybara::Selenium::Driver.new app, :profile => profile |
function _common_section | |
printf $c1 | |
printf $argv[1] | |
printf $c0 | |
printf ":" | |
printf $c2 | |
printf $argv[2] | |
printf $argv[3] | |
printf $c0 | |
printf ", " |
module MyApp | |
class Application < Rails::Application | |
if Rails.env == 'test' | |
require 'diagnostic' | |
config.middleware.use(MyApp::DiagnosticMiddleware) | |
end | |
end | |
end |