Skip to content

Instantly share code, notes, and snippets.

# Dev enviroment
echo sun-java6-jdk shared/accepted-sun-dlj-v1-1 boolean true | debconf-set-selections
sudo apt-get install memcached subversion libxslt-dev libxml2-dev imagemagick libmagickcore-dev mysql-server libmysqlclient-dev -y
# Install Rubygems
cd /usr/local/src
sudo wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.6.tgz
sudo tar xzvf rubygems-1.3.6.tgz
@jcode
jcode / Unix Commands
Created October 19, 2010 11:21
SVN tools
# Add recursively
svn status | grep "^\?" | awk '{print $2}' | xargs svn add
# Clean .svn files
find . -type d -name ‘.svn’ | xargs rm -rf
# Rsync folders
rsync -ruv --exclude=.svn ../themes themes
set :application, "deliverit"
set :repository, "https://jcode.svn.beanstalkapp.com/homero/branches/deliverit/"
set :deploy_via, :remote_cache
set :use_sudo, false
set :user, "root"
set :deploy_to, "/var/rails/#{application}"
set :scm, :subversion
set :keep_releases, 2
@jcode
jcode / Apache2 VirtualHost
Created January 27, 2012 22:12
Apache2 VirtualHost
# override /etc/init.d/apache2/sites_enabled/000-default
NameVirtualHost *
# For each virtual host
<VirtualHost *>
ServerName mydomain.com
ServerAlias x.mydomain.com y.mydomain.com *.otherdomain.net
@jcode
jcode / Capistrano
Created January 27, 2012 22:14
Capistrano
set :application, "myapp"
set :deploy_via, :remote_cache
set :deploy_to, "/var/rails/#{application}"
set :keep_releases, 2
set :branch, "master"
set :use_sudo, false
role :app, "mydomain.com"
role :db, "mydomain.com", :primary => true
@jcode
jcode / Ruby 1.9.3p0 with Psych
Created February 19, 2012 11:07
Ruby 1.9.3p0 with Psych install
wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
tar xzvf yaml-0.1.4.tar.gz
cd yaml-0.1.4
./configure --prefix=/usr/local
make
make install
wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p0.tar.gz
tar xzvf ruby-1.9.3-p0.tar.gz
cd ruby-1.9.3-p0
@jcode
jcode / Debian-Ubuntu Ruby 1.9.3-p194 download compilation with dependencies
Created June 12, 2012 14:21
Debian-Ubuntu Ruby 1.9.3-p194 download & compilation with dependencies
## Base system
apt-get update
apt-get install zlib1g-dev -y
apt-get install mysql-client -y
apt-get install libv8-dev -y
apt-get install build-essential -y
apt-get install libxslt1-dev -y
apt-get install libxml2-dev -y
apt-get install imagemagick -y
## Base system
apt-get update
apt-get install zlib1g-dev build-essential -y
apt-get install git-core -y
apt-get install libv8-dev -y
apt-get install apt-get install libreadline5-dev libncurses5-dev -y
apt-get install build-essential libxslt1-dev libxml2-dev imagemagick libmagickcore-dev libmysqlclient-dev -y
apt-get install libcurl4-openssl-dev libssl-dev libopenssl-ruby libapr1-dev libaprutil1-dev -y
@jcode
jcode / gist:3869055
Created October 10, 2012 22:54
Apache2 Reverse Proxy
a2enmod proxy
a2enmod proxy_http
...in the virtualhost add this lines...
ProxyPreserveHost On
ProxyRequests off
ProxyPass / http://192.168.1.193/
ProxyPassReverse / http://192.168.1.193/
@jcode
jcode / gist:4137015
Created November 23, 2012 19:47
Liquid Example #1
45: <img src="/assets/admin/theme_mentor.png" />
46: </div>
47: <div id="current-theme-desc">
48: <p><%= sanitize(@site.current_theme.description) %></p>
49: <span class="meta-info"><%= raw t('admin.customization.themes.last_modificated') %>
50: : <%= time_ago_in_words(@themeship.updated_at) %></span>
51: <%= link_to t('admin.customization.themes.gallery'), main_app.list_customization_themes_path() %>