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.




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