Monday, December 31, 2012

How to Create DNS Records using Linode API


dns = Fog::DNS.new(provider: 'linode',
                                    linode_api_key: 'your-linode-api-key-goes-here')
zone = dns.zones.create(domain: 'your-domain.com',
                 email: 'admin@your-domain.com')
zone.nameservers

Create a www version of your site and point to the right IP.
record = zone.records.create(value:  '1.2.3.4', name: 'your-domain.com', type: 'A')

To make www.your-domain.com go to the same place, use a cname record:
record = zone.records.create(value: 'your-domain.com', name: 'www', type: 'CNAME')

Thursday, December 13, 2012

to_yaml method y broken in Ruby 1.9


vi ~/.irbrc
YAML::ENGINE.yamler = 'syck'
Save. Now you will be able to use the method y to dump objects in yaml format.

error: The following untracked working tree files would be overwritten by merge: Library/Formula/pbrt.rb



cd /usr/local
git reset --hard origin/master
brew update


Rails 3.2 Tagged Logging

MyLogger = ActiveSupport::BufferedLogger.new(Rails.root.join('log/my_tagged.log'))
MyTaggedLogger.tagged("PAY") { MyTaggedLogger.info "Hello I am working!" }

Wednesday, December 05, 2012

Tuesday, December 04, 2012

Monday, December 03, 2012

How to install local gem


1. Download the .gem file.
2. gem unpack file.gem .
. is the current directory
3. Specify in Gemfile:
   gem 'name-of-gem', '0.1.0', :path => "/path/to/the/unpacked/gem/directory"
4. bundle install