Skip to content

Instantly share code, notes, and snippets.

@lstoll
lstoll / config.ru
Created November 17, 2008 03:44
Paml - hassox is our DHH
ENV["I_LIKE_METHOD_ALIAS_CHAIN"] = "true"
require 'rubygems'
require 'haml'
# performance optimizations.
load 'paml.rb'
require 'hoe'
<?php
/*
+----------------------------------------------+
| |
| PHP apache log parser class |
| |
+----------------------------------------------+
| Filename : apache-log-parser.php |
| Created : 21-Sep-05 23:28 GMT |
| Created By : Sam Clarke |
APP_BASE = File.dirname(File.expand_path(__FILE__))
namespace :db do
task :ar_init do
# Load the database config
require 'active_record'
database_yml = YAML::load(File.open(APP_BASE + "/config/database.yml"))
init_env == "rake" ? current_env = "development".to_sym : current_env = init_env.to_sym # Default to dev env, symbolize
ActiveRecord::Base.establish_connection(database_yml[current_env])
# set a logger for STDOUT
APP_BASE = File.dirname(File.expand_path(__FILE__))
namespace :db do
task :ar_init do
# Load the database config
require 'active_record'
database_yml = YAML::load(File.open(APP_BASE + "/config/database.yml"))
init_env == "rake" ? current_env = "development".to_sym : current_env = init_env.to_sym # Default to dev env, symbolize
ActiveRecord::Base.establish_connection(database_yml[current_env])
# set a logger for STDOUT
## ON DREAMHOST
lstoll@linc ~$ ssh barker.dreamhost.com
Linux barker 2.6.24.6-p4-modules-peon-grsec #1 SMP Thu May 15 22:08:43 PDT 2008 x86_64
Last login: Wed Jan 28 02:08:59 2009 from cpe-121-212-227-234.static.nsw.bigpond.net.au
# create the dir for the repos
[barker]$ mkdir git
# create temp dir
[barker]$ mkdir tmp
[barker]$ cd tmp
#!/bin/sh
KEY="$HOME/.ssh/id_rsa.pub"
if [ ! -f ~/.ssh/id_rsa.pub ];then
echo "private key not found at $KEY"
echo "* please create it with "ssh-keygen -t rsa" *"
echo "* to login to the remote host without a password, don't give the key you create with ssh-keygen a password! *"
exit
fi
function parse_git_branch {
#[ -d .git ] || return 1
git_status="$(git status 2> /dev/null)"
branch_pattern="^# On branch ([^${IFS}]*)"
remote_pattern="# Your branch is (.*) of"
diverge_pattern="# Your branch and (.*) have diverged"
if [[ ! ${git_status}} =~ "working directory clean" ]]; then
state="⚡"
fi
# add an else if or two here if you want to get more specific
#!/bin/bash
if [ ! $1 ]
then
echo "You must specify the name of the repo to clone"
exit
fi
git clone ssh://dh/~/git/$1.git
#!/bin/bash
cd ~/backup.git
TIMESTAMP=`date +%Y-%m-%d.%H:%M:%SUTC`
mysqldump -u drupal_dev -p'ga$f*sbb' -h 127.0.0.1 drupal_dev > ~/backup.git/db/drupal_dev.sql
sudo rsync -a --delete ~drupal-dev/site_data/files/ ~/backup.git/content/drupal_dev
sudo git add *
sudo git commit -a -m "$TIMESTAMP"
sudo git gc
sudo git push origin master
#!/bin/bash
cp -R src/main/resources/* target/u.lstoll.net-1.0-SNAPSHOT/WEB-INF/classes
cp -R target/classes/* target/u.lstoll.net-1.0-SNAPSHOT/WEB-INF/classes
cp -R src/main/webapp/* target/u.lstoll.net-1.0-SNAPSHOT/