The
Ultimate
Business Machine

Technology, business
and innovation.

And, not least, about
the Mac.

Weblog Archive Cutedge

by: Bernard Teo








Creative Commons License

Copyright © 2003-2012
Bernard Teo
Some Rights Reserved.

Sat 12 Aug 2006

Luca 2.2 with MySQL

Category : Technology/Luca2dot2MySQL.txt

I've released Luca 2.2 with support for storing the accounting data in a MySQL database. I've also written the import/export code to shuttle the data between SQLite and MySQL, and back.

I realised then that I've got the basis of the code to do a "universal" SQL data converter, to shuttle data between any kind of SQL database. If I have time, I'll take a look at PostgreSQL or Oracle. (Now, look how richly endowed we all are on the Mac. Who would have thought?)

Luca is getting more stable now and working faster. There are probably a few more bugs lurking inside the system but I thought I'd better get this out as it's quite usable now, and I've made some improvements to the workflow and made several bug fixes. I hope that by the next release, I can be sure that Luca will be thoroughly reliable.

I'm going to stress-test this release next. I've already seen where it's still breaking. But I've worked hard to get to this point and release it because I want this idea to take hold in people's minds - that you can really do a lot on the Mac.

With this release, people who want to integrate an accounting system to the rest of the custom, say, PHP-based workflow that they've built can now do it. The database is open and you can flow your data onto it or get data out of it in ways that I cannot even anticipate now.

And you can get at your accounting data even when you're half-way round the world. I've yet to put in the concurrency-handling code. But we've done this years ago while it was still a 4th Dimension-cum-Oracle-based system (though that would never have worked outside a local area network) and so I know we can do it.

I'll get to the point one day when all these things - MailServe, WebMon, DNS Enabler, Luca, etc - will all come together and make sense as one seamless whole. I have an idea what that is but I can't yet explain, even to myself, what that means. I'm learning as I go.

They say (actually it was Steve Jobs) that you shouldn't start a company just because you want to start a company. You start a company because nobody else believed in an idea and the only way you can get it out of your system (and keep from going crazy) is to go out and build it on your own.

Posted at 4:15AM UTC | permalink

Wed 09 Aug 2006

DNS Enabler 2.1

Category : Technology/DNSEnabler2dot1.txt

I've released DNS Enabler 2.1.

It includes a Bonjour panel to allow DNS Enabler to be used as a configurator to enable wide-area discovery of Bonjour devices :

More information about the types of Bonjour services you can currently configure, and what you need to enter into the individual columns in the Bonjour panel, can be found at : http://www.dns-sd.org/ServiceTypes.html (DNS SRV (RFC 2782) Service Types).

What DNS Enabler saves the user is the need to know the specific syntax to set up SRV and TXT records at the DNS server. All he needs to know is the Bonjour service type, e.g., _http._tcp for publicising web pages (that may be served even from local private networks - you can use the Port number field to publicise a different port other than 80 and port-map that incoming request to a specific local machine) and the domain that will serve that request. The service name is a label that will show up in the Bonjour menu in, say, Safari. And the TXT column contains the path to that specific web page. (The TXT column stores different things for different services. See the cited Bonjour reference).

Stuart Cheshire may be showing this panel at work sometime in his Bonjour talk at WWDC on Thursday, 10th August, at 9.00 am (PST).

PS : I've also added a button to populate the Forwarders field with the list of DNS servers that the user has set up in his Network Preferences. I've left the interface somewhat cluttered at the moment because I'm planning to add a couple more features in the next two weeks, and I'll clean up the interface then.

Posted at 6:28AM UTC | permalink

Sun 30 Jul 2006

Upcoming Updates

Category : Technology/NewUpdatesEndJuly.txt

I'm working on a couple of things. I'll be releasing a version of Luca Accounting soon that will work with MySQL. I just need to write the script that will allow the initial built-in SQLite data to be exported to MySQL.

If there's anybody who can't wait and want to try this out now, just let me know. It's still missing the concurrency handling that is needed for multi-user access (that's the next step), but this is going to make it possible for anyone to access his accounting data from anywhere in the world (if he so chooses), as well as make the database open to all sorts of custom integration.

The second thing I'm working on is this :

This is experimental. It's an extension to DNS Enabler that will allow the user to configure the DNS server so that it'll also broadcast Bonjour services (that the user has happened to have set up) so that they can be discovered, browsed, and accessed from the wide-area network (rather than on just the local network).

I may also add a couple more new features to the next DNS Enabler release that people have asked for (e.g., the ability to set the DNS server so that it doesn't do recursive lookups, and the ability to restrict the range of IP addresses that you allow lookups to be made from).

So, lots of things to do.

Posted at 5:06AM UTC | permalink

Thu 20 Jul 2006

Working around Workaround Bonjour

Category : Technology/WorkingAroundWorkaround.txt

I've updated both DNS Enabler (to 2.0.9) and MailServe (to 2.1.6) to handle the bug introduced by the OS X 10.4.7 update (that "Workaround Bonjour" thing) whereby the system would stall for about 60 seconds whenever a call is made to /bin/launchctl to start a launchdaemon (like BIND, Fetchmail, etc).

I've changed DNS Enabler so that the Restart DNS button avoids calling launchctl, so that the only time you actually see the stall is when you first start the DNS service (be patient - it'll clear - and the DNS Server will still work correctly), and not when you stop the service, and especially not when you restart the service to make changes to your DNS data, which is pretty much what we do most of the time.

I've done the same to the Restart Fetchmail button in MailServe, so that you don't get held up when you need to change Fetchmail parameters.

It's important to note that this happens only on 10.4.7, and that the DNS and Fetchmail services (as well as Postfix, POP, IMAP, etc, i.e, anything started or enabled using launchctl) are all still launched correctly.

Up to now, I've ascertained that this stall only happens when an application makes a call to the "/bin/launchctl load" comamnd (well, sometimes on launchctl unload, depending on the sequence of the calls you make). I believe this is probably an unfortunate side effect of the security-related changes Apple made to patch up the launchdaemon mechanism (launchd) in the 10.4.7 update.

I've just installed a second broadband line to my home so that I can now do all the testing that I had wished I could do without interrupting service on my live server. I happened to use DNSUpdate and also Lingon just now and both of them stalled. Looked up the Console - and it's our friend, Workaround Bonjour. When is Apple going to fix this?

As another aside - as I was posting this on the live server (from this second broadband line), I noticed that things had suddenly become rather sluggish on the live server. Guess what? - it's all the people coming over, via MacUpdate and Version Tracker, for DNS Enabler. So that's how my server feels like from outside. You never know when you're inside your own network.

Posted at 3:56PM UTC | permalink

Sun 16 Jul 2006

MailServe 2.1.5 Update

Category : Technology/MailServe2dot1dot5.txt

I've updated MailServe to 2.1.5, to make improvements to the way MailServe triggers Fetchmail.

It was while working on Fetchmail that I realised Apple broke launchctl on 10.4.7, probably as a side effect of the security changes they were making to launchd.

I've added a way to specify a global value for the Polling Interval (default 60 seconds) and the Time-out Interval (default 45 seconds but can be set to 0 for no time-out).

Also the quotes around the * in the .fetchmailrc file (when Fetchmail is used in multi-drop mode) interfered with the multi-drop operations. This has been corrected in this release. (Thanks to Fergus McMenemie for showing me there was a problem.)

The French localisation for MailServe has been updated by Joselyne Rochaud and Corentin Cras-Méneur, who also took the opportunity to update the French localisations for DNS Enabler, WebMon and Postfix Enabler.
Thanks, Josy and Corentin.

Posted at 6:38AM UTC | permalink

Fri 14 Jul 2006

Bonjour Mystery Update

Category : Technology/BonjourMysteryUpdate.txt

I ended my last post with "I'm starting to hate this thing called Bonjour". Actually, I don't - hate Bonjour, that is.

I've watched Stuart Cheshire's demo of Bonjour on Google Video a couple of months ago, and I've been looking forward to seeing if I can extend DNS Enabler to aid wide-area browsing/discovery of Bonjour services.

I'm planning to update DNS Enabler, WebMon and MailServe, all in the latter part of the year, as soon as I can get a Luca Accounting version released that works with MySQL rather than just SQLite. I'm getting quite close to it.

For more on Bonjour, see this, this, and this. So, I do think Bonjour's good and I'm just being ironical when I say I'm starting to hate it. But what I do hate is that Workaround Error and the hanging that accompanies it.

Stuart Cheshire tells me that the error has nothing to do with Bonjour, which is reasonable considering that you get the error even when you disable Bonjour. "The person who wrote the code that logs that message thought the problem it's reporting might be something related to Bonjour, but it's not." So, Bonjour gets a bad rep and I'm sorry I added to it.

But we're not anywhere nearer finding an answer to the mystery. I hope Apple hurries up and solves it. I'm seeing a lot of people hitting these pages from Google, searching for Bonjour+Workaround, and not just from MacFixIt (who's just linked to it). So, from just a trickle a week ago, there are now a lot of people wondering how this came to insinuate itself into our systems since 10.4.7.

It's an Apple bug and I've given up thinking there's anything I can do about it. Since DNS Enabler, MailServe and Postfix Enabler continue to work, though a bit hobbled on 10.4.7 and only on 10.4.7, I'm going back to working on Luca.

Posted at 1:58PM UTC | permalink

Tue 04 Jul 2006

Bonjour Mystery

Category : Technology/BonjourMystery.txt

The 10.4.7 "launchctl load / Bonjour Workaround Error" mystery deepens. I've been searching for an answer for hours. Nothing turns up from a Google search and I wonder who else is affected by it.

Launchctl is used to turn or off the network-related daemons, like Bind, Fetchmail, Postfix, POP, IMAP, and even the Bonjour (previously known as Rendezvous) service itself.

I've turned off Bonjour (not that I want to, because it's built so closely into the fabric of Mac OS X, e.g., BBedit crashed as soon as I turned off Bonjour), to see if it'll stop the workaround error from occuring. But no change, it still does.

Even reloading Bonjour will throw up the "Workaround Bonjour: Unknown Error" as shown below :

So, in 10.4.7, Workaround Bonjour occurs every time a call to /bin/launchctl is made, no matter which services are launched. And it affects both PPC and Intel Macs updated to 10.4.7.

The thing is, the launchctl command actually succeeds and completes. But it'll be followed by the Workaround Bonjour command(?) which executes and then just hangs there. Where did that come from? That's the big question.

From the point of view of a user using DNS Enabler, or trying to enable Postfix, IMAP, POP or Fetchmail (as opposed to just restarting Postfix, POP or IMAP), he'll see the progress indicator spin for a long time, until the application decides to time out and return control to the user.

Actually all the services have completed successfully - if the user has the patience to wait for a minute or so - and all the Postfix, DNS, POP, IMAP, Fetchmail services would have been set up correctly, even before the Bonjour Workaround Error hang-up occur.

But watching the progress indicator spin for a minute or so, I'm sure the user would (reasonably) feel that something has gone wrong. Wait is what the user should do, because the Bonjour Workaround would eventually time out.

Remember this only came with 10.4.7. And the services, once enabled, will work correctly as usual, even across reboots. It's just that the "enabling" process will seem to take longer (when it used to take a mere few seconds).

So, don't be in a hurry to update your server. Wait for things to be fixed.

Conversely, that's why I do the updates as soon as they appear - it's better that I know before I'm swamped with mail from the users. The search continues. I'm starting to hate this thing called Bonjour.

As an aside, I'm learning to appreciate how having a weblog helps in a situation like this. It's a low-overhead communications tool, to keep the communications channel open, for when the time is better spent searching for solutions. I say this because I've often wondered what a weblog is worth - surely it's not meant to be a diary because who cares what I think or do? - surely there's got to be a more potent use.

Posted at 8:33AM UTC | permalink

Mon 03 Jul 2006

Bonjour Error in 10.4.7

Category : Technology/BonjourError.txt

This snippet from my Terminal session shows when the Bonjour error occurs, when I try to restart Fetchmail :

The problem is at the "launchctl" line, which launches the Fetchmail launchdaemon (which is also used to launch the BIND launchdaemon and that's why DNS Enabler is also affected).

The launchctl command executes and returns quickly, as it is expected to, but after that we get the "Workaround Bonjour: Unknown error: 0" line, which hangs indefinitely until both MailServe and Enabler give up and return control to the user. In both cases, Fetchmail and DNS services are launched correctly, but the user thinks that the system hangs because the progress indicator spins for a very long time before control is returned to the user.

So the question is : why did this Bonjour thing appear in 10.4.7 and how do we get rid of it?

Posted at 8:03AM UTC | permalink

Fetchmail and 10.4.7 Problem

Category : Technology/MailServeBonjourError.txt

I'm seeing a problem that has been introduced with the OS X 10.4.7 update that affects Fetchmail. I get a "Workaround Bonjour: Unknown error: 0" when I try to restart Fetchmail.

From the MailServe interface, if you try to Restart Fechmail, you will see the progress indicator spinning for a long tme before it stops. If you look into the Console log, you'll see that Bonjour-related error, though how Bonjour got into the picture is beyond me at this point. This affects both PowerPC and Intel Macs.

I'm going to trace through this and hope I find a solution.

I've just realised that this Bonjour error affects DNS Enabler, too, when I try to restart the BIND server.

Posted at 7:12AM UTC | permalink

Fri 30 Jun 2006

Google Checkout vs PayPal

Category : Commentary/GoogleCheckout.txt

I've been waiting for this for some time. Google Checkout has just been launched. It's good to have an alternative to PayPal, at last. Here's a link to the Developer's Guide.

Oops, but I can't use it yet until they make this available internationally. Probably a matter of time.

Posted at 1:58PM UTC | permalink

Thu 29 Jun 2006

Mac OS X 10.4.7

Category : Technology/10dot4dot7Problem.txt

I updated my Intel iMac and my iBook to 10.4.7 with no problems, via Software Update. But when I upgraded my server, a PPC-based Mac Mini, the installation aborted half-way, leaving me with a Finder that looked like this when the Mac Mini restarted :

Yikes! I downloaded the Combo updater and did the upgrade again this afternoon when things were relatively quiet. This time, though, all went well.

All the mail server, DNS, PHP, and MySQL stuff still work. So I think it's OK to upgrade, in case you're wondering.

Posted at 2:02PM UTC | permalink

Thu 22 Jun 2006

The Luca Class Model - and what it means

Category : Technology/LucaClassModel.txt

I generated this class model diagram from within Xcode. It shows a portion of the Luca class hierarchy. I was going to draw this manually when I remembered that Xcode has this feature - so, with just one click, it's done :

We've ported Luca, from its beginning as a 4th Dimension (4D)-based application, through PHP, Java, Java-Cocoa, and now to Objective-C, all the while using it to learn about the capabilities of each language.

While MailServe and DNS Enabler were technically difficult because of the need to know enough Unix, these were single-window applications, after all.

Luca is a better example of a real-world business application. It gives us a chance to see how well an object-oriented language like Objective-C performs when we use it to model real-world business processes.

The point is, you can use an object-oriented language like Java or Objective-C without using any of its object-oriented features. Until Luca version 2.1 (that we've just released), Luca was a straight port from its 4D days, and its code was largely procedural, except where we make the Cocoa calls.

Luca 2.1 was where we try to take advantage of the underlying object-oriented language. For example, we recognise that a Balance Sheet or Profit/Loss report is a special case of a Trial Balance report, and we factored the code so that we make one a sub-class of the other.

What we've found, from re-organising the code this way, was that we can cut down the total number of lines of code in the project by half, through elimininating a lot of repetitive code (by making specialised code inherit the behaviour of more general-purpose code).

What this says is that people can, and do, teach the use of Java, etc, in colleges and universities, without exploiting its power as a modelling tool. And even when they do, they miss the point, for want of good examples. How many polytechnics or universities teach the Mac as an example of good object-oriented design? Yet I know, for sure, that we had actually learnt a lot about how to build our own classes from observing how well the Cocoa classes work. The Mac has been largely ignored in the IT (as opposed to art/design) curriculum and the IT industry everywhere remains all the poorer, in terms of imagination, for it.

In art and architecture, there had been the Bauhaus school and Frank Lloyd Wright's Taliesin. In the use of computers, we can do something similar to create a new kind school that combines both art and technology, with a wide reading of the humanities, to build systems that humans would find a joy to use. For example, right now Luca's got a basic utilitarian interface, but I'd like to, some day, build it so it looks as appealing as some of these Dashboard widgets, and yet work as sleek, quickly and accurately as possible.

The second point I'd like to make, through the Luca example, is that IT is a very hard activity to manage. How would a mere "human resource" manager know that the number of lines of code that a programmer writes is a very tricky indicator of programmer productivity and ability?

"The best code is the code you don't have to write", so says Steve Jobs famously while introducing (what became) Cocoa to the Mac world, because each code we write introduces a possibility for error. The best programmer will use the least number of lines of code to do the most number of things, without sacrificing readability or maintainability of the code. Lines of code get whittled away by the quality of the thought.

But which manager, weighing the lines of code each programmer produces, will be able to tell the good guy from the bad?

There was a story a few weeks back about the Singapore Stock Exchange ditching its new system after spending $2 million on its development. The report mentioned how the developer responsible for it, an Indian company, had somewhat dubious credentials since it only had 250 programmers, unlike the one that replaced it which presumably has thousands. I'd never get any of these jobs because I'd want to do it with 5 good guys if 10 is humanly possible.

Posted at 6:54AM UTC | permalink

Read more ...

Mac@Work
Put your Mac to Work

Sivasothi.com? Now how would you do something like that?

Weblogs. Download and start a weblog of your own.

A Mac Business Toolbox
A survey of the possibilities

A Business Scenario
How we could use Macs in businesses

VPN Enabler for Mavericks

MailServe for Mavericks

DNS Enabler for Mavericks

DNS Agent for Mavericks

WebMon for Mavericks

Luca for Mavericks

Liya for Mountain Lion & Mavericks

Postfix Enabler for Tiger and Panther

Sendmail Enabler for Jaguar

Services running on this server, a Mac Mini running Mac OS X 10.9.2 Mavericks:

  • Apache 2 Web Server
  • Postfix Mail Server
  • Dovecot IMAP Server
  • Fetchmail
  • SpamBayes Spam Filter
  • Procmail
  • BIND DNS Server
  • DNS Agent
  • WebDAV Server
  • VPN Server
  • PHP-based weblog
  • MySQL database
  • PostgreSQL database

all set up using MailServe, WebMon, DNS Enabler, DNS Agent, VPN Enabler, Liya and our SQL installers, all on Mavericks.