Fork me on GitHub

Pushover Library for Codeigniter

I recently discovered the Pushover app while browsing IFTTT recipes. I have a number of cron jobs and IFTTT recipes that send me text message notifications and, after discovering Pushover, I decided to convert them to use Pushover notifications. I like that Pushover gives me the ability to set a custom sound and priority in the app; I can now distinguish which cron is sending me a notice from the notification sound on my phone. Also, the messge limit is 512 characters for Pushover; sometimes it's nice to have more than the 160 allowed in a text message.

Old Habits Die Hard: Web-Safe Colors

I put my first website up in 1997. While I was rocking my 16-bit color depth and massive 19" CRT monitor (which weighed about 70 pounds), I knew plenty of people that only had 8-bit color capabilities on their computers. I wanted the websites I designed to look as similar as possible for everyone so, when designing my websites, I took great care to stick to a nice 256 color palette; the so-called web-safe colors.

A Holiday Library in PHP

Some time ago, I wrote a library to work with US holiday dates. Since a number of the holidays are floating holidays (i.e., the last Monday in May), it's handy to have a library to calculate the dates for those holidays.

One of the better uses I've found is to allow the excluding of holiday dates from the jQuery UI date picker. In this post, I'll explain a little about the library and give detail of how it can be used with the jQuery datepicker.

Running MySQL Server on a small 128MB VPS

I recently purchased a small OpenVZ VPS (Virtual Private Server) for $15/year. It has 128MB RAM, 256MB vSwap, 20GB of disk space, and 500GB of bandwidth/month. The server is running Ubuntu 12.04 LTS and has very good transfer rates. Initially, I wanted to use it to host all of my Git repos, but then I realized that it was much easier to just use BitBucket. So, I starting thinking about how I could use this tiny server.

WAN IP from a bash script

Today I was, once again, faced with a problem where a bash shell script was the best solution. Seeing that I spend most of my time writing php code, the shell script was a welcome break.

A few minutes into my coding of the shell script, I realized that I needed the WAN IP address of the server I was working on. My first thought was to write some sort of fancy shell interface into the router where I could query the information I needed and use it in my shell script, but that would have been a bit of overkill. So what I did was put a nice little php script at http://ip.keithscode.com that simply prints the remote IP address that is accessing the script.  Now I can easily get the IP using the following line in my script:

IP=`wget -q -O - http://ip.keithscode.com`

I thought this bit of information my be helpful to someone, so I decided to put a quick note about it here. I've included examples and a bit more explanation after the break. 

Enjoy ...

Windows Gadgets

Recently, I decided to write myself a couple Windows Desktop Gadgets for Windows 7. I wanted to be able to see the load averages on all my servers without opening an SSH connection and I wanted to be able to quickly generate a random password without opening a web page.

The graphic on these aren't spectacular ... I'm a more of a programmer and less of a designer. They've been tested with Windows 7 Professional, but I assume that they will also work as Windows Vista Sidebar gadgets.

Since I only have a couple of them, I'll just put them here: