Unsere Setup-Routine für eine Rails-App mit Nginx, Passenger, rvm auf einen Host Europe-VPS mit Ubuntu 10.4.
apt-get update
apt-get install -y build-essential bison openssl libreadline5 libreadline5-dev curl \
| #!/bin/bash | |
| ssh $1 <<EOF | |
| ps_line=\$(ps aux | grep chef-client | grep sleep ) | |
| secs=\$(echo \$ps_line | grep -o 'sleep [0-9]*' | cut -d' ' -f2) | |
| start=\$(echo \$ps_line | awk '{print \$9}') | |
| start_min=\$(echo \$start | cut -d':' -f 1) | |
| start_sec=\$(echo \$start | cut -d':' -f 2) |
| #!/bin/bash | |
| # put this in your $PATH before /usr/bin, name it vi, chmod +x and enjoy | |
| ARGS=$(echo $@ | sed 's/:/ +/g') | |
| exec /usr/bin/vi $ARGS | |
| # Set up the prompt | |
| autoload -Uz promptinit | |
| promptinit | |
| prompt walters | |
| # Use emacs keybindings even if our EDITOR is set to vi | |
| bindkey -e | |
| # Keep 1000 lines of history within the shell and save it to ~/.zsh_history: |
| #!/bin/bash | |
| for dir in `find . -type d -depth 1`; do | |
| # remove ./ | |
| bag=`echo $dir | sed 's/^..//'` | |
| knife data bag create $bag; | |
| done |
| --- gozk.go 2011-08-29 09:44:44.193098000 +0000 | |
| +++ gozk_static.go 2011-08-29 13:38:18.059167567 +0000 | |
| @@ -10,7 +10,6 @@ | |
| /* | |
| #cgo CFLAGS: -I/usr/include/c-client-src | |
| -#cgo LDFLAGS: -lzookeeper_mt | |
| #include <zookeeper.h> | |
| #include "helpers.h" |
| #!/bin/bash | |
| total_percent=3649.39 | |
| for i in {0..9}; do | |
| last_ten_line_counts[$i]=0 | |
| done | |
| idx=0 | |
| while [ 1 ]; do |
| class Finder | |
| attr_reader :right, :left | |
| def initialize attrs | |
| @fetch = attrs[:fetch] | |
| @test = attrs[:inside_test] | |
| @index = attrs[:inside_index] | |
| @step = attrs[:step] |
| function(head, req) { | |
| var row | |
| var rows=[] | |
| while(row = getRow()) { | |
| rows.push(row) | |
| } | |
| rows.sort(function(a,b) { | |
| return b.value-a.value | |
| }) | |
| send(JSON.stringify({"rows" : rows})) |
| #!/usr/bin/ruby | |
| # to count the words of "The Complete Works of William Shakespeare", type | |
| # $ curl http://www.gutenberg.org/cache/epub/100/pg100.txt | ./wordcount_map_reduce.rb | |
| def map line | |
| line.split(' ').each do |word| | |
| emit(word, 1) | |
| end | |
| end |