Monday, April 13, 2009

Giants Alliance

Two giants are there one called Windows and another called Linux. As i am fan of Windows Interfaces and Usability (by the way i use Windows XP) and also fan of the extreme shell power of Linux, I wished if i can exploit these two powers at the same time.

The solution i found was using Windows XP as my primary OS and adding Debian version on virtual machine. You may be asking why should this solution be said when it is well known and made by some many users but actually, i made some modifications to this solution.

What i did can be summarized in these following points:

  • installing debian without any interface at all, just a shell no more
  • using virtual machine shared folder technique to share a folder between my XP machine and my Linux machine
  • installed ZOC program which is a powerful shell program that allows connecting using openssh and supports multi tabs which is very important feature not available in putty
  • installed openssh-server on debian
  • fixed an IP for my debian machine so as to save my openssh configuration one time only without changing it each time i connect to it

This way, i enjoy my XP machine and whenever i need the shell of linux. i connect using openssh on my debian virtualized machine and do what i want

I use this solution while developing ROR applications, i prepared the environment i use as follows

  • installed ruby, rails, mysql on my debian machine
  • opened remote connections to mysql database so as to use MySQL Query Browser from XP machine

Now, i open my IDE on XP machine that changes in folders place in the shared folder between two machines and i open my server from virtual machine and test apps on debian machine IP rather than my localhost

This experience is great and i enjoy it so much as i feel i have the power of each environment Windows & Linux at the same time

In order to optimize the performance of my Virtual Machine somehow, i raised the priority of these virtualized processes to ‘High’ or even ‘Realtime’. it is now better but not perfect

I think in order to raise the performance significantly, i need to buy another motherboard supporting Intel VT technology. Using such technology i can move virtualization from software layer (being a process that Windows XP Scheduler deal with) to hardware layer which should improve performance as stated

That’s it, i suggest you try this experience and Enjoy as i do

Sunday, April 12, 2009

Export Google Document To WIKI STYLE Document

the idea is simple and only needed is that you do some simple steps and you are done

follow the following steps:

  • save google document as HTML file
  • view html page source and extract the html inside document body tag
  • use this great tool and add in it the html you copied and you will have the wiki style document generated

That’s it, you now have the document you wrote in WIKI style. Take this text and play with it as you wish

Saturday, April 11, 2009

Restore Your Deleted Partition

Yesterday, i passed through a great panic after wrongly deleting my 3 partitions. Suddenly i felt that i lost all my data forever and there is no way out of such problem.

First how this problem occurred ?? actually this issue aroused from “computer management” program on my Windows XP. I opened it and choose one partition and right click and chosen delete. After confirmation, i found all 3 partitions were deleted. What a stupid application !!! i don’t know why should windows has an application that deal with such sensitive parts when not sure of its performance and reliability

Anyway, after some search on the internet, i found a great application called “TestDisk”. Anyone can download this free application from here

I did download it and followed this nice tutorial who showcase how this application works and how to use it safely. I did exactly as it stated and i restored my deleted partitions back again as before with nothing being lost

Thanks “TestDisk” for the great application and you really deserve a donation.

Thursday, April 9, 2009

Gems vs Plugins

Which one to use GEMS or PLUGINS?
This was a question i always asked and i have searched on the internet for comparisons between each one and the other

i can see that people prefer gems for the sake that it is the new future, it has obligatory versions other than rails plugins

But as for me, i only see gems useful in these two cases
  1. when using code provided as gem outside of Rails, maybe with some ruby application
  2. if you want to share code written in gem among applications
other than that, i see plugins better and much more maintainable for each application on its own

Monday, March 9, 2009

Uploading Images from URL using Paperclip

I was searching for a way inside paperclip that uploads image from Url instead of File which is the normal behavior handled by Paperclip but I didn't find that

After too much search and trials, I reached to a solution that is easy to be implemented and handle all cases you can expect in this process

I am applying the solution inside my model but it is preferred to add a patch to Paperclip version to use so that the same logic be applied everywhere but this exercise is left for you to do

To check the code and how it evolved to handle all special cases, Please review my gist here

Cascaded HTML SELECT elements using JQuery V2

This is a small update i made to the code, This code fixes a bug detected and also get rid of some duplicated code

his is an update to the JS function

eSpace.HTML = {
cascadeLists: function(parentId, childId, callbackFunction){
$("body").append('');
var childOptions = $('#' + childId + ' option');
$('#' + parentId + childId).html(childOptions);

$('#' + parentId).change(function(){
var parent = $('#' + parentId)[0];

var selectedOptionValue = '';
if (parent.selectedIndex > -1)
selectedOptionValue = parent.options[parent.selectedIndex].value;

if (selectedOptionValue == '')
$('#' + childId).html($('#' + parentId + childId + ' option[value=""]').clone());
else {
var childs = $('#' + parentId + childId + ' option[parent="'+selectedOptionValue+'"]');
if(childs.size() == 0)
$('#' + childId).html($('#' + parentId + childId + ' option[value=""]').clone());
else
$('#' + childId).html($('#' + parentId + childId + ' option[parent="' + selectedOptionValue + '"]').clone());
}

$('#' + childId).trigger("change");

if(callbackFunction != null) callbackFunction(parent.options[parent.selectedIndex]);
});

$('#' + parentId).trigger("change");
}
}

Saturday, March 7, 2009

GMarks vs Foxmarks

I have found some many friends of mine interested so much in GMarks extension to sync their bookmarks from one pc to another.

As i am also interested in bookmarks sync across computers, and as i also respect google extensions and was a frequent user of Google Browser Sync until they stopped supporting such extension. I said to myself that i have to see what this extension gives

Frankly speaking, using GMarks is very ugly, yes you bookmark and tag your bookmarks but the way of retrieving tagged bookmarks is very old fashioned. It takes us back to the era of Firefox 2 of adding bookmarks in folders and then whenever you look for something, you open your bookmarks and look for what you want. SO UGLY AND OLD FASHIONED way

To understand why GMarks is a bad choice, lets have a look at what Firefox 3 introduced which became a de facto and also is going to be there later on in other browsers even google chrome

With the arrival of Firefox3, we got rid completely of two main stupid things
  • searching for bookmarks in folders, they introduced tags
  • searching bookmarks then if not there, google using one of the search engines beside navigation bar
Firefox 3 focused on value, simply we should deal only with one entity whenever we open a new tab, this entity is the location bar

Since you write keywords on you search engine to get you results, and since now you tag your bookmarks with keywords then we all agree that it is only keywords that matter. The new scenario became open a new tab, you are already on the location bar, write the keywords you are searching for, Firefox will list you tagged bookmarks and some other results from history.

Satisified then fine take any like from this collection. if not satisified then simply hit the enter key and you will be taken to search results from the search engine you prefer

Very lovely way, focusing on one position and having everything in hand for you. let's see what this GMarks did for our lovely neat scenario

Now, if you want something, you go to Gmarks tab beside tools and you will find your tags, you search for the tag you want then you find your bookmarks there. Not satisfied then google and write again the same tags you were about to use. SIMPLE WASTING YOUR TIME AND DON'T EXPLOIT MULTIPLE TAGS SEARCH NOR HISTORY SEARCH

simply guys, it is very stupid. Please get rid of this ugly extension right now. you are brainwashed with it. Simply use Foxmarks

it don't interfere in your cycle at all. It just sync on shutdown or from time to time as you configure it and whenever you add it from any other browser on same pc or another pc you get your bookmarks ready for you

it also has this features
  • compatabile on many browsers, i think safari and opera
  • has web interface to use from anywhere
  • sync passwords also encrypted if you wish to
  • has a new fancy feature added which is suggesting tags from other people to you whenever you tag your bookmark
To be also honest, i must say that Foxmarks is great but you need to disable its sync from time to time and make it on shutdown because it has currently a bug that causes a slowdown to firefox on synchronizarion

i wish this post can help you getting rid of your slavery to GMarks. see the light with Foxmarks instead