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
| module CouchDB | |
| def sync | |
| changes = aof_get.uniq | |
| if changes.length > 0 | |
| couch_create_database! | |
| sync! changes | |
| aof_del! | |
| end |
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 Crypt | |
| constructor: (@key) -> | |
| GibberishAES.size(128); | |
| decrypt: (str) -> | |
| return str unless str? and @key? | |
| GibberishAES.dec(str, @key) | |
| encrypt: (str) -> |
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/zsh | |
| setopt noglob | |
| alias redis='redis-cli' | |
| key=$1 | |
| function _load_fixtures(){ | |
| redis hset $key action bounce | |
| for process (http node dmgr) redis sadd ${key}:processes $process |
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/zsh | |
| alias redis='redis-cli --raw' | |
| # pop ID from queue | |
| id=$(redis rpop "jobs:queue") | |
| # check if we have an ID | |
| if (( $#id > 0 )); then | |
| echo "running workflow $(redis hget "job:${id}:data" process)" && sleep 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
| setopt noglob | |
| for env (IST UAT NFT PROD) do | |
| keys=$(redis -n 1 --raw keys "servers:*:${env}*") | |
| for hostname ($(redis sunion $keys)) do | |
| bladelogic "acl_${hostname}" Server addPermission ${env}role $hostname ${env}user system | |
| done | |
| 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
| SADD status:hostnames ab.local | |
| HSET status:hostname:ab.local http running | |
| ZADD status:hostname:ab.local:weight 5 http |
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
| package IO::Socket::StatusPublisher; | |
| use strict; | |
| use warnings; | |
| use IO::Socket; | |
| sub help { | |
| die "Usage: $0 process status [weight] [hostname]\n" | |
| . "\tprocess: name of process (http,dmgr,etc)\n" | |
| . "\tstatus: status of process (start[ed],run[ning],stop[ped],term[inated])\n" | |
| . "\tweight: (optional) number for size of the pie slice. defaults to 0\n" |
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
| package IO::Socket::StatusPublisher; | |
| use strict; | |
| use warnings; | |
| use IO::Socket; | |
| sub help { | |
| die "Usage: $0 process status [weight] [hostname]\n" | |
| . "\tprocess: name of process (http,dmgr,etc)\n" | |
| . "\tstatus: status of process (start[ed],run[ning],stop[ped],term[inated])\n" | |
| . "\tweight: (optional) number for size of the pie slice. defaults to 0\n" |
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
| all_servers = | |
| UAT: | |
| http: 'UAT1|UAT2' | |
| node: 'UAT1|UAT2|UAT3' | |
| dmgr: 'UAT1' | |
| NFT: | |
| http: 'NFT1|NFT2' | |
| node: 'NFT1|NFT2' | |
| dmgr: 'NFT1' |
OlderNewer