Sunday, December 23, 2012

Installing Microsoft SMTP on IIS

If ever there was an "SMTP for Dummies" solution, it would have to be Microsoft's SMTP implementation for the Internet Information Server (IIS) of its flagship Windows server products.  The product comes free with Windows Servers and just needs to be installed and configured, as it does not normally come pre-installed by default.

I recently migrated my servers to the "cloud" and was faced with the prospect of having to run my own SMTP service as the data center does not offer a centralized SMTP service.  Linux is normally a much more robust solution, but my skills in setting up SMTP date back to more than a decade ago. I'm so out of touch already with going down that route so I considered the easier way out -- Microsoft IIS.

Installing the SMTP service only takes about a minute.  One just has to follow these steps.  Setting it up is also just a matter of pointing-and-clicking for the most part as described here.  In no time at all, the SMTP service was up and running!

Thursday, December 20, 2012

Sending Email via GMail SMTP using C#

I recently availed of a cloud server over at Rackspace.  Since the company does not provide a public SMTP server for their clients, I  had two options -- install my own or, as my brother-in-law suggested, use GMail for outgoing SMTP.  The latter sounded a lot more appealing as maintaining an SMTP server is not a simple task.

I searched around the Internet for sample code and it turned out to be much simpler than I expected with .NET because the System.Net.Mail class structure already has all the stuffs needed to implement the security stuffs.  It just looks something like this:

System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient();
client.Host = "smtp.gmail.com";
client.Port = 587;
client.EnableSsl = true;
client.Credentials = new System.Net.NetworkCredential("dick.chiang@gmail.com", "mypassword");

System.Net.Mail.MailAddress from = new System.Net.Mail.MailAddress("dick.chiang@gmail.com", "Dick Chiang");
System.Net.Mail.MailAddress to = new System.Net.Mail.MailAddress("someguy@yahoo.com");
System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage(from, to);
message.Subject = "Sample GMail Message";
message.Body = "Hello world from GMail!";
client.Send(message);

Wednesday, December 12, 2012

Telnet Client for Windows 7 and 2008 R2

I've been trying to debug something for the past couple of days and I just realized that Windows 7 does not have a telnet client installed by default unlike previous versions of Windows (dating back to version 3.11 as I recall).  Doing a quick Google research, I found out it can be installed by doing the following:
  1. Click Start, and then click Control Panel.
  2. On the Control Panel Home page, click Programs.
  3. In the Programs and Features section, click Turn Windows features on or off.
  4. If the User Account Control dialog box appears, confirm that the action it displays is what you want, and then click Continue.
  5. In the Windows Features list, select Telnet Client, and then click OK.
Windows 2008 R2 also does not have it installed by default.  The following instructions seem to do the trick:

  1. Start Server Manager. Click Start, right-click Computer, and then click Manage.
  2. If the User Account Control dialog box appears, confirm that the action it displays is what you want, and then click Continue.
  3. In the Features Summary section, click Add features.
  4. In the Add Features Wizard, select Telnet Client, and then click Next.
  5. On the Confirm Installation Options page, click Install.
  6. When installation finishes, on the Installation Results page, click Close.

Sunday, November 18, 2012

More on Finding Large GMail Attachments

I previously mentioned this great tool called FindBigMail which scours through your GMail inbox and tag all large attachments.  While the service is free for personal use, you  have to pay to use it for GMail for Domains accounts (aka. Corporate GMail).

But thankfully, it looks like the GMail engineers picked up some ideas and implemented the size search within GMail itself.  Try typing "size:10m" or "larger:10m" to find emails larger than 10MB.

Aside from the "before:yyyy-mm-dd" date search filter, you can now also type something like "older_than:1y" to retrieve email more than a year old.  By mixing this with the "size" search filter, you can now search for old, large email and delete them to free up space!

Thursday, November 1, 2012

Halloween 2012

The three kids went out trick-or-treating (well, Conner just stayed inside the car the whole time).

Halloween 2012

Friday, October 12, 2012

Possessive Noun

I previously thought making a noun into possessive form was as simple as adding an apostrophe-s ('s) if it does not end with an "s", and just a simple apostrophe if it does.  I was tutoring my Grade 4 daughter on possessive nouns last night and I was surprised at all the other rules.

Rule #1 - If the noun is common and singular, always put apostrophe-s -- even if the noun already ends with an "s" already. So for example, you should say "princess's gown" instead of "princess' gown".

Rule #2 - If the noun is proper and single syllable, always put an apostrophe-s also except if the word following it starts with an "s".  For example, its "James's car", but "Kris' shoes".

Rule #3 - If the noun is proper and multi-syllable, then you follow the standard rule of apostrophe-s if it does not end with an "s", and just apostrophe if it does.

Wow!  I learned something new from 4th grade!

Saturday, September 29, 2012

Preserving State Between Web Server Instances

One of my web site applications has been giving me headaches.  Every few days, I would encounter an incident when one of the user session seem to lockout the application causing other users to time out.  I used Microsoft IIS' application pool function to separate it from the other apps running on the same server so I can easily restart its pool without affecting the others.  But still, having to restart the pool every so often is a chore.

I decided to spread out the load to several threads by initially setting up a Web Garden.  A Web Garden uses multiple worker processes and uses a queue manager to process incoming requests to the application pool.  Unlike a Web Farm, which comprises of multiple web servers, a Web Garden just uses multiple worker threads in the same multi-CPU server.

The problem I encountered with running apps in a web garden is that values stored in Session variables are local to the worker thread that was assigned to it.  So if IIS decide to send you to a different worker thread in subsequent requests, the Session variables used in the other worker thread will completely disappear.  I thought of using ViewState at first so that the values are stored on the client side and just passed back on every request.  Unfortunately, ViewStates only seem to work for postbacks to the same URL.  Once the URL changes, the previous ViewState value is also gone.

I found this interesting article on how to use OutOfProc Session State servers.  By using the StateServer instance, one can save session variables between apps or even between servers.  Its not as robust as the SQLServer solution, but its relatively lower overhead.  One only need to add the following lines in the web.config's system.web section:


< sessionState mode="stateserver" stateConnectionString="tcpip=127.0.0.1:42424" />

Will be observing if performance improves with this modest adjustment on the design.

Wednesday, September 26, 2012

Taking the Camry for a spin

I had a meeting at Clark, Pampanga today with a client so I took our new Toyota Camry for its first long distance drive.  I've been wanting to figure out what its mileage is like under a long, smooth driving condition with no traffic.  One of the nifty features of the car's dashboard is a real-time calculator of its gasoline mileage.  Under Manila's normal city traffic conditions, the best I can do is between 6 to 8 km/liter under "Eco Drive" mode.  A long distance drive with no traffic should show a much better performance.

At its peak, I was able to clock a sweet 16.1 km/liter!  I cruised between 80 to 110 kmph during the whole stretch.  It seems that the optimal mileage can be reached by the car if you set it at cruise control and just let the computer take over; or maybe it was just my imagination.  Sigh... if only inner city driving was as fuel efficient.


Saturday, September 15, 2012

Hello World Conner Drake

Cols and I woke up early today because we were supposed to drive Ethan to Xavier for his Saturday make-up class.  But because its been raining heavily the whole night, the school decided to postpone the make-up class.  Cols and I proceeded to Cardinal Santos to have a check-up since she is scheduled to give birth already anytime this week.  The maternity unit said she is already open 2cm and when they contacted Dr. Madamba, she told the staff to inform us to come back later in the day to induce labor already.

We went home first to have lunch and relax a bit.  We drove back to Cardinal Santos around 4:30pm.  When we got to the maternity unit, we were surprised when they told us Cols is now at 5cm and can give birth in 2 hours time!

I proceeded to the admission counter while they prepared Cols to go into labor.  By around 8:30pm, Dr. Madamba predicted baby will be out by around 9pm.  So at quarter to 9, we were moved already from the labor room to the delivery room.  With just a couple of push, and almost right on the dot, Conner Drake popped out of his mom's tummy!


Conner weighed in at 6.7 lbs.

Tuesday, August 21, 2012

The Bungi Family

I bit on something really hard about 3 weeks ago while eating pizza.  I cracked my upper left molar (the one next to the incisor).  The fracture has been bothering me for several days, and finally today, I decided to have it removed!

It was actually not as painful as I was expecting.  Kudos to Dr. Alicia Tan of Mt. Sinai Dental Clinic!  She did inject anesthesia to numb my gums.  But pulling the tooth out turned out to be very effortless.  I hardly felt anything.

Caitlin also had a tooth extracted because her permanent tooth underneath was already pushing it out.  Ethan lost one of his front tooth about a month ago.  Then he lost the other one while playing badminton a couple of weeks ago.  So here we are -- all with missing teeth.
Look at our missing teeth!

Sunday, July 29, 2012

GCHS Batch 87 Reunion

Hard to believe it has been 25 years since we left the gates of Grace Christian High School!  But thanks to the selfless efforts of a few batchmates, several of us got together last night at Chivz in Greenhills for a night of fun and memories.

From GCHS Batch 87 Reunion

It was fun trying to figure who is who after all these years.  Some classmates still looked exactly the same, while others, err..., have "matured" more.  hehehe.  Section 3 (my section) was the most represented (thanks, classmates).  Lets hope the next reunion will not take another 25 years!

Wednesday, July 4, 2012

Importing and Exporting Data across Firebird Databases


In the past couple of weeks, I've encountered a few problems with the Firebird databases that I maintain.  In both cases, I had to retrieve data from a backup and restore it to the one running in production.

Firebird does not come with any built-in utility to do that function.  Thankfully, as with majority of open source projects, there are 3rd party solutions that seem to do what you want.  In this case, I found FBExport:

http://fbexport.sourceforge.net/

The command-line syntax is very straightforward.  First, you extract:

fbexport -S -H hostname -D database1.gdb -U username -P password -F file.fbx -Q "select * from sometable"

Then, you import:

fbexport -I -H hostname -D database2.gdb -U username -P password -F file.fbx -Q "INSERT INTO sometable(field1, field2, field3)"

It works great!

Wednesday, June 6, 2012

Trick Art

I took the kids and my nephew to Seri Fantasy World this afternoon.  The group-buying sites have been promoting them in various deals and lots of people have been buying, so I've been curious as to what is in there.

Seri Fantasy World is located at the second floor of the Manila Ocean Park.  My first impression when I saw the place was that of disappointment.  It looked like a ran-down, low-end version of Active Fun.  Our P198 voucher was good for unlimited viewing of their 3D movie and the Trick Art Museum.  The kids seem to have enjoyed the 3D movie although the quality was pretty lame compared to our Samsung 3D tv at home.

The Trick Art Museum was the highlight of the trip.  The place was actually very small and very unimpressive to look at.  All the images on the wall look very flat and 2D-ish.  But interestingly, when you take a picture, they look very 3D-like.  Check out our shots.

Tuesday, May 15, 2012

Koshi Noodles at Moshi Koshi

When along Shaw Boulevard, pass by and try Moshi Koshi Noodle Boss.  Its a modern Japanese diner which specializes on koshi noodles, a term used to refer to the "chewiness" property of freshly prepared Japanese noodles.  The udon is the specialty although I also love the soba.  They serve zaru soba (cold soba) even though it is officially not in the menu.

Moshi Koshi also serves toppings (donburi) and salads.  No sushi or sashimi on the menu.  Pricing is affordable (mostly below PHP200).  Moshi Koshi is the brainchild of one of the founders of Yellow Cab Pizza.

Wednesday, April 18, 2012

Tracking Images via GPS


Here's a very interesting story.  A hacker was recently apprehended by the FBI based on the photo of the, ahermm... "assets" of his girlfriend.  As it turned out, he took the photo using his iPhone which embeds GPS information in the metadata section of the image file.  Not being aware of it, he posted the image to taunt the authorities.  I guess you can say he committed a "boo-boo".

Sunday, April 15, 2012

PLDT's Lousy DNS Servers

Looking for free and reliable DNS service?  Try out Comodo's free Secure DNS service.  Just configure your router or your PC to use the following DNS servers:

Primary DNS : 156.154.70.22
Secondary DNS : 156.154.71.22

It works soooo much better than PLDT's DNS server that comes with their MyDSL service.  PLDT's DNS server often fails in resolving hostnames.  So even if the DSL link is up, you can't surf.  The problem does not seem to be unique to me as postings in public forums from other PLDT subscribers also describe the same problem.

Manually Updating Comodo Anti-Virus Database

I've been using Comodo's free Internet Security Suite for a couple of years and I have not had any problems with it.  However, when I recently bought a couple of new notebooks for the new office and tried installing it, I realized how inefficient it was.  The Comodo installer itself is about 80MB in size and you can download it from Comodo's site or at CNet.  The problem is Comodo does not provide a site where you can download the latest virus signatures as a single file.  You have to download it using the Comodo software itself.

The anti-virus database (CAV file) from a fresh install is so large (about 129MB).  The download process keeps failing due to time out.  Comodo does not seem to have a partial download/update or a resumable download capability.  If the entire download does not work, the whole thing aborts.  Also, if you have several PC's or notebooks, you have to download that same file on each PC.  It would be so much more efficient to just download a single large database update file and install it on each individual PC's.

Reading through several forums, I found out that there is an unofficial way of doing this.  One can copy the scanners subfolder (specifically, the bases.cav file) of an up-to-date installation under the c:\program files\COMODO\Comodo Internet Security folder to the new PC.  But since its a special folder, you have to switch to Windows safe mode first (http://www.pchell.com/support/safemode.shtml) before you can overwrite your copy.  I tried it and it worked!

Friday, March 9, 2012

BIR eFPS using Brain-Dead BancNet

I really hate BancNet's BIR eFPS interface.  It has got to be one of the lamest implementation of BIR's electronic filing and payment system.  The brain dead system becomes evident from the time you enroll.  The fields cannot be filled-up by typing, but by copying-and-pasting.  That is the weirdest thing ever and took me quite a long time to figure out.

Once you get past the enrollment stage, using it every time also makes you feel like you are back in the mid-90's.  The user interface, with those large frames, is reminiscent of the early years of the World Wide Web.  It is just so plain ugly.  If there is a reverse Web Awards (ie. the ugliest of the web), they have got to be nominated.


Oh, and it only works with Microsoft IE?  Duh!  What kind of website nowadays still requires only IE?


I've been using BDO Corporate Internet Banking's eFPS for a long time.  While the user interface is also another blast-in-the-past, the flow is not as bad as BancNet's.  I think BPI Expresslink's eFPS interface is the cleanest and simplest.

Monday, February 13, 2012

JT's Manukan Grille @ Katipunan

We had lunch today at Joel Torre's JT Grille along Katipunan.  I've read good reviews about it and it seems to be opening more and more branches, so I've always been curious to try it.  The restaurant is in the 2nd floor of the building so it was not easy to find.  We had to ask the guards to figure out how to get there.

There were not that many diners when we got there, but service was really slow.  There seems to be only 3 x staff manning the entire restaurant operation.  We had to follow up several times just to get hot water.  When the waiter delivered the plates, a cockroach-like insect jumped into the table and freaked out Cols.

When the food finally arrived after a long wait, I was filled with excitement.  Sad to say, I was a bit disappointed after the first bite.  It did not taste any more special than any other inasals I've eaten.  Granted that it is much better than Mang Inasal, which has really gone downhill in quality since Jollibee bought it.  But its nothing really special to write home about.

Wi-Tribe @ Marikina

I went to the Wi-Tribe sales office at Ayala Ave this afternoon to apply for a postpaid 4G service for the new  office.  They have a spacious retail outlet there with 3 customer service desks which always has a long queue of customers.  I've been there 3 to 4 times already and I always just leave because of the queue.  I had no choice this time because I wanted to avail of their ongoing promo up to Feb 15 where new subscribers will have no lock-in period.

I considered PLDT's wired DSL service but I was turned off by the 24-month lock-in period.  I really do not understand the logic for lock-in period since PLDT requires you to buy the Zyxel DSL modem anyway and its not as if they are subsidizing it.  And even when you terminate the service, you cannot return the unit and get back your money.  Its considered "sold".  Furthermore, if you apply for a DSL service again elsewhere, you also cannot use that old modem.  You have to buy another new one (even if it is exactly the same unit/model).

I availed of the up-to-2mbps 4G service for Php998 per month.  The bundle comes with a router/wifi access point all-in-one unit for free (take that, PLDT!).  I am not sure if this is just part of the ongoing promo or whether they are really giving away those units to all subscribers.  The packaging is very well thought out and polished -- from the box to the manuals.  Everything is Wi-Tribe branded -- even the http admin page of the router.  You don't see a Zyxel brand unlike the PLDT offering.

The 4G modem/router/wifi access point is really plug-and-play.  You take it out of the box; plug it to the power outlet; get your wifi device to connect to it; and you're up and running!  Of course, there are more "advanced" settings like security, firewall, DDNS, DHCP, etc. that more advanced users would want to tinker around with.  But for ordinary users, its a no-brainer.

Now as to the performance.... well, here in our 2nd floor master bedroom in Loyola Grand Villas, I only get 2 bars out of 4 in the signal strength indicator.  And sometimes, the 2nd light would even blink on and off.  So maybe its more of 1.5 ~ 2 out of 4 only.  In terms of surfing speed, it does not seem to be that much faster compared to our entry level PLDT MyDSL 384kbps.

Caitlin thinks the YouTube streams are not any faster. And forget about BitTorrent.  Wi-Tribe seem to be filtering or throttling it.  I tried to download 4 torrents and none of them can seem to get a session started.  Since Wi-Tribe switched their billing model from data-throughput based, to now "unlimited", I guess they did some engineering in the back-end to prevent abuse.  But what about users who really want to download?  Should they avoid Wi-Tribe altogether?

Monday, January 30, 2012

Umbrellas Anyone?

Aside from liquids, the airport authority (MIAA) at NAIA3 also does not allow umbrellas in hand carry luggages.  I took this shot of a "trash bin" after the x-ray machine where people have to leave their foldable umbrellas behind.  That's a lot of umbrellas.

Sunday, January 29, 2012

At NAIA Terminal 3 Again

I'm at Cafe France again eating while waiting for my CEB flight to Gen San.  Getting connected to Globe's free WiFi service was a lot more complicated this time.  Took several attempts of disconnect/reconnect before I got through.  When I last used it, it was a really simple process of just connecting to the access point.  Now, they added a redirect to MIAA's web page first.

I noticed that the escalators from the Level 3 departure area to the Level 4 shops/restaurants area are all still "under repair".  They were like that when I was here last month!  I guess if people are desperate enough to want to go up, then they will look for the elevator at the back hall.  But casual passengers would just skip the stores altogether and head straight in to the pre-departure area.  I pity the concessionaires/tenants at Level 4.  There must be almost no business.

In  one of the elevators being repaired (yes, there are actually maintenance men fixing it), there was my pet peeve repair "on-going" sign.   Sigh.... this is actually the second time I've seen the "on-going" sign in the past 2 days.  Yesterday, it was along Libis where road repairs were also "on-going".

Saturday, January 28, 2012

Running Skype on our TV

We had a video-conference with Cols at Gen San using the Samsung Smart TV on our end (and its free webcam), and the Samsung Galaxy Tab on Cols' end.  It was pretty interesting to do a Skype session just using the TV and the home Wifi system.  Navigation is pretty simple once the account is setup.

I taught Caitlin how to do it so that she can initiate a Video Call when I go to Gen San also tomorrow.  She can probably figure out how to do it on the computer, but this one is simpler.  She just uses the TV remote to initiate a call.

Google Chrome Printing Problem

I don't know if it is just me, but I really hate the printer manager built into the Chrome browser.  I don't know why Google bothered to make one instead of just relying on the operating system's printer dialog.  The built-in print manager keeps hanging -- maybe 1 out of every 5 tries or so.  And when it crashes, it takes the whole browser with it.  Closing and restarting the browser doesn't seem to do much good either.  A full restart of the PC seems to be the only way to correct it.

So whenever I need to print my forms from BIR's eFPS system, I have to switch to Internet Explorer just so I can print properly.

Thursday, January 19, 2012

Moving Virtual Machines

I moved several of my small virtual machines (VM's) from my old server to the new HP server.  The process was pretty smooth.  Just copy the entire VM folder (which was about 4GB) to the new machine; load it to VMWare Server's inventory list; start it, and voila!  The only thing that took long was the physical moving of the VM folder.

I can imagine putting all VM's in a shared storage device, or SAN, can make the whole process so much simpler.  If you have several servers running VMWare, you can just un-register it from one server, and register it to another, to "move" it easily across your server farm.

Monday, January 16, 2012

Finished my 3rd audio book

I'm starting to become an audiobook junkie!  I just finished my 3rd one.  Having started with Steve Jobs' biography, I went next with Stephen King's Cell.  Now, I just finished Stephen King's Full Dark, No Stars.

I actually haven't read Stephen King's novels for a very long time.  I think the last one I read was back in 1994 or 1995. My favorite authors in more recent years are/were Michael Crichton (he's dead now), Dan Brown and James Rollins.  Unlike these guys, Stephen King does not really go out of way to explain WHY certain things are such in his stories.  You just have to take it as is.


Cell started out as a techno-thriller where the entire population turned into zombies simply because of a "pulse" that were sent to the mobile phones.  Now if it were Crichton or Rollins, they would at least try to find a reasonable explanation as to how that can theoretically be possible.  But with King, it just have to enjoy the bloodbath and gore that ensues.  No explanations necessary.

Full Dark, No Stars is an anthology of 4 short stories.  It took me about 2 weeks to finish it since I just get to listen to it on my way to work, and then on the drive back home.  I really liked this one.  In particular, Big Driver and A Good Marriage were pretty good even though their story line were kind of similar.  The protagonist was a woman who was a victim of a serial killer.  She takes the law into her own hands at the end, and somehow gets absolution from the other characters for "doing the right thing".

The epilogue was interesting.  I'm not sure if it was actually Stephen King's voice or the reader/narrator.  But it basically explained the story behind the story -- ie. where he got the inspiration for Big Driver or the real story that served as the basis for A Good Marriage.  Especially for the latter, its interesting to know that it was actually based on a real story.

Wednesday, January 11, 2012

Old School Computers

Ethan approached me today and asked if I have every seen those "old computers" which do not come with a mouse, and displays its output onto paper.  He was asking what it was called again because he forgot.  My initial thoughts were he must have seen images of the old IBM punch-card based computers like the ENIAC.  And then it hit me!  "Do you mean a typewriter?", I asked.  "Yes! a typewriter!", he exclaimed.  Old school computers indeed.