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.

PHP based password protected access point

I found a PHP based script that will protect data from the general public. This is done using a simple PHP script that will terminate the page data from processing in HTTP request if a correct credential is not entered. The key part of this script is that it can be saved in any folder on the server regardless of the folder access is public or private. The script can be used to protect any web page using the PHP’s native data loading mechanism. I have no idea how secure the PHP script now protecting the secure science area. That’s where detailed user records comes in handy because in an event of a hack or a flooding, I can monitor the situation and close down all lose ends of the system. Continue reading PHP based password protected access point

How to delete a Remote Desktop Connection entry

There is no option in the Microsoft Remote Desktop Connection (RDP) application to delete/remove successful previous RDP connection IP or hostnames from its “Computer” box. I believe this is an omission by the Microsoft development teams that has yet to be “fixed”. In fact, I had no clue how to do this up until recently I had to log in to my server from a public school computer to modify some files. Even after you log out and select delete profile from the RDC, it will still show up in the Connections drop down next time someone open it. This is a problem because if a user with wrong intent to attack your computer or server open the RDC, it will provide them with half of the solution to hack your system, the IP or domain name!

If you try Google search to find an answer to this issue, you will quickly come across Microsoft KB article here, which is more complicated than useful to most users. I have no idea why a great user friendly software company like Microsoft doesn’t explain well on their help sites on registry editing for intermediate to advance users. May be because they don’t want novice users to pick up that information from their site and damage the OS in the process of regedit. Would you rather have a video tutorial? Please watch the YouTube video here.

The following method is the easiest way to delete an entry from Remote Continue reading How to delete a Remote Desktop Connection entry

RAID explained…

I did write about my sever structure with a bit of explanation on Redundant Array of Independent Disks (RAID) before. But today I came across an email I sent out to one of my friends explaining how RAID works and what each type of RAID benefit each situation. Today I will post the email as it is and after the final exams, I will rewrite this article to include more specific details.

RAID(redundant array of independent disks) protection technology is developed to safe guard data in an event of a hardware failure. I found that it is easy to use online info than to type all the explanations. You can read about RAID and watch the following movies to learn the technical information:
RAID 0(not really RAID) : http://www.youtube.com/watch?v=Uwie0rJSYiE
RAID 1: http://www.youtube.com/watch?v=-PlS4seeexA&feature=related
RAID 5: http://www.youtube.com/watch?v=LTq4pGZtzho
http://www.codinghorror.com/blog/2009/05/beyond-raid.html

There are few types of RAID and each one has its unique qualities and Continue reading RAID explained…

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