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:
git diff origin/master --name-only --diff-filter=ACMR | grep '.rb' | ag -v 'schema' | xargs rubocop -c .rubocop.yml --force-exclusion --display-cop-names |
alias rdm="git diff master --name-only --diff-filter=ACMR | grep '.rb' | ag -v 'schema' | xargs rubocop" |
#!/bin/bash | |
osascript -e "display notification with title \"Start Pomodoro!\" sound name \"Hero.aiff\"" && \ | |
(sleep 1500 | pv --timer) && \ | |
osascript -e "display notification with title \"Pomodoro Break!\" sound name \"Hero.aiff\"" && \ | |
(sleep 300 | pv --timer) && \ | |
# (sleep 900 | pv --timer) &&\ # Uncomment for long breaks; | |
osascript -e "display notification with title \"Pomodoro Break Done!\" sound name \"Hero.aiff\"" |
# spec_helper for faster testing of plain old ruby objects | |
# To check if a spec is ready for this spec_helper, | |
# just replace `require "spec_helper"` | |
# with `require "slim_spec_helper"` and edit | |
# this file as necessary | |
# Loads a subset of the gemfile using bundler/inline | |
begin | |
require "bundler/inline" | |
rescue LoadError => e |
If you're familiar with bbatsov/ruby-style-guide, you can immediately bbatsov-ize the files you changed in a (current) feature branch:
git diff origin/master --name-status | awk '{print $2}' | xargs rubocop --auto-correct
That roughly transates to: get all changed files in the current feature branch and run each file through rubocop, autocorrecting (modifying) the files if possible.
I recommend saving the changes in a separate commit for easier code reviews.
$ brew install ansible # OSX
$ [sudo] pip install ansible # elsewhere
The purpose of all this is to see if sphinx, thinking sphinx and thinking sphinx delayed delta are all working properly. | |
I created a test controller on a separate monit subdomain that simply generates and posts a test value and then uses curl to retrieve it. If the two values match, then sphinx is working properly with delayed delta. | |
This example assumes a Linux installation. | |
The file 'delayed_delta.sh' spawns the `rake ts:dd` process in the background, saving its PID to tmp/pids in your Rails project. You can start and stop it by running '/etc/init.d/delayed_delta.sh start' and '/etc/init.d/delayed_delta.sh stop'. You will use these in your monitoring to, see the monitrc snippet. | |
In a crontab, every X seconds or minutes, run 'ar_sphinx_mon.sh' to see if records are properly being inserted and indexed. If they aren't, then kill all Thinking Sphinx processes and monit should restart them. |
=> #<OpenStruct site_id="7018", currency_decimals="2", tax_decimals="2", tax_rate_1="7.0000", tax_rate_2="0.0000", regional_options="0", unit_type_id="28", unit_type_name="Drive Up Unit", has_charge_tax_1=true, has_charge_tax_2=true, def_lease_num="1", is_mobile=true, is_inside=true, floor="1", width="9.5000", length="20.0000", area="190.0000", push_rate="80.0000", standard_rate="100.0000", standard_weekly_rate="0.0000", total_units="1", total_units_occupied="1", total_units_vacant="0", total_units_reserved="1", first_available_unit_id="2972", first_available_unit_name="100", first_available_unit_description="This is a test. Ramp access, Elevator, interior", representative_unit_id="2972", representative_unit_name="100", representative_unit_description="This is a test. Ramp access, Elevator, interior", admin_fee="0.0000", reservation_fee="10.0000", is_first_available_unit_rented=true> | |
=> #<OpenStruct site_id="7018", currency_decimals="2", tax_decimals="2", tax_rate_1="7.0000", tax_rate_2="0.0000", regional_op |