Thursday, November 19, 2009

Of Mathematics And UI Styling

I was never a fan of Co-ordinate Geometry till now, but then I hadn't really encountered proper UI styling with delicate skins also till recently.
Of course when one uses proper utils for creating skins as Photoshop or Gimp etc, one still doesn't need to encounter a lot of Maths, but then I had different ideas. I wanted to design without the editors and that has led me to find out a lot about equations and other mathematical formulae associated.
Actionscript UI design Rocks... :)
It's great to finally use some proper Maths!!!!

Cheers.

Sunday, November 1, 2009

Database Replication in a nutshell

Database Replication allows is the making of an exact copy of one database into another in the same or a different server. This can be seen as a master-slave relationship wherein the slave copies the changes done into the master.

THE PROCESS:
All the statements that are to be run in a database are stored in a log file by the DB. The log file has a pointer that points to the last run command. At a certain lag from the main pointer a pointer to the replicated DB exits. Thus each command in the log passes through both the pointers thus updating both the databases.

HOW TO:Replication can be set up by granting the permission and setting the slave. This can be done as below:

Ensure that the master db uses a binary update log and has a server id as 1. To do this db config file (my.cnf) should have the following lines
log-bin
server-id=1

To the master database grant access to replication
GRANT REPLICATION SLAVE ON *.* TO user IDENTIFIED BY password

In the slave db config file set the master path, user and password to access and you are done.
Ofcourse there would be lot more configurations to be done based on specific cases.

Securing the Amazon Server

Security attacks on Amazon Server (S3) are common occurence. While studying the nature of the attacks that were sent we found that one of the major gateways was the phpMyAdmin (an open source database access tool).
It seems that the tool is vulnerable to attack and can prove an easy entry into the system. Removing it was the first step to securing. The next step was to restrict entry into the system for which we added the .htaccess file in the system with the allowed ips configured. But as with web based applications this was not a neat solution first it can cause a hindrance if not properly configured. Also since access cannot be completely restricted, getting in using proxy servers cannot be ruled out.
The next step hence was a proper firewall into the system. A nice tool that helps one build a firewall security into the system is the FWBuilder. One can configure the allowed traffic in and out of the system in a couple of easy steps easy to understand options. Once done the rule set is saved in the local system and can be applied to the server. Smart, easy and secure.