Some Solaris 11 Tricks

I am currently doing battle with a text-only installation of Solaris 11. I say “doing battle” because, of course, it isn’t quite like Linux. It’s close enough that it’s familiar, but different enough that nothing really works! What you really need is a Linux-to-Solaris phrasebook… and these are the bits I’ve cooked up so far!

Before anyone writes in to say, “This method does it better’ or ‘Why not use this command instead’… this is a quick survival guide, not an elegant, considered dissertation on the best way of doing anything. Getting a result (that’s useful to me) is all that counts!

1. How do you know what your CD/DVD device is called?

You want to mount a CD or DVD manually and the mount command will require that you know the proper device name for that drive. How do you find out what it is?

In Linux, you might do any of these:

cat /etc/fstab
ls -l /dev/cdrom
cat /proc/sys/dev/cdrom/info  -check the "drive name" information

The Solaris 11 equivalent I use is:

rmformat -l

That’s the “removable rewriteable media format utility” (so it has more uses than just listing things out!) Its output is potentially confusing: what it refers to as the “Logical Node” is what you’re actually after in a mount command, whereas its display of the “Physical Node” isn’t.

2. How do you see all your file systems?

Obviously, “rmformat” is only going to tell you about file systems on removable media. How do you simply get a listing of all other physical storage devices that exist?

In Linux, you could do worse than check the contents of /etc/fstab, though more detail is usually available by doing an fstab -l.

On Solaris, there are lots of ways of doing it, but maybe the most informative and yet simplest is:

iostat -En

Bear in mind, though, that the default file system for a Solaris 11 installation is ZFS, so maybe something like

zpool list

…will provide you the information you’re looking for.

3. How do you manually mount a CD/DVD then?

In Linux, you might get away with things such as:

mount -t iso9660 /dev/sr0 /some-mountpoint

The Solaris 11 equivalent is very close:

mount -F hsfs -o ro /dev/rdisk/c3t1d0p0 /some-mountpoint

It’s still essentially “mount <some file type> <some device> <somewhere>, but the specific switches have changed. Specifically, “hsfs” is the ‘High Sierra Rock Ridge and ISO9660 file system’… which makes it ‘the cd file system’. And we use “-F” rather than “-t”, because we’re dealing with “F”ilesystems, not “t”ypes. Sort of!

4. How do you create an ISO file from files?

Let’s pretend you’ve downloaded the two Oracle 11gR2 zip files from OTN, you’ve unzipped both of them and thus created a single “database” directory. How can you turn that directory into the contents of a single new ISO file, suitable for burning to a DVD?

On Linux, I’d perhaps fire up Brasero and do it via a GUI (though K3b is really needed to get that specific job done properly) Using Brasero would also be open to me if I’d installed the Live version of Solaris 11, given the Gnome desktop that ships with. But using the command-line only, I’d do this on Linux:

mkisofs -r -v -J -R -o output.iso /path-to-main-folder

There are a bazillion switches that might be needed to get all the right formats on the resulting ISO (like long file names, etc). The particular mix of Joliet and Rock Ridge options shown here might not always be appropriate.

On Solaris, we have this:

mkisofs -r -v -J -R -o output.iso /path-to-main-folder

Actually, that’s exactly the same command as before. So there’s a win!

If you happen to be trying to create a functional ISO from the unzipped & combined two Oracle 11gR2 zip file downloads as I mentioned originally, though, I think you’ll need to add a few more switches. I find this works on Solaris 11, anyway:

mkisofs -log-file log.txt -r -v -J -R -d -l -N -allow-lowercase 
-allow-multidot -ldots -allow-leading-dots 
-o ora11gR2.iso /database

(In case the font lets me down, that’s “Jay Are dee el En’ in the middle bit there and it’s a reference to ‘minus eldots’… there’s no number ’1′ anywhere, in other words. And of course it’s all on one line, though I’ve broken it up here to make it look a bit nicer).

5. How do you map a SAMBA share?

Assume we have a mountpoint called “/network” on both a Linux and a Solaris 11 machine, and we want to connect to a share called NEWTON/Public that is being offered by a Windows 2012 server somewhere (we’re nothing if not up-to-date in these parts!) On Linux, I’d do this: mount -t cifs -o username=Administrator NEWTON/Public /network

I’d love to be able to tell you what that Solaris 11 equivalent is, but I have yet to find one on text-mode Solaris 11. The GUIversion of Solaris 11 will certainly let you browse network shares in Nautilus, but it seems not to like any provided by Windows 2008 R2 and Windows 2012 servers… it simply keeps asking for the username/password for the share without ever seeming to realise it’s been told it multiple times! Browsing an ancient XP box I’d forgotten about, though, was no problem.

Anyway, the long and the short of it is that Solaris 11 of any flavour does not seem to be a nice fit in a mostly-Windows environment. However, that perception might be as a result of the fact that a lot of the available documentation and web-tips etc. appear to be mostly about Solaris 10 -and mostly about setting up a SAMBA server, not using Solaris as a mere SAMBA client. Give me a week or two… hopefully some better news will turn up. (If you know the answer already, feel free to add enlightenment for all in the comments!)

6. How do you check what IP address you’re using

On either Linux or Solaris, you can still use ifconfig, but it’s been deprecated for a while (even in Linux, but especially in Solaris). The command is used slightly differently in the two O/Ses, too: in Linux, the command ifconfig will return you the IP addresses for all interfaces. Try that on Solaris, however, and you’ll get a help/syntax message -because on Solaris, you’re supposed to specify the precise interface you want to know about. You are therefore supposed to use a command like ifconfig net0.

Which of course immediately invites the question: how do I know what my network interfaces are called? To which there is the answer: dladm show-link. There are other variants on that command: dladm show-ether, for example, will list only the Ethernet interfaces, not the wireless ones, bridged, virtual interfaces (or sundry other types).

Anyway… I have plenty of other Linux/Solaris conversion tips like these, but that’s probably enough for today’s efforts. Watch this space…

Gladstone, Oracle 11g and Sabayon

It’s Gladstone as you’ve never seen him before: sporting a dashing new look in the form of my ‘Jaws’ progress indicator, which allows the various package installations taking place at the time to be done slightly more efficiently than before. Makes my code a bit easier to read, too, at certain points!

In addition, the thing which really gives a gleam to his eye is his new-found support for doing Oracle 11gR2 installations on 64-bit Gnome-based Sabayon. Large and very silly moustaches are entirely optional, therefore.

It’s not perfect: things start out a bit rough when Gladstone produces black text and Sabayon decides to use a black background in its default terminal windows! The result is like looking for a black cat in a coal cellar… and you’ll need to edit the terminal colour profile to something other than the default ‘white on black’ before you can get much further:

Before:

and After:

No doubt there’s a clever way for me to auto-detect the colour scheme in use and react accordingly… but until I find out what that is, you’ll just have to deal with it manually!

Curiously, during the ‘software prerequisites’ installation stage, I found that any attempt to install the rpm package caused 580MB of downloads plus a metric crap-tonne of grief in being unable to reboot the PC once it had all finished. I accordingly stopped trying to install it… and its absence didn’t appear to faze the Oracle installation at all, whilst allowing everything else to behave perfectly normally. It reduced my Internet bills, too. It’s odd, since “rpm” is always mentioned as a pre-requisite for every Oracle install, no matter what distro you’re using. Clearly, it’s not that simple!

Anyway: once you get to the point of launching the Oracle Universal Installer, be prepared for it to complain about practically everything! It will even declare that appropriate OS users and groups haven’t been created (though they have). It’s the usual trick with the ‘Ignore All’ checkbox, therefore, and the OUI will proceed without drama:

Click the Ignore All checkbox, because the OUI can’t work stuff out, but it’s all OK really

Like most modern distros, Sabayon will cause linking errors to be thrown quite early on in the piece:

Gladstone will have prepared for this possibility by writing a ‘fix-linking-errors.sh’ shell script to your desktop ahead of time. Just find that file at the first linking error, double-click it and run it as yourself (not as root). After that, you should be able to click the Retry button in the Oracle Universal Installer and no further errors will then occur.

I must say that I really like Sabayon as a distro. It gets nearly everything right that I was looking for during my recent installfest. It’s polished and practical and runs everything I need it to do. In a contest between it and Linux Mint Debian Edition, there’s actually no contest at all: Sabayon knocks LMDE into a cocked hat, in large part because LMDE is using tricks like MAME to hold onto a Gnome 2 codebase (resulting in quite a bit of instability and all-round flakiness, in my view). Sabayon, in contrast, has fully adopted Gnome 3 (though KDE and XFCE versions are available). Though I despise Gnome 3 as a desktop, being on a ‘proper’ codebase does result in greater overall O/S stability, I think. Being able to run Oracle on it without too much pain is then just the icing on the cake.

If only I’d looked into it before Windows 8 was released to manufacturing…

I’ll close by mentioning that whilst re-jigging Gladstone to take account of all this new stuff, I realised that the old code contained a lot of howlers …bugs which ought to have caused anyone using it to install on such old warhorses as CentOS or OEL to start beating a path to my door complaining about it. However, no such complaints were received… which makes me wonder if anyone is actually using it any more! If not, fine: I certainly do, and I’m its most important customer -but I could certainly do with more users/testers letting me know if things aren’t right. Anyone with a little patience and a big, fat, fast Internet connection is welcome to do lots of beta testing …and I’d be grateful for the feedback!

Invisible Mending

Just by way of a little test, I upgraded ToH’s PC to Windows 8 yesterday (from Windows 7), without actually getting approval beforehand.

You might have thought a change like that would have been noticed. But 36 hours later, and still not a word to indicate that “something’s different”! That’s 36 hours with things like Photoshop and Microsoft Money being used pretty intensively. Apparently, a change of O/S makes not one noticeable difference to that particular user experience!

This is as near as I can get to the “An O/S your mother could operate” test -and Windows 8 would appear to pass with flying colours. I really do wonder what all those screaming, ‘What an abomination! The end of Microsoft! A Disaster!!’ have actually been using all this time. As someone who took about 2 years to vaguely feel OK about Windows 7, I’m experiencing precisely nothing in Windows 8 except “faster, snappier, efficient”. This is certainly no Vista…

Various commentators have also moaned about different aspects of Windows Server 2012 and/or Office 2013, but I’m using both very happily. Server 2012 feels leaner than before and runs Oracle 11.2.0.3 perfectly well (though I did have to manually install the .Net 3.5 framework first).

There is an issue with using Internet Explorer 10 to access Enterprise Manager, though. You’ll get the usual warnings about invalid security certificates, but you’ve previously been offered a chance to ‘continue to this site’, import the certificate and thus work around the issue. In Internet Explorer 10, however, there is no link to let you continue to the site, so there’s no way to import the self-certified certificate. My workaround was, therefore, to open a command prompt (Win+R, then type cmd and press Enter), and issue the following four commands:

set ORACLE_SID=orcl
set ORACLE_UNQNAME=orcl
set ORACLE_HOSTNAME=localhost
emctl unsecure dbconsole

It’s important to use “localhost” for the ORACLE_HOSTNAME value, rather than the “proper” name for your server, whatever it might be. Otherwise, feel free to substitute in the correct name for your instance if it isn’t actually “orcl”. The effect of the last command is to allow you to connect to Enterprise Manager by a plain http URL instead of an https one. For example, I can now connect to http://localhost:1158/em -and by not using secure http, you completely negate the need for security certificate in the first place, so there are no dramas getting it to work.

No doubt when Oracle 12c finally appears (my bet is on December 12th: 12c on 12/12/12 has a certain symmetry about it), IE10 will work perfectly… but until then, that’s the best I can offer. Of course, it’s not ideal from a security point of view, but that’s the state of the workaround at present.

Oh, and don’t forget to add 1158 as a new rule to the server’s firewall if you mean to connect to Enterprise Manager remotely. (Win key → type “firewall” → launch Firewall with Advanced Security → right-click Inbound Rules→ New Rule → Port → Next → 1158 → Next → Allow the connection → Next → Next → type ‘Enterprise Manager rule’ as a name → Finish).

Missing Overlaps

It is relatively simple to check that a single, specific date falls within a range of other dates. Suppose we have an existing hotel room booking from 16th September to 20th September, and someone wants to know if our room is free for the night of 19th September:

SQL> select
 case when to_date('19-SEP-2012','DD-MON-YYYY') between 
   to_date('16-SEP-2012','DD-MON-YYYY') and to_date('20-SEP-2012','DD-MON-YYYY')
 then 'Overlap'
 else 'No Overlap'
end as CROSSOVER
from dual;

CROSSOVER
----------
Overlap

The between function will do the job nicely, as you can see.

It gets more interesting, though, when the proposed new booking is for, say, the 21st September to 26th September: now you have the problem of checking two date ranges against each other… and, in theory, any part of the new date range might overlap any part of the old range. How to detect that full or partial overlap?

One approach is to consider the three logical possibilities for an overlap:

  • Proposed booking start date is between the existing booking’s start and end dates
  • Proposed booking end date is between the existing booking’s start and end dates
  • Proposed booking start date is before the existing booking’s start date AND the proposed end date is after the existing booking’s end date

Only if none of those three conditions is met would the proposed new booking be acceptable (i.e., would we say there is no overlap of the two date ranges). One way of coding that in SQL, for example, might be:

With Condition1 as 
(select case when to_date('&&ProposedStart','DD-MON-YYYY') 
  between to_date('16-SEP-2012','DD-MON-YYYY') and to_date('20-SEP-2012','DD-MON-YYYY')
 then 1 else 0 end as FAILIFONE from dual),
Condition2 as 
(select case when to_date('&&ProposedEnd','DD-MON-YYYY') 
  between to_date('16-SEP-2012','DD-MON-YYYY') and to_date('20-SEP-2012','DD-MON-YYYY')
 then 1 else 0 end as FAILIFONE from dual),
Condition3 as 
(select case when 
  to_date('&&ProposedStart','DD-MON-YYYY') < to_date('16-SEP-2012','DD-MON-YYYY') 
  AND 
  to_date('&&ProposedEnd','DD-MON-YYYY') > to_date('20-SEP-2012','DD-MON-YYYY')
 then 1 else 0 end as FAILIFONE from dual) 
select case when sum(failifone)>0 then 'Overlap' else 'No Overlap' end as crossover from ( 
Select failifone from condition1
union 
Select failifone from condition2
union 
Select failifone from condition3);

If you run that code and supply 21-SEP-2012 and 26-SEP-2012 as the proposed start and end dates, you’ll find no conflict between the proposed and existing bookings:

Enter value for proposedstart: 21-SEP-2012
Enter value for proposedend: 26-SEP-2012

CROSSOVER
----------
No Overlap

Supply different dates, though, and you should get appropriate responses. For example, for the date range 1st September to 30th October -which we know immediately overlap- you’ll get this response:

Enter value for proposedstart: 01-SEP-2012
Enter value for proposedend: 31-OCT-2012

CROSSOVER
----------
Overlap

You’ll similarly find that a proposed booking of 20th September to 26th September fails, because the overlap on the 20th September is detected… and so on.

Where it gets interesting, though, is that when this subject comes up in forums etc. it is often mentioned that Oracle has an OVERLAPS function (which was first introduced in version 8.1, but has never been documented… which makes using it problematic!) The syntax for OVERLAPS is a lot simpler than my coding efforts above:

SQL> With overlaps as
 (select 'Y' as overlap_flag from dual where
 (to_date('16/09/2012','DD/MM/YYYY'), to_date('20/09/2012','DD/MM/YYYY'))
 overlaps
 (to_date('21/09/2012','DD/MM/YYYY'), to_date('26/09/2012','DD/MM/YYYY'))
 ),
fillers as
 (select 'Y' as dummy from dual)
select case 
  when o.overlap_flag='Y' then 'Overlap Detected' 
  else 'No Overlap' end as Overlap
from
overlaps o, fillers f
where o.overlap_flag(+) = f.dummy;

OVERLAP
----------------
No Overlap

Here, I’m again comparing a 16th-20th original booking with a proposed booking for 21st-26th… and, quite rightly, no overlap in the date ranges is detected.

This minor revision to the earlier code shows a problem, though:

SQL> With overlaps as
 2 (select 'Y' as overlap_flag from dual where
 3 (to_date('16/09/2012','DD/MM/YYYY'), to_date('20/09/2012','DD/MM/YYYY'))
 4 overlaps
 5 (to_date('20/09/2012','DD/MM/YYYY'), to_date('26/09/2012','DD/MM/YYYY'))
 6 ),
 7 fillers as
 8 (select 'Y' as dummy from dual)
 9 select case when o.overlap_flag='Y' then 'Overlap Detected' else 'No Overlap' end as Overlap
10 from
11 overlaps o, fillers f
12 where o.overlap_flag(+) = f.dummy;

OVERLAP
----------------
No Overlap

This time, I’m comparing an original 16th-20th booking with a proposed 20th-26th one. You and I might, I think, say that the 20th from each collides and that an overlap should be declared… but the OVERLAPS function begs to disagree.

You might think this has to do with days starting/ending at midnight, and so on. But you can modify the code slightly to get to-the-second precision, like so:

SQL> With overlaps as
  2 (select 'Y' as overlap_flag from dual where
  3 (to_date('16/09/2012','DD/MM/YYYY'), to_date('20/09/2012 23:59:46','DD/MM/YYYY HH24:MI:SS'))
  4 overlaps
  5 (to_date('20/09/2012 23:59:46','DD/MM/YYYY HH24:MI:SS'), to_date('26/09/2012','DD/MM/YYYY'))
  6 ),
  7 fillers as
  8 (select 'Y' as dummy from dual)
  9 select case when o.overlap_flag='Y' then 'Overlap Detected' else 'No Overlap' end as Overlap
 10 from
 11 overlaps o, fillers f
 12 where o.overlap_flag(+) = f.dummy;

OVERLAP
----------------
No Overlap

Here, I’ve asked to compare an ending date of 11:59 and 46 seconds PM with a proposed start time of 11:59 and 46 seconds PM… and again, the function declares the two don’t overlap.

Interestingly, though, my original ‘hand-coded’ SQL, if slightly adjusted to allow for hours, minutes and second precision on the relevant start/end dates does declare it an overlap. Here’s my modified code:

With Condition1 as 
(select case when to_date('&&ProposedStart','DD-MON-YYYY HH24:MI:SS') 
  between to_date('16-SEP-2012','DD-MON-YYYY') and 
          to_date('20-SEP-2012 23:59:46','DD-MON-YYYY HH24:MI:SS')
 then 1 else 0 end as FAILIFONE from dual),
Condition2 as 
(select case when to_date('&&ProposedEnd','DD-MON-YYYY') 
  between to_date('16-SEP-2012','DD-MON-YYYY') and 
          to_date('20-SEP-2012 23:59:46','DD-MON-YYYY HH24:MI:SS')
  then 1 else 0 end as FAILIFONE from dual),
Condition3 as 
(select case when to_date('&&ProposedStart','DD-MON-YYYY HH24:MI:SS') 
  < to_date('16-SEP-2012','DD-MON-YYYY') 
  AND to_date('&&ProposedEnd','DD-MON-YYYY')
  > to_date('20-SEP-2012 23:59:46','DD-MON-YYYY HH24:MI:SS')
 then 1 else 0 end as FAILIFONE from dual) 
select case when sum(failifone)>0 then 'Overlap' 
       else 'No Overlap' end as crossover 
from ( 
select failifone from condition1
union 
select failifone from condition2
union 
select failifone from condition3);

This just allows the proposed start time of the new booking to be specified to the second, and knows the end-time of the existing booking to the second, too. Plug in the relevant proposed start and end times, and you get this:

SQL> With Condition1 as
  2 (select case when to_date('&&ProposedStart','DD-MON-YYYY HH24:MI:SS') 
    between to_date('16-SEP-2012','DD-MON-YYYY') and 
            to_date('20-SEP-2012 23:59:46','DD-MON-YYYY HH24:MI:SS')
  3 then 1 else 0 end as FAILIFONE from dual),
  4 Condition2 as
  5 (select case when to_date('&&ProposedEnd','DD-MON-YYYY') 
    between to_date('16-SEP-2012','DD-MON-YYYY') and 
            to_date('20-SEP-2012 23:59:46','DD-MON-YYYY HH24:MI:SS')
  6 then 1 else 0 end as FAILIFONE from dual),
  7 Condition3 as
  8 (select case when to_date('&&ProposedStart','DD-MON-YYYY HH24:MI:SS') 
    < to_date('16-SEP-2012','DD-MON-YYYY') 
    AND to_date('&&ProposedEnd','DD-MON-YYYY') 
    > to_date('20-SEP-2012 23:59:46','DD-MON-YYYY HH24:MI:SS')
  9 then 1 else 0 end as FAILIFONE from dual)
 10 select case when sum(failifone)>0 then 'Overlap' 
           else 'No Overlap' end as crossover 
    from (
 11 Select failifone from condition1
 12 union
 13 Select failifone from condition2
 14 union
 15 Select failifone from condition3);

Enter value for proposedstart: 20-SEP-2012 23:59:46
Enter value for proposedend: 26-SEP-2012

CROSSOVER
----------
Overlap

I guess there’s a philosophical question to be addressed here. If my original range is (say) the numbers from 5 to 10, does the number 10 fall “between” those? Oracle says it does:

SQL> select case when 10 between 5 and 10 then 'True' else 'False' end from dual;

CASEW
-----
True

…though you might well argue that only the numbers 6, 7, 8 and 9 are legitimately “between” the comparison number range.

Similarly, if your starting range are the letters “e” to “m”, does the letter “e” fall between those? Again, Oracle says yes:

SQL> select case when 'e' between 'e' and 'm' then 'True' else 'False' end from dual;

CASEW
-----
True

…though whether the start and end point of a range can legitimately be said to be “between” anything is, it seems to me, at least questionable.

Anyway, the kicker here is that Oracle is philosophically inconsistent on the matter: the OVERLAPS function considers that a date, Z, does not overlap a date range X→Z, whereas the BETWEEN function does. Which is something you might want to be aware of… and is probably a good reason to steer clear of undocumented functions!

Windows 8 fiddling

There are a few issues I have found with Windows 8 (64-bit) as my main desktop. In no particular order:

  • I wanted to uninstall Java, because of recent security scares (and because I use nothing that really depends on it, as far as I know). But I was unable to uninstall Java without first disabling the User Access Control feature. I set it back to its default setting afterwards, of course.
  • Both VMware and VirtualBox are flakey/unstable. I tried the VirtualBox beta, but that didn’t improve matters much there. I felt obliged to download the new VMware Workstation version 9, and that’s running really well… but it is an awful lot more expensive than it used to be, and I don’t know that I can justify the price to myself:

Interestingly, despite VMware’s best geolocating efforts to prevent me from visiting the US version of their store, I can tell you that the US retail price for the same thing is $249… which is most odd, given that currently one US$ buys you more or less one Aussie dollar. I wonder why the Aussies are therefore being over-charged by something in the region of 50%??! Definitely a case for a US-based VPN, methinks.

  • Microsoft Security Essentials does not work on Windows 8. That’s not an issue in itself, because Win8 ships with a capable “Windows Defender” equivalent. Unfortunately, there is no way to scan an individual file or folder with this tool (there is no right-click and select ‘scan now’ or its equivalent, for example). You can do it via the command line, but it’s not pretty:
"C:\Program Files\Windows Defender\mpcmdrun" -scan -scantype 3 -file "C:\users\hjr\Downloads\VirtualBox-4.2.0_RC3-80444-Win.exe"

(Obviously, replace the specific path/filename with whatever is required). There are articles out there saying it’s possible to get a right-click option back if you create a couple of registry keys, but they didn’t work for me (most were written before the Win8 code was finalised, of course). A third-party anti-virus application might be the better option, therefore. If only I knew which one to use…

  • Oracle 11.2.0.1 installs on it fine and without incident. However, it spews a lot of pretty ugly-looking icons all over the Start screen. Nothing you can’t unpin and sort out manually, of course; but a pain, nonetheless. A lot of older programs are going to wreak the same sort of havoc, I fear.
  • There is no desktop clock (my eyesight means I can’t read the little clock down in the system tray area from a distance, so I really need one!) Fortunately, a free one looking very much like the one I described creating on CentOS a while back is available for free from here. It works well, but I have to warn you that the installer tries desperately to get you to install extra packages or agree to have your browser home page changed. It is, frankly, appalling but if you take the time to actually read the various screens and decline the various offers of licenses, it is possible to have the desktop clock/gadget without any nasty extras. I’d really like to find an equivalent that isn’t so burdened with crapware, though.
  • The Task Manager in Windows 8 is a lot more useful than its Win7 counterpart (and the graphs are nicer!). You can get to the list of Services here, and also the list of applications which will auto-start at each reboot. Very handy.
  • I mentioned last time that there was no apparent way to switch off sound effects or the 3-card deal in the Metro-ised Solitaire game. There is: you have to do a Win+C when it has focus. That key combination brings up a “Charms Bar”, one of whose options always contains a “Settings” option. When you click that in desktop mode with nothing particular running, you get options to visit the Control Panel or personalise the desktop theme. Click it when using a Metro app, however, and the Settings option will instead take you to app-specific configuration options. I can’t say that’s entirely intuitive: it’s taken me a day or two to discover it, after all! But now I know it’s there, it will make a big difference to how useful some of those Metro apps really can be.
  • It’s not yet possible to install the Media Centre component, so I haven’t been able to upgrade my Win7 Media Centre, currently doing TV recording and video playing duties. Apparently, it will be available on the day the OS is officially released to the public, but not having it available even though the OS has been released to manufacturing seems a bit dumb to me.
  • Windows 8 support for FLAC (i.e., it doesn’t) is disappointing but not unexpected. Unfortunately, the workarounds for previous versions (Shark Codecs, WMP Tag Plus, etc) seem to be broken in Windows 8. This is a deal-breaker for me… I can always use Foobar2000, of course, but a native Windows player for one of the commonest codecs around would have been a nice gesture from Microsoft!
  • There are lots of references at various points when you’re doing something to “tap here…” when, from a quick look at my hardware, the OS should know “click here” would be more appropriate. Irritating, a very little…

Nothing that’s a complete show-stopper, though the FLAC stuff is a real pain (as I say, Foobar2000 is the saviour there). I have just bought myself a new 128GB SSD, so this weekend, I think I’ll do a fresh Windows 8 install on that and see how I get on. I never thought in-place upgrades of MS O/Ses was a great idea, though this one’s gone a lot smoother than I thought possible.

Windows 8… meet Desktop

I am having the day off and so, naturally, I thought I’d replace my O/S with something new and exciting. And then I got out the RTM of Windows 8. In for a penny, in for a pound, so no messing around with VMs: this one got installed straight over the top of my workaday Windows 7 (which shares dual-boot capacity with whatever Linux distro I happen to be playing with that day).

So this article comes to you from a real, live genuine Windows 8 desktop… and I thought I was going to write about how awful it was etc. etc. etc., but in fact, I have to write that “It isn’t anywhere near as bad as it’s been cracked up to be”. Colour me surprised.

First thing I should get clear is that the loss of the Start “orb” isn’t a big deal. For example, if I wanted to launch the calculator in Windows 7, I might well have clicked Start → All Programs → (scroll down a bit) → Accessories → Calculator. (Did you realise it was so many clicks for something so trivial? I certainly didn’t!) In Windows 8, I click Desktop → the calculator icon I pinned to my taskbar earlier. Dramatically fewer mouse clicks! OK, I cheated, because you have to: once you are in the traditional desktop mode, there’s no obvious way to launch any programs at all, unless you have the relevant icons festooned on your taskbar or desktop. So, knowing this, you make sure those icons are to hand before you go to Desktop mode… which is, of course, a bit of a nuisance, but once it’s done, you really do use less mouse-clicks than before …or, at the very least, no more than before.

My point is that having no Start button doesn’t necessarily mean things are more difficult to find or launch -just that you have to do things in a slightly different way, but that new way isn’t actually too bad.

If you are red-hot with your Windows key shortcuts, for example, you might already know to do Win+R to bring up the ‘run command’ dialog. Worked in Windows 7, still works in Windows 8. So you could simply type Win+R then “calc” and press Enter in either version. Again, the loss of the Start orb doesn’t make doing that any harder than before.

Discoverability of things in Windows 8 is a bit more of a problem, I will agree.. but, after a bit of thought, I’ve decided that a lot of things which seem impenetrably difficult to find are really just in a new place and it’s no big deal: we learnt where the stuff used to be, thinking it was a bit odd. We’ll learn where the stuff has been moved to …which, whilst decidedly different, isn’t actually any more logically insane.

For example: we all know that to log out or switch off a Windows 7 PC, we click the Start button. Now, in Windows 8, you have to know to bring up the “Charms Bar” (Win+C or hover your mouse in the right-hand top-most corner of the screen), click Settings then Power: there are your options to sleep, restart or shutdown. Log out is somewhere else again: the Start screen (so press your Windows key or hover in the bottom-left corner of your desktop), click your photo/icon, then select “Sign Out”. I mean, it’s definitely different, but there’s a certain logic to it and not that many key presses extra, if any. It’s just a matter of climbing a learning curve for something new. In other words, it’s not worse than before, particularly; just different.

I know a lot has been written about the split-personality thing, too: on the one hand, Windows 8 looks remarkably like a de-Aero-ified Windows 7 (in Desktop mode); on the other hand, it looks like a tablet interface (in its Metro-esque guise). A lot of people on assorted forums seem to dislike this immensely. All I can say is that I’ve been tapping away in Desktop mode for about an hour and a half… and I haven’t seen sight nor sound of Metro (or whatever we have to call it these days) once. The thing doesn’t keep flipping between the two modes: if you stick to running “desktop apps” (VMware, Chrome, Word, Outlook, Handbrake, Stellarium, MuseScore etc etc), then you’ll live in the desktop and you’ll hardly notice anything has changed. If you happen to start using more “tablet-like apps”, then you’ll spend more time in the Metro area. Personally, I don’t find the dichotomy annoying, simply because they are so different. It’s not like two similar things that are easy to confuse, for example: that definitely gets annoying. This is more like speaking French in Paris and sticking to English in London: you adjust to whichever world you want to move in at that time. It’s certainly not difficult.

Funnily enough, I think if you own a tablet or smartphone of any description, you’re going to wish you could spend more time with the Metro interface. The idea of a small, cheap app dedicated to doing one thing is certainly something a Galaxy/Nexus/iPad user is going to be familiar with… and having to put up instead with huge, monolithic, hundred-dollar-plus software packages like Office or Photoshop is going to seem a bit odd in time, I feel sure.

Anyway, for me, I find that I’ve got an un-Aero-ized version of Windows 7 that has Metro available to me if I need it, but isn’t in my face (hardly at all, in fact) unless I do. It’s certainly a hybrid approach, but it’s not as crazy as I’ve been reading it to be for months past.

Actually, whilst on the subject of Aero, I’d like to say, “Good riddance to bad rubbish”. It’s a relief to see it go. I frankly never understood the attraction of semi-transparent (and semi-readable) window title bars, so their loss is a return to sanity as far as I am concerned. There is instead a reasonable choice of colour schemes and on the whole, they work quite well. It’s just like having a theme-able “Classic” skin in XP, really: it feels efficient and effective, without looking like it’s been dragged screaming and kicking out of the 1990s. I can certainly live with it.

There are plenty of niggles, all the same. A simple case in point: I occasionally play a game of Solitaire whilst waiting for something to install or build, but no such game exists in Windows 8. Oh, I can certainly go to the Start page and click Games… but I am then launched into something that demands my Hotmail credentials before admitting me to an online store. Solitaire is available for free download, but it’s 196MB and plays very slowly in full-screen with no apparent way to turn off dumb sound effects (or to stop dealing three at a time!) Same thing for photos: yes, the Metro app will pick up the contents of your Pictures library and display them quite nicely, but there’s no (apparent -it’s early days!) way to tell it to import pictures from a network share… whilst multiple tiles encourage you to link your Facebook or Skydrive accounts. The Metro Music app is similarly forever pushing you to sign in (hotmail credentials, I guess, though it mentions the Xbox on-screen… why?!) and displaying loads of web content for me to buy (strangely, there’s not one Beethoven album on display!)

The Internet is crawling all over this particular O/S, and it’s annoying. You are prompted for your Windows Live/hotmail credentials as part of the basic O/S installation process -and it’s by no means obvious that you aren’t required to part with them (but you aren’t). I don’t have the best of Internet connections at the best of times, so an O/S that starts behaving as if it’s permanently connected to the Internet or assumes that you want to connect yourself up to everything all the time is not great news for me.

But that’s all the Metro stuff; back in the Desktop world, things chug on much as they always have, I am relieved to say!

And that brings me to the much-discussed issue of “touch”: this is the O/S that assumes you’ve got touch-enabled monitors and so on, isn’t it, and is hopeless unless you have? Nope. Not in my (limited) experience. The worst I can say is that the Start screen (and a lot of the Metro apps) splurge their contents horizontally across the screen… so I am forever having to use the scroll bars to see everything. It is obvious at this point that life would be a lot easier if you could just flick things sideways by touch, as I’d do on my Nexus. But as I’ve tried to emphasise: the Metro stuff is something you definitely don’t have to interact with much if you don’t want to. I am certainly not overwhelmed by a feeling of “must upgrade my hardware to touch-sensitive kit”, anyway.

A couple of serious issues arose that I should mention. VMware Workstation 8 refused to run my virtual machines after the O/S upgrade. I had to manually edit the .vmx file for a VM and change the vmci0.present = “TRUE” setting to be “FALSE”. After that, the machine would boot but the network interface still refused to work. In the end, I uninstalled VMware and re-installed… and everything came good.

Perhaps most seriously, I have to report that Angry Birds in Space doesn’t work at all, complaining that OpenGL renderers of various versions aren’t supported or installed. I haven’t researched this issue yet (!), so I’ve no idea if there’s a workaround. I’d expect one sooner rather than later!

All my other favourites (Stellarium, MuseScore, Exact Audio Copy, Photoshop, Office 2010) work just as they always did. The upgrade is, from their point of view, perfectly painless.

Anyway, I’m sure we’ve all read what a disaster Windows 8 is and how it will ruin Microsoft… but I’m pretty sure it won’t. I’m likewise sure we’ve all read how Microsoft always alternates good OSes with terrible ones (98 → Me →Windows XP → Vista → 7)… and so we’re due for a terrible one. But this release, I think, proves that “rule” false: it’s a perfectly good OS. I reckon the Metro stuff is a bit under-cooked, to be honest, but it’s certainly intriguing for what it might become.

Would I rush out to upgrade a perfectly good Windows 7 machine? Well, I did… but no, I don’t think there’s sufficient goodies to justify it if I hadn’t already paid for it via my Technet subscription. But if you’re buying new kit and the new OS ships with it; or if you’ve got some ancient XP machines that are in need of a refresh… then I don’t think there’s anything here to be particularly afraid of or concerned about, and I’d not hesitate to do the deed (because it runs smaller and lighter than Windows 7 on older kit, basically).

And that is definitely something I wasn’t expecting to write at the start of the day!

Jaws… A Bash Script progress bar

Back in about 1987, I started working for a very small company running out of offices on London’s South Bank -hence their name, SouthBank Systems PLC. They wrote specialist, database-based applications for local councils and their contractors to manage how their parks, street trees and other amenity values should be maintained.

I learnt so much in that job -that Bowling Greens are about the most expensive piece of grass you can ever install, per square meter, for example. Or that, if you make the mistake of writing your code this way, it is easy to generate “random inspection lists” that send an inspector first to one site, then a second on the other side of the borough, then back to a third… which was adjacent to the first! Who knew that what they really needed was a random selection of sites that were then sorted into an ordered, walkable path. Well, we did eventually: but it took us a while before the penny dropped!

One of the first-ever training sessions I ever gave took place in a greenhouse in Aldershot, where the contractors were bemused by the two minutes of frenetic activity they’d seen me do before turning to them to speak. They wanted to know what I’d done, because it looked interesting. It took a moment for me to work out what they were intrigued by, but yeah: they wanted to know how to switch a computer on and what happens when you do. I learnt how to read audience expectations that day!

Anyway, one of the little features of our software we were quite proud of, and which the clients loved, was Jaws. He was simply a shark fin that paced up and down the screen, letting you know that stuff was happening in the background. These days we call them progress bars and don’t think much about them, but to the kind of people I was working with back then, the “personality” of the progress bar was important.

I’d therefore like to present you with my 25-year tribute to Jaws, The SouthBank Systems progress bar, as implemented in Bash, as follows:

function jaws() {
i=1
char=">"
pos=4
while true
do
 i=$((i+1))
 if [ $(($i%60)) -eq 0 ]; then
   if [ "$char" = ">" ]; then
     char="<"
   else
     char=">"
   fi
 fi
 if [ "$char" = ">" ]; then
   pos=$((pos+1))
   if [ "$pos" -gt 60 ]; then
     pos=60
   fi
 else
   pos=$((pos-1))
   if [ "$pos" -lt 5]; then
     pos=5
   fi
 fi
 tput cup 18 5; echo "............................................................";
 tput cup 18 $(($pos)); echo -n $char;tput cup 20 5
 sleep 0.2
done
}

The variable “i” forever increments. But we pick a point when its value can be tested. In this case we check whether i modulus 60 is zero. (that is, can “i” be devided by 60 without leaving any remainder). If it is, then we use that to trigger a change in the progress bar character from “>” to “<”. Additionally, if we are left with “>” as our character, then we know to keep on incrementing the position where that character should be displayed. If we acquire a “<”. then the position counter will be decreased.

So you stick that function at the top of your bash script somewhere, and then it comes time to use it. Here’s the simplest case:

jaws &
jawsp=$!
sleep 40
kill $jawsp &>/dev/null

The “thing” this script is doing is simply to sleep for 40 seconds, but it could be doing any meaningful work. The point is that before the work starts, you invoke the jaws function -with an ampersand character (&) to make it run in a new, background session. We assign the process ID of that new session to a jawsp variable. When our sleep/work has finished, we can kill that process, which will stop the shark fins parading up and down the screen.

Eighties tribute bands are seldom worth the price of admission and it is similarly likely that you will consider Jaws a not very exciting addition to your set of Bash scripting skills. You may indeed be bemused that there was a highly professional set of clients and staff who thought Jaws was one of our most valuable bits of IP (shocking, but true, I fear). But even if it’s as welcome as a Mama Mia reunion ‘do’ at the Hammersmith Palais on a wet Wednesday night, I’m going to let you watch the video anyway because, for me, he brings back happy memories when my database skills extended to re-building DataFlex indexes and showing gardeners how to turn on a PC. Happy times!

Coming soon to a Gladstone shell script near you shortly, of course…

And cheers to Chris Megan, who wrote the original, all those moons ago.