Fixing the Mac Messages Program When it Can’t Login

A while back, I noticed something strange — I couldn’t log into the Messages program on my Mac Mini.  The Messages program interacts with iMessage, which means you can use it to send (essentially) text messages to any iPhone or iPad.  It’s great when communicating with people who are using iPhones because you have the full computer keyboard and display to use instead of an iDevice’s more limited capabilities.

But all of a sudden a while back, when I tried to log into Messages, it just spun and spun and spun but never got anywhere — just on the Mac Mini.  On my MacBook Air, it still worked perfectly fine.  I tried all the various solutions I found on the net — deleting various files and directories, logging in and out of accounts, etc.  But nothing worked … until … well, a story first.

Continue reading

What I want from the next generation of iOS …

Business Insider has an article detailing what their expert wants from the next generation of iOS.  Were I to summarize it, I would paraphrase Henry Ford: they want faster horses.

But that’s not what I want.  And it’s not what they should want, either.  Instead, here’s what everyone should want: they should want the ability build and deploy native applications that are written in HTML 5 + JavaScript.

Allow me to explain …

Right now, the only way to write a “native” iOS application is using a language called Objective-C.  Unfortunately, nobody else uses Objective-C but Apple.  It’s not a bad language, but it is quirky and, without Apple’s sponsorship, I’m pretty sure it would be dead now.  As a result, developers tend to become very specialized in iOS programming as they master and stay abreast of iOS quirks.  It’s a lot like the Catholic church and latin: there’s a lot of people who “speak” latin only because it’s the language of the church.  Other than knowing the root meaning of a few scientific terms or legal phrases, Latin doesn’t get a lot of play anymore.

You can build iOS applications using other languages, but they’re not native.  What does that mean?  It means that these applications do not have direct access to all of the neat features of the iPhone.

As a result,  if you want to build and deploy an application on the iPhone that uses HTML + JavaScript (which is a quirky language, to be fair, but also very popular now) you have to use an Objective-C “wrapper” around it (PhoneGap is one such popular wrapper).  The wrapper is responsible for talking to iOS and serving as an intermediary between the JavaScript and the iOS operating system.  It works, and it’s popular, but it’s painful and incomplete.  The JavaScript code relies on the wrapper to provide access to anything it needs, and if it is missing something the developer has to augment it by writing code in … Objective-C.

But if Apple embraced HTML + JavaScript and allowed people to write applications natively in those languages, it would dramatically increase the number of people who build applications, increase the number of applications built, and make building applications for iOS easier than building them for any other device on the market.

That would be good for Apple, good for developers, and good for iPhone owners.  Android would be left behind and look backwards.  The impact of this on the developer community would be immense and positive.

That’s what I want.

Quick update on Raspberry Pi as application server

A brief status update to my earlier post about running a Raspberry Pi server:

It’s rock steady running MySQL and a custom Java app (that generates Twitter statistics).  The CPU does get pinned to 100% at times, but since it’s keeping up with the Twitter data I’m collecting  just fine that’s not really an issue for me.

The last time I rebooted it was when I changed the amount of memory available to the GPU: since I’m running headless, I only need enough for the character mode console for emergencies.

Here’s a view of the system in operation from “top”:

Click to enlarge

Click to enlarge

Funny that the Java app is talking up so much more of the computer’s  CPU than MySQL.  I think I have some optimization to perform in my code 🙁

Using a Raspberry Pi as a Server

I have an old iMac sitting under my desk, and today’s the first day it’s been turned off in ages.  Until today, I was using it as an application server: it was running a MySQL database and a custom Java application that does Twitter data collection.  But this morning, I moved the last of those tasks to a $35 computer, the Raspberry Pi:

Photo courtesy of Daniel Mietchen, Wikimedia Commons

Photo courtesy of Daniel Mietchen, Wikimedia Commons

The old iMac was a G4 processor — the next to the last of the non-Intel CPUs Apple used.  Because of that, it is stuck on older versions of software: OSX 10.5 (Leopard), a MySQL version from years ago, and a somewhat quirky version of Java.  But it did its job well, and just ran without issue.  Uptime said the last time it was rebooted was over 160 days ago (probably as the result of a software upgrade or mid-summer extended power outage).

So moving to a new server was a bit of a risk — don’t fix what’s not broken.  But the advantages of the Pi were enormous:

  • Size: Having an iMac under your desk is a little junky. My wife asked “can’t you just buy another Mac Mini instead?” (And I did consider that).
  • Modern software: Being able to get current versions of an operating system, database, and Java are reassuring.
  • Power consumption: The iMac pulls on the order of 100 watts.  The Pi, with its external hub and disk drive, probably more like 7.  As we head back into Hurricane Season here in Florida, the lower power profile means that the computer can run a lot longer on battery back-up UPS; it’s not uncommon to get power outages of a half hour during bad thunderstorms.
  • Geek Factor: Using an ARM server is dipping my toes into a platform of the future.

There were a few concerns about limitations:

  • The processor in the ARM is clocked slower than the G4 and is probably not as powerful overall.  
  • The Pi has 512mb of memory while the iMac has 1gb.
  • The boot disk drive of the Pi is an SD card (which tops out at 32gb), and since my database is now over 30gb that means I had to attach an external USB drive to the computer.  USB drives are not the fastest.
  • It doesn’t have native WiFi.  Right now it’s running on a cable connection to the router, so it doesn’t have as much freedom to be moved around as the iMac.  But it’s also so small that sticking it near the router isn’t a big deal.

So how’s it doing?

As far as the memory concern, the Pi is only using about half of its memory to support the Java app and the database (until I expand the buffers in the database to sop up the extra memory, of course). Performance is good enough — it keeps up with the Twitter feeds I’m collecting, so there’s no problem there.  It sits idle much of the time, so I know it’s not struggling to keep up.  All in all, it seems like the performance and capabilities are on a par with the “Micro” virtual server that Amazon charges you $17 a month.

What’s the full configuration?

  • A Raspberry Pi+Case, ordered from Sparkfun for $52 with shipping
  • A four port USB 2 hub I had lying around my junk drawer.
  • A 100gb USB backup disk that was also in the junk drawer
  • A USB power supply with the appropriate connector for the Pi … that was in a junk drawer.  I have a lot of electronics junk.
  • An 8gb SD card I stole from a video camera

So probably the full costs of this, if I had to buy all the pieces new, would have been more in the range of $100 — the $35 computer is still a bit of a “stone soup” kind of thing.  But for $100 for a full functional Linux server that would fit into a Kleenex box, I am impressed!

Recommendations?

If you’re looking for an “under the desktop” server, these seem like a great way to go for a lightweight project.  You have to be comfortable with Linux system administration — very comfortable — but if you are (or feel like now’s the time to learn) it’s a good option for at home or skunk works projects.