Aug 05

Uninstall SQL Server Denali causes SQL Server 2008 R2 Management Studio to stop working

I installed MS SQL Server Denali CTP3 (and its management studio) installed parallel to SQL Server 2008 R2, and everything works fine until I decided to uninstall Denali. The uninstallation of Denali was smooth and gave no error, however, after the uninstallation, MS SQL Server 2008 R2 Management Studio could not be launched. It didn’t give any error message and just didn’t launch at all. I had to reinstall MS SQL Server 2008 R2 to fix the error, and I could not just reinstall the Management Studio because it kept giving me installation error.

Bottom line, don’t install MS SQL Server “Denali” along with MS SQL Server 2008 R2.

Aug 05

Windows Task Manager Launching Error: Windows cannot find C:\Windows\system32\taskmgr.exe

After I uninstalled MS SQL Server “Denali” CTP3, my Task Manager cannot be launched. Every time I try to launch it, it gives me an error:

Windows cannot find ‘C:\Windows\system32\taskmgr.exe’. Make sure you typed the name correctly, and then try again.

How to fix it?

Before I installed SQL Server “Denali”, I used Process Explorer to replace my Task Manager, and it seems that the uninstallation of “Denali” messed up Process Explorer. But since Task Manager has been replaced by Process Explorer, it will not be able to find the correctly file when Task Manager is being launched.

What I did was to rerun Process Explorer, then go to Options –> Replace Task Manager, then close Process Explorer.

If you want to go back to the built-in Task Manager in Windows, then repeat the above step (click Replace Task Manager again).
 
Hope this helps.
Jul 22

TrueCrypt donation

TrueCrypt is free open-source disk encryption software for Windows, Mac, and Linux. You can use it to encrypt your files, disk partitions, and even a whole disk. It is very easy to use and the encryption and the decryption process is transparent to end user, for instance, once a TrueCrypt container (a container is a TrueCrypt encrypted file containing all your data) is decrypted and mounted, the mounted container is the same as a disk drive to the end user. Any file put in the mounted disk drive will be encrypted automatically, and any file pulled outside the disk will be decrypted automatically.

As many open-source projects, it relies mainly on donations from users for their development cost. Recently, TrueCrypt set up a donation goal of $150,000 for their future development. My donation is limited, so I would like to use my blog to give it a shout-out. If you are a happy TrueCrypt, I encourage you to consider a donation to TrueCrypt to help them meet their goal. To see the current donation status and make a donation, you can visit their home page at http://www.truecrypt.org

Happy Encrypting!

Jul 19

How to use conditional CASE statement in Oracle WHERE clause to retrieve data

Here is the table structure that I need to query:

UserID

Type

Name

Department

Status

Classification

Enrollment_Status

Where “Type” and “Department” are foreign keys of the other two tables. The query criteria are:

If the user type is “Student” (type ID = 1), then only retrieve enrolled students (Enrollment_Status = ‘EN’);

If the user type is not “Student” (type ID <> 1), then check Classification field and only retrieve data with Classification <> ‘R’

It is a perfect scenario for using CASE statement in WHERE clause, and here is the complete query in Oracle PL/SQL:

SELECT    U.UserID, U.NAME, 

          D.DEPARTMENT,  U.STATUS, 

          U.CLASSIFICATION

FROM      Users U, Departments D, UserType T    

WHERE CASE WHEN (T.ID = '1') AND  (U.ENROLLMENT_STATUS = 'EN') THEN 1

           WHEN (T.ID <> '1') AND (U.CLASSIFICATION <> 'R') THEN 1

           ELSE 0

      END = 1

AND  U."TYPE" = T.ID 

AND (U.DEPARTMENT = D.DEPARTMENT_CODE (+) )

ORDER BY UserID;

For more information about CASE statement in MS SQL, check here: http://msdn.microsoft.com/en-us/library/ms181765.aspx

For more information about CASE statement in Oracle PL/SQL, check here:

http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96624/04_struc.htm#484

[UPDATE]: I just found out that .NET TableAdapter does not recognize the CASE statement above, thought the above query runs well in Oracle SQL Developer. After further investigation, I realize the above query can be changed to this:

SELECT    U.UserID, U.NAME, 

          D.DEPARTMENT,  U.STATUS, 

          U.CLASSIFICATION

FROM      Users U, Departments D, UserType T    

WHERE 

((T.ID = '1' AND  U.ENROLLMENT_STATUS = 'EN') OR (T.ID <> '1' AND U.CLASSIFICATION <> 'R'))

AND  U."TYPE" = T.ID 

AND (U.DEPARTMENT = D.DEPARTMENT_CODE (+) )

ORDER BY UserID;

And TableAdapter will recognize the above query and execute it without any error.

Jul 08

More free bonus from SugarSync cloud service

If you already use SugarSync, then you know that after you sign up an account (either Free or Paid account), if you finish five tasks under Getting Started tab in your account, then you will get 125 MB bonus storage. If you think 125 MB bonus is not good enough, then here is the good news. Started June 6th, SugarSync lets you earn 125 MB bonus for each task you finish, so the total bonus will be 625 MB when you finish all five tasks.

SugarSync bonus storage

 

What about those who already finished the five tasks before the change? The good news is they are eligible too! If you already finished the tasks before, then just log back into your account, and you will be prompted for this bonus. All you need to do is to accept the bonus, and you don’t need to do the tasks again. How nice. For more information for this new bonus, check this post: http://www.sugarsync.com/blog/2011/07/06/free-storage-come-and-get-it/

 

If you haven’t used SugarSync, or you haven’t heard of SugarSync, SugarSync is a secure online backup and file synchronization service. You can back up your important files on SugarSync cloud storage and also synchronize them with your other devices, such as computer and smart phone. For more information about SugarSync and other similar services, you can read my blog post http://www.codingbeaver.com/myblog/index.php/2011/04/29/drop-dropbox-and-pick-up-sugarsync/

If you decide to use SugarSync, you can use this referral link to sign up. With this link you will get 500 MB bonus storage when you complete the registration. So your total bonus storage will be 500 MB + 625 MB (if you finish the five tasks) = 1125 MB!

Sign up with this referral link to get 500 MB bonus:

https://www.sugarsync.com/referral?rf=e3izqm2hfvy70

And I will get 500 MB bonus if you sign up using the above link. Thank you in advance.

Jun 30

Web site hacked

My site was hacked on June 28th, 2011 around 8:00pm. How I found out? Here is the story.

When I tried to access my site after coming back from a vacation, I noticed there is a PHP error at the bottom of the page as this:

PHP Warning:  Cannot modify header information – headers already sent by (output started at /home/{username}/public_html/blog/wp-content/plugins/all-in-one-seo-pack/aioseop.class.php:221) in /home/{username}/public_html/blog/wp-content/themes/gray-and-square/footer.php(2) : eval()’d code(216) : eval()’d code on line 1

I thought the theme file is somehow corrupted, so I tried to log into my site to fix the theme and I was surprised that my site kept telling me my credentials were wrong. Finally I decided to reset my password, but was shocked when I got the password reset email showing my username is “user”. No wonder I could not log into my site.

After I reset my password, I changed the username back to my previous one directly from the database end because WordPress does not allow anyone to change their username.

The change of username, not by me, makes me believe that my site was hacked, so I did more investigation in the file system. There was no surprise to find out that a suspicious file was uploaded to my public_html folder called us.php. This file gave the hacker full control of my site, and here is a screen shot of the execution of the file:

BlogSiteHacked

The timestamp of the folders show that the “imgs” folder was modified, and indeed there is a file that will turn my site into a phishing site. Obviously, there is some security hole(s) that enabled the hacker to upload us.php to my site and then gained the full control of the site. The question is where the security hole(s) came from? I have been keeping up with the latest WordPress all the time, whenever a new version is released, I will update my site to use it. The only possibility, then, is the third-party plugins I have been using.

Here are the plugins I use in my WordPress blog:

  • Akismet
  • All in One SEO Pack
  • cforms
  • MCEComments

To me, the vulnerability most likely came from All in One SEO Pack, though I am not 100% sure. And it seems that someone else has already complained about the security vulnerabilities in this plugin. You can check here.

Now my site is back and running with All in One SEO Pack disabled. I will be more careful in the future when choosing a third-party plugin for my site.

Jun 21

FireFox 5.0 released

As promised in FireFox’s new rapid release development cycle, Mozilla released a new version of FireFox web browser today: FireFox 5.0, about three months after the release of FireFox 4.0 on March 22nd, 2011.

Go ahead upgrade your current FireFox or download and install FireFox if you are not using it (really? You are not using FireFox?), and enjoy the security and feature it brings to you.

Jun 17

Block unwanted web tracking via Ghostery

Do you know when you visit a web site, you behavior might be monitored and tracked? If I tell you that there are six sites will be monitoring you when you visit MSNBC web site (www.msnbc.com), will you believe it?

Thanks to a nice browser plugin called Ghostery, you can find all those hidden sites that are tracking you. I highly recommend everyone to download and install it, and the plugin is available for Internet Explorer, FireFox, Google Chrome, and Safari.

Note: lots of web sites are using Google Analytics to track web site visits, so if you use Ghostery and enable tracking block, you need to remember to uncheck Google Analytics from the the blocking list.

Here is a screen shot displaying all web sites that are tracking you on MSNBC web site.

GhosteryFireFox

Jun 15

Send a laughter via ETrade BabyMail

I bet lot of people are familiar with E*Trade’s famous talking baby commercials, but do you know that last week E*Trade launched a fun, free web site allowing user to create and send personalized and animated talking E*Trade Baby message to anyone? You can use the built-in E*Trade Baby images or upload your own images, then type or record a brief message, or choose from one of the built-in messages, then you are ready to send it to anyone you would like via using email, blog, Facebook, or mobile. It can be used for any occasions, I guess, but as Father’s Day is around the corner, it would be a wonderful idea to send your dad a laughter via E*Trade BabyMail.

Here is the web site: http://www.etradebabymail.com

Here is my E*Trade BabyMail: http://www.etradebabymail.com/?mId=40132417.3

Have fun!

May 11

Windows XP mode could not be restored because of either host processor mismatch or lack of hardware assisted virtualization support in the system

If you use Windows XP Mode and make any change in your BIOS, then you may notice that next time when you try to launch Windows XP Mode, you will get an error message as this:

Windows XP mode could not be restored because of either host processor mismatch or lack of hardware assisted virtualization support in the system.

The reason is that by default when you close Windows XP Mode, Windows Virtual PC will put Windows XP Mode in hibernation. If you make change in your BIOS, then Windows Virtual PC will think the hibernation file is corrupted and throw the above error. The fix is easy: find the hibernation file, delete it (or rename it), then restart Windows XP Mode.

The hibernation file in Windows 7 is located at C:\Users\{UserID}\AppData\Local\Microsoft\Windows Virtual PC\Virtual Machines, the name of the file is “Windows XP Mode.vsv”. You can either change the extension or delete the file, then restart Windows XP Mode, it will create a new .vsv file.

To prevent this error from happening again in the future, you can change the virtual pc option from Hibernation to Shutdown.

1. Open Virtual PC.
2. Click on Tools and then click on Settings.
3. Under the Close tab, change the option from Hibernate to shutdown.
4. Restart your computer and start your Virtual PC for the changes to take effect.