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
# | |
# Possible cross-server database restoring of databases by adding the following at line 79 of: | |
# | |
# /usr/local/ey_resin/ruby/lib/ruby/gems/1.8/gems/ey_cloud_server-1.4.24/lib/ey_backup/cli.rb | |
# | |
# Then, you could run the following: | |
# | |
# eybackup -E my_other_environment -D my_local_db_name_if_different --restore 9:mybackedup_database.sql.gz | |
# | |
opts.on("-E", "--environment EY_Environment", "Engine Yard Environment.") do |environment| |
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
diff -r winslett.ey_cloud_server-1.4.24/lib/ey_backup/cli.rb /usr/local/ey_resin/ruby/lib/ruby/gems/1.8/gems/ey_cloud_server-1.4.24/lib/ey_backup/cli.rb | |
77a78,81 | |
> | |
> opts.on("-h", "--host HOSTNAME", "Remote hostname to connect, defaults to local") do |host| | |
> options[:host] = host | |
> end | |
diff -r winslett.ey_cloud_server-1.4.24/lib/ey_backup/engine.rb /usr/local/ey_resin/ruby/lib/ruby/gems/1.8/gems/ey_cloud_server-1.4.24/lib/ey_backup/engine.rb | |
6c6 | |
< attr_reader :username, :password | |
--- |
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
function split_db_dump { | |
if [ -f $1 ] | |
then | |
split -p 'Table structure' $1 | |
for file in x* | |
do | |
head -n1 $file | grep -oE '`[^`]+`' | sed 's/`//g' | xargs -n1 -I {} mv $file {} | |
done | |
else | |
echo "File name is required" |
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
heroku config:set MONGOHQ_URL='mongodb://myusername:mypassword@flame.mongohq.com:27017/my_database' |
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 'rubygems' | |
require 'mongo' | |
@conn = Mongo::Connection.new("localhost", 27017, :pool_size => 10, :pool_timeout => 5) | |
@db = @conn['mongomapper_resque_development'] | |
@coll = @db['users'] | |
puts @db.command({getLastError: 1}) | |
1.upto(10) do |
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
Twas the night before Christmas, when all through the house | |
Not a creature was stirring, not even a mouse. | |
The stockings were hung by the chimney with care, | |
In hopes that St Nicholas soon would be there. | |
The children were nestled all snug in their beds, | |
While visions of sugar-plums danced in their heads. | |
And mamma in her ‘kerchief, and I in my cap, | |
Had just settled our brains for a long winter’s nap. |
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
production: | |
sessions: | |
default: | |
uri: mongodb://<username>:<password>@<host>:<port>/<database_name> | |
options: | |
skip_version_check: true | |
consistency: :strong | |
safe: true | |
max_retries: 30 | |
retry_interval: 1 |
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 'benchmark' | |
class Data | |
class << self | |
@@key_values = {} | |
def put(key, value, time) | |
@@key_values[key] ||= [] | |
@@key_values[key] << {time: time, value: value} | |
true |
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
1. Eat Bi-Rite ice cream in Dolores Park | |
2. Tan yourself with other hip San Francisco residents at Dolores Park | |
3. Visit Bi-Rite grocery store in the Mission | |
4. Visit Golden Gate park and climb to the top of the DeYoung Museum | |
5. Stare at beautiful art at the San Francisco Museum of Modern Art (“SFMoMA”) | |
6. Window shop on Valencia St in The Mission - start at 16th and Valencia and walk to 25th and Valencia | |
7. Visit the Ferry Building Farmers Market (on Saturdays) under the Bay Bridge | |
8. Take a cable car on the California Line to Pac Heights and meander back down Fillmore St | |
9. Eat dim-sum in the largest China Town in the USA (Koi Palace in Daly City which is South of San Francisco is considered excellent for this) | |
10. See a concert at the Great American Music Hall |
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
uri = URI.parse(ENV['POSTGRES_URL']) | |
$query_postgres = lambda do |sql| | |
begin | |
$postgres ||= PG.connect(uri.hostname, uri.port, nil, nil, uri.path[1..-1], uri.user, uri.password) | |
$postgres.exec(sql) | |
rescue PG::UnableToSend | |
$postgres = nil | |
retry | |
end |
OlderNewer