There are a lot of people who interested in trying out Linux on Earth. What holding them back is mainly because they can’t live without Windows. There are several ways to get your hands on Linux:
The second method contains the risk of wipe out your Windows but now there is a improved and safer of this method. Wubi is a installer that allows you to be hassle free installing Linux Ubuntu.
Wubi will creates a file that isolated itself as a virtual partition of Linux in Windows and you can only see it as a large file. It also adds an extra option to let we boot Linux. If you feel like Linux is not your cup of tea (Ya, I like tea :p ), then you can just go to uninstall it anytime. This is really a painless process and who interested on Linux is highly recommended to try.
In: Computing 数码编程
23 Oct 2008Still remember I was toying with AWS? A while back, I tried database replication on AWS with the most common implementation, one database server maintains the master copy of the database and additional database servers maintain slave copies of the database. This divides the database reads from one or more slaves and database writes to master, which can results in a large performance advantage due to load sharing. The instructions of set up MySQL database replicaiton are below.

The Master
First we have to enable networking for MySQL, and MySQL should listen on all IP addresses, therefore we comment out these lines (if existant).
/etc/mysql/my.cnf
#skip-networking #bind-address = 127.0.0.1
Beside these, we also have to tell MySQL for which database it should write logs, which log file it should use. These logs are required by the slave to monitor the changes on the master.
/etc/mysql/my.cnf
log-bin = /var/log/mysql/mysql-bin.log
binlog-do-db=sampledb
server-id=1Restart MySQL after the editing:
/etc/init.d/mysql restart
Now we log into the MySQL as root and create a user with replication privileges:
GRANT REPLICATION SLAVE ON *.* TO 'slave_user'@'%' IDENTIFIED BY 'password'; FLUSH PRIVILEGES;
Again, in MySQL shell, we run the following query to obtain master status:
USE sampledb; FLUSH TABLES WITH READ LOCK; SHOW MASTER STATUS;
Write down the information as we need it for slave. Similar result will show something like below:
+---------------+----------+--------------+------------------+ | File | Position | Binlog_do_db | Binlog_ignore_db | +---------------+----------+--------------+------------------+ | mysql-bin.009 | 123 | sampledb | | +---------------+----------+--------------+------------------+ 1 row in set (0.00 sec)
The Slave
On the slave we first login MySQL. We have to create the database and loaded the data from master:
CREATE DATABASE sampledb; LOAD DATA FROM MASTER;
Then we have to tell MySQL on the slave that it is the slave, that the master is 192.168.0.100, and that the which master database to watch of.
/etc/mysql/my.cnf
server-id=2 master-host=192.168.0.100 master-user=slave_user master-password=password master-connect-retry=60 replicate-do-db=sampledb
Then restart MySQL:
/etc/init.d/mysql restart
Login to MySQL again and perform following commands:
SLAVE STOP; CHANGE MASTER TO MASTER_HOST='192.168.0.100', MASTER_USER='slave_user', MASTER_PASSWORD='password', MASTER_LOG_FILE='mysql-bin.009', MASTER_LOG_POS=123; START SLAVE;
In: Computing 数码编程
7 Oct 2008I been using VirtualBox to deploy virtual machines on my Windows machine since a significant memory upgrade. VirtualBox is suprisingly easy to used if compared to VMWare and it just fit to my basic needs.

Access the web server from the guest on host is pretty straightforward but not the other way.
In my scenario, my host OS is XP and the guest OS is Ubuntu. First, we go to the XP host and open a command prompt, and configure the port forwarding in the VirtualBox installation directory, as follows:
cd C:\Program Files\Sun\xVM VirtualBox VBoxManage setextradata MyUbuntu "VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/HostPort" 8888 VBoxManage setextradata MyUbuntu "VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/GuestPort" 80 VBoxManage setextradata MyUbuntu "VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/Protocol" TCP
This simply arbitrarily assign port 8888 of our host XP to forward connections to the guest Ubuntu’s port 80, which is the default port for HTTP connections.
Having done that, we now turn on our guest Ubuntu and use our web browser on host XP to browse http://localhost:8888/. Alright, now we got a local web server to play with.
We can also allowing SSH connections from the host OS to the guest OS as follows:
cd C:\Program Files\Sun\xVM VirtualBox VBoxManage setextradata MyUbuntu "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort" 2222 VBoxManage setextradata MyUbuntu "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort" 22 VBoxManage setextradata MyUbuntu "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol" TCP
In: Computing 数码编程
24 Sep 2008Whenever people are talking about Amazon. Most of the people will say “Ya, the online bookstore right?”. But now beside the online store, Amazon also offering a series of web services, Amazon Web Services or AWS in short.

The infrastructure services that are offered:
Recently, my job required me to look into EC2 and S3. We need to design a scalable architecture of new web application. It is worth to take a deep look into them.
EC2 is about scalable application deployment. This service allows you to create virtual machine or instance and run your web applications. In layman’s term, it allows your to rent and run your web applications. What interesting is the service provides manageable compute capacity of applications through its simple web service interface. It is “elastic” because you can scale your applications based on your demand. It charged as low as $0.10 by hourly basis on each instance. Of course there is different charges on the data transfer usage as well. Presume that you do not own a servers farm, multiple machines or any similar infrastructure, EC2 is relatively flexible and cost-effectiveness to scale your application during high or low traffic usage. Sound good huh? But there is a main drawback of EC2. It is an image which means no permanent data will be stored. If something goes wrong on the hardware, power failure, or anything that you could possible imagine, then your data is gone. There is where S3 comes in to solve the problem.
S3 is a online storage service. It claimed to gives the developer the same scalable data storage infrastructure that Amazon uses to run its business. Amazon charges $0.15 per GB a month.
I will start to setup up and run some applications on EC2. I will post more about the findings on AWS.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quisque sed felis. Aliquam sit amet felis. Mauris semper, velit semper laoreet dictum, quam diam dictum urna, nec placerat elit nisl in quam. Etiam augue pede, molestie eget, rhoncus at, convallis ut, eros. Aliquam pharetra.