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 redis import Redis | |
| import simplejson | |
| class Resque(object): | |
| """Dirt simple Resque client in Python. Can be used to create jobs.""" | |
| redis_server = 'localhost:6379' | |
| def __init__(self): | |
| host, port = self.redis_server.split(':') | |
| self.redis = Redis(host=host, port=int(port)) |
| --- src/http/ngx_http_variables.c.orig 2010-01-11 03:21:46.000000000 -0800 | |
| +++ src/http/ngx_http_variables.c 2010-02-18 10:01:32.000000000 -0800 | |
| @@ -93,6 +93,9 @@ | |
| static ngx_int_t ngx_http_variable_pid(ngx_http_request_t *r, | |
| ngx_http_variable_value_t *v, uintptr_t data); | |
| +static ngx_int_t ngx_http_variable_start_time(ngx_http_request_t *r, | |
| + ngx_http_variable_value_t *v, uintptr_t data); | |
| + | |
| /* |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
| <title>SoundCloud OAuth 2 User Agent Authentication Flow Demo</title> | |
| <script type="text/javascript" charset="utf-8" src="javascript/jquery-1.4.2.js"></script> | |
| <script type="text/javascript" charset="utf-8"> | |
| $(function () { | |
| var extractToken = function(hash) { |
| class WeakHash | |
| def initialize(cache = Hash.new) | |
| @cache = cache | |
| @key_map = {} | |
| @rev_cache = Hash.new{|h,k| h[k] = {}} | |
| @reclaim_value = lambda do |value_id| | |
| if value = @rev_cache.delete(value_id) | |
| value.each_key{|key| @cache.delete key} | |
| end | |
| end |
| require 'chef' | |
| require 'chef/node' | |
| class Opscode | |
| class Backup | |
| attr_accessor :backup_dir | |
| def initialize(backup_dir, config_file) | |
| @backup_dir = backup_dir | |
| Chef::Config.from_file(config_file) |
| # Run: curl https://gist.github.com/raw/719970/locale_diff.rb | ruby - en fi | |
| require 'rubygems' | |
| require 'yaml' | |
| l1 = ARGV[0] | |
| l2 = ARGV[1] | |
| first = YAML.load_file(l1 + ".yml") | |
| second = YAML.load_file(l2 + ".yml") | |
| def diff(root, compared, structure = []) |
The best way to use this tool is to hook apt's use of dpkg to run it before doing any package installs.
In your apt.conf, put this:
DPkg::Pre-Install-Pkgs {"xargs -rL1 bash /path/to/stripdeb.sh 2>&1 | logger -t stripdeb"}
Then, a demo:
% sudo apt-get install mysql-server-5.1
| { | |
| "id":"dbauser", | |
| "uid":506, | |
| "comment":"DBA User", | |
| "shell":"/bin/bash", | |
| "groups": [ | |
| "sysadm", | |
| "dba" | |
| ], | |
| "ssh_key": "XXXXXXXXXX" |
| # -*- ruby -*- | |
| # Needs following parameters configured in rake.rb: | |
| # DNS_DOMAIN: domain for which to set entries, including trailing dot | |
| # (e.g. "example.com.") | |
| # DNS_ATTRIBUTE: attribute containing hostname to CNAME to, defaults | |
| # to 'fqdn'; for EC2, use "ec2.public_hostname" | |
| # DNS_ENTRIES: hash mapping hostname to node search query, | |
| # e.g. {'buildbot' => 'recipes:buildbot', 'monitoring' => | |
| # 'roles:monitoring'} |