Code Snippets

Shell Script To Configure A Read Only User On A PostgreSQL Database

**UPDATE: New article here.

Its a little more complicated to create a read only database user with PostgreSQL than say using something like MySQL. You will need to grant select access on each table in the database for the read only user. Keep in mind that each time you add a new table you will need to either run the shell script below again or manually grant select access on the new table for the read only user.

Technology Insights

Cisco IOS: Forward Called Teclo DID To An Extension, Translate, Translation-Rule Limitation

A client of mine had a Cisco 2811 installed before I started working for them so I had to go over the configuration to become familiar with things. One of the Cisco IOS configuration items used was translation-rule which will allow 10 to 15 Rules to be created under each translation-rule. In this scenario they were using translation-rule to forward external DID’s from their telco provider┬áto internal extensions. This works fine except for the fact that if you have more than 10 (in this case) external numbers you won’t be able to continue to forward them to internal extensions without complicating the configuration using multiple dial plans, etc. The easiest way to get away from the translation-rule being used in this way is to assign t he external DID telephone numbers as secondary numbers under each extension configuration as explained below.

Technology Insights

Create A Google Analytics Filter To Exclude A Group Or Subnet Of IP Addresses

If you are using Google Analytics for web analytics it can be beneficial to exclude certain addresses to provide a more accurate view of traffic to the site. There are numerous reasons that excluding IP’s from the analytics statistics such as if it is a personal site that doesn’t do a lot of traffic and you are working on all the time from home the analytics results might not provide a real world view of what other visitors view the most. Another example might be if it’s a corporate web site that numerous developers, QA personal, and others employees are visiting from the same address space it could skew the analytics results because of such a high concentration of traffic from one IP address or subnet. One of the great reasons for reviewing the web analytics data provided by Google Analytics is to see what pages customers view or what region your customers are from. This type of data can help prioritize the areas of the site that should be worked on the most or what content provides the best return on investment and if the data includes your own traffic it might not provide accurate data for you to review.