• Home
  • Who Am I?
  •  

    IEEE CS offers Free Brainbench Tests

    June 16th, 2009

    IEEE CS in agreement with Brainbench , is offering free tests for members. This is an amazing offering, even if you are not interested in transcripts, you guys can still go in there to prepare for professional exams like MCSE , Cisco certifications etc. You can consider these are free practice tests. The e-Learning campus not only offers these free tests but you also get access to 600 online books relevant to Computer Science and alot of free courses.

    This is a great chance to improve your CV.



    Free Microsoft Software for Computer Science Students

    June 16th, 2009

    This is something which I must share with everyone. Microsoft in agreement with IEEE , offers quite a few free softwares to IEEE student members. The offering includes (but is not limited to ) :

    • Windows Vista Business and Enterprise Editions
    • Windows 7 Ultimate RC and Beta
    • Windows XP ( SP 3)
    • SQL Server Enterprise and Developer Editions ( 2000 , 2005 , 2008)
    • Windows Server 2003 and 2008
    • Visual Studio 2003, 2005 and 2008
    • Access 2003 and 2007
    • Virtual PC
    • Office Grove
    • Project Professional
    • Visio Professional 2007
    • Expression Studio
    • ISA Server 2006 Enterprise Edition
    • Biz talk
    • Infopath
    • OneNote
    • SharePoint

    ……. and that is all for free and this is not even the complete list but that i believe are the most important ones.

    Once you signup as student member of IEEE Computer society or IEEE ( each costs $12.50 for students ) , after appox. 7 days you get the Login information for the e-academy member area , from there you can purchase all those softwares for $0 and then download them.

    Another limited list of Free Microsoft software for student is available at www.dreamspark.com

    All you CS students, what are waiting for!



    SVN and MySQL Schema Synchronization

    September 29th, 2008

    When I started to work in a virtual team comprising of 6 developers , I felt that the most time consuming task was syncing the database changes amongst team members. As we were using SVN , we didn’t have to worry about the files but the DB schema was always an issue. So I started to look into something solid which we could couple of with SVN client in order to make this process as smooth as possible. Blame it on my search capabilities or eye sight but honestly i didn’t come across something I liked. So i devised a mechanism which might be far from ideal but which is working well for us. Keep in mind that we all are working in Windows environment (as the client is using Windows server) , so some steps might be slightly different for people in the Linux camp.

    Here is what I did :

    Step 1:
    I located a ready made script which would let me sync 2 databases. I found a well written class by “Diogo Resende” here

    Step 2:
    I modified the class , so that instead of actually syncing the databases , it would just return the queries which it is going to run in order to sync the databases.

    Step 3:
    Now I created an exact copy of my current database , lets call this database “test”. The called the copy i created “svn_test”.  Keep in mind that my working database is still “test”. After this point I never touched “svn_test”.

    Step 4:
    I created a small database on my online server with a table called “changes” with  change_id , change_set , submit_time fields. “change_id” was set to be primary and auto increment. I created a one page management script for this and placed the script on the remote server to be easily accessible by all. Lets say the location of this script is http://something.com/changes_list.php. This script lists all the records in descending order. I can edit , delete and add records from this script as well.

    Step 5:
    I created a PHP script called “pre_hook.php”, which would compare “test” and “svn_test” and return to me all the queries. These queries were stored in the remote database table called “changes” , it would store the last returned “change_id” in a file called “change-id.txt”. It would also generate a file called “changed.txt”, if there was no changes ,  nothing would be submited to the remote DB  and  the  file “changed.txt” will be deleted if it were present. This script also created a file called “run.bat” , if there were any new queries , the script would insert explorer “http://something.com/changes_list.php in the “run.bat” file , otherwise it would just insert “exit” in it.

    Step 6 :
    I created another script called “post_hook.php” , it would check if “changed.txt” was present , if so it would replace the database “svn_test” with “test”.

    Step 7:
    I created yet another script called “post_update.php” , which would connect to the remote database and tried to find query the records which were entered after its last run. The script stores the highest “change_id” it got in a text file. So next time it would only try to query for records which are higher than the stored “change_id”. If the script got any new records from the remote database. It would parse the queries in each record and run them on database “test”.

    Step 8:
    As we all use Tortoise SVN , I created 4 hooks. A hook on “start commit” , this hook would run the “pre_hook.php” script. Hook 2 was created on “pre commit” which would run the “run.bat” file created by pre_hook.php. Hook 3 was created on “post commit”, this would run the “post_hook.php” script. Hook 4 was created to on “post update” , this would run the “post_update.php” script.

    How it works (or is supposed to work):
    After all the above steps. I goto the database “test” and make a change to xyz table. Now remember that “svn_test” DOESNT have this change. So now i continue to work on php scripts and I decide to commit to SVN. So what will happen is when the commit starts the “pre_hook.php” will gather all the schema changes (if any) , send them to the remote MySQL database , place the link to the remote script I deployed at http://something.com/changes_list.php inside the “run.bat” file. BEFORE actually sending the files to the SVN , the” run.bat” would be executed and it would show me the list of changes that were just submitted , so that i can view them manually as well and adjust if needed , which is rare . After the commit is complete , the “test” database is copied over “svn_test” by “post_hook.php”. Next time someone updates the repository , the “post_update.php” script will kick in after the update is complete and return all the new changes submitted to the remote database. Now that persons database has the changes I made to mine as well. The remote DB management script also lets us input other queries as we may please.  So that on next update everyone can get the changes those queries reflect.

    This system is not perfect, but it saves us plenty of time.  I am still thinking/searching for a better solution , which takes care of the changes in the data as well but for now this is what I have.

    Hoping that this would help someone else as well.



    PHP Code Cleaner : Download

    July 25th, 2008

    Alot of people have been asking me regarding the installable version so I just zipped up the files I had on my hard drive for PHP Code Cleaner. The files include a script which helps you clean up multiple files at the same time. Just go through the “readme.txt”.

    Please understand that the code is a very raw attempt on solving the problem of cleaning and indentation , so it does have its problems. Please report the bugs you can find and i will try to fix them as soon as i find some time.

    Download



    Mars : Life or No Life , But Interesting For Sure!

    March 13th, 2008

    Mars , The Red PlanetThe universe is so full of surprises , plenty of buzz around regarding the new photo released by NASA which shows a female like figure on the Red Planet. Brilliant!

    But on careful examination, its anyones guess really, it could just be like the faces of Mars we saw a few years ago. But i found really interesting were the ripple effects we see in the picture. Amazing , they just seem like there was a river flowing there. The curve in the surface indicates it as well. I have marked the interesting regions in red boxes , you should click on the thumbnail to see the interesting areas , i have reduced the size of the picture and then download the full picture to feel the full effect.

    Honestly , if I wasn’t told this was a picture from Mars, me the ignorant would have thought, this is a picture of the rocky mountains or something. :)

    You can download the full 44MB picture from NASA by clicking on this link.



    PHP Code Cleaner and Indenter

    December 19th, 2007

    Online Code Cleaner Demo

    With six years of experience with PHP , I have been ‘blessed’ with working with code written by really lazy people , who just didn’t think it was important at all to indent their code or comment it or make the opening and ending curly braces align.

    And sometimes our favorite FTP clients would add God knows why those silly annoying empty lines and the code would keep getting bigger and bigger.

    And I am sure that I am not alone in my frustrations.

    That is why is am writing this script which will try to take care of all that.

    Basically it will try to achieve the following goals:

    • Indent your code with tabs.
    • Put a comment block at the start of class definitions or functions.
    • Provide you with the facility to align curly brackets.
    • Remove unwanted lines from the code.
    • Put some spacing in blocks for improved readability.
    • Replaces short open tags with proper <?php tags
    • If a PHP block contains only one line , it will put the whole block in one line to improve readability.

    Please provide your valuable feedback to improve this script. I will be soon releasing a full script which will clean the code in all PHP files in a directory. Stay tuned!

    Online Code Cleaner Demo



    Web based FTP Sync Tool written in PHP

    December 4th, 2007

    FTP Sync Jobs ScreenFTP Sync 0.9

    PURPOSE:
    To upload files which have changed to your production server , automating the task of comparing which files have changed. You simply create a FTP job
    in the script , run the job and it will upload the changed files for you.

    REQUIREMENTS:
    FTP functions are required for this script to work.
    PHP 4 Or 5
    MySQL 4+

    INSTALL:
    Open dbinc.php and put in the database connection variables in there. Once done run installer.php from your browser and you are all set to go.
    Its advised to remove installer.php once you have finished installation.

    SECURITY:
    It if advised that the admin creates users and allocates jobs to them. Also the admin should block access to the database and script files
    from general staff.

    INFO:
    We made this script for our internal use , thought it might be useful for some of you out there. It was a tiring job to find which files needed to be uploaded
    to the main server after development on local server. Thus i created this script , where you can create jobs and upload folders and files which were changed.

    The decision to upload happens on 3 rules:

    1 : you can provide time and date in the job page , files which were created after that time will be uploaded.

    2 : you can ask the script to match the time against the server file , the script would calculate the time offset and calculate if the file has
    changed since last upload.

    3 : The script also keeps a log , if the file changed after last upload , it will upload the file.

    You can exclude the files you dont want to upload, for instance you wont want to upload and overwrite config.php or something like that. So you
    can create the skip list. The skip list is the path of the file from the source directory you have provided.

    For instance if you have a source directory called “/www/something/upload/” , and you dont want to upload the file “/www/something/upload/config.php”
    or the folder “/www/something/upload/users/images” then you would put in something like this:

    config.php
    users/images

    Remember no trailing slash for folders.

    You need to have writable permissions for the logs folder , also if you want to utlize the copy permissions feature you will need the BcMath library
    compiled with PHP.

    The admin can run any job , but if you want to have users which can run specific jobs only please utilize the users section , in which a user can
    run all jobs or only specific jobs.

    Same goes for the jobs , you can set an attribute to allow all users to run the job.

    This code has been tested on PHP 5 and PHP 4.4.

    You are free to modify the code as you please. The code is released in the public domain under the GPL license.

    Enjoy!



    WP Admin Switcher Plugin Updated

    December 4th, 2007

    WP Admin Switcher has been updated , please download the latest zip from the link on the right. This version has been tested on WP 2.3.1 If you are getting a file not found error , than it means you dont have the .htaccess rules set for mod_rewrite. WP Admin Switcher wont work without this.

    Thanks to all the users sending in feedback to make this plugin better.

    Soon i will be updating the plugin to handle blogs with no mod_rewrite (permalinks) .

    Keep checking!



    PHP :: Serialize and Unserialize Alternative

    November 17th, 2007

    For quite sometime now I have been really annoyed by the unreliability of serialize and unserialize , when you would have a large string or some some special characters in there that wouldnt turn back into variables. So finally after not finding a decent alternative by someone else ( maybe I am only one suffering from the problem????? ) , I decided to write my own two functions.

    These two are working great for me , hope they serve some purpose to someone else. I am sure there is room for improvement here, please send in any suggestions or ideas to incorporate.

    1.  
    2.         /// Usage
    3.         ////– first parameter is the var name , second is the var itself
    4.         $string = makeXML(’somevarname’ , $somevarname);
    5.  
    6.         ////— extractVars takes the above string as parameter ,
    7.         ////— and returns an arrray with variable name as key and variable itself
    8.         ///—  as value , i have used extract() to take all vars into code.
    9.         extract(extractVars($string));
    10.  
    11.  
    12.         function extractVars($xml , $name= , $type=){
    13.                 $reg="!<xmlvar name=\’(.*?)\’ type=’(.*?)’>(.*?)</xmlvar name=\’\\1\’>!s";
    14.                 preg_match_all($reg , $xml , $matches);
    15.  
    16.                 foreach($matches[1] as $index=>$key){
    17.                         $optname = $key;
    18.                         $opttype = $matches[2][$index];
    19.                         $optval = $matches[3][$index];
    20.  
    21.                         $optxpl = explode("::" , $optname);
    22.                         $optname = $optxpl[count($optxpl)-1];
    23.  
    24.                         if($opttype == ‘object’){
    25.                                 $bigarr[$optname] = (object)extractVars($optval , $optname , $opttype);
    26.                         }elseif($opttype==‘array’){
    27.                                 $bigarr[$optname] = extractVars($optval , $optname , $opttype);
    28.                         }else{
    29.                                 $bigarr[$optname] = $optval;
    30.                         }
    31.                 }
    32.  
    33.                 return $bigarr;
    34.         }
    35.  
    36.  
    37.  
    38.         function makeXML($name , $var="" , $parent = NULL ){
    39.                 if(!is_null($parent)) $parent = $parent."::";
    40.  
    41.                 if(is_object($var)){
    42.                         $xml .= "<xmlvar name=’$parent$name’ type=’object’>";
    43.                         foreach($var as $key=>$val){
    44.                                 $xml .= makeXML($key , $val , $parent.$name);
    45.                         }
    46.                         $xml .= "</xmlvar name=’$parent$name’>\r\n";
    47.                 }elseif(is_array($var)){
    48.                         $xml .= "<xmlvar name=’$parent$name’ type=’array’>";
    49.                         foreach($var as $key=>$val){
    50.                                 $xml .= $tab.makeXML($key , $val , $parent.$name);
    51.                         }
    52.                         $xml .= "</xmlvar name=’$parent$name’>\r\n";
    53.                 }elseif(is_bool($var)){
    54.                         $xml .= "<xmlvar name=’$parent$name’ type=’bool’>";
    55.                         $xml .= "$var";
    56.                         $xml .= "</xmlvar name=’$parent$name’>\r\n";
    57.                 }else{
    58.                         $xml .= "<xmlvar name=’$parent$name’ type=’string’>";
    59.                         $xml .= "$var";
    60.                         $xml .= "</xmlvar name=’$parent$name’>\r\n";
    61.                 }
    62.                 return $xml;
    63.         }
    64.  


    Migrating From Windows To Fedora Core Linux : The Journey Begins

    September 12th, 2007

    My New DesktopI have always been a fan of the Linux community and always wanted to make Linux as my main Desktop OS , but things like Visual Studio .NET stopped that from happening. For 3 years I have been administrating Linux based servers as part of my job responsibility of being a Senior Web Developer, who doesnt really like to be dependent on sys admins , who take their time to even carry out simplest of operations. I always liked the stability and robustness of these servers and always wanted to have something similar on my desktop. ‘Boot and Forget’ has been something of a dream with Microsoft Windows. But on the other hand I was so used to the Windows desktop that i was afraid to move an inch , as I thought it would effect my performance. Here is the story of how I finally had the courage to make the leap.

    Last week our office network suffered a heavy blow cause of a silly virus/worm which kept on replicating itself to all computers on the network , though my system remained safe as I was using McAfee (which i consider the best anti-virus around) . One of my responsibilities includes network administration as well thus i was running between systems trying to fix one thing after the other. Some systems were damaged to the extent of needing a new XP install. That day I decided that it was time that we all moved to a less vulnerable system. The ground work was done , as we recently started to use OpenSuse 10.2 for our local testing server needs.

    So next day we first tested out Ubuntu 7 aka Feisty Fawn on a junior developers machine . It was pretty much plug and play and I love the live CD idea , Wireless networking went in pretty smoothly and so did all the other hardware. Perfect! BUT I just couldnt get used to the idea of a fake root … I mean root is root…. how can you fake it? . Does the logged in user have root rights or not …. well turns out the user does have root rights but to do anything really useful you have to use ’sudo’ . Nahhhh not for me .. I want control , I dont want to fake it!!! . See Ubuntu is for the really casual desktop user, like my wife , who just needs the check her emails and browse around a bit but for people who use the computer to its full extent Ubuntu is kinda limited.

    Then I installed Fedora Core 7 on an another machine and things started to fall in place. Fedora seemed to have all the answers I needed , and it also seemed to have better performance than Ubuntu. This gave me the courage and confidence to install on my own machine. So I installed FC 7 on a new hard drive on my own machine , keeping all the windows stuff on 2 seperate hard drives. The install process also proved seamless support for my SATA drive and RAID controller which while installing Windows required a driver to be installed via a floppy drive!! . As most would know Linux offers two popular desktop environments KDE and GNOME , I installed both , just to make sure I can experiment with both and find out which is best for me. After a few quick minutes on both KDE and GNOME , I decided to stick with KDE. The collection of applications provided in the install package is amazingly good , basically almost everything you might need is already in there. Ranging from Multimedia software to Server Administration tools.

    All of my hardware installed automatically , including my Creative Audigy Sound Card , which I thought might be left out. The only thing that FC 7 didnt pick up was my Wifi card . So the next step was to configure the Internet/LAN connectivity via my D-Link WIFI card , the driver for which i found at http://rt2×00.serialmonkey.com/ . To see the link activity in taskbar like we do in windows system tray (the two monitors blinking on and off) , I installed KNemo. and added it to my system tray panel. See now its about customizing your environment as close to what you are already used to , basically the Windows interface. and trust me there is no real limit to customization when you enter the linux world. It is only limited by your imagination.

    2 Very important sites to remember for KDE are kde-look.org and kde-apps.org . Browsing about I found a Set of XP icons which took care of the Icons part of the look and feel. Then I turned my attention towards the square “K” menu button ,I installed KBFX which allowed me to customize my “Start” button and make it rectangular or customize the icon , this app also allowed me to change the menu style and allowed templating of the K menu.

    Once the look and feel become something to which I was accustomed , Now I wanted to mount my other 2 hard drives and make my XP bootable as well from my Linux GRUB loader. So I searched around and found the answer for Duel botting , I edited to my /boot/grub/grub.conf and added this to the end.

    title Windows XP
    map (hd0) (hd1)
    map (hd1) (hd0)
    rootnoverify (hd1,0)
    chainloader +1

    to make my NTFS partitions on my other 2 hard drives mounted at boot time , i created folders in /mnt folder and added the below to my /etc/fstab file

    /dev/sdc1               /mnt/C-Drive             ntfs-3g  defaults      0 0
    /dev/sdc5               /mnt/D-Drive             ntfs-3g  defaults      0 0
    /dev/sdc6               /mnt/E-Drive             ntfs-3g  defaults      0 0

    You can find the /dev/xyz by typing fdisk -l at the terminal, this outputs the details of the hard drives and partitions. Upon next reboot , I was able to get to my XP boot loader via the GRUB menu and also I got the other partitions mounted just fine.

    Once this was out of the way I wanted to have something similar to “My Computer” , I once again found kde-apps to be my friend and found KIO Slave sysinfo:/ , i added a new link to URL on my desktop , named it My Computer and in the path to run I placed “sysinfo:/” , double clicking the icon brought me to a page which showed me my HD Partitions , CPU , RAM , VGA stats . pretty neat stuff!

    Once my environment was set i moved towards my IM needs , I found Pidgin (formerly known as gaim) pretty good , with messege archiving support and ability to connect to several IM networks at the same time , it made my day. I also found KMess to be a reasonable MSN clone. Got my skype working pretty soon as well.

    Wonderful , so far so good!!

    Now I moved towards the tools i needed for my professional needs. As a hard core web developer , my favorite browser remains FireFox BUT i do have to check my sites with IE as well , just to make sure everything is working well for both sides of the internet world. The best news came when I found IE for linux!!!! YES IE FOR LINUX!!! Check it out here , the install went perfect and now my linux was IE capable! .Another thing I must point out here is the fact that i copied my FireFox profile over from my XP install and replaced the profile folder on my linux box and on FireFox restart , everything was there including all the plugins! WOW … Kudus to the FireFox team!

    The next stage was to get my favorite WYSIWYG editor Macromedia Dreamweaver working , i had heard that it was possible . So I searched around and found how to run Macromedia Dreamweaver and Flash on Linux , wonderful resource , priceless!. Although that article is targeted at Ubuntu users but it fits perfectly fine into our Fedora distro as well. So after a bit my linux box was running Macromedia Dreamweaver as well. Though I still have to figure out how to associate PHP files with Dreamweaver , so that they would open in Dreamweaver automatically.

    I tried the same approach with my favorite FTP client CuteFTP and it worked out pretty good as well , a little buggy but tolerable for me!

    At the end of all this , I was pretty satisfied with how my Fedora box turned out. Now I turned towards some performance tweaks and found this really good series of articles. Part 1 , Part 2 and Part 3 , these articles surely helped me tweak a few things performance wise. The last but not the least was to go into services manager (just like I did on windows) and turn off un-needed services at run time. Like i didnt need the ISDN support , so I turned it off , I also didnt need bluetooth support , so i turned that service off , basically this will vary according to your needs , so turn off services carefully and wisely.

    I think this is enough for now , in the next article I will try to cover SAMBA and how I got my network computers (which include both Windows and Linux machines) to share files and printers with each other.

    Hope this info comes in handy for someone!