Technology Insights

How to Add a Secondary IP Address to a SliceHost VPS

First off you can add multiple IP’s to each SliceHost VPS. Adding the secondary IP address to a SliceHost Virtual Private Server (VPS) is easy. Open the SliceManager control panel and click the Help tab to open a support ticket. In the ticket state that you want a secondary IP, the justification for it, and that you understand it will cost $2/month. Typically support responds very quickly and will configure the secondary IP address for you.

Typical justification would be that you are running a web server and need to have multiple SSL certificates.

Technology Errors

Redmine: Stuff To Do Plugin: Internal error: An error occured on the page you were trying to access

When installing the Redmine Stuff To Do plugin you might get the below error in your browser.

Error:
Internal error
An error occurred on the page you were trying to access.
If you continue to experience problems please contact your redMine administrator for assistance.

Upon further investigation you will probably see another error similar to the below in the production.log under your Redmine installation.

Technology Insights

Redmine email.yml: Enable Email Sending Through Gmail

Follow the below instructions to have your Redmine application send email using TLS through Gmail. As long as you have a Gmail account you will be able to send mail through smtp.gmail.com.

  1. Install TLS: First install TLS for the Redmine project. Login to the server with the user that runs Redmine and issue the below command from the Redmine project root directory to install TLS.
    bash

    1. ./script/plugin install http://svn.douglasfshearer.com/rails/plugins/action_mailer_optional_tls

Technology Errors

json/common.rb:122:in `parse’: 574: unexpected token at ” (JSON::ParserError)

I have been writing some scripts in ruby to parse JSON generated data. To do this it requires the json ruby gem which works great to parse through JSON output. Anyhow I was loading files into ruby and parsing them without issue until i got to a larger file and I received the below error.

Error:
/usr/local/lib/ruby/gems/1.8/gems/json-1.1.3/lib/json/common.rb:122:in `parse’: 574: unexpected token at ” (JSON::ParserError)
from /usr/local/lib/ruby/gems/1.8/gems/json-1.1.3/lib/json/common.rb:122:in `parse’
from tickets.rb:13
from tickets.rb:11:in `open’
from tickets.rb:11

Technology Insights

Use vi To Find And Replace Content While Breaking a Line

The power of the Unix command vi never ceases to amaze me. I have known how to search and replace easily using vi for a long time however I didn’t know how to find and replace plus insert a line break during the replace. After toying around with vi for awhile I was able to figure it out. The example below shows how to find and replace certain text while inserting a line break.

Contents of a File:

sql

  1. (1,2,'title one','2009-04-20 17:55:46','description one'),(2,2,'title two','2009-04-20 18:05:54','description two'),(3,2,'title three','2009-04-20 18:23:10','description three'),(4,2,'title four','2009-04-20 19:33:42','description four'),(5,2,'title five','2009-04-20 19:45:34','description five')