Top 10 Disappointing Technologies

Australian online magazine PC Authority have published a list of the top 10 most disappointing technologies that never changed the world. The list (in brief below) has many that I’m familiar with but some that I am not and I’d go along with much of the reasoning behind it.

10. Virtual Reality
9. Alternative search engines
8. Voice recognition
7. Apple Lisa
6. 10GB Ethernet
5. FireWire
4. Bluetooth
3. Itanium
2. Zune
1. Windows Vista

They even gave an honourable mention to Biometrics and Ubuntu, with the latter being somewhat contentious. That said, I have agree that while Ubuntu has come on a long, long way, it’s still not quite there in terms of mainstream desktop/laptop use.

Variable manipulation from within a Bash subshell

Consider a shell script that counts the number of lines in a file. There are a number of ways to do this and I initially chose the following method:

NUMLINES=0
cat /tmp/file.txt | while read LINE;
do
NUMLINES=`expr $NUMLINES + 1`
done
echo "Number of lines was $NUMLINES"

However, using this approach the value of NUMLINES was always zero after the while loop has ended, even though when I printed out its value inside the while loop it appeared to be incrementing just fine.

The problem turned out to be the use of the pipe at the beginning of the the while loop. This causes a new sub-shell to be created, which in turn creates a new local version of the NUMLINES. Thus, the original copy of the NUMLINES variable (outside the while loop) is never actually changed. Here is one solution to this that eliminates the use of the pipe (i.e. replace the piping of the file in the while with a redirection from the file at the end of the while statement):

NUMLINES=0
while read LINE;
do
NUMLINES=`expr $NUMLINES + 1`
done < /tmp/file.txt
echo "Number of lines was $NUMLINES"

This worked for me!

Triskit Project

Triskit is a fascinating project that takes the form of a self-generating toy system. If you own (or have access to) a mini laser cutter or acrylic sheet stock then you can use the Triskit software to design pieces for your very own toy system (called a Triskit). You can use the data that is produced by the software as input data for your laser cutter and the result is your very own, custom-made toy part.

Sample Triskit

One of the benefits of this is that, if you are trying to build a toy and find that you don’t have a particular part that does what you need, you can just make one to suit your needs. With the likes of LEGO and K’nex, you are limited to what pieces came in the original box.

World’s Longest Domain Name

On a recent visit to Wales, Joe Cashin took a great photograph of a Volvo Car Sales showroom in the town with the longest name in Britain

Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch

Whilst I had heard of this town before, I did not realise that it holds the record for the longest Internet domain name in the world, which is:

http://www.llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogochuchaf.co.uk

Upon visiting this site I learned that the longest domain name supported by the Internet (excluding the suffix) is 63 characters and amazingly the above domain name has exactly this many letters. However, if you look closely you will see that the domain name above actually contains and additional 5 letters (uchaf). This is because the domain represents the upper/older part of the village and “uchaf” is the Welsh for “higher” or “upper”.

It’s just a shame that they didn’t put a little more effort into the website.

IPv6 Here We Come

The IPv6 debate has been rolling on now for several years with no definitive end in sight. However, for my money, the addition of several IPv6 addresses to a number of the root DNS servers earlier this week is another significant step in the right direction for IPv6.

For those of you fortunate enough not to be involved in the debate, this report by the BBC Technology website includes a simple (and brief) overview of what IPv6 is and why it is required. It’s well worth 2 minutes of your time if you have a passing interest in computing or technology generally.

Source: SlashDot

75 million lose their Internet connection

The Guardian have posted a good summary of the circumstances surrounding the loss of Internet connectivity in the Middle East and India last week. Apparently, the best part of 75 million users were affected, all because of a ship’s attempt to moor off the coast of Egypt in bad weather.

More interestingly, they also posted a link to a map entitled The Internet’s Undersea World (by Telegeography.com) that illustrates the mass of undersea submarine cables that deliver the global connectivity enjoyed by the millions of us oblivious Internet users every day. The speeds of some of those cables are just phenomenal!

Source: The Guardian

To script or not to script

In an interesting article on the merits (or not) of scripting languages, James Turner outlines where some of their strengths and weaknesses lie. He uses Perl as the example in this instance but on reading the article I found that many of the pros and cons readily apply to most other scripting languages I’ve used (Tcl, Python, Bash, Sh).

In particular, his comments about them being strong on cross-platform support and weak on performance-related applications definitely ring true from my past experiences with Tcl/Tk. However, one point that he did not make, which I feel is definitely one of scripting languages’ stronger points, is in the area of custom testing and debugging, in the context of prototype product design and integration.

The likes of Perl, Python and/or Tcl really can enable you to glue together some pretty compelling, custom-made testing utilities, often without the need for complicated frameworks or other plugins. In particular, the ability to create your own extensions (using C or even SWIG) can make for some pretty powerful, tailor-made manufacturing test tools (trust me, I’ve been there!).

Of course this may not suit everyone’s needs, and there will be those that will opt for off-the-shelf products that do similar. However, if you are dealing with a newly designed product or hardware appliance featuring custom firmware not seen before, that needs to run on several different platforms, then a decent scripting language will most definitely be your friend.

Source: CIO.com

Syslog connections rejected using Syslog-NG on Solaris

The Problem

After an upgrade from Syslog-NG version 1.6.7 to version 2.0.5, our syslog server began reporting the following error each time an event was received from a remote host:

Syslog connection rejected by tcpd; from=’AF_INET(127.0.0.1:XXXXX)’

The syslog server was a Solaris x86 system which had a number of reverse SSH tunnels to several SPARC-based syslog clients. The version of syslog-ng was obtained from sunfreeware.com in binary form on both systems.

The Solution

It turns out that Syslog-NG 2.x introduced support for TCP Wrappers (which tcpd is part of) and thus, the settings in my /etc/hosts.allow and /etc/hosts.deny files were actually preventing syslog-ng from accessing port 514 on the local host. Adding the following entry to hosts.allow seems to have fixed the problem:

syslog-ng: localhost

Of course you will need to refresh/restart the inetd service after you do this (svcadm refresh/restart inetd).

Installing Nagios on Solaris

If you are not familiar with it, Nagios is an open source system and network monitoring application that keeps a watchful eye on hosts and services that you specify, alerting you when things go bad and when they get better. It was designed to run under Linux but, according to the creators, should also run on other Unix variants. With this in mind, I decided to try it out on Solaris.

Fortunately, they provide a very comprehensive User Guide and trust me, you’re going to need it. Suffice it to say, there is a section early in this document entitled Advice for Beginners which is pretty blunt about how tricky Nagios is to set up and, believe me, they are not wrong. Having said that, they do also say that once you get it running you will never want to be without it and I can definitely subscribe this this notion too.
Anyway, here are my notes from installing Nagios on Solaris:

My Setup

  • Solaris 10 (u3) for x86
  • Sun Studio 12
  • Nagios 2.10
  • Nagios Plugins 1.4.11

Building Nagios

I downloaded the Nagios source tar ball and unpacked it as a non-root user. Then, following the User Guide, I ran the configure script with no argument (implying I wanted all default settings) followed make all and this seemed to work fine.

Building Nagios Plugins

Nagios does most things by using other scripts/applications which it calls plugins. The Nagios website provides a collection of popular plugins for you to build. Once again, I did so using a configure command followed by a make all command. However, this did not go entirely smoothly:

  1. A number of the plugins failed to build citing an “undefined symbol: floor” error. This was resolved by adding -lm to the LIBS defined in line 328 of nagios-plugins-1.4.11/plugins/Makefile. This could probably also have been fixed by adding $(MATHLIBS) to the links statement of the affected plugins but that would have been more work.
  2. The check_dhcp module failed to compile citing several unknown data types (i.e. u_int8_t and u_int32_t). This was resolved by adding a -D__solaris__ to CPPFLAGS definitions at line 161 of nagios-plugins-1.4.11/plugins-root/Makefile
  3. The nagios-plugins-1.4.11/plugins-root/Makefile was also missing the same -lm link parameter as the plugins Makefile (line 221)

Once all of the above changes were make, all of the plugins seemed to build correctly.

Problems Found During Nagios Configuration

1. check_ping plugin did not work

No matter what way I configured the use of the check_ping plugin (in localhost.cfg, services section) it always reported:

CRITICAL – You need more args!!!
Could not open pipe:

A number of websites suggested that this was an IPv6 issue and that I should have used the --with-ipv6=no in my original call to the configure script when building the plugins. However, this was not the solution for me. It turns out that the definition of PING_COMMAND in nagios-plugins-1.4.11/config.h was empty and thus the check_ping plugin was actually making no attempt whatsoever to ping the requested host. I suspect that the reason for this is that I built the software as a non-root user which, on Solaris, does not have the ping command in it’s path (since ping is located in /usr/sbin on Solaris). Hence, the original configure script was unable to produce a valid definition for PING_COMMAND.

The solution to this was to edit nagios-plugins-1.4.11/config.h and add the following definition for PING_COMMAND (line 796)

#define PING_COMMAND “/usr/sbin/ping -s %s 64 %u”

The above command specific to Solaris and makes the Solaris version of ping behave like the Linux ping command. After this edit, I had to force a rebuild of the check_ping plugin (touch plugins/check_ping.c; make)

2. statusmap.cgi did not build

I only noticed this when I tried to view the Status Map section of Nagios. In short, the reason why this has not built is that I was missing a GD library on my Solaris system. The solution was to download and install a version of the GD library (and each of its dependent packages). I got mine from sunfreeware.com. The statusmap.cgi utility then built correctly and once I copied it to the libexec directory where Nagios was installed, it worked.

3. VRML Browser Plugin required

When I tried to view the 3-D Status Map options in Nagios, my brower kept launching a “Save As” dialog box. I turns out I needed to install a VRML plugin in my browser. I chose one called Cortona from Parallel Graphics. It seems to work fine in Firefox although, as yet, the 3-D Status Map view is more impressive than it is useful (for me anyway).

Conclusion

Nagios indeed took a long time to install, configure and set up. However, I can confirm that it was worth the effort and I am very pleased with it so far.

MySQL Proxy Gotcha on Solaris SPARC

The Problem

During a recent install of MySQL Proxy on a Solaris 10 system (sparc u3), we encountered the following error whenever we supplied the --pid-file command-line argument:

Conversion from character set ‘646’ to ‘UTF-8’ is not supported

However, if we omitted the --pid-file argument, it worked just fine.
The Solution
Running ldd against the application revealed no missing libraries but when we ran it with truss, we discovered that it was indeed missing some library files:

open64("/export/home/mysqldev/mysql-proxy-32bit/inst/glib/lib/charset.alias", O_RDONLY) Err#2 ENOENT
access("/usr/lib/iconv/geniconvtbl/binarytables/646%UTF-8.bt", R_OK) Err#2 ENOENT
access("/usr/lib/iconv/646%UTF-8.so", R_OK) Err#2 ENOENT
open("/usr/lib/iconv/alias", O_RDONLY) Err#2 ENOENT

It turns out that the Solaris system we were using was originally installed using the Core System cluster (SUNWCreq) and did not have all the requisite Unicode packages installed. So, an installation of the SUNWuiu8 package (from the Solaris distribution media) duly resolved the matter.