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
# First do a check to see what versions of TC/TT are supported by the ruby gem | |
# http://rufus.rubyforge.org/rufus-tokyo/ | |
# Install tokyo cabinet | |
wget http://sourceforge.net/projects/tokyocabinet/files/tokyocabinet/1.4.29/tokyocabinet-1.4.29.tar.gz/download | |
tar xvf tokyocabinet-1.4.29 | |
cd tokyocabinet-1.4.29 | |
./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
# 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 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
# check the hostname, needed as part of install | |
hostname -f | |
sudo apt-get install postfix telnet mailx | |
# test with | |
mail james@james.com |
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 |
OlderNewer