Over 915 million ways to combine just 6 LEGO bricks

It’s been a while since I’ve posted anything about my favourite toy, LEGO, so I thought I’d correct that with a crazy LEGO fact that stuck in my mind this weekend while watching National Geographic’s special MegaFactories: LEGO. So here it is:

The number of unique ways you can combine 6 classic (2×4 stud) LEGO bricks of the same colour is an incredible 915,103,765

That’s over 915 million different ways! So, if like me, you had to find out how they came up with this number, there’s a great story behind it here, along with some great numbers regarding combining of larger numbers of bricks.

Other great facts from this same programme were:

  • Over 50% of LEGO’s entire annual sales take place in the 2 months before Christmas each year
  • The LEGO factory in Billund, Denmark is technically the largest manufacturer of tyres in the world (great table quiz question!)
  • Worldwide, 7 LEGO products are sold every second

Calling all Web Developers, check out FeedHenry

If you’re a web developer and would like to get on board the mobile app train, then you should check out FeedHenry.

Our cloud-based developer studio allows you to develop apps using familiar web technologies like HTML, CSS and JavaScript and then build versions of those apps for iPhone, iPad, Android, BlackBerry, Windows Phone 7 and Nokia WRT, all from the same code base. Registration is completely free.

Each app can also execute part of its business logic in our cloud. This allows you can change the key functionality of the app without having to push (time consuming and costly) updates to the app stores. It also means that you don’t need to provision any extra infrastructure to scale your apps to millions of users.

There’s a whole bunch of other stuff it does too so if you’d like to know more, head on over to http://www.feedhenry.com

You might also like to take a peek at http://www.aerlingus.com/help/aerlingusmobile – all built on the FeedHenry platform!

HOWTO: Flush DNS cache on Mac OS X

Had some strange behaviour with DNS on Mac OS X earlier today. Made a change inside DNS and waited the required amount of time for the TTLs to expire. Then verified that the new IP address was resolving (using both dig and nslookup).

However, my system was still trying to use the old IP address when I tried a simple ssh or telnet command.

In the end, I discovered how to flush my local DNS cache, which fixed the problem. You can do this as follows:

$ dscacheutil -flushcache

OmniGraffle’s stencil library at Graffletopia.com

I reluctantly bought a copy of OmniGraffle for Mac some weeks back, purely to do some updates to diagrams originally created with Visio on Windows (which is not available for Mac). At first, I thought the selection pre-made images (stencils to use their technology) was quite poor and very much lacking from those available for Visio. However, that was before I discovered Graffletopia.

Nice, very nice!

Google Apps free account limit being reduced

If you’ve been considering moving your domain to Google Apps, and you are likely to need more than 10 accounts, you might want to consider moving before 10 May 2011 as they are tightening the rules on the maximum number of user accounts you can have on the free account from that date.

Here’s the official announcement I received from Google earlier today:

We recently announced upcoming changes to the maximum number of users for Google Apps. We want to let you know that, as a current customer, the changes will not affect you.

As of May 10, any organization that signs up for a new account will be required to use the paid Google Apps for Business product in order to create more than 10 users. We honor our commitment to all existing customers and will allow you to add more than 10 users to your account for xxxxx.com at no additional charge, based on the limit in place when you joined us.

Still though, a 10 user limit is probably good enough for most personal uses and to be fair, $50 per user per year, it’s still very good value for money.

HOWTO: Show a summary of data used by all MySQL tables

Here is a useful MySQL command that shows (an approximation of) the amount of storage (disk and memory) consumed by each table in a MySQL database.

SELECT
 TABLE_NAME,
 TABLE_ROWS,
 DATA_LENGTH / (1024*1024),
 INDEX_LENGTH / (1024*1024),
 (DATA_LENGTH + INDEX_LENGTH) / (1024*1024) as total
FROM
 information_schema.TABLES
WHERE
 TABLE_SCHEMA = (SELECT DATABASE())
GROUP BY
 TABLE_NAME
ORDER BY
 total;

Please bear in mind that the data returned will be an approximation, but should still show you a reasonable enough split which of your tables are consuming most of the resources.

Recovering an Amazon instance with a corrupted SSH configuration

One of our test Amazon EC2 instances decided to go for a holiday last week (reason still under investigation), and as part of the attempted recovery process we tried the eventual obligatory “system reboot”. Unfortunately, this failed to fix the problem, and we then also discovered that an unsupported setting previously added to the OpenSSH configuration (/etc/ssh/sshd_config) actually prevented the SSH daemon from starting at all (we found this out from “View System Log” option in the AWS Management Console).

In any case, as you may know, SSH is pretty much the only way to gain administrative access to an Amazon instance (there is no Unix/Serial console or Remote Desktop to speak of), so if you mess up your SSH configuration, you really are in big trouble!

Actually, that’s not entirely true. As it happens, if your instance is EBS-backed (i.e. uses an EBS volume for its root/system partition), you can actually detach the root partition from the broken instance, attach and mount it on another running instance, fix the erroneous configuration setting, re-attach to the broken instance, and reboot again. Voila, Problem solved!

This is all very reminiscent of that call from a family member saying their computer won’t boot any more, whereupon you remove their hard disk and insert it as a second drive in your own PC in order to get a copy of all the files they invariably haven’t backed up.

For the record we found the solution on the Amazon Forums, and also uncovered another useful command in the process:

sshd -t

Very much like the “apachectl -t” command, this will syntax-check your SSH configuration files for you. You should run this command every time you make a change to your SSH configuration settings.