Convert from VMWare Player to VMWare Server
September 2nd, 2008 by Aaron
At superdev, we have a distribution of a gentoo image made with vmware workstation. This works fine in vmware player - but not the free vmware server - and I wanted to have vmware server running so I could have more than one server running on my windows laptop. Well, there are two small simple edits I had to do - and it was all good.
First of all, I grabbed my favorite free hex editor and evilly smiled. Open XVI32.
Second, edit the file named VirtualMachineName.vmx. Replace the virtualHW.version = “6″ with virtualHW.version = “4″. SAVE.
Finally, edit the file named VirtualMachineName.vmxd. If you have more than one (like -1, -2, use the one without the suffix. Those are the data files, the vmxd is the config). Once again, replace the virtualHW.version = “6″ with virtualHW.version = “4″. SAVE.
Other things I ran into…
For whatever reason, my eth0 turned into eth1 once I transferred. So I had to do that modification. (Also, my dhcp on my network stopped responding to the vm, but I changed it to NAT anyway - because I wanted it as a local connection anyways.)
Does your design leave an unknown size gap? navigationFiller.js!
September 2nd, 2008 by Aaron
If you’ve ever worked with a customer’s CMS pages and heard the term “Oh but I want some images underneath the links” - you need this script. Whether your using old style tables or the coolest CSS tricks, filling in space to the bottom of the page can be useful.
Enter navigationFiller.js
With this js file and some configuration in the HTML, you can solve the problem of having that blank space below the navigation bar. For example, see our before screen…
Minus it being very very ugly and boring, you’ll see the huge blank space below the list on the left - or the ‘navigation’ links - if they were a tags. Now, lets imagine that the content on the right side may be variable lengths - this is where navigationFiller.js falls in.
navigationFiller.js will calculate the available space and fill with images from your pre-configured list.
See the after picture - of our equally as AWESOME demo pics?
This is from a simple script include and then some configuration options. The script has public methods for populating the images that you want to use.
Its easy - lets see how:
How to Use
First thing’s first, include the js file in the head of your document.
1 2 3 4 | <head> <script type="text/javascript" src="navigationFiller.js"></script> ... </head> |
Next, configure your options. First, you must make a new instance of the object. Then, you can add images 1 by 1. The order you add them is the order they may appear. Check out this javascript:
1 2 3 4 5 6 7 | var oFiller = new navigationFiller(); oFiller.add('1.gif'); oFiller.add('2.gif'); oFiller.add('3.gif'); /** add using your normal onload() handler **/ window.onload = function() {oFiller.create('fillerDiv');} |
As you can see, you finally run the oFiller.create() function with the ID of the div that you wish to populate with these images.
So What Happens?
If you have a div with an ID passed to the oFiller.create() in the above example, the script will calculate the height of the current document, and the location of the div, and then load images in until there is no more room left. It will not extend past the height of the existing document.
Bugs or Limitations?
I have a huge todo list - so this is more of a proof of concept. It should be noted that it only works with FireFox at this point. Also, the code is sloppy and possibly buggy. You can see the top of the js file for my expanded todo list.
Download!
You can download it here: Navigation Filler Zip (with Examples)
Useful Eclipse Plugin: Find a file name in project immediately
September 1st, 2008 by Aaron
Unfortunately, at #superdev, there are times when the include_path in PHP is calculated. It is not always clear where to find a file. Other times there are just too many places to find the file. Because of this - and Eclipse PDT’s inability to find a file from an include or include_once statement when you ctrl click it, I needed to find a tool to find files fast.
Don’t be Lazy - use ‘Teh Google’
So for the longest time, I would determine what classes or functions were being used from the included file, and then do a search of the code base for “function functionName()” because I knew it would find that file … eventually.
Well, turns out, there is a better way.
Goto File Eclipse Plugin
I found this great plugin for eclipse: GotoFile @ muermann.org. I wish I had thought that this could be done - and searched earlier! heh. Turns out this plugin adds a new menu to your search menu by which you can launch the dialog window. Then, just start typing the name of the file and it live searches for you. When you finally find it, just double click it - and it’ll open up the file it found in your project. It appears to work for any file in your project - which is amazing. For more features and details, check out hte GotoFile Eclipse Plugin Home Page.
