sudo apt-get update
sudo apt-get install postfix mailutils
sudo mkfifo /var/spool/postfix/public/pickup
sudo /etc/init.d/postfix restart
sudo touch /var/mail/deploy
sudo chown deploy:deploy /var/mail/deploy
sudo reboot
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
# brew install git bash-completion | |
# Completion | |
if [ -f `brew --prefix`/etc/bash_completion ]; then | |
. `brew --prefix`/etc/bash_completion | |
fi | |
# Editor | |
export EDITOR='mate -w' |
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
--- | |
:update_sources: true | |
:sources: | |
- http://gems.rubyforge.org/ | |
- http://gems.github.com | |
:benchmark: false | |
:bulk_threshold: 1000 | |
:backtrace: false | |
:verbose: true | |
gem: --no-ri --no-rdoc |
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
# http://antonio.ognio.com/2010/07/28/installing-redis-on-linux-and-mac-os-x/ | |
wget http://redis.googlecode.com/files/redis-2.2.2.tar.gz | |
tar -xzvf redis-2.2.2.tar.gz | |
cd redis-2.2.2 && sudo make && sudo make install | |
Five binaries will be installed to /usr/local/bin, redis-server, redis-benchmark, redis-cli, redis-check-dump and redis-check-aof. You’ll have to manually copy the Redis configuration file to /etc like this: | |
sudo mkdir /etc/redis | |
sudo cp redis.conf /etc/redis/redis.conf |
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
[mysqld] | |
# | |
# * Networking | |
# | |
# Instead of skip-networking the default is now to listen only on | |
# localhost which is more compatible and is not less secure. | |
bind-address = 192.168.xxxx.xxxx | |
# |
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
# you can make as many tabs as you wish... | |
# tab names are actually arbitrary at this point too. | |
--- | |
- tab1: cd ~/foo/bar | |
- tab2: | |
- mysql -u root | |
- use test; | |
- show tables; | |
- tab3: echo "hello world" | |
- tab4: cd ~/baz/ && svn up |
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
// public/javascripts/application.js | |
// JQUERY example | |
// Accepts ev.foo, ev.bar, ev.html | |
$(document).bind('some:event', function(ev) { | |
// do something here | |
$('some-div').html(ev.html); | |
}); |
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
# http://www.rubyenterpriseedition.com/documentation.html#_garbage_collector_performance_tuning | |
# http://snaprails.tumblr.com/post/241746095/rubys-gc-configuration | |
# http://smartic.us/2010/10/27/tune-your-ruby-enterprise-edition-garbage-collection-settings-to-run-tests-faster/ | |
# http://izumi.plan99.net/blog/wp-content/uploads/2009/01/ree-documentation.html#_garbage_collector_performance_tuning | |
$ sudo nano /usr/local/bin/tuned_ruby | |
# !/bin/bash | |
export RUBY_HEAP_MIN_SLOTS=500000 | |
export RUBY_HEAP_SLOTS_INCREMENT=250000 |
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
# Credit to Mike Perham for this gem of an idea | |
# http://www.mikeperham.com/2007/12/17/creating-a-counter_cache-column/ | |
class RailsMigration < ActiveRecord::Migration | |
def self.up | |
add_column :media, :followers_count, :integer, :default => 0, :null => false | |
# Populate the media follower counter cache in one fell swoop. | |
sql = "update media, (select operable_id, count(*) as the_count from follow_operations "\ | |
"group by operable_id) as follows set media.followers_count = follows.the_count "\ | |
"where media.id = follows.operable_id;" |
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
$ sudo apt-get install gcc g++ build-essential libssl-dev libreadline5-dev zlib1g-dev linux-headers-generic | |
$ sudo apt-get install libc6-dev libssl-dev libmysql++-dev libsqlite3-dev make | |
$ wget ftp://ftp.ruby-lang.org//pub/ruby/1.9/ruby-1.9.2-p0.tar.gz | |
$ tar -xvzf ruby-1.9.2-p0.tar.gz | |
$ cd ruby-1.9.2-p0/ | |
$ ./configure --prefix=/usr/local/ruby | |
$ make && sudo make install | |
$ sudo nano /etc/environment | |
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/ruby/bin" |
OlderNewer