Skip to content

Instantly share code, notes, and snippets.

View nickmarden's full-sized avatar

Nick Marden nickmarden

View GitHub Profile
@nickmarden
nickmarden / gist:1498254
Created December 19, 2011 18:20
Running the paperclip-spike migrations and accessing paperclip-enabled models afterward
[nick@nick-mba paperclip-spike] (master)$ bundle exec rake db:migrate
== PaperclipMeta: migrating ==================================================
-- add_column(:uploaded_images, :img_meta, :text)
-> 0.0315s
...
== PaperclipMeta: migrated (0.0772s) =========================================
== PaperclipifyUploadedImages: migrating =====================================
-- execute("CREATE TABLE attachment_fu_uploaded_images_backup AS SELECT * FROM uploaded_images")
-> 0.0219s
--- src/searchd.cpp.orig 2010-05-10 23:49:13.000000000 +0100
+++ src/searchd.cpp 2010-05-10 23:52:03.000000000 +0100
@@ -10224,7 +10224,11 @@
g_iClientTimeout = hSearchd["client_timeout"].intval();
if ( hSearchd.Exists ( "max_children" ) && hSearchd["max_children"].intval()>=0 )
+ {
g_iMaxChildren = hSearchd["max_children"].intval();
+ if ( g_iMaxChildren > 0 )
+ g_iPreforkChildren = g_iMaxChildren;
export CHEF_USER=nick_marden
organization "your-organization"
....
Chef::Config.knife[:aws_account_id] = "123456789" # Your AWS Account ID
Chef::Config.knife[:aws_access_key_id] = "XXX"
Chef::Config.knife[:aws_secret_access_key] = "XXX"
[nick@nick-mba ironfan-homebase] (master)$ knife cluster list
Cluster Path: /Users/nick/workspace/ironfan-homebase/clusters
+-------------+-------------------------+
| cluster | path |
+-------------+-------------------------+
+-------------+-------------------------+
Ironfan.cluster 'my_first_cluster' do
# This is the Chef environment that the Chef nodes
# will be placed under.
environment :dev
# This Chef role comes built in to ironfan. It defines
# certain universal behaviors such as installing ntpd,
# zsh, and (strangely) emacs
role :systemwide
[nick@nick-mba ironfan-homebase] (master)$ knife cluster show my_first_cluster
Inventorying servers in my_first_cluster cluster, all facets, all servers
my_first_cluster: Loading chef
my_first_cluster: Loading ec2
my_first_cluster: Reconciling DSL and provider information
+-----------------------------+-------+-------------+----------+------------+-----+
| Name | Chef? | State | Flavor | AZ | Env |
+-----------------------------+-------+-------------+----------+------------+-----+
| my_first_cluster-web-0 | no | not running | m1.small | us-east-1c | dev |
| my_first_cluster-web-1 | no | not running | m1.small | us-east-1c | dev |
[nick@nick-mba ironfan-homebase] (master)$ knife cluster launch my_first_cluster
Inventorying servers in my_first_cluster cluster, all facets, all servers
my_first_cluster: Loading chef
my_first_cluster: Loading ec2
my_first_cluster: Reconciling DSL and provider information
+-----------------------------+-------+-------------+----------+------------+-----+
| Name | Chef? | State | Flavor | AZ | Env |
+-----------------------------+-------+-------------+----------+------------+-----+
| my_first_cluster-web-0 | yes | not running | m1.small | us-east-1c | dev |
| my_first_cluster-web-1 | yes | not running | m1.small | us-east-1c | dev |
[nick@nick-mba ironfan-homebase] (master)$ knife cluster bootstrap --yes my_first_cluster-database
Inventorying servers in my_first_cluster cluster, database facet, all servers
my_first_cluster: Loading chef
my_first_cluster: Loading ec2
my_first_cluster: Reconciling DSL and provider information
+-----------------------------+-------+---------+----------+------------+------+------------+--------------+---------------+------------+
| Name | Chef? | State | Flavor | AZ | Env | MachineID | Public IP | Private IP | Created On |
+-----------------------------+-------+---------+----------+------------+------+------------+--------------+---------------+------------+
| my_first_cluster-database-0 | yes | running | m1.large | us-west-1a | dev | i-28850471 | 50.18.71.186 | 10.174.19.139 | 2012-11-05 |
+-----------------------------+-------+---------+----------+------------+------+------------+--------------+---------------+------------+