Open the postgresql.conf config file:
$> mate /usr/local/var/postgres/postgresql.conf
Uncomment the line with 'log_destination' and set it to 'syslog'
log_destination = 'syslog'
Open the syslog config:
| #!/usr/bin/env ruby | |
| # | |
| # Git commit-msg hook. If your branch name is in the form "t123", automatically | |
| # adds "Refs #123." to commit messages unless they mention "#123" already. | |
| # Include "#close" or "#finish" to add "Closes #123." | |
| # | |
| # For Pivotal Tracker, branch names like "s123" adds "[#123]". | |
| # Include "#close" or "#finish" to add "[Finishes #123]". | |
| # | |
| # If you include "#noref" in the commit message, nothing will be added to |
| # Author: Pieter Noordhuis | |
| # Description: Simple demo to showcase Redis PubSub with EventMachine | |
| # | |
| # Requirements: | |
| # - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby | |
| # - a browser with WebSocket support | |
| # | |
| # Usage: | |
| # ruby redis_pubsub_demo.rb | |
| # |
| #!/usr/bin/env ruby -w | |
| ## Using ruby's standard OptionParser to get subcommand's in command line arguments | |
| ## Note you cannot do: opt.rb help command | |
| ## other options are commander, main, GLI, trollop... | |
| # run it as | |
| # ruby opt.rb --help | |
| # ruby opt.rb foo --help | |
| # ruby opt.rb foo -q | |
| # etc |
| $ ruby -v | |
| ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.4.0] | |
| $ ruby bench_erubis_slim_haml.rb | |
| Rehearsal --------------------------------------------------------------------------------------- | |
| empty loop 0.000000 0.000000 0.000000 ( 0.001055) | |
| erubis 2.690000 0.000000 2.690000 ( 2.697228) | |
| slim 4.200000 0.010000 4.210000 ( 4.196183) | |
| haml 3.1.0.alpha.14 (Bleeding Edge) 19.660000 0.040000 19.700000 ( 19.681350) | |
| haml (ugly) 3.1.0.alpha.14 (Bleeding Edge) 18.940000 0.070000 19.010000 ( 19.004186) |
| # 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 |
Open the postgresql.conf config file:
$> mate /usr/local/var/postgres/postgresql.conf
Uncomment the line with 'log_destination' and set it to 'syslog'
log_destination = 'syslog'
Open the syslog config:
| include Rails.application.routes.url_helpers | |
| default_url_options[:host] = "localhost" |
I've been using this technique in most of my Ruby projects lately where Ruby versions are required:
.rbenv-version containing the target Ruby using a definition name defined in ruby-build (example below). These strings are a proper subset of RVM Ruby string names so far....rvmrc (with rvm --create --rvmrc "1.9.3@myapp") and edit the environment_id= line to fetch the Ruby version from .rbenv-version (example below).Today I learned about another Ruby manager, rbfu, where the author is using a similar technique with .rbfu-version.
| (The MIT License) | |
| Copyright (c) 2012-2020 Myron Marston | |
| Permission is hereby granted, free of charge, to any person obtaining | |
| a copy of this software and associated documentation files (the | |
| "Software"), to deal in the Software without restriction, including | |
| without limitation the rights to use, copy, modify, merge, publish, | |
| distribute, sublicense, and/or sell copies of the Software, and to | |
| permit persons to whom the Software is furnished to do so, subject to |