Unix init script for searchd (sphinx server) and monit config
If you are using thinking_sphinx for your text search needs on a rails project, you will need to have searchd service monitored in production. Monit service allows us to monitor a unix service. However, there is no good/recommended init script that exists. Here’s one that could work for your rails3 project.
Postgres command reference for rails project
If you recently switched your default rails project from mysql database to postgres, you may realize that creating databases and users isn’t as much breeze as mysql was.
Here’s a few commands to keep in mind:
On Ubuntu atleast, installing postgres using apt-get creates a unix system user called postgres. The postgres server seems to run under this user and this is kind of like the root user for database. You have to “sudo su – postgres” to create other users.
If your app is setup to use app_development and app_test for development purposes, you need a database user say “app”. Here’s to start:
# create user app;If you need the user to have password
# create user app with password 'password';In postgres, new users don’t have privilege to create database by default. A user created with above command will not be able to execute “rake db:create:all” to create databases. In order to create a user who has ability to create database, use this.
# create user app createdb;If you need to enable an existing user to drop/create database, use this:
# ALTER ROLE username WITH CREATEDB;Intalling pg gem on ubuntu
Installing pg gem (for protgres) on ubuntu server requires following packages
$ sudo apt-get install libpq-dev $ sudo apt-get install postgresql-server-dev-all
Enforcing HTTPS using apache config
Rails 3.1 makes it easy to enforce SSL from within the application. If entire site is to be served under SSL, it may be cleaner to configure this at apache level. Here’s what apache vhost config would look like in that case.
NameVirtualHost *:80
<VirtualHost *:80>
ServerName website.com
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</VirtualHost>
<VirtualHost *:443>
ServerName website.com
DocumentRoot /var/www/website.com/
SSLEngine on
SSLProtocol all
SSLCipherSuite HIGH:MEDIUM
SSLOptions +StdEnvVars
SSLCertificateFile /path/to/website.com.crt
SSLCertificateKeyFile /path/to/website.com.key
</VirtualHost>
Group Chat Services: Campfire, HipChat, FlowDock, Grove.io
If your software development team is still using email or mailing list as primary tool for chat purposes, you are doing it wrong. Having used one in last few years, I can say that group chat services like Campfire, Grove.io, HipChat and FlowDock are as indispensible as your IDE or choice of OS.
I evaluated these few services recently and here’s how I see them stack up:
TXT chat
All have it. I don’t count ability to choose fonts etc. as a big deal as long as the default fonts are good not annoying. All of these services do a decent job at that. One thing I do look for is minimalistic interface. I like interface where most of the space is used for chat text and listing users and no other fancy logo etc. Again, most of them do a good job. Having used campfire in the past, I like HipChat screen slightly better. Personally, I don’t like how Campfire quotes multiline text differently from single line text. HipChat does this better. Undoubtedly, this is a minore point.
File/Image upload
Grove.io is the only one that doesn’t support this, I am guessing, because it’s implementation is IRC protocol based. The benefit for IRC based protocol is that you can use your existing IM clients (Adium, Colloquy etc.) instead of having another app running on your machine. To me, that is a minor advantage versus having ability to attach files/images while I am chatting. As trivial as this sounds, this is the most used feature after txt messages when you are upgrading from age-old IRC based chats. And it is plenti-useful in your day today operations. Ability to drag-drop files/images is the biggest efficiency gain with group chats. And this point alone made Grove.io a no-go for me.
IM integration or stand-alone application
While I enjoyed campfire for unobtrusive chat and file/image sharing, I didn’t like web based interface. Web-app wrappers like Fluid app mitigate it to a certain extent, but still it doesn’t enable full desktop integration like growl notification. Grove.io beats other at this game since it allows your traditional IRC based client to be used. HipChat has a standalone app, which is awesome.
Third party application integration
While these group chat service are useful to any business domain, I am primarily looking at software development shops. And as software developers you need ability to integrate your apps/tools. Any service that doesn’t have such integration is a fail. All 4 services I evaluated offer different level of integration. Some are basic in that they enable any kind of HTTP post and integration has to be built (Grove.io). While others like FlowDoc have already written whole host of plugins to use. Campfire has a few as well. Integration with github could be useful for my purposes. Which one wins for you depends on your specific needs here.
Pricing
For a medium size team of 15-25 people, most of these service cost round $25-$40/month. I didn’t care which one is absolutely the cheapest since they are all within a ball-park and what tools/integrations they offer is more important than saving a few extra bucks. I do like HipChat’s pricing model of $2/user/month which is linearly applicable as opposed to different buckets of pricing that Campfire and FlowDoc offers.
If you are using no such tools, check these out. They are a must for a software development team!
(Thanks @automach and @raykrueger for services suggestions.)
How to ask for professional reference
It used to be that giving professional reference to your potential employer was just about sharing a few names along with their phone numbers. Not anymore. Winning the technical interview is just half the battle, and especially at senior level positions, the response from your professional reference(s) matter more than ever. Preparing and grooming your references before you actually need them and maintaining elevated communication with each referee can pay huge dividends.
Most potential employers require around 3 professional references. When you start your job search, you are better served getting initial permission from folks that you think could be your professional reference. This is a good time to inform them about why you are looking for new opportunity. Also, confirm phone number, email where they can be reached for reference. You should have about 5 people at various levels (boss, direct report, colleague) available before you actually need them.
While most of us do this right, we forget a few things.
It makes a huge difference if you could share important information about the job with your referee and the person checking reference just before the call happens. Here are some of things you should do before each of your potential employer decides to check on your reference.
Give following information to your referee (person giving professional reference):
- Company detail: Share name of company, website and a brief description of what they do. This saves your referee time to research the company and prepare their answers. It also conveys that you value their time and remain ready to make it as easy as possible.
- Position being interviewed for: Share the title of the position (Sr. Business Analyst, Architect) and job description. This helps them understand the nature of your work in that position so they can highlight the alignment with the job in an enhanced manner.
- Name, phone number, email of person calling. This is important since most people don’t pickup phone if they don’t recognize the number. Also, sharing approximate time of expected call helps a great deal in making sure that they connect the first time!
The same goes for the other side of the equation:
Give the person performing reference check following information:
- Referee’s contact information: Name, phone number, email, preferred time to contact. This is obvious. During initial cultivation of reference, check and confirm which phone, weekday/time works best for them.
- Brief description of nature of professional relationship (boss, direct report, colleague): Thinks like “I worked closely on X project with Y colleague” or “He/she was the lead and I reported to him in Sr. developer capacity”.
- What are some of the things that the person can provide information on: Things like “he can talk about my people skills more than my development ability” or “He can vouch about my progress since our time at X company”. No, this is not cheesy at all. It helps your potential employer understand what are some of the highlights of each reference. Sure, they will not follow the script exactly as you laid out but it will be pretty close.
All in all, your goal with reference should be to get truthful and consistent story (about you) to come out. Preparing your references takes a little effort/time but it is well worth the effort.
Finally, don’t forget to send thank you email to all referee that you’ve used in your search and inform them about your decision to choose a particular company.
Installing gsl gem on mac osx
At Local Offer Network, we use GNU scientific library to categorize all the offers that we aggregate using scientific methods. We leverage a rubygem called gsl for this heavily. Since this is a native gem installing it is a little tricky atleast on mac OSX.
In order to install, we have to install an older version of gsl library using homebrew first.
$ brew install gsl114
This installs the gsl version v1.14. Please note that latest version of gsl library (brew install gsl) will not work for the gsl gem. If you have already installed latest gsl, remote it (brew remove gsl) and start over.
Once this is installed successfully, the gsl gem should install fine.
$ gem install gsl
New Feature: PocketQuote, to help with comparision shopping

At Nail Your Mortgage (NYM), we don’t just believe in “Truth in Lending”, we help our customers uncover the truth on a daily basis.
We also realize that pricing of mortgages is very opaque and shopping for mortgages is a daunting task. In our quest to simplify mortgage shopping, we have added a new tool that, we believe, will greatly simplify comparison of mortgages. This new tool is called PocketQuote. Here is some fact about this tool.
What is a
?
- A PocketQuote is a guaranteed mortgage quote that you can generate anonymously, for free.
- A PocketQuote lists all criteria based on which pricing is determined. This is important since most brokers will advertise their best rates, which may or may not apply to your specific situation.
- A lowest rate guarantee from Nail Your Mortgage to stand by flat fee ($750 in IL).
- Best of all, it is anonymous. You are not required to register or share your email/name to get this guarantee from us. Nail Your Mortgage is confident that a fair comparison will reveal that NYM costs are the lowest under any circumstances.
We are so confident in our lowest price guarantee that we encourage borrowers to shop around. PocketQuote is an example of that. We highly recommend our clients to print a PDF quote and send it to other brokers to match beat our rate. Client and their brokers can visit our website anytime to get the latest rate.
Nail Your Mortgage is one of the only handful of mortgage brokers (probably the only) that doesn’t add any markup to the wholesale rate that we get from Lender. Our PocketQuote Guarantee ensures that our fees to consumer ($750 in IL) will never change, irrespective of the amount of loan you buy.
If you are in the market for refinance or purchasing a new home, you ought to check PocketQuote out.

Upgrading to ruby 1.9: rbx-require-relative requires Ruby version ~> 1.8.7
If you are upgrading from ruby 1.8 or Ruby Enterprise 1.8.7 to ruby 1.9.2, you may encounter this error.
Installing rbx-require-relative (0.0.5) Unfortunately, a fatal error has occurred. Please report this error to the Bundler issue tracker at https://github.com/carlhuda/ bundler/issues so that we can fix it. Thanks!/Users/sjain/.rvm/rubies/ruby-1.9.2-p290/ lib/ruby/site_ruby/1.9.1/rubygems/ installer.rb:364:in `ensure_required_ruby_version_met': rbx-require-relative requires Ruby version ~> 1.8.7. (Gem::InstallError)
This most likely happens because you are declaring a dependency on ruby-debug gem in your Gemfile.
group :development do gem 'ruby-debug' end
With ruby 1.9, you need to update this with new gem name ruby-debug19.
group :development do gem 'ruby-debug19' end
This will eliminate the dependency on rbx-require-relative and fix the issue.
Developing webapp that require you to expose your local machine on web
If you’ve ever developed facebook applications or have needed to integrate with paypal payment service, you know that those services require a reverse connection from their servers to your webapp to complete full circle. The process of making your webapp, running on your machine during development, to outside world was painful at best.
Not anymore. With this service called “localtunnel”, it is a piece of cake.