Aug 20, 2013

Trace SQL login error

Solution from: http://www.eraofdata.com/sql-18456-login-failures/

In SQL 2008 R2, I encountered this type of message:
Login failed for user 'sa'. Reason: Failed to open the explicitly specified database.

That’s all, no more information. If I look into Windows Event log, I only can see:Login failed for user 'sa'. Reason: Failed to open the explicitly specified database. [CLIENT: <local machine>]

That’s not clear enough. So just a trace from SQL Profiler including these 3 types of message can help to give more details:

  • Audit Login Failed (under Security Audit)
  • User Error Messages (under Errors & Warnings)
  • Errorlog (under Errors & Warnings)

Thanks SQL Profiler !

Jun 18, 2013

Using Apple Wireless Keyboard on Windows (PC)

 
If you want to use your Apple Wireless Keyboard on a PC and could not use Fn + Arrow as PgUp, PgDn, Home, End then there is a solution: update your Apple Wireless Keyboard Driver.
Just tested today: Working on PC with Windows 7 Pro 64 bit (note: it is NOT a Mac).
Apple Wireless keyboard in Windows (PC)
http://i.imgur.com/xAWRAsQ.png
bigger screenshot
Steps:
  1. Download latest Bootcamp drivers (as of now it is v5.0.5033 from http://support.apple.com/kb/DL1638)
  2. Extract the file, then open folder \BootCamp5.0.5033\BootCamp\Drivers\Apple
  3. Run BootCamp.msi (do NOT run setup.exe as it will say it is unsupported on this computer model)
  4. Wait for the driver installation finish, then restart your PC.
  5. On next bootup, run Bootcamp (surprisingly you can !!!), go to Keyboard and choose whether you want F1,F2,etc as standard keyboard function. For more info, check the Apple Wireless Keyboard keyboard mapping in Windows kb http://support.apple.com/kb/ht1171
That's it. No need extra software, just latest drivers from Apple.




Feb 7, 2013

“Invalid image size” error for MacType

 

MacType is a great alternative to Gdipp. Both do great jobs in rendering Windows font to be like MacOS X.

 

But if you had this error “Invalid image size” upon starting your MacType tray, it is due to your Taskbar and Active Title Bar size is smaller than certain size. Mine is smaller than 18.

In Windows 7, go to Control Panel –> Window Color and Appearance, click Advanced appearance settings. Select Active Title Bar and adjust it till you see no more error.

image

image

MacType should be now working fine.

Jan 30, 2013

How to: solved Synergy problem with shared keyboard between Mac and Windows

 

In case you own an Macbook (running Mac or Windows in Bootcamp mode) and another PC, you may want to share the keyboard and mouse using a nice tool Synergy (download here).

For introduction on Synergy I’ll let you explore its website.

Problem: Before you get too excited, you’ll probably run into this problem: if you setup your Mac as client and PC as server, probably you’ll cannot type on Mac.

Root cause: Different keyboard mapping causes Synergy to behave like that. If you check the synergy.log, error code is due to mismatch keyboard layout. The keyboard code on your Mac after install Bootcamp driver will be something like English (Apple) which is incompatible with your Windows, most of the time is English (United States).

Well Synergy should be improved to accept such different keyboard layout), but that’s for later.

Solution: Just delete the default keyboard on Mac (running Windows) and add the English (United States) – US or whatever keyboard code you’re using on your Server. You’ll be able to use your PC keyboard immediately.

image

Dec 23, 2012

Claim more SSD drive space on Windows

Ok when we talk about SSD, we all knew the sweet juicy lovely speed of it, but we hate the pricey pricetag, its tiny size and the performance degradation.
But worry not, price is lowering everyday. I just got my 240GB Kingston SSD 3K for less than $1/GB. Kingston claims it can last for more than 8 years with daily IO of 10GB. That’s about 29.2TB IO !!! I bet personally I’ll never exceed that limit.
But 240GB is a bit tiny for my OS, Virtual Machines + all the dev tool (FYI I have VS2008,VS2010,V2012, MSSQL 2008-2012 with 50GB db in total.
So, I only worry about its “tiny” size. What I do ? I go cleanup hard disk. How?
1. Manually I go disable the page file, disable hibernatation (powercfg –h off) and move my System Restore folder to the other 3TB drive. I don’t need any of these on my SSD. Love it, +14GB at least.
2. http://www.iishacks.com/2011/06/23/reduce-windows-7-winsxs-folder-size/ : in short, run this command:
dism /online /cleanup-image /spsuperseded
Reduce huge WinSXS folder. Love it too, +4GB.
3. Run CCleaner – useful and easy. Just a click, +3GB and all thrash cleanup.
Results: on my workstation with 240GB SSD
Before: Free space = 121GB
After: Free space= 142GB (+21GB ! Yay)