Friday, March 2, 2012

Know your IIS Log Folder Naming?

Ever wonder which IIS log folder belongs to which website? The answer is fairly straight forward.

The folder in which IIS logs are located is called W3SVC[Website ID]\.

For IIS 7+, you can find out the website ID by visiting the website's advanced properties as below:



For IIS 6, you can view the exact website's log folder here:

Friday, February 3, 2012

How to resize your VM image disk

When your VMware image size is not large enough, yet you don't want to create a new image with OS installation from scratch, one can perform the resizing of the VM image. One of the easiest ways to do so is with the VMware converter.

Steps:

1. Download VMware converter.

2. Shutdown the virtual machine.

3. Start the VMware converter software tool.

4. Click on "Convert machine" button.

5. In the source type field, choose the option "VMware Workstation or other VMware virtual machine". And click next.

6. In the Destination System panel, choose also the option "VMware Workstation or other VMware virtual machine" for the destination type field.

7. For the VMware product, select the version of the VMware product on which your image is based on.

8. Specify the virtual machine name and location accordingly to your environment. And click next.

9. Edit the "Data to copy" part, and choose "Select volumes to copy" for the data copy type. Then choose "" in the destination size drop-down field. Specify the size in GB, e.g. 60.

10. Click next and finish to start the conversion job. Wait for the conversion is complete. The new VM image now should have the specified disk size to go with it!

Question of the Day: Know your in-use IIS & SQL server versions?

Ever wonder what versions are in use for IIS and MS SQL server? For server-side development, this can be a common questions that get asked often.

  • For IIS, visit the registry:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InetStp\VersionString

  • For MS SQL server:

(1) Connect to the SQL server via the Management Studio tool


(2) Run the query - 


Select @@version


The result is then shown ~
==================================================
Microsoft SQL Server 2008 (SP1) - 10.0.2531.0 (X64) Mar 29 2009 
10:11:52 Copyright (c) 1988-2008 Microsoft Corporation Express 
Edition (64-bit) on Windows NT 6.1 (Build 7600: )
==================================================


BTW, thank goodness it's Friday!

How to change the default windows log-on user

For windows server 2008, I once had a problem where the default windows log-on page still showed the deleted user. To change the log-on user, simply go to the registry:


HKLM\Software\Microsoft\WindowsNT\CurretnVersion\winlogon


and change the value of DefaultUsername to the user that you would like to show up on the windows log-on page!

Friday, January 20, 2012

A free JavaScript IDE? Aptana to the rescue

Just thought I share one cent: for those of us doing web development and looking for a good, free IDE, Aptana fits the bill well!

http://aptana.com/

Sunday, January 8, 2012

Visual Studio Code Formatting (tab spaces)

In our project at work, we have a visual studio code base that contains server codes of various languages, including C#, JS, HTML, XML, SQL, and CSS. The issue we have is that the format of the code is very much inconsistent: some code are tabbed at two spaces while others at four spaces. The reason for this mixture is because the code has been passed on by a few teams, who have been following different coding standards. This problem can be common among project code, especially legacy code.

To solve this problem, there are recommendations to use the VS macro to run the "Format Code" command on the solution. And I found such a recommendation: Format all document in visual studio. However, for some undiscovered reasons, it was not able to re-format our project code. Then I was quite lucky enough to find an existing tool called CodeMaid that does this job wonderfully. I could simply run the cleanup all files function, then all code will be automatically re-formatted with the same tab spacing. Afterwards, the inconsistent itches in our code are gone!

P.S. if you're looking for some coding style suggestions, StyleCop as an add-on may fit the bill. It prints out possible coding style problems as warnings for your consideration.

Saturday, October 29, 2011

Got my HTC tattoo updated to Android 2.3 with CyanogenMod

Recently a friend told me that he's got his HTC tattoo to use Android 2.3. He proceeded to showing me the upgraded phone with cool-looking UI and new features. On top of this, his phone now has a much better performance (UI response) along with a longer battery life.

So five days later, on a free Friday night when the clock struck 12 midnight, I googled on the way to update my Tattoo from Android 1.6 to 2.3. What follow are the results and steps to doing so.

The main instruction page on how to flash can be found here:

http://wiki.cyanogenmod.com/wiki/HTC_Tattoo:_Full_Update_Guide

I then followed the instruction prescribed here but found I was having trouble rooting my device using the adb command line. The error that I always encounter was unable to "exit" debug shell correctly. Many messages were printed such as "reboot...". So when I tried to perform a "su", I got permission denied. It turns out there's a much easier way to root my device, as it can be found here using Universal Androot:

http://www.addictivetips.com/mobile/how-to-root-android-devices-with-universal-androot-app/

After this first hurdle is overcome, the rest seems like much doable and effortless (well, relatively). The next thing on the agenda is installing the ClockworkMod Recovery. While using the instructions from the update guide, I had a problem with flash_image: it simply won't work. Either it's not found or illegal instruction. The solution was found there:

http://forum.cyanogenmod.com/topic/24333-flash-image-not-found/

Basically, I downloaded the flash_image version as detailed here (file hosted on rapidshare). Voila, the flash_image executable now works and recovery was installed. To boot into ClockworkMod Recovery, the instruction is: adb reboot recovery

http://www.addictivetips.com/mobile/what-is-clockworkmod-recovery-and-how-to-use-it-on-android-complete-guide/

Then after flashing CyanogenMod via Recovery, I was a happy man with his Tattoo upgraded :-)

P.S. If you find that the newly upgraded phone does not work with Wifi, you may need to replace a new file: wlan_loader, as detailed here:

http://code.google.com/p/cyanogenmod/issues/detail?id=4370

Happy hacking, flashing or bricking!!!