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
db_params = { | |
"adapter"=>"mysql", | |
"database"=>"#{application}_#{rails_env}", | |
"username"=>"root", | |
"password"=>"", | |
"host"=>"localhost", | |
"socket"=>"" | |
} | |
db_params.each do |param, default_val| |
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
require 'rubygems' | |
require 'id3lib' | |
require File.join(File.dirname(__FILE__),'discogs/lib/discogs.rb') | |
# Script to tag mp3 releases using the discogs webservice. | |
# It requires the discogs gem: git://github.com/crofty/discogs.git | |
# Usage: | |
# ruby tag release_folder | |
# Then, when prompted, give the discogs release number |
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
# Installing Tokyo Cabinet on a slicehost slice | |
cd ~/src | |
wget http://tokyocabinet.sourceforge.net/tokyocabinet-1.4.23.tar.gz | |
tar xvzf tokyocabinet-1.4.23.tar.gz | |
cd tokyocabinet-1.4.23 | |
./configure | |
make | |
sudo make install | |
wget http://tokyocabinet.sourceforge.net/rubypkg/tokyocabinet-ruby-1.25.tar.gz |
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
# Capistrano task for importing database from production | |
require 'yaml' | |
desc "Copy the remote production database to the local development database" | |
task :backup, :roles => :db, :only => { :primary => true } do | |
filename = "#{application}.dump.#{Time.now.to_i}.sql.bz2" | |
file = "/tmp/#{filename}" | |
on_rollback { delete file } | |
get "#{current_path}/config/database.yml", "tmp/prod_database.yml" |
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
# Capistrano task for refreshing local db | |
require 'yaml' | |
desc "Copy the remote production database to the local development database" | |
task :backup, :roles => :db, :only => { :primary => true } do | |
filename = "#{application}.dump.#{Time.now.to_i}.sql.bz2" | |
file = "/tmp/#{filename}" | |
on_rollback { delete file } | |
get "#{current_path}/config/database.yml", "tmp/prod_database.yml" |
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 munin munin-node | |
# Edit the config file: sudo vim /etc/munin/munin.conf | |
dbdir /var/lib/munin/ | |
htmldir /var/www/munin/ | |
logdir /var/log/munin | |
rundir /var/run/munin/ | |
[localhost.localdomain] | |
address 127.0.0.1 | |
use_node_name yes |
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 monit | |
# Edit config file, example below | |
sudo vim /etc/monit/monitrc | |
# Check config syntax | |
sudo monit -t | |
# When no syntax errors edit the /etc/default/monit file to startup=1 | |
sudo vim /etc/default/monit | |
# Start the service with: | |
sudo /etc/init.d/monit start |
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
# Enabling URL rewriting with apache | |
sudo a2enmod rewrite | |
# Edit /etc/apache2/apache2.conf | |
RewriteEngine On | |
# Edit the vhosts in /etc/apache2/sites-available. e.g. | |
<VirtualHost *:80> | |
ServerName domain.com | |
ServerAlias www.domain.com | |
RewriteCond %{HTTP_HOST} ^domain\.com | |
RewriteRule (.*) http://www.domain.com$1 [R=301,L] |
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 update | |
sudo aptitude install build-essential | |
sudo apt-get install libmozjs-dev libicu-dev libcurl4-openssl-dev erlang | |
mkdir ~/src | |
cd ~/src | |
wget http://apache.mirror.anlx.net/couchdb/0.9.1/apache-couchdb-0.9.1.tar.gz | |
tar zxvf apache-couchdb-0.9.1.tar.gz | |
cd apache-couchdb-0.9.1 | |
./configure && make && sudo make install |
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
# check the hostname, needed as part of install | |
hostname -f | |
sudo apt-get install postfix telnet mailx | |
# test with | |
mail james@james.com |
OlderNewer