Skip to content


Ubuntu 10.04, LAMP and the ImageCreateTrueColor problem

Brave sort that I am, I can’t help upgrading tot he latest and greatest of whatever.   I know it is asking for trouble, but somehow I like living on my wits.  So, after a fresh install of Ubuntu 10.04 everything seems lovely – all in all a very clean and professional disto.

Until I got working on GigCalendar again that is – I ran accross an obscure failure with the image upload process (GigCalendar is a Joomla component I have been working on to present and manage publicity for bands and/or performance venues).   After uploading images, the return page was blank – yet refreshing showed the upload to have occured but not the auto resizing.  Very wierd.  Turns out after scanning the apache error.log that I’ve made a call to ImageCreateTrueColor - a GD library function that seems to be missing in the default LAMP stack installed with 10.04.

After a bit of hunting around, I found several references to this – apparently whoever puts the distro together has switched out the standard suite of PHP add-ons and somehow nixed the GD library where this and many other important image processing functions are located.

Google to the rescue, I found this link explaining the step-by-step details for reselecting the libraries and recompiling PHP from source http://cumu.li/2008/5/13/recompiling-php5-with-bundled-support-for-gd-on-ubuntu .  It’s a more or less painless process but I’m happy to crib off someone else’s work.

Oh – one thing.  Don’t forget to update the version numbers to reflect the current state of the art.  The instructions refer to php 5.2.3 while the current version (at the time of this writing) is 5.3.2

Yet another last thing – As my good friend Mubashir points out, the version of PHP available seperately from the 10.04 repo does indeed have the gsImageCreateTrueColor function built in.  It’s just the version bundled with the new LAMP stack that does not.  So a simple apt-get install php should do the trick and save a hour long compilation process.  Oh well.  it’s good to know how to do these things anyway.  Thanks Mubashir.

Posted in Ubuntu.


Solar Hot Water – Southern California’s low hanging fruit

Ask most people about “going solar” and they think automatically about huge, expensive silicon panels with all the inverters and all.  I’ve been there and done that too.  My 2KW roof installation happily generates electrical power whenever the sun shines – and this being Los Angeles, it shines just about all the time.  Great.  But probably not a good investment.  Even with all the rebates and tax incentives, I doubt it will ever really pay for itself – not until we’re facing 20 or 30 cent per KWHr.  Still, I put the system in to “do my bit” and fuel the industry etc.  Installation prices are falling quite considerably since I put my system in.  I’m still not a big fan though.

More recently though, facing an excess of free time, I decided to get creative and install my own solar domestic hot water system.  So far, the results are brilliant – I get all the hot water I can use for the cost of about 1 penny per day – that for the small electric pump which drives the water through the collectors.  For the life of me, I can’t see why the building regulations don’t make such systems compulsory in all new constructions.    For one or two thousand dollars (depending on your creativity) you too can live off the fat o’ the land.  Here’s my story…

My quest started by finding a couple of previously-loved collector panels on Craigslist.  Back when Jimmy Carter was president, tax incentives created a large industry making these things – and they were built to last.  Even the White House installed a system.  I’m told that the first thing Raegan did on taking office was to repeal the incentives and then remove the panels.  Without the tax incentives, the burgeoning solar industry died in childhood and early adopters found no-one available to maintain the systems in place.   This was bad news for the country, but happily for me – it means there are a lot of components available for next to nothing.  I picked up a couple of 4′ x 8′ solar collectors for little more than the scrap metal value – and these things were build to last.

The next step was to research on the internet how best to use these panels.  It turns out there are three main systems, each suitable for a different climate.  The simplest is a thermo-siphon design, where a large storage tank is installed above the collector panels.  When the sun shines, hot water from the panels rises into the tank without pumps or anything.  This design only works where there is zero chance of frost though.  Even here in Sunny California, we get one or two nights a year below freezing, so this design is out.

The most popular system pumps anti-freeze in a closed circuit, transferring heat to the storage tank via a heat exchanger.  This system is more complex and hence costly to install.  One problem faced by this design is in dealing with overheating – once the storage tank reaches the upper set point, something needs to be done to prevent the antifreeze mixture from over heating (and in the process becoming corrosive and reducing the freeze protection).  Many of improperly maintained installations failed with corrosion and burst pipes and/or leaks caused by not changing the anti-freeze early enough.  For much of the country though, this is the only workable system.

In temperate climates though, such as here in Southern California, there is an ingenious design refereed to as a drain-back system which is almost maintenance free and more or less fool-proof.  In a drain back system, plain water is used in the closed loop, avoiding breakdown of the antifreeze due to overheating.  A simple electronic pump control made just for this purpose sensors the temperature of the water in the collectors and in the storage tank and whenever there seems to be a useful differential, turns on a small circulatory pump driving water through the collectors and heat exchanges etc – just like in the anti-freeze system (Using plain water as the heat exchange medium turns out to be more efficient in both the heat capacity and in lower viscosity for the pump – a double win).  When the controller senses no need for heat (either due to the storage tank upper temperature limit being reached or when the sun no-longer shines enough) the pump turns off (saving electricity).  Rather than keeping the collector panels full of water though, which could freeze and burst, this design incorporates a small reservoir tank mounted inside the building’s warmed space.  When the pump turns off, all the water in the collectors flows back into the reservoir – the drain-back tank – and is protected from freezing.  Care must be taking in installation to ensure that all the pipes slope continuously back to the drain-back tank for this purpose.  Installations tend to look a bit odd as a result – a small price to pay, I think.

Here is my simplistic diagram of the arrangement showing the closed circuit heating loop.  The drain back tank is shown here with an open top while in practice the solar loop is sealed to prevent evaporation.

When there is no useful temperature difference between the collectors and the tank – or when the hot water tank reaches the top set point, the controller (not shown) shuts off the circulating pump and water from the collectors quickly drains into the drainback tank avoiding any possibility of freezing or overheating.

The most expensive part of this – not counting my labor -  was in the brand new 80 gallon solar hot water tank.  My old gas powered tank was rusting through and I was unable to find something better to replace it.  The model I choose incorporated a heat exchanger in the bottom part of the tank and an electrical heater element in the upper part.  Once or twice a year we go for three or four days without significant sunshine.  I though I might need the electrical backup for these days, but so far we have been able to brave it out during these periods with shorter and shorter showers etc. so the electrical elements remain un-connected.

Next in expense was the dedicated drainback tank.  I’m not too happy about this as the drain back tank is really low tech.  I think I spent something like $400 in the end which seems criminal.  I tried a number of alternatives first, but finally accepted the inevitable.

The differential temperature controller came next at something like $120 or so.  I picked a model with regular household plug sockets making it easy to trouble shoot – I can plug the pump directly into the wall power if needed.

The last part was the water pump – there were a bewildering set of choices here and a wide range of prices.  Nearly everything I read online said that I needed a bronze or stainless steel pump and fittings, costing 2 or 3 times as much as regular cast iron pumps.  The idea being that using water as the solar fluid would cause the iron pump to rust.  One link pointed out though that this was not a problem with a drain back system so long as the solar circuit is closed.  Rust is caused by dissolved oxygen in the water which being sealed is quickly depleted.  I shopped around until I found a three speed cast iron pump on special – I think the whole thing cost no more than $50 and it works like a charm.   The drainback tank includes a parallel site-glass which I look at from time to time to confirm that the water levels remain constant (no leaks) and rust free.

During the design, I was concerned about the energy consumed by the electrical pump.  In the end, I run my pump on the lowest possible speed which according to my kill-a-watt unit uses 50 Watts.  Note that the pump only runs while the water is being actively heated, so most of the time it is off.  In practice, I find the pump runs for about 3 hours a day.  3 hours at 50 Watts makes .15 KWh per day which at our utility rate of $0.12 per KWh becomes about 2 cents per day.  Not bad for some simple plumbing.

One last thing before wrapping up – many of the things we take for granted with domestic hot water are no longer true once we go solar.  Advice like switching to a washing powder that works in cold water is no longer necessary.  Similarly, lowering the hot water temperature setting does nothing to save energy.  Taking long hot baths still uses water – but that’s another thing.  In practice, I set the tank cut-off temperature well above the normal 45C (115F) – more like 70C (160F).  To prevent scalding though, I installed a tempering valve which constantly adds cold water to the mix.  The effect is like having a tank much larger than the actual 80 gallons.
So that’s how it works.  I highly recommend something similar to anyone living in a high solar region.  There is nothing like the feeling of smugness that comes from a piping hot shower of liquid sunshine.

Posted in Energy Conservation, Going green.


Curious problem with Ubuntu auto-update – (solved)

I ran into a small problem today, somewhat connected to my earlier auto-update post some months ago.

Recapping the earlier post, Ubuntu has a built-in update process which dose a brilliant job at keeping everything up-to-date.  The down side is that users have to go through a more-or-less daily chore of accepting the update suggestions.  My post showed how to configure the updater to do it’s work silently.

So far, so good.  A few days ago though, I noticed my CPU usage constantly pegging at 100%, making the system sluggish, though not unusable (more or less like Microsoft Windows on a good day ).  I didn’t know it at the time, but it the problem seems to be due to an update dependency which required access to the original installation CD.  While running updates in the background, the system had no way of indicating that it needed the CD.  Opps.

I tried running the update process manually, but it failed to obtain the update process lock – this was another clue that the system was stuck in the automatic update process.

Next step was to kill the automatic update process.  Open a terminal, run top to see the offending process name (apt-get), run ps -e|grep apt-get to find the process ID, then sudo kill xxxx to kill it.  Still using 100% cpu, I ran top again, this time finding the auto-update process hogging the system, use ps and kill again to nix this one.  CPU usage now back to normal – whew!.

Returning to the GUI, I ran the update process manually again, which then downloaded some 64 out of 66 updates before showing a dialog asking for the original installation CD – ah-ha!  Luckily for me, I still had one; so popping it in the drive allowed the process to finish without further incident.

I’m guessing the auto-update process running in the background was unable to show the dialog asking for the CD.  I tried looking through the log files (see System Log Viewer) and found what might have been a clue in the bootstrap.log – apparently, my system was reporting a host of pre-dependency problems – things like bash depending on dash which was not installed etc.  Maybe this was ubuntu’s way of letting me know it was in trouble.  If so, it could have been clearer…

I don’t know if everyone else running auto-updates is also having this problem, if so – maybe my experience will save them time and frustration.  Good luck

Michael

Posted in Ubuntu.


And now for something completely different – saving capitalism for/from the capitaists

Well, so much for my personal goal of one blog posting per day, come rain come shine.  I still like the idea but the flesh is so unwilling.  I’m prompted today though by a recent fun post sent to me by a friend from the fakestevejobs blog.

First – take a minute to read this gem.

The problem we have all seen is that western businesses are so focussed on short-term financial results that we fail miserably in longer-term planning and investments.   One place I worked made assembly robots – big expensive durable goods.  Before the and of any financial year – everything was focused on making sales.  All the test/development units, all the spare-parts, all the demo units – everything had to be cleared out in a giant fire sale to boost the end-of-year figures and make us look good.  Great – no worry that for the first two months of the coming financial year there is nothing to sell (all the parts kits having been raided for the fire sale).  Now the only hope of recovery would be another fire sale at the end of the next financial year, so the cycle continues.  Robbing Peter to pay Paul – or rather robbing Paul’s child to pay Paul.  Sounds familiar – no?

Wherever you look, people bemoan the short-sightedness of other peoples decisions – yet feel compelled to do the same thing themselves.  Anyone brave enough to buck the system and take this bad news on the chin would be killed by the market place.  They wouldn’t live long enough to show the wisdom of long term planning and execution.  This sucks bottom – yo. (I’ve been watching “The Wire” – highly recommended).

The miracle of electronic stock trading is only encouraging this.  When regular folks can execute stock trades of any size for $10 or so in an instant – no wonder companies are deadly afraid of any bad news.  And not just day traders (assuming there are any of these left standing), large institution investors too act second by second looking to squeeze some advantage from whatever hits the news wire.   You can’t blame them – it’s the system.

My solution (drum roll, please).
Limit stock trading to an enrolment period open one week every five years.

I haven’t worked out the mechanics of this – what to do with all the stock-brokers etc for the other 250 odd weeks – maybe stagger the open weeks by industry or alphabetically or something, although this create difficulties in selling one investment before buying another etc. if they are not in the same enrolment window.  Hmmmm.

Oh well – better minds are needed to figure out the mechanics of it all.  I think I’ve done enough for my Nobel prize.  I can always share it with someone else – as the “dude” says in the Big Labowski – this might put me in a whole new tax bracket etc…

Posted in Uncategorized, Very Interesting....


Ubuntu unattended auto-update

Anyone brave enough to have kicked the Microsoft shackles and embrace the wonderful world of linux – and here I’m talking about Ubuntu specifically, but this might also apply to other distros too – will have enjoyed the delight of easy and frequent system updates and a vastly simplified application installation process.  3 cheers to Linux.

As I write this, the next regular release of Ubuntu is about a month away and there seems to be a pattern around this stage of the cycle of super-frequent system updates – I guess this is all the fixes being readied for the next release, percolating down into the regular upgrade cycle.  It should get quieter soon – just before the real release, but right now, there seems to be a list of 10 to 15 individual updates every day.  I like the ability to review updates and to choose to delay them until after (say) some critical demo or presentation – but I just don’t have the time or attention span to review each and every update package so applying the updates becomes something of an automatic chore after each reboot of my workstation.

No more – I finally got around to figuring out how to completely automate this – and like many things with Ubuntu – it is a simple as pi (3.1415926 – give or take a metric smidgen)

Edit the upgrade configuration file /etc/apt/apt.conf.d/50unattended-upgrades and uncomment the jaunty-updates line (shown in red below)

// Automatically upgrade packages from these (origin, archive) pairs
Unattended-Upgrade::Allowed-Origins {
“Ubuntu karmic-security”;
“Ubuntu karmic-updates”;
};

(Don’t forget sudo – this is a system file)…

Enjoy

Posted in Ubuntu.


Adventures in Open Source – CMS Systems

It’s been a long time since my initial flurry of posts and a lot of new things have come along, uncommented upon.  No more.

One of the big new things for me is Joomla. In case you don’t know already, Joomla is an Open Source Web content management system (CMS) written in PHP and using a mysql database (also open source).  The natural home is on some Linux server using a standard LAMP stack (Linux, Apache web server, MySQL and PHP), though it’s pretty straightforward to host it on a windows server too if you had too.

Content Management Systems (CMS) In the old days, anyone wanting to publish to the web had to learn HTML, then figure out how to create content with the right mark-up to fit in with whatever web site style conventions were in place, add the necessary navigational links etc.  This was great for the few people who could do it well, but created an unsurmountable barrier to entry for non-geeks – writers and others generally more skilled at creating something worth reading.  In the simplest sense, this is the role of the CMS – let writers write and let designers/programmers design and program – oh frabjous joy!.  Being a geek myself, another feature that really floats my boat is that in publishing content, the author gets to specify how long it should remain.  No more publicity for passed events.

There are a number of competing CMS’s out there.  Choosing any one is a little like getting married – you will make a huge investment in learning time and content development for better or worse.  In general, there is no easy way to move content from one system to another so you’d better get it right first time.   In Windows land, the big hitters are all super-expensive commercial systems – there are some open source and/or shareware systems but the user base is so very, very tiny that it would be risky to bet the farm on any of them.  In the Linux tent though, there are some very well established competing systems – each with certain advantages and disadvantages.  And a dedicated set of advocates for each.  Ignoring the little guys, the three big boys are Joomla (formerly Mambo), Drupal (I love these names) and Wordpress.

Wordpress.  Clearly the king in terms of number of installation, Wordpress was originally focussed on blog creation where it excells (This blog is managed by a Wordpress installation on a shared linux host – I spent no more than 15 minutes getting everything setup from scratch before posting real content – Brilliant).  Apparently, Wordpress can do much more than simple blogs, but it is so well entrenched in this area of excellence that few people use it for anything significantly beyond the core blog area.

Drupal.  This is the new kid on the block, and seing as how young the block itself is, this means very new.  (Correction – I imagined that the low-adoption rate of Drupal was because it is so new, but it turns out Drupal has been around longer than any of the others – it’s just growing steadily while the others have taken off like a rocket) From what I’ve read, Drupal is faster and cleaner than the existing versions of Joomla, but has a much steeper learning curve for administrators and designers.   This seems to agree with my experience, having gained some experience with the older Joomla, the install process for Drupal was equally simple, but from there on, I had no clear way of adapting it to my needs.  There were relatively few add-on components and few resources on the web for wuestions any newbie (such as myself0 would have.  By contrast, Joomla has an enormous following, matched by the thousands of open source components and templates writtent to work with it.  Almost any problem can be solved with a simple Google search as there are literally thousands and thousands of people who have run into whatever situation you might find yourself in.  It’s nice not to be alone.

Joomla. I have to confess a bias in all this – Joomla was the first and only real full-function CMS that I have had to work with, and it works so well that I haven’t given the others as much attention.  Sorry for the bias – blame history.

Joomla was developed as a split-off from the simpler Mambo CMS which I’m told is still being developed and has it’s band of dedicated followers.  The first version of Joomla was so similar to Mambo, that all the extension components for Mambo worked on Joomla too – this was a great advantage, helping Joomla hit the road with a much enhanced set of capabilities beyond the core functions that come is Joomla itself.  After a short while though, shortcoming in the API became a problem so a near complete re-write was produced and remain (at least for the time being) the standard for today.  This new version (Joomla 1.5) came with an optional system::legacy plugin, providing a n API bridge so that components written for the original version of Joomla would still work under Joomla 1.5.  For majority of compnents, this wedge worked well enough, still most compnents have been re-written to use the native Joomla 1.5 API.

Nevertheless, there are many thousands of open source components available for Joomla, something no other CMS can boast.  And the number of developers, designers and writers practiced on Joomla so far outstrips the other CMSs as to make Joomla THE dominant CMS with an ongoing level of investment unmatchable by any other system commercial or open source.

I’ve been writing and maintaining components for Joomla 1.0 and more recently for Joomla 1.5 which, once the initial learning curve has been reached seem simple and efficient to adapt to just about any purpose.

I did a Google trend search (this is the subject of another post, but if you don’t know about Google trends – check it out now).

Screenshot

Posted in web hosting.


Going Green…

One of the wonderful benefits from living in these interesting times is the new green revolution.  Saving this, conserving that and protecting the other – these are the watch words of our time.  And such a refreshing change from the get-rich-quick schemes of a few years ago.  Nevertheless, there is a real danger in any of these mass movements, that we loose sight of the ultimate goal – of treading more lightly on the Earth and leaving more for those to follow.

(starting again) It’s so easy to become preachy about this.  More to the point – what can I do that makes sense.

I have a few luxuries to help here – time and know-how.  The internet is a great tool for this – just about anything we might need professional help on is explained in excruciating detail on the web.  Whenever something seems to be out of my league, I remember the previous projects that seemed that way too, and after some hours study on the net – I just jump right in.  Well, maybe not everything – I’m tempted to have a go with minor surgery on my family members – it really doesn’t look that difficult and would save a bomb over regular hospitals etc.  But I just can’t seem to get anyone ready to give it a try.

These days, I’m interested in finding ways to reduce our consumption of water and power.  And If I can grow a larger portion of our food – then so much the better.  More on these topics coming up…

Posted in Going green.


Water sports – no, not that kind!

It must be in the blood.

Salt water runs through the veins of all Englishmen (not intending to be sexist here – I’m sure some dribbles through the gals too…).  It’s no accident that having travelled thousands and thousands of miles from my homeland to live in the Americas, I chose to park myself in fabulous Los Angeles – as close as I can afford to the great Pacific.  It was either that or the Atlantic seaboard for me.  Now the rest of the country – full no doubt with a million wonders and all – might as well not be there.  I think the same goes for Australia.  All life, it seems, is driven to the wet/dry boundary.  This is as it should be, even though it means too many others have the same idea resulting in traffic jams to beat the band. Ah – Los Angeles.

My good wife though, heralding as she does from Switzerland, sees nothing in the sea – only an void without any decent mountains.

For me, the water is everything.  Every minute spent on dry land should be in preparation for getting back in.  And nothing with engines and noise either.    To that end, and in no particular order we have:

  • Kayaking
  • Sailing
  • Scuba diving
  • everything else (swimming – too much like real work, snorkeling and boogie-boarding).  Surfing (and wind-surfing) should be on the list too, but these require some skill.  Oh well….

True, there are plenty of other worthwhile things to do here – but these could be done anywhere.  Leave the dry stuff for the poor souls who can’t get to the sea.

Posted in Water Sports.


WordPress – jumping through the hoops

Still new at all this blogging lark and some things seem more intuative than others.  Right now, I’ve been dealing with WordPress – the engine that drives this blog.  OK, the thing is, my first post generated a congrats comment from a friend, who pointed out the need to install “Askimet” to protect myself from comment-spam.  (Comment-spam – something I’ve never even thought of before, but I now know it has to be resisted like nothing else!).

So, how to install this beauty then…   First off, I logged into the blog page (this one) and picked the admin link – way easier than trying to remember the URL – whatever that was.  Suprisingly, it didn’t ask for a password. Maybe one of the dozen or so password caches are doing their magic for me, which is great while they work – then one day I will be asked for a password and I’ll have no idea which one I used.

(Side note – what’s up with all these passwords.  Every site seems to have a different set of rules about what constitutes an acceptable password.  Some demand one or more “special characters” while others refuse them.  Aghhhhhhhhh!)

Nevertheless (good word – that), my local WordPress admin screen pops up and Voila – there among the suggested plug-ins is the formentioned Askimet.  Click-click and the install is done – but wait.  Now it says it needs my WordPress API code to enable it.  What???  OK then, I run off to the www.wordpress.com where I’m invited to create a log-in (another damn login) with yet another set of password rules (I don’t get it – the page says my everyday password is strong – yet apparently not strong enough for the form).  Time to call out a more secure password – one I keep in reserve for more sensitive things, like ordering things).  All goes well and it says “wait for a verification email” to continue.  Well, at least one good thing resulted from this change of web host – my  email is lightning-fast – at least compared with my previous host where incoming mail regularly took 30 minutes to an hour to show up.  Goodness knows what they were doing all that time.  Even internal mail like resetting the control panel password (yes – I forget these things so easily) which sends email to me ON THE SAME SERVER! – takes a good 30 minues. sigh.  That’s all in the past now :)

OK, so mail received and – click – verified.  Logging back into my wordpress.com account and clicking on the profile side-link showed the new API-key.  Hooray.  a quick copy and past into the still-waiting Askinet activation dialog on my own wordpress site and everything seems happy.  I’m at last protected from something I didn’t even know was a threat.

Now to check out craigslist and dream about sailboats etc…

Posted in web hosting.


My first entry…

This is my first post – I don’t expect too much just yet, but hang in there.  Things can only get better.

I just signed up for a new web-hosting package through http://justhost.com and it seems to very straightforward.   I picked this web hosting site based on a number of factors, most importantly the unlimited settings (storage, bandwidth, databases, domains etc.) and of course, the price.  At $3.95 a month for a 2 year commitment, with free domain registration thrown-in – this is pretty hard to beat.

One thing bugged me though – as soon as my credit card info was entered and submitted – they display a page of “upgrades” – things like SSH (unix shell access) and statistics packages – which I was convinced were already included.  So much for the “no hidden charges” claim.

Nevertheless, here am I trying to figure out how to use the web-based control panel and file manager do what I need.  It seems pretty straightforward but rather clunky and slow – shell access would have been much easier.

I’m setting this blog up using WordPress which was a matter of 3 or 4 clicks thanks to “Fantastico” – the install script manager.  I only had to delete the original index.php due to a naming conflict.  Three minutes after submitting my credit card and here I am – publishing away like a pro!

Oh, one more thing.  I chose to move my old domain from another web host rather than create a new domain.  So far, I just used the original registrar’s management console to re-point the name servers to the servers used by JustHost.com.  Despite the warning that this might take 72 hours to propagate through the worlds network of DNS servers – it seems to work immediately.  The first refresh of my old web page brought me over to the new site.  Now I have to figure out how to retrieve the old content – I wish I’d thought of that before pressing the button…

Posted in web hosting.