This file contains 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
$:.unshift('~/rufus/rufus-tokyo/lib') | |
require 'benchmark' | |
require 'rubygems' | |
require 'faker' | |
require 'date' | |
# | |
# the data | |
# |
This file contains 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
require 'capistrano/recipes/deploy/strategy/remote' | |
module Capistrano | |
module Deploy | |
module Strategy | |
# Implements the deployment strategy that keeps a checkout of | |
# the source code on each remote server. Each deploy simply updates the | |
# checkout | |
class GitSync < Remote |
This file contains 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 | |
require 'yaml' | |
require 'benchmark' | |
require 'rubygems' | |
require 'rufus/tokyo' | |
$cab_file = "cab_#{Process.pid}.tch" | |
pcount = (ARGV[0] || 2).to_i |
This file contains 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
# get the apps | |
#ey environments --all | grep -E "^\w" | |
# get the environments | |
#ey environments --all | grep -E "^\s+\w" | awk '{print $1}' | |
_ey_does_ssh_list_need_generating () { | |
if [ ! -f ~/.ey_ssh_lists ]; then return 0; | |
else | |
yesterday=$(date +%s -d yesterday) |
This file contains 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
zblut@zblut-benchmark smart_api (ey_appcloud) % ey deploy -a smart_api -e testdb -r ey_appcloud | |
Connecting to the server... | |
Beginning deploy for 'smart_api' in 'testdb' on server... | |
~> Deploying revision 8bbe781... Debugging why deploy is now failing and loosing current symlink. | |
~> Loading deployment task overrides from /data/smart_api/shared/cached-copy/config/eydeploy.rb | |
~> Pushing code to all servers | |
rsync: failed to set times on "/data/smart_api/shared/cached-copy/tmp": Operation not permitted (1) | |
rsync: recv_generator: mkdir "/data/smart_api/shared/cached-copy/tmp/cache" failed: Permission denied (13) | |
*** Skipping any contents from this failed directory *** | |
rsync: recv_generator: mkdir "/data/smart_api/shared/cached-copy/tmp/sessions" failed: Permission denied (13) |
This file contains 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
;; Fix indentation for buffer | |
(defun fix-read-only-indentation () | |
"Fix the indentation of a read only file. For now you have to | |
remember to not save this change if you have write access to the | |
file" | |
(interactive) | |
(toggle-read-only) | |
(indent-region (point-min) (point-max))) |
This file contains 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
# rough if else ... | |
execute "restarting-mysql-with-custom-config" do | |
command "/etc/init.d/mysql restart" | |
only_if "pgrep mysqld" | |
end | |
execute "starting-mysql-with-custom-config" do | |
command "/etc/init.d/mysql start" | |
not_if "pgrep mysqld" |
This file contains 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
S3Object.store('lambda.jpg', d, 'mybucket', :content_type => 'image/jpeg', :content_md5 => Base64.encode64(Digest::MD5.digest(d))) |
This file contains 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
def notify_new_relic | |
run "cd #{release_path} && newrelic_cmd deployments -r `git log -1 --pretty=format:%H | head` || /bin/true" | |
end | |
on_app_master do | |
notify_new_relic | |
end |
This file contains 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
;; solution for part 1 http://programmingpraxis.com/2011/09/02/two-string-exercises/ | |
(defun rdup (str) | |
(defun rdup_ (str res) | |
(if (null str) | |
res | |
(if (member (car str) res) | |
(rdup_ (cdr str) res) | |
(rdup_ (cdr str) (append res (list (car str))))))) | |
(concat (rdup_ (string-to-list str) '()))) |
OlderNewer