Feb 28, 2014

Every QA engineer’s dream

So, I dreamt in office – seriously, about code & QA tasks.

In my dream, all of the QA tedious & repetitive tasks are automated, in one or another way like this:

2014-02-28_132753

And when I wake up, actually it’s true Smile I loved Selenium and any other automated test tool.

but, there’s a failing test case, oh oh.

Jan 27, 2014

A closer look into slow Visual Studio start-up

Did your Visual Studio take forever to start ? Take a deep look into the root cause:

  • Root cause #1: a slow hard-drive.

Observation: A normal 7200rpm HDD is considered slow to work with a project with thousands of files. Upon load the solution, Visual Studio do lots of I/O check and file content lookup (.suo, .xml, .csproj). Some plugin and add-on such as Resharper even do cache reload (see video), thus increasing the disk I/O.

Solution: switch to SSD. A recent SSD SATA3 cost around $200 for 240GB – enough for OS & your source code.

  • Root cause #2: too many plug-in, add-on and extensions.


    Observation: You’ll notice how blazing fast it is if you start your Visual Studio in Safe Mode ( Start –> Run:  devenv.exe /safemode or right click Visual Studio icon and choose Safe Mode.)

    image

Solution: disable the add-on & extensions you don’t need (or the ones that took longest time to start).
Step-by-step:

1. Start –> Run, enter :

Devenv /log C:\vslog.xml
It will start Visual Studio in Diagnostics mode, and output the log to C:\vslog.xml

2. Copy this file (link or Git) to C:\ , then open C:\vslog.xml using Internet Explorer
You’ll have this pre-formatted nice view: take a look at the hotspot






Notes: the XSL is not mine, credit to this guy 




  • Root cause 3: Antivirus running in the background



Observation: Antivirus programs are known for their intensive disk usage and they can clog to the hard drive, especially when your programs generate a lot of files (I bet the AV detects it and start scanning the generated files)


Solution: Temporarily disable your antivirus program (if not needed). For me, disabling AVG improve the load time by at least 1.5s-2s.

Dec 16, 2013

VPS (Virtual Private Server) hosting guide for newbie (like me)


Choosing your VPS provider
I just managed to get my own website up and running (I’ll host my wedding photos and invitation here woohoo ^^ !). I got a deal at $4/month for VPS hosting with www.reversehosts.com , and signup my own domain at www.name.com
Their offer (@$39.95/annually valid as of 16th Dec 2013)
SDVPS 2048 – (4 shared vCPU cores )
Disk Space: 100 GB
Bandwidth: 2 TB
RAM: 2048 MB
Burst: 3072 MB
IPv4 Addresses: 1
IPv6 Addresses: 16
Port: 100Mbps
Control Panel: SolusVM
Technical Support: Yes
Management: Unmanaged
My advise: DO READ REVIEWS about your VPS before signing up. Some offer too-good-to-be-true deal, which ends up really bad service or interruptible hosting. I read some about this company and so far so good.
Get your first website:
Step 1: Setup domain and websiteUsually your VPS will offer domain registration service as well as VPS hosting. So if you registered with your VPS provider, good, just SSH to your server.

Otherwise you can register your domain elsewhere, for me, I chose www.name.com , they got pretty good prestige and feedback. I knew GoDaddy.com is another choice, it’s up to you. Usually they are comparable and equivalent.
Step 2: point your domain to the IP of your VPS
Each domain registrar offer different way to do it, but most likely there will be a page for your to configure like this:
image
The most important is your A record (to map the domain to the IP of your VPS).
Step 3: SSH to your VPS to test
On Windows, you can use Putty , on Mac / Linux, just use SSH. Using either Putty or SSH you can connect to your VPS IP or your domain name (after step 2, your domain is already mapped to your IP).
At your SSH console, try these command first:
a. To test your VPS performance:
#root@myvps:~# dd if=/dev/zero of=test bs=64k count=16k conv=fdatasync && rm -f test

Output:

16384+0 records in
16384+0 records out
1073741824 bytes (1.1 GB) copied, 9.53016 s, 113 MB/s


b. To get more info about your VPS CPU & to test your VPS network bandwidth speed:

#root@myvps:~# wget freevps.us/downloads/bench.sh -O - -o /dev/nul|bash

Output:

CPU model :  Intel(R) Xeon(R) CPU E3-1270 V2 @ 3.50GHz
Number of cores : 4
CPU frequency :  3500.024 MHz
Total amount of ram : 2048 MB
Total amount of swap : 1024 MB
System uptime :   2:02,
Download speed from CacheFly: 10.8MB/s
Download speed from Coloat, Atlanta GA: 9.77MB/s
Download speed from Softlayer, Dallas, TX: 10.6MB/s
Download speed from Linode, Tokyo, JP: 8.73MB/s
Download speed from i3d.net, NL:
Download speed from Leaseweb, Haarlem, NL: 5.27MB/s
Download speed from Softlayer, Singapore: 6.90MB/s
Download speed from Softlayer, Seattle, WA: 5.63MB/s
Download speed from Softlayer, San Jose, CA: 11.0MB/s
Download speed from Softlayer, Washington, DC: 9.38MB/s
I/O speed :  105 MB/s


Step 4: Setup your web server and FTP:

Most of the VPS provider already setup your OS with Apache (well, or lighthttpd). So figure out which web server your have. If not, install Apache in Linux

For me, I have Apache 2, so at SSH console, I’ll test my web folder

root@myvps:/# cd /var/www
root@myvps:/var/www# ls


index.html

Nothing much, my web contains just a file. The next step is to FTP something to our webserver. I’m using FileZilla, and SFTP is so easy.
image

That’s it. Now you can start FTP whatever static content your want to your web.
Next blog will be about how to setup the rest on your VPS (DB server, lighthttpd, XWindows (Gnome/KDE), VNC for remote desktop). Keep reading !

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.