This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| for dir in `find . -type d -depth 1`; do | |
| # remove ./ | |
| bag=`echo $dir | sed 's/^..//'` | |
| knife data bag create $bag; | |
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| total_percent=3649.39 | |
| for i in {0..9}; do | |
| last_ten_line_counts[$i]=0 | |
| done | |
| idx=0 | |
| while [ 1 ]; do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Finder | |
| attr_reader :right, :left | |
| def initialize attrs | |
| @fetch = attrs[:fetch] | |
| @test = attrs[:inside_test] | |
| @index = attrs[:inside_index] | |
| @step = attrs[:step] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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})) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
NewerOlder