Note: Run this script as the root user (no sudo calls are used in the script).
You will need the curl package installed, though I would have no idea why it wouldn't be installed by default:
zypper --non-interactive install curl
| # install_chef_server.sh | |
| # | |
| # From list post by John Merrells <[email protected]> | |
| # Modified by Mike Bailey <[email protected]> | |
| logfile="/root/log.txt" | |
| echo "-----" >> $logfile | |
| # New sources.list | |
| cat > /etc/apt/sources.list << EOF |
| # cookbooks/chef/attributes/chef.rb | |
| set_unless[:chef][:log_location] = "STDOUT" | |
| set_unless[:chef][:log_level] = "info" | |
| set_unless[:chef][:url_type] = "http" | |
| set_unless[:chef][:server_fqdn] = "your-chef-server" | |
| set_unless[:chef][:server_port] = "4000" | |
| set_unless[:chef][:validation_client_name] = "chef-validator" | |
| set_unless[:chef][:cache_path] = "/var/cache/chef" |
| =Navigating= | |
| visit('/projects') | |
| visit(post_comments_path(post)) | |
| =Clicking links and buttons= | |
| click_link('id-of-link') | |
| click_link('Link Text') | |
| click_button('Save') | |
| click('Link Text') # Click either a link or a button | |
| click('Button Value') |
| # Source accepts the protocol s3:// with the host as the bucket | |
| # access_key_id and secret_access_key are just that | |
| s3_file "/var/bulk/the_file.tar.gz" do | |
| source "s3://your.bucket/the_file.tar.gz" | |
| access_key_id your_key | |
| secret_access_key your_secret | |
| owner "root" | |
| group "root" | |
| mode 0644 | |
| end |
| #!/bin/bash | |
| #ec2-run-instances --user-data-file chefserver-ec2-userdata.sh -g chef-server --key mykey -t m1.large --instance-initiated-shutdown-behavior terminate ami-1aad5273 | grep INSTANCE | INSTANCE=`cut -f 2` | xargs -I XXX ec2-create-tags XXX --tag Name=chefserver ; sleep 60 ; ec2-describe-instances $INSTANCE | grep INSTANCE | grep running | echo ssh ubuntu@`cut -f 4` | |
| # ami-1aad5273 - ubuntu 11.04 64bit server ebs | |
| # ami-2cc83145 - alestic ubunt 10.04 LTS 32bit server ebs | |
| # ami-2ec83147 - alestic ubunt 10.04 LTS 64bit server ebs | |
| # ami-8e1fece7 - amazon 64 bit ebs | |
| exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1 | |
| set -e -x | |
| # START CHEF BOOSTRAP |
| @test_deploy @javascript # @test_deploy tag setup in cucumber.yml profile, @javascript runs in capybara-webkit | |
| Feature: Smoke Test | |
| In order to test that the application is deployed | |
| As a caring developer | |
| I want to check a few features of the site | |
| Background: | |
| Given we are in the deploy environment | |
| Scenario: Logging in and checking basic navigation |
| " tmux will only forward escape sequences to the terminal if surrounded by a DCS sequence | |
| " http://sourceforge.net/mailarchive/forum.php?thread_name=AANLkTinkbdoZ8eNR1X2UobLTeww1jFrvfJxTMfKSq-L%2B%40mail.gmail.com&forum_name=tmux-users | |
| if exists('$TMUX') | |
| let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=1\x7\<Esc>\\" | |
| let &t_EI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=0\x7\<Esc>\\" | |
| else | |
| let &t_SI = "\<Esc>]50;CursorShape=1\x7" | |
| let &t_EI = "\<Esc>]50;CursorShape=0\x7" | |
| endif |
| # First install tmux | |
| brew install tmux | |
| # For mouse support (for switching panes and windows) | |
| # Only needed if you are using Terminal.app (iTerm has mouse support) | |
| Install http://www.culater.net/software/SIMBL/SIMBL.php | |
| Then install https://bitheap.org/mouseterm/ | |
| # More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/ |
| #!/usr/bin/env ruby | |
| # List all keys stored in memcache. | |
| # Credit to Graham King at http://www.darkcoding.net/software/memcached-list-all-keys/ for the original article on how to get the data from memcache in the first place. | |
| require 'net/telnet' | |
| headings = %w(id expires bytes cache_key) | |
| rows = [] |