goption

Archive for the Site News category

New URL shortener

I installed a new, PHP-based URL shortening package today. The home-built one I've used in the past remains in place, but new entries will use the new package, which is more robust than the old one.

posted 14 Aug 2009 in Site News

New site design

I spent some time today reworking the style sheet for the site, to hopefully give it a cleaner, more modern look. Luckily, the basic structure of the site makes it easy to update to change the layout.

posted 31 Jan 2008 in Site News

Pibgorn

I added Pibgorn to the comics page. Pibgorn is an online-only, 3-day-a-week strip by Brooke McEldowney, creator of 9 Chickweed Lane.

posted 12 Jun 2006 in Site News

My FJR site

I finally decided to set up a separate site for my FJR postings. Here it is:

TCFJR

Yay.

posted 29 Apr 2006 in Site News

Headache Page

I added four more months to the top of the Headache page, so it now displays two full years, with daily details for the most recent twelve months, and summaries for the preceeding twelve months.

Also, an overlib box with details from that day's entry are now displayed when you hover over a medication day (in yellow).

posted 19 Apr 2006 in Site News

Odds and Ends

The Odds and Ends sidebar section for remaindered links has been updated to use the overLIB tool tips library. In the past, the Movable Type excerpt (if any) was displayed as regular text following each link, and there was no way to determine the category of an O&E link.

Now, hovering over a link displays an overLIB floating tooltip, with the category as the caption and the excerpt as the body. If the excerpt is blank, a single   is used to persuade some height into the body of the tooltip. Double quotes in the excerpt are converted to entity reference ".

Since entries in the Odds and Ends weblog have titles that are full link tags, the only way to add the required onmouseover/onmouseout entries was to use the MTPerlScript plug-in, with a function that takes three arguments: MTEntryTitle, MTEntryCategory, and MTEntryExcerpt. The code builds the overlib call using the excerpt and caption, then modifies the title string to include the overlib and nd calls.

posted 18 Apr 2006 in Site News

EasyRGB - color helper

EasyRGB - Color harmonies, complements and themes.

I used this to come up with a complementary color for the background of the menu bar on the new Grey style. It's a big improvement over the first, semi-random color I had chosen.

posted 4 Apr 2006 in Technology

New Grey Style

I revamped the grey style to use larger, white letters on an grey-blue background. The header logo is now a background image, and the entire header is clickable to return to the home page, ala the LAPI site. I should convert all the style sheets to this type of header.

posted 29 Mar 2006 in Site News

microURL - a Perl-based URL shortener

Long URLs can be a pain. If you send them by e-mail, they often wrap, making it tedious to cut and paste them back together. Amazon URLs are notorious, but in the course of any busy day on the web, you're bound to come across others.

The solution is to create a shorter equivalent for the long URL. TinyURL is the most cited example, but there are tons of other sites that do the same thing. The problem with external services like TinyURL is that you do not control your own destiny &mdash if they change their TOS, or even just go out of business, all your shortened links are now worthless.

My solution was to build a URL shortener on my own site, under my own control. I call it microURL, and it consists of five parts:

  • a database table to hold the URL data
  • create.cgi, to create the shortened URL's
  • u.cgi, to handle the redirection from a short URL to the original site
  • .htaccess changes
  • a bookmarklet
Database

For my setup, I create a new MySQL database named goption_url, and then a table named conversion:

+---------+---------+------+-----+---------+----------------+
| Field   | Type    | Null | Key | Default | Extra          |
+---------+---------+------+-----+---------+----------------+
| id      | int(11) |      | PRI | NULL    | auto_increment |
| fullurl | text    |      |     |         |                |
| hits    | int(11) |      |     | 0       |                |
+---------+---------+------+-----+---------+----------------+
create.cgi
This little Perl script takes a long URL and create a short equivalent, using these steps:
  1. First, check the database to see if the long URL is already in the table; if so, it's id is used;
  2. If this is a new long URL, insert it into the database:
    INSERT INTO conversion (id, fullurl) VALUES(NULL, $fullurl)
    id is auto_incremented on the insertion. The id for the new record is used;
  3. The id from either step 1 or step 2 is converted to base 62 (using the characters 0-9, A-Z, and a-z), and the result is appended to the base redirection URL:http://goption.com/u. So, the first record created has a short URL of http://goption.com/u1, and so on.
u.cgi

This script handles the redirection for a short URL. The short URL tag is converted from base 62 back to decimal, and the result is loaded from the database. The hit counter for that URL is incremented, and the CGI.pm redirect function is used to go to the original, long URL.

.htaccess changes

To make the short URL as short as possible, .htaccess is used to rewrite the short URL into an equivalent call to u.cgi:

RewriteEngine on
RewriteRule ^u$ u.cgi
RewriteRule ^u([0-9,A-Z,a-z]+)$ u.cgi/$1

This changes a URL in this format:

  http://goption.com/uaZ

into this format:

  http://goption.com/u.cgi/aZ

A Bookmarklet

Finally, to make it easy to create a new microURL, create a new bookmarklet like so:

javascript:void(location.href='http://goption.com/create.cgi?
  url='+location.href)

and load it onto your Bookmarks Toolbar. When you're viewing a target page, just click on the bookmarklet to create a microURL for the current URL.

This is a simple, flexible way to create my own short URLs that last as long as I want them to - under my terms. Full source after the jump.

Update: The original version of create.cgi did not accept long URLs with embedded ampersands - a major limitation. I reworked it to use CGI.pm's query_string function when it's called from the bookmarklet, to get the entire URL (which is decoded into a normal URL string).

Show all...

posted 22 Mar 2006 in Technology

Site upgrades

For as long as I can remember, I've wanted to make two upgrades to my Movable Type setup: a better monthly archive list, and an actual Recent Categories listing. Today, I finished both.

Previously, all pages but the main index page used the standard MT monthly archive listing. As the months and years go by, this listing became so long as to be unusable - or at least quite ugly. A few months ago I was reading the Tiny Pineapple weblog, and noticed that the author used a yearly table format. I sent him an e-mail asking how he did it, and he good-naturedly admitted to building and updating it manually.

In my mind I was assuming that a lot of deep MT work would be needed to build it automatically. This morning, I decided to try a different, much simpler method: use the MTPerlScript module to open the archive directory, find the year archives, and print the monthly archive table. It took a few iterations, but it now works quite well, if I say so myself.

I've had a Recent Categories section on my main page sidebar since the last redesign, but the categories listed were hard coded in the template and rarely updated. With my MTPerlScript success with the monthly archive table, I dived in to automate the section, using raw DBI code instead of MT internals. It took a couple of minutes to lock down the SQL, and I needed to "borrow" the dirify function from MT::Util, but now the Recent Categories section is fully automated.

posted 28 Nov 2005 in Site News

Caught a bird

My webcam caught a bird flying past my office window, at 8:41 this morning:

webcam-2005-10-10-10 42 03.jpg

The camera face north-northwest so I don't get the best of the sunset pictures, but last night's view was pretty nice:

webcam-2005-10-09-18 26 33.jpg

posted 10 Nov 2005 in Doing

Teaser style

I've been using small, teaser graphics in the upper-right corner of many posts for a while now, but always just added the necessary spacer info directly to the tag - normally align=right style="margin-left: .5em; margin-bottom: .5em;". Some of the teasers are in macros in the banner template, and some are just inline in individual posts.

This morning, I converted the teaser-specific formatting into a class in the style sheet. I changed all the macros to use the class, and changed the most recent inline teaser (lightning) to use the class.

posted 20 Sep 2005 in Site News

PDF icon

file_pdf.gif

posted 26 Jul 2005 in Site News

page-break-after

The calendar on the Headache page started out with three months, grew to six months, and is now (and forever) a full twelve months. From the beginning the monthly calendars have been wrapped in a <div id="calendar"> tag. With the recent change over to a Print-specific style sheet, I decided to move the daily narrative section of the Headache page to a new page when printed. The calendar entry for the print.css style sheet now includes "page-break-after: always;", which FireFox happily supports.

Each of the doctors that I hand the diary to are interested in the calendars, but they don't seem to really care about the narrative. With the calendars on a separate page, their bookkeeping will be simplified.

I'll take the new printout to Dr. Liao on Thursday morning, along with my fully-notarized Advanced Health Care Directive.

posted 26 Apr 2005 in Site News

Print-specific style sheet

I print out my headache diary each time I visit a doctor, with varying results. What looks pretty (enough, at least) on the screen doesn't translate well to a printed page. IE has big trouble printing it in portrait, as well, with the text getting cropped on the right margin.

In honor of this morning's visit to Dr. Wogenson, I created a print-specific style sheet, and changed a couple of templates to make it work. The Meta template now includes media="screen" on the original style sheet LINKs, along with a new link to print.css with media="print". The Banner template includes a new #printhead div, with goption in stylized text. The screen style sheets set display:none; for #printhead, and the print stylesheet sets display:none; for the standard header and menu div's.

The print style sheet also removes the page background, the border around the master div, and a few other minor changes.

The site looks the same when viewed on the screen, but now looks much better when printed.

posted 14 Apr 2005 in Site News

Moving on up...

reblog.pngI finally bit the bullet and upgraded to Movable Type 3.1, specifically as part of an evaluation of a new tool called reBlog.

Currently, when I want to cross-post a link I find in Sharp Reader, I drag the link to my Windows desktop, then drag it into Firefox, then use the JustBlotIt! extension to post it. reBlog is a package with it's own RSS aggregator and MT extensions to help automate the cross-posting of links.

I'm still working on it, and it'll probably be a while before I switch away from Sharp Reader, but there are some potential advantages: a) I can read my RSS feeds from any computer; b) I can cross-post without having to drag things around.

posted 23 Nov 2004 in Site News

Hosting Woes

Over the years, I collected a variety of web sites that I either managed directly or indirectly. Back in March of '04, I setup a reseller account with iNetter. The account offered a lot of flexibility, and lots of disk space, for a reasonable price.

Within a week of moving all my domains there, the server I was on became a spamming haven, and was pulled by iNetter's co-location company, which promptly reformated the drives and re-sold it to another provider. I had no backups; iNetter had no backups; there was no way to make a backup. I was not a happy person. Luckily, my old hosting company sent me a backup, so I only lost a few days worth of activity.

Before the server problem, it was easy to get tech support, but as the weeks went by after the crash, it became harder and harder. They had a lot of clients on the server that died, and I think a lot of them left, leaving iNetter overworked and under revenued. I stuck by them - until this week.

Last week, the httpd daemon on the server I was assigned to mysteriously crashed. You could ssh into the server, you could get your mail, you could ftp, but you couldn't view your websites. Now, a few of my client sites are AYSO sites, and this is the busy season for youth soccer. It was a very bad time to have these problems.

To make it worse, it was impossible to get ahold of anyone at iNetter. The phone number listed prominently on their website was out of service (never a good sign); their tech support chat was always offline; help desk requests went unanswered for days, or mysteriously disappeared.

The httpd outages continued for 8 straight days. I had to make a change. Without sufficient research, I found a new hosting company (IncognitoNetworks), and signed up for a basic reseller account. I moved one of the AYSO sites there under heavy pressure, before realizing that most of my help desk requests were taking 8-24 hours for a response. I put in some more time researching alternatives, but there's not a lot out there that fit my needs - SSH access, plus lots of disk space and bandwidth, all for a reasonable price.

I finally found a hosting company I could live with: Hosting Zoom. I signed up for 10gb of disk, 75gb of bandwidth, plus ssh, a full Fantastico (which iNetter didn't support), plus 24/7 live support chat. During the transition I've had occassion to use their tech support, and am very impressed.

I needed to leave bcisys.com at iNetter for the duration, so I setup a new domain for my hosting service: Xoption.com. So far, I've moved all but two domains: bcisys.com, which provides critical e-mail support, and ayso98.org, which is orphaned at Incognito for now, until their webmaster is ready for another host move.

It's always a pain to move websites, especially ones that use database backends, but this has gone smoothly (so far...), and I'm looking forward to having a more reliable server.

posted 4 Nov 2004 in Technology

Copter


posted 5 Aug 2004 in Site News

Headache calendar updates

Over the last few days, I've made these changes to the Headache page:

  • I replaced the old format with an unordered list, to reduce the page size;
  • Using Brad Choate's MTCalendarEX plug-in, I added a third monthly calendar. The page now lists the current month and the previous two months;
  • Highlighted days in each calendar are now links to that's day's full text entry;
  • Using Brad Choate's PerlScript plug-in for MT, I've added a line below each monthly calendar that lists the number of Imitrex days for that month;

posted 21 Jul 2004 in Site News

Photo Rescue Expert

I had a problem uploading the pictures of Gabriela's graduation, and invested in Photo Rescue, a nice program that recovers deleted and/or damaged photos from a camera memory card.

Here's the exe: Photo Rescue Expert

posted 2 Jun 2004 in Site News

Headache Calendar

The Headache page now includes calendars of the previous and current months. Days where I needed prescription medication are highlighted in blue.

In the past, I found it difficult to give an accurate answer when asked how often I get migraines without some kind of record. Since April 23, 2004 I've been adding an entry to the Links weblog every day, with a brief description of any headaches that day, using the Headaches category. If I took an Imitrex, the entry also gets assigned to the Imitrex category. The Headache page lists every entry in the Headaches category; the calendar highlights only the days which have an entry with the Imitrex category assigned.

posted 28 May 2004 in Site News

Posting Albums

Here's the process for posting photos:

  1. Create a directory for the album in d:\bnc\photos on Elba.
  2. Upload the photos from the camera into the newly created directory.
  3. Run the utility setnametotime to convert the weird sequential file names to date/time stamp format
  4. Open an Explorer window with the photo directory.
  5. Start Web Album Generator
    • Drag the files from the Explorer window onto WAG's file pane.
    • Select File->Generate Album:
      • Enter an appropriate string in the Album Title field;
      • Use the defaults for all other fields, clicking Next until the last dialog;
      • In the final dialog select D:\albums\NAME for the Album's directory, where NAME is a dirify'ed shorthand for the album title;
      • Click Finish
    • Select File->Save Album As; select the directory from step 1, and enter the dirify'ed album name as the filename.
    • Exit WAG.
  6. Use CoreFTP (or Filezilla) to move the entire album directory (from step 6) onto the server, in the ~/html/albums directory.
  7. ssh into the server.
  8. cd to ~/html/albums/NAME, where NAME is the dirify'ed name of the album directory on the server.
  9. Run ~/bin/fixphoto
  10. Create a new MT entry, with Albums as the primary catetory. Enter a pithy title for the post. NOTE: enter the dirify'ed name of the album directory in the Keywords field.

That's it. setnametotime, WAG, and CoreFTP are in this Zip file.

posted 23 Apr 2004 in Site News

Relative Font Sizes

I plan to do this, someday soon.

Power To The People: Relative Font Sizes: A List Apart

posted 22 Apr 2004 in Site News

23rd Post

From asterisk*

  1. Go to your blog's archives.
  2. Find your 23rd post (or closest to).
  3. Find the fifth sentence (or closest to).
  4. Post the text of the sentence in your blog along with these instructions.

From The Cruise, with the fifth sentence emphasized within the entire paragraph for some much needed context:

As usual, Carole was running late - very late. So late, in fact, that I got to drive them to the ship. Carole normally has to drive everywhere - the alternative is having her get car sick, so it's an easy decision. But, she can't get a ticket until at least September. She's already got one on her record, and another that she went to traffic school for, and she can't go back to traffic school until September.
posted 21 Apr 2004 in Site News

Bookshelf listings

I recreated the MTAmazon/MTMacro setup I had in place before losing my server last week. This gives my Bookshelf entries a nice, consistent look, with a small image of the book cover and the book title (both linked to the appropriate Amazon page), along with the author's name(s).

And yes, I have a backup.

posted 28 Mar 2004 in Site News

Up and Down

I have about 16 domain accounts right now. Half of them have their nameservers set to ns7.inetter.net and ns8.inetter.net; the other half use ns1.bcisys.com and ns2.bcisys.com.

I had to update the IP for ns1.bcisys.com and ns2.bcisys.com after moving to the new server. Unfortunately, the e-mail I got from Inetter had the wrong info. I finally figured it out on Friday, got the right info from Inetter, and updated my domain record accordingly. As of this morning, the domains that use ns1.bcisys.com and ns2.bcisys.com were resolving normally.

Alas, the domains set to ns7/ns8 would resolve only intermittently. I spent a lot of time with Jason on the support chat, trying to figure it out. He found that restarting bind would solve the problem. We both wondered why the bind problem didn't affect the private label nameserver, since both ns1.bcisys.com and ns7.inetter.net point to the same server.

Jason said he's going to ask the system admins to check things out in the morning. We'll see.

posted 28 Mar 2004 in Site News

Oops...

Well, I'm back - finally.

Back at the beginning of March, I decided it finally made sense to become a web host provider. I signed up for a reseller account with inetter.net, which gave me pretty much everything I was looking for: WHM access for setting up new accounts; each client account has direct cPanel access; a load of disk and bandwidth to work with, etc.

I started a gradual move of all the sites I handle onto the new host. It turns out there's quite a few: two for me, two for Carole, one for each of the kids, four for various AYSO programs. I consolidated all the domain registrations on godaddy.com, and started by moving bcisys.com to the new host. That went pretty well, so over a couple of weeks I got everything shuffled over.

I was pretty happy with Inetter - help desk requests got processed promptly, and they have a live on-line support chat system that works pretty well. Based on my good experiences, I began shutting down the accounts on the old providers.

On Monday, none of the sites were available. Inetter told me they were having problems, so I let it go for a while. The problems persisted on Tuesday, when I got some sobering news from Inetter: the server that housed all my sites had been taken offline by their dedicated service provider because spammers had infiltrated the server. On top of that, they wiped the server before any backups could be made.

Ouch. I was totally screwed. I had backups of the individual sites, but they were stored on the bcisys.com account, which was also gone. The AYSO RvR site that I had invested 40 hours in was gone for good.

I was able to reclaim the data for most of the sites from the old ISP's. This account was restored after an extraordinary effort from my old provider, Blogomania, who found an old monthly backup of the site and the database and graciously provided it to me. I am very, very grateful to them for the help.

So, here's where I stand: a) the AYSO RvR site is gone - it was new and had only existed on the lost server, and there were no backups anywhere; b) goption is back to its state as of March 3rd. A lot of entries are gone, and the redesign of the Bookshelf category using MTAmazon was lost; c) most of the other sites are mostly static, and I was able to recover them from backups made on the old ISP's sites.

All in all - it could have been worse. Tuesday was not fun - I wigged out, and was barely able to function for a while. On top of the normal stress of the day job and a less-than-ideal report card for Justin, I was over the edge. I told one of the support guys from Inetter that it was days like these that made me glad I stopped drinking 26 years ago.

So, for now I'm staying with Inetter. They extended some goodies to help ease the blow, but it still sucks, big time.

posted 26 Mar 2004 in Site News

Get Firefox

  • I added a link from the Firefox promo page to the main page sidebar only, under the Technorati and blo.gs links.
  • The addition of an image anchor in the sidebar required a new style sheet entry to disable the normal border that goes around link images.
posted 9 Feb 2004 in Site News

Firefox Bookmarks

Download file

posted 9 Feb 2004 in Site News

To Do's

  • Convert to em-based sizing, so resizing will work as expected.
  • Setup entries to they can be collapsed after expansion.
posted 26 Jan 2004 in Site News

Setting width in em's?

Instead of fixed pixel widths, is em's the way to go? The page would shrink or expand based on the user's selected font size.

posted 12 Dec 2003 in Site News

Another Test

posted 5 Dec 2003 in Site News

Test

posted 5 Dec 2003 in Site News

Photo Changes

I wrote a script to convert the albums generated by the free generator into a site-specific format, using the standard style sheets. Because of this change, albums no longer open in a new browser window.

posted 1 Dec 2003 in Site News

Style selection; favicon

A few days ago I added style selection to the main page of the site. Currently, each alternate style sheet is a full copy of the main site, with each alternate style having minor changes to body background and possibly the nav bar background color. I still need to weed down the alternate sheets to only the changes, since the main sheet's entries will still be in place even when an alternate sheet is in use.

I also added a lame but functional favicon.

posted 1 Dec 2003 in Site News

Highlight Current Page

I added some CSS and made some minor changes to the MT templates to highlight the current page on the top nav bar. The changes are based on the following article:

highlighting current page with css

Ideally, the nav link for the current page would be un-clickable, but that's not possible using CSS. A little PHP or JavaScript may be necessary.

posted 1 Dec 2003 in Site News

Photos now posted

I finally got my photo albums posted - use the Photo item on the main navigation bar at the top of each window.

Show all...

posted 25 Nov 2003 in Site News

Redesign

I'm in the process of redesigning the site. The old layout was bland and boring. The new site is (hopefully) bright and bold.

The main page has been converted, and I'm working through the other MT templates. I plan to be done over the weekend, but it's a busy one, so things may need to wait.

posted 24 Oct 2003 in Site News