Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| require 'tire' | |
| require 'active_support/core_ext/numeric' | |
| require 'active_support/core_ext/time/zones' | |
| # Tire.configure { logger STDERR, level: 'debug' } | |
| class Time; DATE_FORMATS.update lucene: "%Y-%m-%dT%H:%M"; end | |
| Tire.index 'venues' do |
| #!/usr/bin/env ruby | |
| require 'rubygems' | |
| require 'bundler' | |
| require 'fileutils' | |
| require 'net/http' | |
| require 'net/https' | |
| require 'uri' | |
| TMP_DIR = "/tmp/gems" |
| check process redis-server | |
| with pidfile "/var/run/redis.pid" | |
| start program = "/etc/init.d/redis-server start" | |
| stop program = "/etc/init.d/redis-server stop" | |
| if 2 restarts within 3 cycles then timeout | |
| if totalmem > 100 Mb then alert | |
| if children > 255 for 5 cycles then stop | |
| if cpu usage > 95% for 3 cycles then restart | |
| if failed host 127.0.0.1 port 6379 then restart | |
| if 5 restarts within 5 cycles then timeout |
| Steps to install and run PostgreSQL 9.2 using Homebrew (Mac OS X) | |
| (if you aren't using version 9.1.5, change line 6 with the correct version) | |
| 1. pg_ctl -D /usr/local/var/postgres stop -s -m fast | |
| 2. mv /usr/local/var/postgres /usr/local/var/postgres91 | |
| 3. curl https://raw.github.com/fragility/homebrew/737af01178590950749cf5e841f2d086c57c5a80/Library/Formula/postgresql.rb > /usr/local/Library/Formula/postgresql.rb | |
| 4. brew upgrade postgresql | |
| 5. initdb /usr/local/var/postgres -E utf8 | |
| 6. pg_upgrade -b /usr/local/Cellar/postgresql/9.1.5/bin -B /usr/local/Cellar/postgresql/9.2.0/bin -d /usr/local/var/postgres91 -D /usr/local/var/postgres | |
| 7. pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| # Ignore static version of the site (used to upload error pages to S3 for Heroku errors) | |
| /out |
| # Run tests with `PROFILE_FG=1 [rake|rspec]` to profile FactoryGirl | |
| # | |
| # Example output: | |
| # | |
| # **Class** | **create** | **build** | **attributes_for** | |
| # --------- | ---------- | --------- | ------------------ | |
| # **Total** | **11** | **0** | **0** | |
| # Post | 5 | 0 | 0 | |
| # Author | 3 | 0 | 0 | |
| # User | 3 | 0 | 0 |
| license: mit |
This guide assumes that you recently run brew upgrade postgresql and discovered to your dismay that you accidentally bumped from one major version to another: say 9.3.x to 9.4.x. Yes, that is a major version bump in PG land.
First let's check something.
brew info postgresqlThe top of what gets printed as a result is the most important:
| SELECT | |
| tc.constraint_name, tc.table_name, kcu.column_name, | |
| ccu.table_name AS foreign_table_name, | |
| ccu.column_name AS foreign_column_name | |
| FROM | |
| information_schema.table_constraints AS tc | |
| JOIN information_schema.key_column_usage AS kcu | |
| ON tc.constraint_name = kcu.constraint_name | |
| JOIN information_schema.constraint_column_usage AS ccu | |
| ON ccu.constraint_name = tc.constraint_name |