June 1, 2011

VMWare, Samba, Eclipse, and XDebug: Mixing a virtual Linux environment with a Microsoft Windows development environment

June 1, 2011 - Categories: development, drupal, geek

I’m starting the second phase of a Drupal development project, which means I get to write about all sorts of geeky things again. Hooray! So I’m investing some time into improving my environment set-up, and taking notes along the way.

This time, I’m going to try developing code in Eclipse instead of Emacs, although I’ll dip into Emacs occasionally if I need to do anything involving keyboard macros or custom automation. Setting up a good Eclipse environment will help me use XDebug for line-by-line debugging. var_dump> can only take me so far, and I still haven’t figured out how to properly use XDebug under Emacs. Configuring Eclipse will also help me help my coworkers, who tend to not be big Emacs fans. (Sigh.)

So here’s my current setup:

  • A Linux server environment in VMWare, so that I can use all the Unix tools I like and so that I don’t have to fuss about with a WAMP stack
  • Samba for sharing the source code between the Linux VM image and my Microsoft Windows laptop
  • XDebug for debugging
  • Eclipse and PDT for development

I like this because it allows me to edit files in Microsoft Windows or in Linux, and I can use step-by-step debugging instead of relying on var_dump.

Setting up Samba

Samba allows you to share folders on the network. Edit your smb.conf (mine’s in /etc/samba/) and uncomment/edit the following lines:

security = user

   comment = Home Directories
   browseable = no
   read only = no
   valid users = %S

You may also need to use smbpasswd to set the user’s password.


Install php5-xdebug or whatever the Xdebug package is for PHP on your system. Edit xdebug.ini (mine’s in /etc/php5/conf.d) and add the following lines to the end:


Warning: this allows debugging access from any computer that connects to it. Use this only on your development image. If you want to limit debugging access to a specific computer, remove the line that refers to remote_connect_back and replace it with this:


Eclipse and PDT

I downloaded the all-in-one PHP Development Toolkit (PDT) from http://www.eclipse.org/pdt/, unpacked it, and imported my project. After struggling with Javascript and HTML validation, I ended up disabling most of those warnings. Then I set up a debug configuration that used Xdebug and the server in the VM image, and voila! Line by line debugging with the ability to look in variables. Hooray!

2011-05-31 Tue 17:37

Hungry hungry compost and other garden updates

June 1, 2011 - Categories: gardening

The compost bin chomps through imageall the organic material we give it. It’s nowhere near the smooth dark brown of finished compost yet, but when I turn it every week, my two full bins have mysteriously become two half-bins of compost. The Internet says it takes a ton of organic material (a literal ton, mind you) to make half a cubic yard of compost. To make two cubic yards of compost, then, you need about one Asian elephant’s weight in organic material. (Yes, I estimate tons in elephants, thanks to hanging out with my dad at the zoo.) So I’ll probably buy lots more cow manure (moo poo, as we call it) to amend the soil next year, instead of hoping that the compost bins will pull through quickly.

Other garden updates:

  • Asparagus: Tall and ferny. This is their second year, so we’re leaving them alone to grow and store energy for next year. Four square feet of asparagus might be too little, though. =) We’ll give it a try anyway!
  • Basil: Still getting established in the garden. Slow new growth.
  • Blueberries: Setting fruit. I’m going to put up some netting this weekend or next weekend so that we have a chance of tasting some berries, not like last year when the birds and squirrels had them all…
  • Cilantro: First true leaves emerging. Thoughts of stir-fries dance through my head.
  • Dill: Starting to look all dill-like. Still small, though!
  • Lettuce: Starting to go to seed. I may have a baby lettuce salad after all.
  • Mint: I had my first cup of home-grown mint tea the other day. Mmmmm.
  • Oregano: Thriving like anything. I must make pasta soon.
  • Onions, garlic, and garlic chives: Growing around the garden. Quite easy to grow. I think I’ll pull up more perennials next year and plant those instead.
  • Peas: More than two feet tall now, climbing up the strings like they’re racing the other seedlings. The ones in the unprotected box near the house are winning.
  • Spinach: Probably growing. I think I might be confusing it with weeds, so I’m leaving that section alone for now.
  • Strawberries: The new runners have established themselves and are even blooming, which is a pleasant surprise. All the plants are beginning to set fruit. Exciting times! Must pick up straw or some other mulch so that I can keep the berries off the ground. Also, it turns out you can make tea from strawberry leaves. Looking forward to trying that!
  • Tomatoes: Growing slowly, but getting there. I think we might have some kind of blight, though. =|

Casualties: a Thai basil plant, and the curry plant in front

I planted bok choi last weekend, and I planted some edamame today. We’re more likely to take the time and effort to cook the edamame than the string beans I grew the other year. =) I also sprinkled a lot of lettuce and spinach near the borders, where I pulled up the lilies of the valley. All those sprouts are coming up now that I’m home enough to keep the soil moist. (Note: Don’t plant lilies of the valley in your garden unless you mean it. They’re invasive and will take over. Ditto mint, which I keep in a pot.)

Pity it’s no longer dandelion season. We pulled up almost all of ours and ate them as salads. If we have more next year, I may host a party. We do have a berry tree out back that will be fun to harvest. We missed harvesting it last year, but we caught a lot of berries on a tarp the year before that. I think it would be a good combination with pastry cream, tart shells, maybe some powdered sugar on top. By that time, the tea garden should be growing quite well, too. Garden party! J- said her friends are excited about our tomatoes and peas, so we should have them over to harvest too. Mmm…