Tuesday, September 30, 2008

[trip] Mike and Shelbey's Wedding

When: 2008.09.25 - 2008.09.28
Where: Seattle
Accomodation: The Pan Pacific Hotel

- You won't give us the car at our price because we are 20 min early? Fine. We'll wait.
- Whoa! The speedometer just shot past 200 miles and went full circle! OK. I guess this car is dead (or possessed)
- Would we like that red H3 instead? Sure! Not ironic at all driving a giant humvee in a green city like Seattle
- Your fitness center is open 24 hours and has a 10-person hot tub. Seriously?
- At Maxmillian at Pike's Market -- Yes, we'll wait here until it's happy hour. Then we will order all 10 items off your happy hour food menu plus a bucket of beer. Thank you very much.
- The Space Needle - And the foggy / damp view from the Space Needle
- Savor Seattle Tour's Pike Market food tour -- donuts, salmon, cherry chocolate, fresh cheese, clam chowder, coconut cream pie ... follow the pink umbrella!
- Oh, and, a lot more clam chowder the day after.
- "How do you solve a problem like Mike Davis?"
- Um. I don't think these beer nuts are meant to substitute a meal ... but okay, I'll go ask for another cup full.
- Let's check out Game Works!
- Finding a great meshed, padded, seat-belt friendly harness for Jose
- Finally! We found Uwajimaya!
- We got time before the wedding starts! Let's see if we can find a cocktail! (and no, they were all closed)
- Beautiful wedding at the most intimate chapel at an catholic school
- Yes, I went back for multiple servings of that damn good beef and salad with candied walnut
- Great wedding music that went through the decades
- Hanging out with the bride and groom in the hot tub after the reception, at 1am
- Hanging out with the bride and groom's family at the hotel bar, at 2am

Sunday, September 28, 2008

[outing] Angelini Osteria

Who: Christine, Pierre, me
Where: Angelini Osteria

- Arugula salad with sauteed cherry tomatoes and octupus
- Waygu beef cheek on a bed of polenta
- Happy birthday Christine - and thanks for the cup of Mascarpone!
- Fantastic dessert wine - 2004 Acinatico, Recioto della Valpolicella Region, Stefano Accordini Winery
     - http://www.accordinistefano.it/eng/vi_reciotoclass2004.php
- Whoa! look at your stunning hair christine!

Sunday, September 14, 2008

[muse] Usefulness vs Usability

- First, make sure the product is useful
- Then, think about making the product usable

Friday, September 12, 2008

[sql] How to find invalid email address in SQL Server

Very awkward without regular expression. So not perfect. But, catches enough.
select email   
  from loginuser where  
     patindex ('%[ &'',":;!+=\/()<>]%', email) > 0  -- Invalid characters
  or patindex ('[@.-_]%', email) > 0        -- Valid but cannot be starting character
  or patindex ('%[@.-_]', email) > 0        -- Valid but cannot be ending character
  or email not like '%@%.%'                 -- Must contain at least one @ and one .
  or email like '%..%'                      -- Cannot have two periods in a row
  or email like '%@%@%'                     -- Cannot have two @ anywhere
  or email like '%.@%' or email like '%@.%' -- Cannot have @ and . next to each other
  or email like '%.cm' or email like '%.co' -- Camaroon or Colombia? Unlikely. Probably typos  
  or email like '%.or' or email like '%.ne' -- Missing last letter  

Monday, September 01, 2008

[log] How to install Wordpress on IIS 6 Windows Home Server

The following is very specific to IIS 6.0 Windows Home Server. It is a continuation of this post.

Critical assumptions:

- You have set up a domain with homeserver.com (like, http://yourdomain.homeserver.com), when you set up your home server machine
- You have done ALL the steps to install PHP and MySQL

And now, for Wordpress:

1. Download and unpack
- Download from: http://wordpress.org/download/ (wordpress-x.x.x.zip)
- Create the directory c:\inetpub\wwwroot\blog (This would allow your blog to be accessed at http://yourdomain.homeserver.com/blog)
- Copy wordpress-x.x.x.zip\wordpress\* into c:\inetpub\wwwroot\blog (Navigate into the zip file in an explorer window, and double click on the file)

2. Create database and user
- Open MySQL client (Start Menu -> Programs -> MySQL -> MySQL Command Line Client)
- Enter your admin user password (hopefully you wrote this down)
- Type in the following commands (the expected outcome of each command should look like "Query OK, x row affected")

> create user wordpressusr identified by 'wordpresspwd';
> create database wordpress;
> grant all privileges on wordpress.* to wordpressusr;
> flush privileges;
> exit;

3. Setup Wordpress Config file
- Open an explorer window and navigate to c:\inetpub\wwwroot\blo
- Rename wp-config-sample.php file to wp-config.php
- Open wp-config.php in a text editor (Use notepad if there's nothing else)
- Find the three lines that look like below and changed them to match:

define('DB_NAME', 'wordpress'); // The name of the database
define('DB_USER', 'wordpressusr'); // Your MySQL username
define('DB_PASSWORD', 'wordpresspwd'); // ...and password

4. Go through Wordpress Install
- In a web browser, go to http://localhost/blog/wp-admin/install.php
- Follow the self-explanatory instruction. It will walk you through creating an administrator account.

5. Change blog address
(This step is missing in all instructions that I've seen)
- In a web browser, go to http://localhost/blog
- Find the login link and login as administrator.
- Click on "settings" (near right hand side of screen)
- For "Blog Address" and "Wordpress Address", change from "localhost" to "yourdomain.homeserver.com"

6. Change wp-content write permission
(This step is also missing in all instructions that I've seen)
- In an explorer window, navigate to c:\inetpub\wwwroot\blog\
- Right-click on wp-content
- Click on "Properties"
- Click on "Security" tab
- In the top-half of the window, click on "Windows/Users" in the list of users
- Then in the bottom-half of the window, click on checkbox for "modify" and "write"
- (If you don't do this, you won't be able to upload images and other content)

7. Now you are finally done
- In a web browser, go to http://yourdomain.homeserver.com/blog
- (If you don't see anything, make sure you had set up index.php as default content. See step 4 of how to install php)
- Login. Spend the rest of the day downloading and figuring out which theme you want to use (no one can resist spending hours fussing with themes)
- Oh yes, and blog.

[log] How to install PHP 5 and MySQL 6 on IIS 6 Windows Home Server

Installed PHP and MySQL on Windows Home Server with IIS6 this weekend, in order to install Wordpress and Gallery. As expected, it was all about figuring out confusing and non-existant installation instruction. Recap of how I should do it (if there is a next time).

[ PHP 5 ]

1. Download and run installer
- Go to PHP download page: http://www.php.net/downloads.php
- Download the Installer (php-x.x.x-win32-installer.msi)
- Download and Zip pakcage (php-x.x.x-win32.zip)
- (Why two packages? The installer saves time by automatically settig a bunch of IIS settings. But the zip file has all the DLLs that we need to add in)
- Double click to run the installer. Use all the default settings it suggests. Choose ISAPI, when it asks about it.

2. Copy DLLs
- In an explorer window, navigate to c:\program files\php\ext (The installer would have created this folder if you used the default setting)
- In another explorer window, navigate into the zip package (php-x.x.x-win32.zip).
- In yet another explorer window, navigate into c:\windows\system32
- Copy php-x.x.x-win32.zip\libmysql.dll into c:\windows\system32
- Copy php-x.x.x-win32.zip\ext\*.* into c:\program files\php\ext
- (Probably won't use all the extensions, but it's much easier to have them in there to just activate in php.ini file in the future)

3. Setup php.ini
- Open c:\program files\php\php.ini in a text editor
- Find the right section by searching for "extension="
- Add these lines:
- extension=php_mysql.dll
- extension=php_gd.dll
- extension=php_gettext.dll
- (mysql is for both wordpress and gallery. gd and gettext are for gallery only)
- As a last check, search for "extension_dir" and make sure it's set to c:\program files\php\ext. If it isn't, fix it.

4. Add index.php as a default content file
(This step is critical for all the PHP apps like wordpress and gallery)
- Start Menu -> Programs -> Administrative Tools -> Internet Information Services
- Expand the first level (which is something about "local computer")
- Then expand the "Web Sites" folder, now you should see "Default Web Site"
- Right-click on "Default Web Site"
- Click on the "Documents" tab
- Click "Add" button and type in "index.php"
- Click "Apply" and then close all the windows

5. Reboot the machine
- Tried just with IISReset, but IIS could not find php.ini in the right directory. So I rebooted the machine and that worked.

[ MySQL 6]

1. Go to http://dev.mysql.com/downloads/mysql/6.0.html#win32
2. Download the "Essential", which has the file name that looks like mysql-essential-x.x.x-win32.msi
3. Double click to run the installer. Use all default settings.
4. Reminder -- Write down the admin password. You'll need to log in as admin later to create databases and users to install things like wordpress.

PHP and MySQL by themsevles are not all that interesting. Make them useful by installing some applications. Here's how to install Wordpress on IIS 6 Windows Home Server.