I've been trying to understand how to setup systems from
the ground up on Ubuntu. I just installed redis onto
the box and here's how I did it and some things to look
out for.
To install:
| from fabric.api import env, run, sudo, local, put | |
| def production(): | |
| """Defines production environment""" | |
| env.user = "deploy" | |
| env.hosts = ['example.com',] | |
| env.base_dir = "/var/www" | |
| env.app_name = "app" | |
| env.domain_name = "app.example.com" | |
| env.domain_path = "%(base_dir)s/%(domain_name)s" % { 'base_dir':env.base_dir, 'domain_name':env.domain_name } |
| # NOTICE: to get Nginx+Unicorn best-practices configuration see the gist https://gist.github.com/3052776 | |
| $ cd /usr/src | |
| $ wget http://nginx.org/download/nginx-1.2.1.tar.gz | |
| $ tar xzvf ./nginx-1.2.1.tar.gz && rm -f ./nginx-1.2.1.tar.gz | |
| $ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.30.tar.gz | |
| $ tar xzvf pcre-8.30.tar.gz && rm -f ./pcre-8.30.tar.gz | |
| $ wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz |
| #!/usr/bin/env python | |
| """Run all processes in parallel. | |
| Group output by process groups and order within groups | |
| """ | |
| import shlex | |
| import subprocess | |
| import sys | |
| import threading |
| [unix_http_server] | |
| file=/tmp/supervisor.sock ; path to your socket file | |
| [supervisord] | |
| logfile=/var/log/supervisord/supervisord.log ; supervisord log file | |
| logfile_maxbytes=50MB ; maximum size of logfile before rotation | |
| logfile_backups=10 ; number of backed up logfiles | |
| loglevel=error ; info, debug, warn, trace | |
| pidfile=/var/run/supervisord.pid ; pidfile location | |
| nodaemon=false ; run supervisord as a daemon |
| #!/usr/bin/env ruby | |
| # Script to import tumblr posts into local markdown posts ready to be consumed by Jekyll. | |
| # Inspired by New Bamboo's post http://blog.new-bamboo.co.uk/2009/2/20/migrating-from-mephisto-to-jekyll | |
| # Supports post types: regular, quote, link, photo, video and audio | |
| # Saves local copies of images | |
| require 'rubygems' | |
| require 'open-uri' | |
| require 'nokogiri' |
| <!DOCTYPE html> | |
| <!-- Created by Josh Dick <http://joshdick.net> --> | |
| <html> | |
| <head> | |
| <meta http-equiv="content-type" content="text/html; charset=utf-8" /> | |
| <meta name="language" content="en" /> | |
| <title>Elegant E-Mail Address Obfuscation</title> | |
| <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script> | |
| </head> |
| <?xml version="1.0" encoding="UTF-8" ?> | |
| <Data> | |
| <Series> | |
| <id>83462</id> | |
| <Actors>|Nathan Fillion|Stana Katic|Molly C. Quinn|Jon Huertas|Seamus Dever|Tamala Jones|Susan Sullivan|Ruben Santiago-Hudson|Monet Mazur|</Actors> | |
| <Airs_DayOfWeek>Monday</Airs_DayOfWeek> | |
| <Airs_Time>10:00 PM</Airs_Time> | |
| <ContentRating>TV-PG</ContentRating> | |
| <FirstAired>2009-03-09</FirstAired> | |
| <Genre>|Drama|</Genre> |
| # As a general rule, I despise all things SEO with it's witchery and voodoo ways. | |
| # However, these two practices are confirmed semi-non-witchcraft SEO best practice. | |
| # | |
| # 1. Serve your content from a consistent domain (www vs. non-www, Doesn't matter. Just be consistent) | |
| # In addition this is nice for Heroku and other cloud based deployment environments that leave your app | |
| # accessible from a url like http://myapp.herokuapp.com | |
| # | |
| # 2. Believe it or not, trailing slashes matter. The google machine interprets http://domain.com/about | |
| # as a different page than domain.com/about/ | |
| # (source: http://googlewebmastercentral.blogspot.com/2010/04/to-slash-or-not-to-slash.html ) |
| # First install tmux | |
| brew install tmux | |
| # For mouse support (for switching panes and windows) | |
| # Only needed if you are using Terminal.app (iTerm has mouse support) | |
| Install http://www.culater.net/software/SIMBL/SIMBL.php | |
| Then install https://bitheap.org/mouseterm/ | |
| # More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/ |