Skip to content

Using Cargo to deploy to multiple containers

I am new to maven, but recently used it on a project that needed to deploy to two tomcat containers.  Cargo seems to be the plugin of choice, but I had a devil of a time trying to get it to deploy to two existing containers with one command.

I ended up using the ant-run plugin to just manually copy the war files where they needed to be.  This plugin usage also archives old war files and expands the new one, as well as deploying to the failover container.

Attached, you can see the relevant section of the pom.xml: cargo-deploy-two-containers

Hope this helps.

CakePHP Rating System

I was thinking about adding a rating system (1-5 stars) to a cakephp site I run, and was looking forward to it.  But then I remembered the cardinal rule of software development, especially in the internet age: check and see if someone has done it first.

And someone had. Updated 6/2/2105: The previous link no longer works.  If I had to, I’d try this plugin instead (but I haven’t).

The biggest issue I ran into is making sure that I added the javascript helper to every controller that uses the default layout.  If I didn’t do that, I got a blank white screen.  Other than that, smooth sailing.

google_debug parameter: Google Ad Manager Help

I’m using Google Ad Manager because OpenX didn’t get back to me quickly enough when I requested a free hosted account.  Sorry, it’s not Google Ad Manager, it’s Double Click for Publishers.  Whoops.

It’s relatively complicated software, probably because serving ads is relatively complicated business.  I have hacked my way through it, but the single most helpful tip I found was to append <code>?google_debug</code> to the page you’re trying to get the ad displaying on.  This pops up a window with what is basically a stack trace of the javascript execution on your page.  You might not understand all of it, but you can definitely cut and paste the message you find into the Google Ad Manager help search, and find more useful answers.

Quick Donation Website Setup

This is based off a question I got from a friend–how can non techies easily set up a website to take donations and publicize a cause?

It’s not hard.

Of course, Google Sites isn’t the most flexible publishing platform (see, for instance, this discussion on how to link to an uploaded PDF), but it will get the job done for most simple sites.

Long live the non expert publisher!

Why the reverse brain drain?

Via a retweet from Brad Feld, I saw this article.

This is confusing to me.  There is no hard data, but I’d like to explore why are people leaving the US to start companies back in the homeland.

Is it because of:

  1. visa issues
  2. the cost to build a company
  3. the economic opportunity in their home country

If it is the first one, I’m in favor of reform, though I think there are a number of ways to encourage founders to stay, and tying their visa to VC funding, like the startup visa does, doesn’t seem like an optimal strategy.

If it is the second, then we need a cost benefits analysis.  Making it easier to start companies is not an unalloyed good.  For example, I wouldn’t want it to be easier to start a company that made cancer causing products.  It’s harder to start a company in the US because we as a society have made choices that impose costs on companies.  Ask the Chinese how it is to have ineffective regulation.  On the other hand, as outlined in comments here, lowering risk for entrepeneurs (lack of health insurance!) could really lower costs for starting a company.

If it is the last, then, good luck to them.  Who can argue with the fact that Indian engineers are cheaper or that “there are no mature companies, like Google and Microsoft” in these countries?

On My Brief Experience with Wireframe Tools

I was looking for a tool to quickly and easily build wireframes.  Oh, it had to be free too.  Luckily, I found this useful list of wireframing tools.

The first one I picked was Simple Diagrams.  I like Adobe AIR apps, already have the runtime and it looked nice.  Even had some tutorials, even if they were third party generated.

But then, I’m actually using it, and I go to save the image and there’s no save!  You can export as PNG, but you can’t, using the free version, save a project, shut down your computer, turn it on again, and then open up your project to where you were.  Now, I’m no opponent of freemium business models, but if you can’t save a diagram and come back to it, the program is really crippled.  Call it a demo, but it’s not anywhere near a free functioning version.

I then tried Web Site Wireframe, but wanted something that would work offline.

Finally, I tried Pencil Prject.  It’s not the most polished (one of the tabs in the main screen is “My Stuffs”) but it worked–I could edit files offline, and save projects and re-open them later. It’s also kinda cool because it is built on top of the XUL and Firefox application frameworks (they have a plugin and a standalone app available).

Any wireframe tools you would recommend?

Parsing street addresses in a java application

I recently had to find a way to parse a street address into its component parts, and thought I’d share my adventure.

The idea is to take a string like “123 S Main Street” and break it apart into the street number (123), the street direction (S), the street name (Main) and the street type (Street).

At first, I thought that regular expressions would work, but the sheer variety of legal postal street addresses quickly dissuaded me, as did my boss’s misgivings.

Stackoverflow has a nice discussion of the problem, which gave me some additional pointers.  There’s a commercial solution, which is available as a COM component or a web service–I didn’t try this.  There is a free, but application/attribution required, web service provided by a university that did a great job (thanks, California tax payers).  This solution is also available in a for-pay variant.

Neither of these were desirable because we needed to parse a lot of addresses quickly, and calling out over the web can be slow.  Some more digging turned up this stack question and  JGeocoder, which has a fairly robust address parser.  It’s not perfect, but it was free and open source.  I am not sure if it is still in development (the author didn’t respond to my email) but it does what we need it to do.

As an added bonus, we’re using pentaho for the data processing, and you can call java classes directly from your data processing steps, so I didn’t even have to wrap the java call in a shell script or anything.

DualPhone 3088 Skype Phone: first impressions

AKA, the internet eats the phone system, installment one.

We recently bought a skype phone (having been inspired by this post).  We wanted to use our cell phones less (having been inspired by this book), and Skype seemed like an alternative to the local telco (Qwest).  Of course, it just increases our dependence on our local ISP (Comcast).  Gotta love broadband duopolies.

There was one requirement that made the phone relatively easy to choose.

  • It had to work without a computer being on.  I didn’t want to have to tie up a laptop or netbook for this phone.

This criteria limits you to about three phone models.  There are tons of phones that work as long as they are plugged into a computer (and they are cheaper too).  After spending some time wandering through Amazon.com’s catalog (a local store was also called, and they didn’t have anything), we selected the DualPhone 3088.  Here’s the Amazon page.

Impressions from using this phone for about a month.

  • It was easy to set up–I just created another skype account and set it up for some subscriptions.
  • The phone service is pretty good, though it has cut out a couple of times in use.  Of course, having AT&T as a cell phone provider, this is something we’re used to.
  • The phone feels cheap.  The handset is light and not quite full sized.

The economics are powerful, though.  A full subscription to skype (Skype In, so that others can call us, and Skype Out, so that we can call regular phone numbers) is around 9 bucks a month.  As we cut back our cell phone minutes, we’ll see whether a Skype phone is a full blown solution.

Own your social media–install Storytlr

I guess I’m just not very trusting, because I like to have copies of my data.  I host my own blog, rather than use blogger or wordpress.com.  I host my own email (or at least one of my two main accounts).  I prefer to document interesting things on my blog, rather than a site like Quora or Stack Overflow (though I do have an account on the latter).  Heck, even though I use an open ID provider, my own domain is the master, and I just delegate to myopenid.com.

So, since I recently have been putting a bit more effort into my social media presence (you can find me on twitter here), I looked around to find a backup solution.  I did find one–Storytlr–via this article on backing up your twitter feed.  It apparently used to be a hosted service, but now is open source–code here, install instructions here.  (There’s at least one for pay service too, but then, you don’t really own your data, plus I’m cheap.)

It was pretty trivial to install.  I ran into this issue with Storytlr not recognizing that PDO was installed, but the fix (hacking the install script) worked, and I didn’t run into the Zend error also in that bug post.

I also ran into an issue where I chose an admin password of less than six characters on install.  Storytlr was happy to let me do that, but then wouldn’t let me enter the exact same password when I was logging in for the first time.  To fix this, I had to update the password column in the users table with a new MD5 string, created using this tool.

So, what does Storytlr actually give me?

  • Access to my data: I set up feeds to be polled regularly (requires access to cron) and can export them to CSV whenever I want.  And I keep them as long as I want to.
  • One single point of view of all my social content.
  • Really easy way to add more feeds if I join a new social network.  Here are the sites/networks Storytlr supports right now.

The issues I ran into are:

  • Technical issues, resolved as documented above.
  • No support for facebook.  (Well, there’s this experimental support, announced here, but nothing that is part of the project.)  This is big, given how bad Facebook is with respect to privacy.  I am not sure what my next steps are here.
  • Not wanting others to have access to my lifestream.  This was easily fixed with a Auth directive.

If you are depending on social media sites, have some technical chops, a server to host it on, and want to ensure a historical archive, you should look at Storytlr.

How to connect a Jabra VBT2050 earpiece to a Palm Centro

Everyone should use an earpiece.  My SO is reading “Disconnect: the truth about cell phone radiation, what the industry has done to hide it, and how to protect your family” and it’s some scary stuff.

I’ve struggled with setting up my earpiece enough times that I want to document what I did just now.  There are a lot of instructions on the internet, but they all seem incomplete, or aimed at a different phone.  Here’s the Jabra manual (PDF), even though it isn’t much help.

So, here are my step by step instructions on how to connect my AT&T Palm Centro with my Jabra VBT2050 earpiece.

  • Turn off the earpiece by holding down the side button until you see 4 fast blinks.  Disconnect it from the charger.
  • Then, turn off bluetooth on the phone.  Disconnect it from the charger.
  • Turn on the bluetooth on your phone
  • Make sure your phone’s bluetooth setting is ‘visible’
  • On the phone, choose ‘setup devices’
  • Choose ‘trusted devices’
  • Choose ‘add device’
  • Turn on the Jabra earpiece by holding down the button you used to turn it off
  • Continue to hold the on/off button down until you see it blinking three times slowly.
  • Press the center button of the earpiece (the one you use to connect/disconnect calls) for about 10-20 seconds, until the light on the earpiece is steady.
  • Choose ‘find more’ on your phone.
  • Select the Jabra earpiece.
  • Choose ‘OK’
  • Enter the passcode: 0000 (I’ve not found a way to change this, which seems rather idiotic).
  • Choose ‘OK’  You should now be at the ‘Trusted devices’ screen.
  • Select the Jabra earpiece from the list
  • Press the menu key on your Centro.  It’s next to the ‘Alt’ key.
  • Select ‘Connect’.  The earpiece should be blinking one time slowly.
  • Click ‘OK’ on out.  You should see a blue set of headphones next to your bars when you get to the main screen.
  • You can change your phone’s bluetooth visibility to ‘hidden’

Hope this helps!