-
Open a browser
# start an instance of firefox with selenium-webdriver driver = Selenium::WebDriver.for :firefox # :chrome -> chrome # :ie -> iexplore
- Go to a specified URL
| #! /usr/bin/ruby | |
| # | |
| # A script to check Amazon Webservice's Health Status Dashboard | |
| # | |
| # Jens Braeuer, github.com/jbraeuer | |
| # | |
| # Version 1.0 | |
| # |
| #put in lib/tasks/fixtures.rake | |
| namespace :db do | |
| namespace :fixtures do | |
| desc 'Create YAML test fixtures from data in an existing database. | |
| Defaults to development database. Set RAILS_ENV to override.' | |
| task :dump => :environment do | |
| sql = "SELECT * FROM %s" | |
| skip_tables = ["schema_migrations"] | |
| ActiveRecord::Base.establish_connection(:development) | |
| (ActiveRecord::Base.connection.tables - skip_tables).each do |table_name| |
| 0. SSH to server | |
| 1. Edit /opt/bitnami/apps/jenkins/jenkins_home/config.xml | |
| 2. set userSecurity to false: <userSecurity>false</userSecurity> | |
| 3. delete | |
| <authorizationStrategy> and <securityRealm> | |
| 4. /etc/init.d/bitnami restart |
| function errexit() { | |
| local err=$? | |
| set +o xtrace | |
| local code="${1:-1}" | |
| echo "Error in ${BASH_SOURCE[1]}:${BASH_LINENO[0]}. '${BASH_COMMAND}' exited with status $err" | |
| # Print out the stack trace described by $function_stack | |
| if [ ${#FUNCNAME[@]} -gt 2 ] | |
| then | |
| echo "Call tree:" | |
| for ((i=1;i<${#FUNCNAME[@]}-1;i++)) |
| #!/bin/sh | |
| # Reads OTP secrets belonging to an readable name from a file and generates OTP | |
| # tokens. The secrets should be in a file, separated by a colon. | |
| # E.g. test:secretkey | |
| # | |
| # Works really nicely together with an alias: | |
| # alias otp='~/otp.sh' | |
| # | |
| # Licensed under CC0 <https://creativecommons.org/publicdomain/zero/1.0/> |
| URL="http://stackoverflow.com/" | |
| # store the whole response with the status at the and | |
| HTTP_RESPONSE=$(curl --silent --write-out "HTTPSTATUS:%{http_code}" -X POST $URL) | |
| # extract the body | |
| HTTP_BODY=$(echo $HTTP_RESPONSE | sed -e 's/HTTPSTATUS\:.*//g') | |
| # extract the status | |
| HTTP_STATUS=$(echo $HTTP_RESPONSE | tr -d '\n' | sed -e 's/.*HTTPSTATUS://') |
| elastic: | |
| image: elasticsearch | |
| haproxy: | |
| image: haproxy | |
| volumes: | |
| - ${PWD}:/usr/local/etc/haproxy | |
| links: | |
| - elastic | |
| ports: |