Windows XP Alarm Clock How-To

June 6th, 2010

It has always amazed me that operating systems come with card games, text editors, media players, etc… but not a simple alarm clock. So here’s a solution I came up with for users of Windows XP. Enjoy.

Step 1: Create your alarm clock “buzzer”

Open Windows Media Player and create a playlist to be played when your “alarm” goes off. Save your playlist (it should have a .wpl file extention) and remember where you saved it.

Step 2: Create your Media Player launcher batch file

For the sake of an easy example, let’s say that in step one you named your playlist “playlist.wpl” and saved it at c:\playlists\playlist.wpl, your launcher batch would be:

START wmplayer c:\playlists\playlist.wpl && EXIT

Create this file using your favorite text editor and save it with a .bat extension – something like alarm.bat would probably work well.

Step 3: Set your alarm using Scheduled Tasks

Open Windows Scheduled tasks and add a new entry: Start Menu > Control Panel (in classic view) > Scheduled Tasks > Add Scheduled Task.

This will open the “Scheduled Task Wizard”, click ‘next’ on the first screen, then ‘browse’ on the second to choose the batch file created in step two as the task to run

Once your alarm.bat batch file has been chosen as the scheduled task to run (and you’ve tested alarm.bat to make sure it launches your playlist in Windows Media Player), set the correct time and date for the task to run, how frequently you’d like your alarm to go off, and any other desired scheduled task settings (there are some important logged-on and power settings to take a look at), make sure the task is enabled, click ‘OK’ and voila! An alarm clock in Windows!

Sorry, there’s no snooze.

How-To Create a 301 Redirect in Magento URL Rewrite Management

December 16th, 2009

I’ve noticed that I’m getting a lot of traffic recently for search queries regarding my previous post on some fairly unimportant details in the process of creating a 301 Permanent redirect using Magento’s URL Rewrite Management. I thought I would take a step back and post a quick how-to:

First: Is the redirect you want to implement at the page (“path”) or domain (“hostname”) level? If you need to redirect any part of the domain, you’ll have to do so somewhere else (like in the .htaccess file of your apache server)

Assuming then that this will be a redirect from one page to another, if I wanted to move and/or rename this page to a new URL, for example:

From: http://thewhatscool.com/seo/how-to-magento-301-redirect.html

To: http://thewhatscool.com/seo/magento-redirect-implementation.html

I would do the following in Magento to create the appropriate pemanent redirect:

  1. Navigate to Catalog > Url Rewrite Management
  2. Click the “Add Urlrewrite” button
  3. Select “Custom” from the “Create Urlrewrite” drop-down menu
  4. The “Urlrewrite Information” form would be completed thusly:

ID Path: seo/how-to-magento-301-redirect.html
Request Path: seo/how-to-magento-301-redirect.html
Target Path: http://thewhatscool.com/seo/magento-redirect-implementation.html
Redirect: Permanent(301)

So, to recap:
ID Path and Request path are the same: the path off the root of the url to redirect FROM – everything after (not including) the domain name and trailing slash.
Target path is the URL to redirect TO.

Nitpicking Magento Custom URL Rewrite Management for 301 Redirects

November 16th, 2009

Update! Looking for instructions/more detail? I’ve posted a quick Magento 301 How-To

I’ve been working on cleaning up the IA on a Magento based eCommerce store and noticed something that may be of interest to anyone using the Magento’s URL Rewrite Management to create path-level permanent redirects….

Yeah, this is a minor detail (maybe), but why not make sure it’s done correctly …So what am I nitpicking here?

The Problem

Magento asks for an “ID Path” “Request Path” and “Target Path”

Trouble is…that the target path is treated as a target url when output to “location” in the response header. These redirects still work correctly in terms of functionality, but I’d rather see the full URL location in the response header instead of an absolute path. My entire point here, as ridiculous as it seems, is that I’m required to input only a path for “ID Path” and “Request Path” (full URLs don’t work here, making manual Mod_Rewrite wizardry necessary for host/domain level redirects), but “Target Path” should read “Target URL”

The Solution

See “Target Path” – Read “Target URL” – Act Accordingly

Nofollow Nomore

June 4th, 2009

So I haven’t really looked into this a whole bunch, but apparently there’s something all abuzz about nofollow no longer being the what’s cool (or…doing anything?)

Here’s what I think.

The nofollow attribute had to be done away with because the ability to nofollow links makes Matt Cutts seem somewhat (very) disingenuous every time he claims that all you have to do is make a website with quality content that other sites will want to link to. Well guess what, if link juice is valuable and linking is now run by marketers instead of webmasters, that doesn’t exactly fly since most of those links (from one site to another) are probably nofollowed.

You know what I’d really like to see instead of nofollow? Link attributes like “navigation.” Something to designate that, yes, these category pages are linked to from every other page on the site (via top or side navigation bars), but those links should be ignored because they are there for usability purposes, not because I’m giving them all an equal “vote” of importance.

What about that? (in keeping with my theme) that would be the what’s cool for sure.

Permanent Redirects in ASP .NET without ISAPI_Rewrite

June 4th, 2009

Apparently, if your site is built with ASP .NET and you have some canonical rewriting to do, ISAPI_rewrite is the total what’s cool. Convenient .htaccess and full RegEx support, nice.

Unless you happen to not have any access to your host server to install ISAPI. I found myself in this situation and thought I would share my solution. As an added perk to taking this route — you don’t have to specify everything to be redirected, you can simply specify the canonical version and any request that doesn’t match gets 301′d auto-mati-cally. Cool (especially for the lazy).

Heed my advice at your own risk — I have a notorious reputation for dropping sites. This worked for me, but there’s no guarantee it won’t mess something up in every situation.

Assuming you have file-level access to your site and the code is in C# (a VB translation shouldn’t be too hard, but I’m not gonna do it)…

1)Find Global.asax and open it for editing

2)Find the Application_BeginRequest Event (it should be right there at the beginning, all the next steps are code to be nested within this event. Here’s what mine looks like:

<script RunAt="server">
protected void Application_BeginRequest(Object sender, EventArgs e)
{

3) First, set the variables to work with:

string page = Request.Path.ToString();
string host = Request.Url.Host.ToString();

One of the (few) cool things I’ve found about ASP .NET is that the request is pre “parsed” into very usable segments. The “Request.Path” object returns everything after the host (/thepage.aspx) — Request.Url.Host is just what it sounds like — the host portion of the request URL (www.thewebsite.com)

4)If there are any requests to keep un-redirected — subdomains for example — we’ll first have to exclude those. Let’s say we have a blog subdomain for this example, we’ll start the code by excluding it from the redirect. We also have to exclude the canonical host from the request as well (I’ve nested my ifs for display):

if (host != "blog.thewebsite.com")
{
if (host != "www.thewebsite.com")

5. The redirect. Notice that I’m not using Response.Redirect — that’s because it returns a 302. I haven’t found native support for automatic 301s, hence the following:

{
Response.Clear();
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location", "http://www.website.com" + page);
Response.End();
}
}

Done and done. The whole thing put together looks like:

protected void Application_BeginRequest(Object sender, EventArgs e)
{
string page = Request.Path.ToString();
string host = Request.Url.Host.ToString();
if (host != "blog.thewebsite.com")
{
if (host != "www.thewebsite.com")
{
Response.Clear();
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location", "http://www.thewebsite.com" + page);
Response.End();
}
}
}