Category Archives: Computer Science

Computer Science (CS) and Information Technology (IT) related items will be posted under this category. Topics include, but not limited to, system administration, hardware/software troubleshooting, coding/programming (PHP, HTML, Java, Python, etc) and more.

Thank you for the suggestions to improve the blog

Most web developers don’t take suggestions from the public seriously. But I do care about your input to my website and the blog.

Recently few of my visitors suggested great ways to improve social media integration to promote this blog through comments, “Likes”, emails forwards, etc. As you may have noticed already, I went ahead and added the Facebook module and Share/Bookmark module to my WP blog. The Facebook Like/Send module will only appear when you click on the article link itself.

Anyway, please keep these great suggestions for improvement coming. I do read all of them and I will implement most of the interesting modules.

Special thanks goes to visitor named “Treadmill reviews” for Facebook suggestion.

Side note: This is my first blog post using Blackberry Bold 9900 WordPress Application.

Adding an IP log code to PHP files

A lot of people want to keep track of who visit their site. There are several ways to collect user data and the most easiest method would be to collect data using a third party company that logs IPs, page visited and other information such as web browser, data, time, etc. Then then data can be modify to create data on demographics and Internet service providers by extrapolating the IP addresses. However, what is fun of having a third party do your code for you? The fun part comes win when we can make our own code such as the one posted below:

<!--ip log-->
<?php
$v_ip = $_SERVER['REMOTE_ADDR'];
$v_date = date("l d F H:i:s");
$v_page = $_SERVER['REQUEST_URI'];
$u_ref = $_SERVER['HTTP_REFERER'];
$fp = fopen("sanuja.com-ip_log.php", "a");
if ($v_ip != "192.168.1.1") {
fputs($fp, "<strong>IP: $v_ip - </strong><strong>PAGE:</strong> $v_page - <strong>DATE:</strong> $v_date - <strong>REFERER:</strong> $u_refn
");
}
fclose($fp);
?>

Continue reading Adding an IP log code to PHP files

Update on my servers

Fist of all OMG! My marks for exams roll out and I did some what poor… However, it is possible to pull up a good grade if I study well for the final.

Anyway, I am still working on rather upgrading and updating my servers. I am looking in to buying another server specifically for file storage. My current system has limited space for data storage with RAID 5 low capacity high RPM drives. However, there are servers sale online for very cheap with over 8TB storage with RAID 5 configuration.

I will save some money down the road and will buy a new server for media files with may be FreeNAS operating system. I know it is a waste of money, but then again this is my hobby and somewhat it makes sense to spend my own money on that. I wonder if I will work on development of severs when I am 70 or 80 years old. LOL I don’t want to live that long anyway.

Not many people read my blog anyway, but in case any one who came across my blog, I am sorry that I didn’t updated the system in a long time.

I hope a lot of students across Canada and rest of the world who wrote exam did well. All the best for all of you.

RAID cannot be trusted for safe data storage

Many people think that RAID configuration can protect their data for sure. This is not the case because even RAID 1 have its own problems. The most common problem that many server operators face is that after a drive fail, the rebuilding process take the other functional hard drives to the maximum limits sometimes causing one of them to fail. This is often true in RAID 5 and when you end up with two failed drives, all the data will be lost on the array.

Another common cause of RAID failure would be the RAID controller failure. If the RAID controller failed and you are unable to find the exact same controller with exact same specifications and/or the RAID controller you have now do not have a the capability to recover data in case of a controller failure without losing the data, (MOST controllers rebuilt the RAID array when a new controller is added) you will lose all the data on your system.

The lesson here is that we should always backup important data on more than one computer. If you have important data such as company information or any mission critical data, then you should also back up in more than one physical location. For example, if you have data that must be protected at all cost, it should be back up outside of the house that the main server is located. This will safe guard the data in case of a fire or massive failure in electrical system causing a power surge that didn’t suppressed by the UPS.

Server RAID rebuilt…

This is actually the continuation my previous update on the server. As I noted in that previous post setting up a RAID 5 with six 146 GB drives and two 72 GB drives was very stupid. But I never explained why this is a stupid idea on my first post. Today we will look at the best way to mix and match different types of harddrives on a RAID system for optimum performance and the highest storage output.

The the RAID 5 system works by taking all the hard drives with even different sizes and strip the data on all of them to provide one drive fail backup support for the system. In other words, on a RAID 5 system, you an tolerate one drive failure without loosing data. In this method, the RAID controller will take the lowest capacity of all the drives on the array and multiply that lowest capacity by the number for drives regardless of the capacities of the larger drives. For example, if we have two 72 GB drives and six 146 GB drives, the RAID controller will see all the eight drives as 72 GB drives. By doing the math for the RAID 5 system: (72 GB * 8)-72GB = 567 GB in total. Considering 146 GB *6 itself is 876 GB, this creates a a lot of wasted space. In addition to this reduced space, the 72 GB HDs are running at 15K RPM while the 146 GB HDs are running at 10 K causing the RAID to operate at the lowest RPM value of 10 K even with the six 15 K drives have the capability to Continue reading Server RAID rebuilt…