Code Snippets

Shell Script To Check Number Of Rows In A PostgreSQL Database

The below code snipet was created to check the number of rows in a PostgreSQL database, log the output to a file, and warn if the number of rows is over a certain number. There are numerous variables in the code snipet below that will need to be modified for it to work properly including message, notify, dbuser, and logfile. This code was created on CentOS some other items could be different including the location of the date command.

This script can be run as follows: checkrows $host $database

 

Details
Technology Insights

Set Up A Redundant Network In A Colo

The question is often raised of how to provide a redundant network solution when connecting your leased cabinet or cage to your colocation’s network. This goal can be achieved in numerous ways but most solutions are fairly expensive. Below I list an entry level option to provide network redundancy when connecting to your colo. One of my preferred vendors is Fortinet because of cost and functionality. Most Foritnet devices will handle BGP, IPS, and provide seamless redundancy between devices. The solution below can be upgraded by purchasing more powerful devices as well as introducing a couple more devices into the solution.
Details
Technology Insights

Purge FireFox cookies for a site

Frequently it is convenient, when testing and debugging (or even just when browsing normally), to purge all of the cookies for a particular site. Although it is possible to do so through FireFox’s cookie manager (accessible through Preferences, Privacy, “Show Cookies”), it is much easier and quicker to use the aptly named [Remove Cookies for…

Details