GossenInsurance.ca is now BlocksAgencies.ca

Recently we launched a new website for Gossen Insurance. As of April 1st they have been bought by Block’s Agencies and will be operating under that name, along with two other agencies in Borden and Langham. We’ve re-branded the new Gossen Insurance website for Block’s Agencies, and added the two other locations that Block’s Agencies owns to the website as well. The website is now available through both blocksagencies.ca and blocksagencies.ca. This makes sure that any links to the old website, either sent out by email, printed on promotional material, or on Facebook will continue to work and will take the you to the right page. If you’d like to see how we set this up to make sure we didn’t confuse any visitors you can ready about it in our blog here.

Redirecting your website to a new domain

Have you ever needed to move your website to a new domain? This can be a tricky thing to do without breaking all the links to your website that exist in emails, print media, Facebook, or anywhere else on the internet. It is possible to redirect all incoming links with a piece of .htaccess code that will keep all your old links working.

.htaccess Code

RewriteEngine On
RewriteBase /

# New code to redirect from olddomain.com to newdomain.com
# Permanent redirect for caching purposes, also include the query string
RewriteCond %{HTTP_HOST} ^olddomain.com
RewriteRule (.*) http://newdomain.com/$1 [R=permanent,QSA,L]

# New code to redirect from www.olddomain.com to www.newdomain.com
RewriteCond %{HTTP_HOST} ^www.olddomain.com
RewriteRule (.*) http://www.newdomain.com/$1 [R=permanent,QSA,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

Replace olddomain.com with your old domain name, and newdomain.com with your new domain name. This will redirect all links that go to your old domain to your new domain.

Link Examples
Takes you too

Takes you too

Limiting the number of post/page revisions that are saved in WordPress

Whenever you modify a post or page on your WordPress site, a copy of is saved to make it possible to revert any changes that have been made.  Although this is a great feature when you quickly need to revert site content, the number of revisions can quickly add up and begin to take up a large amount of space in your database.  It is possible to set a maximum number of revisions that will be saved for each post/page by adding the following snippet to wp-config.php


/* keep a maximum of 5 revisions for each post/page */
define('WP_POST_REVISIONS', 5);
/* disable revisions for post/pages */
define('WP_POST_REVISIONS', 9);

Empty WordPress trash automatically

Ever since the release of version 2.9 WordPress automatically deletes posts, pages, attachments, and comments, from the trash bin every 30 days. You are able to change this default behaviour by adding a snippet of code to the wp-config.php file of your WordPress install. This can be handy if you want to empty the trash more often to save space, or if you want to disable the trash altogether.

The following snippet would empty the trash every 7 days. You can set this to whatever number works best for you or even 0 to disable the trash feature completely.


define('EMPTY_TRASH_DAYS', 7 );

Speed up your website with Zlib

Having your website load as quickly as possible is crucial to make sure that you don’t scare your visitors away and recently even search engines are starting to rank your site based on its load time.

One way in which you can decrease the load time on your website is to enable zlib or gzip on your server.

If you have access to your php.ini you can enable zlib for all the pages/sites running on your server by changing the following values in your php.ini file to look like this:
[Read more…]

Launch of New Gossen Insurance Website

We are happy to announce the launch of a new website for Gossen Insurance.

Gossen Insurance is a Waldheim based insurance broker that offers competitive insurance options and a wide range of services for the local community.

They needed a new site for their business, and they needed it quickly. This website was setup and ready for use in a matter of a few weeks. It uses dynamic forms not only to allow visitors to the site to contact staff but also to request quotes for various types of insurance. The site is setup to be as simple and easy to use as possible, to allow site visitors to quickly access the information they need, and to easily be able to contact staff at the office if they need anything futher. We’ve also developed a section of the site for the staff to quickly and easily list rental property available in Waldheim as a public service to the community.

Using Trickle to Control Bandwidth Use in Any Program

There are a number of reasons why you would want to control how much bandwidth any given program is able to use. This can be done in a couple different ways, including options right with in the software, or through a software or hardware firewall. A great little program for managing bandwidth use is Trickle. Trickle runs completely in userspace, which means we don’t need to mess with a firewall, or even need root access.

If you’re on Ubuntu/Debian you should be able to install Trickle using

sudo apt-get install trickle

Now that you’ve got Trickle installed just use it before any network command to limit its bandwidth. Quite self-explanatory -u specifies upload and -d download.

trickle -u 25 -d 100 myCommand

The reason I first started using Trickle was so I could use Rsync and SCP to copy/backup files on my computer without negatively affecting the speed of my Internet connection. I have a fairly limited upload speed and this is an example of how I would limit the upload speed to 100 KB/s when backup up a folder with Rsync. Please note that when using Trickle with Rsync you have to use the -e option.

trickle -a -e "trickle -u 100 ssh" myFiles matthew@example.com:/home/matthew/backups/

It is even easier using Trickle with SCP where all you would need to do is use:

trickle -u 100 scp myFile.zip matthew@example.com:/home/matthew/backups/

Simplifying Managing Your SSH Connections by Using an SSH Config File

I’ve been using Linux as my primary operating system for over five years, and spent a good deal of time with it before that time. It’s only been within the last year or so that I’ve really begun to explore and enjoy working from the Linux/Unix command line. It’s greatly simplified my work flow when it comes to many tasks, and it seems I spend the majority of my time either in a command line or web browser now a days. Now that nearly 100% of the time when I’m working on a remote system, whether it is a server, Linux/Unix PC, or networking equipment, I’m usually connecting with SSH.

SSH is an incredibly powerful tool that can be used for everything from remote terminal access, to running entire graphical programs over a network. For me though remembering and having to type in all the IP Addresses, DNS Names, usernames and port numbers for all the SSH connections I use daily can be a real pain. That’s why setting up your own SSH config file can save huge amounts of time and effort in your day-to-day work.

This tutorial will be much easier to follow if you have a basic understanding of how to use SSH.
The steps in this tutorial were performed on Ubuntu 11.10. You may need to modify some steps depending on what system you are running.

GUI Version

1. Open Gedit (or your editor of your choice)
2. Click File->Save
Go to your home folder, and display hidden files by hitting CTRL+H on your keyboard.
Open the .ssh folder and save your new file as config

Command Line Version

1. First open up the terminal on your Linux/Unix based system.
2. Use vi (or any editor of your choice)

vi ~/.ssh/config

3. There are many options that you can set in a config file, but we will go over the settings that I usually use. Here’s an example:

Host myServer

HostName example.com
User root
Port 222

Host myDesktop


This example shows two different SSH connections and their different options. The first is an example server that we want to connect to at example.com, with the username root, and where the SSH service is running on the non-standard port 222. The second is an example of a computer on your local network. As you can see we used a local IP address instead of a DNS name, also we didn’t bother setting a port number since it is running on the standard port 22. Also because in this example I’m assuming your connecting from another computer you own at the location there is no username set since I’m assuming you are using the same username on both computers you’re using for the connection.

4. Other options that I often use would be ServerAliveInterval, and ServerAliveCountMax.

Host myServer

HostName example.com
User root
Port 222
ServerAliveInterval 30
ServerAliveCountMax 120

Host myDesktop

ServerAliveInterval 30
ServerAliveCountMax 120

This example would keep your SSH connection live for an hour by refreshing the connection every 30 seconds. This can be handy if you don’t want to be logged out every time you step away from your keyboard.

With your new SSH Config file instead of having to type in:

ssh -p 222 root@example.com 

You can just use:

ssh myServer

Hope this little trick saves you as much time as it has saved me.

Fix VIM in Ubuntu

An issue that I’ve noticed over the last couple releases of Ubuntu is that the “tiny” version of VIM is installed by default. This for me has always been a big issue, as a number of the controls in the regular VIM don’t work in the “tiny” version. Luckily for us though, this is a very easy and quick fix.
Just install the vim-gtk package using apt-get.

sudo apt-get install vim-gtk

You’ll now have the full version of VIM, as well as the GUI version.