Building a Rails Gmail Client Outside-In
Posted: May 29, 2012 Filed under: Uncategorized | Tags: rails, ruby, software development Leave a comment »New Article: Building a Rails Gmail Client Outside-In/
For all the new projects that I start with my stakeholders I have been pushing Outside–in software development and Specification by example. Specification by Example really improves the collabora…
2012 Whiskey Row Marathon
Posted: May 14, 2012 Filed under: Uncategorized | Tags: running Leave a comment »
On May 5th my wife and I did the 2012 Whiskey Row Marathon 10k. It was very challenging and a lot of fun. The Proceeds from this race go directly into the scholarship fund at the Prescott YMCA to assist children and families in financial need to participate in child care, swimming lessons, youth sports and gymnastics classes. Prescott is my home town and most of my family still lives up there so it was great to do the run and spend time with the family. This was my wife’s first race and she did amazing.
After the race we spent some quality time at PBC enjoying some great beer. My dad also hooked me up with a pretty cool solar lite bottle opener from a local Prescott company called Solarfunstuff.
Our next run will be the 2012 Hospice Run For Life in Flagstaff, AZ on June 28. At 7,000 feet (2,130 m) elevation it should prove to be another challenging and exciting run.
Rendering Partials with Sinatra
Posted: April 7, 2012 Filed under: Uncategorized | Tags: ruby, sinatra Leave a comment »Simple way to render partials with Sinatra:
https://gist.github.com/119874#gistcomment-238742
Ruby 1.9.3 IMAP segfault with OpenSSL
Posted: April 1, 2012 Filed under: Uncategorized | Tags: ruby Leave a comment »After upgrading to Ruby 1.9.3 I spent most of the morning trying to figure out why my IMAP code was giving a segfault
..
1.9.3p0 :001 > require 'net/imap'
=> true
1.9.3p0 :002 > m = Net::IMAP.new('imap.gmail.com', 993, true, nil, false)
/Users/carlos/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/imap.rb:1439: [BUG] Segmentation fault
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.3.0]
-- Control frame information -----------------------------------------------
c:0028 p:---- s:0108 b:0108 l:000107 d:000107 CFUNC :connect
c:0027 p:0198 s:0105 b:0105 l:000104 d:000104 METHOD /Users/carlos/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/imap.rb:1439
c:0026 p:0172 s:0100 b:0100 l:000099 d:000099 METHOD /Users/carlos/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/imap.rb:1036
c:0025 p:---- s:0091 b:0091 l:000090 d:000090 FINISH
c:0024 p:---- s:0089 b:0089 l:000088 d:000088 CFUNC :new
c:0023 p:0023 s:0083 b:0083 l:001b28 d:001470 EVAL (irb):2
c:0022 p:---- s:0080 b:0080 l:000079 d:000079 FINISH
c:0021 p:---- s:0078 b:0078 l:000077 d:000077 CFUNC :eval
..
Turns out it was related to OpenSSL and the fact that I forgot to install the Ruby OpenSSL extensions. Chris Irish’s post reminded me of the requirement.
$ rvm remove ruby-1.9.3
$ rvm install ruby-1.9.3 --with-openssl-dir=/opt/local --with-iconv-dir=$rvm_path/usr
..
1.9.3-p0 :003 > m = Net::IMAP.new('imap.gmail.com', 993, true, nil, false)
=> #<Net::IMAP:0x007f808500cc30 @mon_owner=nil, @mon_count=0, @mon_mutex=#, @host="imap.gmail.com", @port=993, @tag_prefix="RUBY", @tagno=0, @parser=#, @sock=#, @usessl=true, @responses={}, @tagged_responses={}, @response_handlers=[], @tagged_response_arrival=#<MonitorMixin::ConditionVariable:0x007f808500c280 @monitor=#, @cond=#<ConditionVariable:0x007f808500c258 @waiters=[], @waiters_mutex=#>>, @continuation_request_arrival=#<MonitorMixin::ConditionVariable:0x007f808312c1d0 @monitor=#, @cond=#<ConditionVariable:0x007f808312c1a8 @waiters=[], @waiters_mutex=#>>, @idle_done_cond=nil, @logout_command_tag=nil, @debug_output_bol=true, @exception=nil, @greeting=#<struct Net::IMAP::UntaggedResponse name="OK", data=#, raw_data="* OK Gimap ready for requests from 174.19.150.134 7if4443230pbt.12\r\n">, @client_thread=#, @receiver_thread=#, @receiver_thread_terminating=false>
1.9.3-p0 :004 >
Tornado Pretty Error Pages
Posted: March 23, 2012 Filed under: Uncategorized Leave a comment »http://carlosgabaldon.com/articles/tornado-pretty-error-pages/
Tornado Templates
Posted: March 9, 2012 Filed under: Open Source | Tags: python Leave a comment »More fun with Tornado!
http://carlosgabaldon.com/articles/tornado-templates/
Tornado Web Server
Posted: February 19, 2012 Filed under: Open Source | Tags: open source, python Leave a comment »Last week I started working with a cool new web server.
http://carlosgabaldon.com/articles/storm-chasing-tornado/
SCALE 10x 2012
Posted: January 20, 2012 Filed under: Conferences | Tags: open source, technology Leave a comment »I am at the SCALE 10x conference today in LA. I just finished registration, the line was long, but I made it through.
The first talk I will be attending is called Mentoring Moments: Creating Opportunities for Success presented by Amber Graner
I will be doing live blogging throughout the day..
UPDATE….
Mentoring Moments: Creating Opportunities for Success presented by Amber Graner.
What is a mentor?
- Strong interpersonal skills
- Strong Supervisory Skills
- Knowledge of the project
– Have a broad knowledge of the project to match up people
- Interested in someone else’s growth
– What their feedback, you care about their growth..It can not be about you it has to be about their growth.
What Mentors Do?
- Set high expectations of performance, but not unattainable.
- Offer challenging ideas
- Help build self confidence
- Encourage professional behavior
- Offer friendship
- Listen to personal problems
- Control negative behaviors & attitudes
- Teach by example
- Provide growth experiences
- Explain how the project works
- Couches are not the same as mentors
– Couches successes can be easily measured by performance
– Mentors teach the whole of the person
— Interpersonal skills
— Communication skills
– Good leaders are usually good mentors
- Mentors are self aware of their actions & behaviors
- Open source work should be put on their resume..
What makes you a mentor?
- Role Model
– People want to emulate their behavior
- Teacher
- Friend
- Support
- Resource
What are moments?
- teaching someone skills in brief periods of time, should be present.
How to create moments?
- 1:1 Conversions
- Meetings
- Blog posts
- Actions
– You need to create those moments..every day.. all the time..
– Make those moments fun
How do you evaluate success?
- If you can create favorable or desired actions in people from brief moments.
Take ways
- Know the person well enough to know when to push them and when to hold back.
- Always be open to being mentored yourself..
- Traditional mentoring does not work
- Corporate methods do not work, because community based teams do not care about traditional methods.
- Be yourself without apology
- It is not personal
- Don’t be afraid to fail publicly
- I am good enough
- Collaborate openly
– Tell people your ideas, do not be afraid to share your thoughts
- Be Transparent
- Take ad-hoc moments to mentor people, when people ask for help
- Teach someone how to do something then get out of their way so they can do it
- Set times, no longer than a day to work on a skill set or share information
- How to find a mentor? Look for them! Ask them!
UPDATE….
-
Lee Thompson
DevOps Day Keynote
SCALE DevOps day
Lee Thompson is CTO at MorphLabs
- DevOps is a community based idea, not a set of specific practices.
- DevOps toolchain
- Ops wants stability
- Dev wants change
- Each have different traditional goals
- The Visible OPS Handbook
- Agile development fixes the wall between Biz & DEV
- DevOps fixes the wall between DEV & Ops
- Dev view
– Lack of visibility into production
– Schedule slippage due to deployment problems
– Lack of understanding in operations
– Release process is awkward
- Ops view
– 80% of prod outages are related to changes
- Businesses spend almost half them time on change management
– 47% of time is related to change management
- Everyone has monitoring, but almost no one has control, why?
- Need a control toolchain
– Runbook Automation
– Control
– Eventing, Alarm
– Charting, History
– Measurement Instrumentation
– System
- SPC
– Process control
— Keep things in standard deviation, goes out start alarming
— View few companies do SPC
- Lean Development
– Focus on Value Stream Mapping
— Understand what creates value in the process
- Read the Lean Startup – discusses the biz problem
– Aligns the concepts of DevOps with biz
– Provides tools
— Minimum Viable System
— Reduce Batch Size
— Continuous Integration
— Continuous Deployment
— Innovation Accounting
– Fail quick and Pivot
– To do lean Startup, you need DevOps!
Take ways
- Development has over focus on unit test and lack of focus on integration tests
- Integration testing is harder than actual development
- It is about people working together..
- 
UPDATE…
nventory – Your Infrastructure’s Source of Truth
nVentory
- Collects data in automated fashion
- Allows programs and people collect data about your infrastructure
- Common, but painful Sources of Truth
– Spreadsheet
– Static file
– DNS
– Hostname
– MySQL/Postgres
– Custom Solution
- Better approaches
– Puppet and Chef are better
– Enterprise solutions are expensive
Why nVentory?
- Centralized
- Detailed
- Metadata
- Multiple access methods
- API
- etc
Why for DevOps?
- It is essential that all individual tools be consider part of a a large toolchain that spans the entire dev to ops lifecycle
- Your tools should all talk to a master
– Everyone should know where to go for answers
What is nVentory?
- Provides the foundation, you have to build the house
eHarmony uses:
- Chef-solo – app config mgt
- Etch – sys config mgt
- Jenkins – ci
- Self service VMs – custom private clouds
- Splunk – Monitoring
- Finance – audits
- QA, Ops, and Engineering
Objects are the key to nVentory!
- Everything is an object
– Rack, nodes, load balancer, etc
– Tree of relationships
– Node Group is related objects based on purpose
Other Objects that nVentory provides!
– status
– hardware_profile
– operating_system
– network_interface
– ip_address
– vip
– lb_pool
– tags & graffiti
— allow customization of nVentory
How is the nVentory Server built?
- Uses MVC pattern
- Heavy usage of ActiveRecord
- For each object, there are corresponding model, view and controller for it
- RESTful API
– Makes integration very easy since it uses HTTP and associated VERBS (GET, POST, PUT, DESTROY)
nVentory Clients
- Written in Ruby & Perl
- Uses various tools to gather host/hardware info
- Clients use the RESTful api to talk with the Server by invoking the nv-register command
How do you setup client?
- Install one each box at build time
nVentory client provides simple commands for getting things such as:
- Get host names
- Get node groups
- Get named hosts
- etc..
- Can also use Ruby api for developing clients
How does eHarmony use nVentory?
- User mgt
- Actions to a group of machines
- Config mgt
- Discovery of node details
- Change mgt
- Use the api to write scripts that pull all the machine in a given node group then act on them
Demo
– http://nventory.slacklabs.com/
UPDATE…
Four lighting talks..
Communication topic
- Part of a triangle
– Infinity
— natural emotional response
— degree of liking, people are naturally social
– Reality
— the state of things as they are or they appear to be
— is subjective
– Communication
— imparting or interchange of ideas
— most important part of the triangle
Increase Infinity
- Find something to like about another person
- Find something that the person agrees with to find a common ground
———————–
HA Proxy topic – Slides
- mature 10 years old
- purpose is a load balancer, that is it
- configuration can get ugly
– haproxy_join can solve complexity
- has web ui for managing
- has command line, but unfriendly
– haproxyctl simplifies
- ruby gems
– rhapr – can manage multiple HAProxies
– easy libs
—————————–
Visualizing Http benchmarks topic – parbench
- incorporates time into the benchmark
- randomly sleep benchmarks

——————————-
Control for the Cloud topic – John Willis
Three legs of the cloud – Challenges
- Infrastructure
– Private, Public, Hybrid?
- Cloud Management
– ACL, DR, Auth, Auditing, Security, financial controls, compliance
- Configuration Management
– Puppet, Chef?
Finding your inspiration
Posted: January 17, 2012 Filed under: Uncategorized | Tags: inspiration, marathon, running 2 Comments »Three months ago I decided I wanted to start running, but like many people I did not really like running. I figured the best approach was to just jump “feet” first into the idea of becoming a runner. After a few weeks I was making physical progress but, I was still not mentally into the run.
I was doing the run, but not being in the run.
Then in my quest for inspiration I happened to be reading a Runner’s World article about how Flea from the Red Hot Chili Peppers was inspired by the book Born to Run by Christopher McDougall. So I picked up a copy of the book and started reading. I was amazed how it quickly transformed by view point on running. My next run I decided to ditch the iPod and focus on being mindful during my run.
I focused on my breathing, how my legs felt, the temperature outside, how it made me feel, the trees, the wind, essentially the pure feeling of the run.
So my journey went from:
Now with my first 1/2 marathon complete with a pretty good time,
I know now that I am just starting my journey…
Rails Common Commands
Posted: October 3, 2010 Filed under: Uncategorized | Tags: rails, ruby, software development 1 Comment »A list of frequent Rails command line commands.
- rvm use ruby-1.9.2-p0 - ruby version manager; switches to Ruby 1.9.2
- rvm use ruby-1.9.2-p0 --default - ruby version manager; sets 1.9.2 as default
- rvm use system - ruby version manager; switches to Ruby 1.87
- rails new - creates a new Rails application
- rails server [s] - launches WEBrick web server
- rails generate [g] - lists available generators
- rails generate controller --help - provides usage documentation
- rails generate model --help - provides usage documentation
- rails generate migration --help - provides usage documentation
- rails destroy controller [Name] - undo generate controller
- rails destroy model [Name] - undo generate model
- rails generate scaffold [Name] --skip --no-migration - scaffold skipping existing files
- rake db:migrate - runs database migrations
- rake db:test:clone - clones current environment's database schema
- rake db:test:purge - empties the test database
- rake routes - list of all of the available routes
- rake -T - list of rake commands
- git init - creates git repo
- git add . - adds all files to working tree
- git commit -m "Initial commit" - commits files to repo
- git status - status of the working tree
- git push origin master - merges local repo with remote
- git checkout -b new-dev - creates topic branch
- git checkout master - switches to master branch
- git merge new-dev - merges new-dev branch into master branch
- git checkout -f - undo uncommitted changes on working tree
- git branch - list branches
- git branch -d modify-README - deletes branch
- git mv README README.markdown - renames files using move command
- heroku create - creates app on Heroku servers
- git push heroku master - pushs app on to Heroku servers
- heroku rake db:migrate - runs database migrations on Heroku servers
- heroku pg:reset --db SHARED_DATABASE_URL - deletes database file
- heroku db:push - transfer an existing database to Heroku.
- heroku logs - get logs.
- rails console - command line interface to Rails app
- rails dbconsole - command line database interface
- bundle install - installs gems from Gemfile









