Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
svn remove log/*
svn commit -m"removing log files"
svn propset svn:ignore "*.log" log/
svn update log/
svn commit -m 'Ignoring all files in /log/ ending in .log'
svn move config/database.yml config/database.example
svn commit -m 'Moving database.yml to database.example to provide a template for anyone who checks out the code'
svn propset svn:ignore "database.yml" config/
svn update config/
require "thor/shell"
say("Modifying a new Rails app ...", :yellow)
#----------------------------------------------------------------------------
# Configure
#----------------------------------------------------------------------------
=begin
unless options[:database] == 'sqlite3'
username = ask("What's your database username[root]")
username = 'root' if username.blank?
# To show SQL Statements in the rails console
# copy this code to ~/.irbrc
# code found there http://frozenplague.net/2008/12/showing-sql-statements-in-scriptconsole/
if ENV.include?('RAILS_ENV') && !Object.const_defined?('RAILS_DEFAULT_LOGGER')
require 'logger'
RAILS_DEFAULT_LOGGER = Logger.new(STDOUT)
end
@kewinwang
kewinwang / .irbrc
Created May 18, 2011 09:55
custom configuration ~/.irbrc file
require 'rubygems'
require 'wirble'
Wirble.init
Wirble.colorize
if ENV.include?('RAILS_ENV') && !Object.const_defined?('RAILS_DEFAULT_LOGGER')
require 'logger'
RAILS_DEFAULT_LOGGER = Logger.new(STDOUT)
end
IRB.conf[:IRB_RC] = proc do |conf|
#!/bin/sh
# Install ImageMagick on Snow Leopard: by kain, improved by mislav and samsoffes
# http://www.icoretech.org/2009/08/install-imagemagick-in-leopard-snow-leopard/
# Work with 64bit kernel mode
set -e
PREFIX=/usr/local
# Passenger users: amend your Apache global configuration with the following directive
# SetEnv PATH /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
@kewinwang
kewinwang / full.gem.list.txt
Created September 29, 2011 14:47
Full Gem List Deployed in ruby applications monitored by New Relic, September 2011
Full Gem List Deployed in ruby applications monitored by New Relic, September 2011
Count Gem Name
----------------
7570 rack
7444 rake
7425 rails
7424 activesupport
7421 bundler
7412 actionpack
@kewinwang
kewinwang / full.plugin.list.txt
Created September 29, 2011 14:48 — forked from briandoll/full.plugin.list.txt
Full Plugin List Deployed in applications monitored by New Relic, September 2011
Full Plugin List Deployed in Rails applications monitored by New Relic, September 2011
Count Plugin Name
-------------------
2040 rpm
1534 newrelic_rpm
1268 acts_as_list
1186 paperclip
1130 will_paginate
1068 exception_notification
@kewinwang
kewinwang / UpgradeCentOSRuby.sh
Created October 21, 2011 07:21 — forked from jimjeffers/Ruby_1.9.2-p290_on_Ubuntu_10.4
Upgrade CentOS ruby to 1.8.7 -p299 and install passenger.
# Install ruby 1.8.7 -p299
sudo mkdir /usr/local/src
cd /usr/local/src
sudo curl -O ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p299.tar.gz
sudo tar xzvf ruby-1.8.7-p299.tar.gz
cd ruby-1.8.7-p299
sudo ./configure --enable-shared --enable-pthread
sudo make
sudo make install
cd ext/zlib
@kewinwang
kewinwang / gist:1476411
Created December 14, 2011 12:36 — forked from samqiu/railscasts.rb
download railscast video
#!/usr/bin/ruby
require 'rss'
p 'Downloading rss index'
rss_string = open('http://feeds.feedburner.com/railscasts').read
rss = RSS::Parser.parse(rss_string, false)
videos_urls = rss.items.map { |it| it.enclosure.url }.reverse
videos_filenames = videos_urls.map {|url| url.split('/').last }
@kewinwang
kewinwang / puppet_master_seed_prod_8140.conf
Created January 9, 2012 16:12 — forked from jeffmccune/puppet_master_seed_prod_8140.conf
Puppet Master Front End Load Balancer configuration
## Apache Load Balancer Front End ##
# Puppet Apache::Config[010_frontend_puppet_prod.conf]
# This file managed by Puppet from a template.
# source: puppet_frontend_XXXX.conf
# All CA requests should be directed to specific workers
<Proxy balancer://puppet_prod_ca>
# Only one member
BalancerMember http://puppetca.puppetlabs.vm:18140