Category Archives: Technology

Firefox 31 and the New Tab tab

Firefox 31 hit the Arch repos at some point today and now I have it. Since Mozilla moved to their 42 day release cycle, most of the changes from one release to the next have been incremental and not really worth noting. But I did notice something new when I opened a new tab.

That search bar immediately above my most recently used tabs is new. And handy.

And, for the borg-averse, you can change your default search engine by clicking on the logo. This gives you a drop-down showing your currently installed search engines and an option to manage the same.

flattr this!

Doudou Linux

Back in December, I acquired an old, old laptop with the intention of letting the twins use it. My eldest already has access to a laptop, which is running openSUSE and configured so that he is able to use it without (usually) needing any help from me. For the twins, though, I thought it would be worth giving Doudou Linux a try.

I have been very impressed indeed.

Doudou Linux is a Debian based-distribution aimed at 2 to 12 year olds. It achieves this by way of a heavily customised LXDE desktop which is very easy for a four-year-old to navigate. The terminal, and some of the settings, are tucked away somewhat – to the extent that I had to go to the online documentation in order to find them – but this makes sense in the context of a distribution aimed at young children. You really do not want a typical pre-schooler to find their way into any of the
settings, ever.

We have been using the live CD version for the past six months, but this weekend I finally found the time to actually install it. The installer is graphical, intuitive and familiar to anyone who has ever installed a Debian based distribution. The only quirk is that there is no icon – we’re back to keeping dangerous options away from little hands again – and you have to find the terminal in order to launch the installer.

The install itself is quick and painless and the laptop really is flying now. This is a very undemanding distro in terms of resource requirements:

To make DoudouLinux run, a PC or Macintosh computer with 256 MB of memory and an 800 MHz processor inside is required.

I have also been pleasantly surprised at the width of the software selection. The Childsplay and Gcompris suites are both included, as is Tux Paint. What has proved popular with the twins is Pysycache, which mainly aims to teach mouse control but comes with a collection of digital jigsaws that are surprisingly entertaining.

Also popular in our household is Raincat, a puzzle game in which you have to keep a cat dry as it travels from start to finish. The controls on this one can be a bit unforgiving and I have found that it works best if I sit with the twins, talk about how to solve the puzzle, and then handle the actions for them.

There are many more games and applications included and one of the many nice touches is that Doudou Linux groups these into age-appropriate categories (an initial menu, Mini Doudou Linux and Whole Doudou Linux) which means that the children can explore what’s available without being overwhelmed by inappropriate choices.

Overall, Doudou is a really well thought out, very nicely designed distribution that does look like it will grow with its target users. I can see us keeping this distro around for many years to come.

flattr this!

Keeping Qshell sessions alive

Not a lot of people realise this, but the IBM i has a POSIX compliant shell environment, known as Qshell. It’s relatively basic (compared to both BASH and the native i command line) but it can be quite handy when I need (for example) to grep a source file.

One thing that has always annoyed me about Qshell, however, is that it doesn’t retain any history between sessions. Given that my workflow will involve starting at the i command line, performing a task in Qshell, and then returning to the command line, the lack of a history lead either to unnecessary typing or copying and pasting commands into and out of a text editor.

Today I noticed that the F12 key can be used to disconnect a Qshell session without actually ending it. And when I next enter the QSH command, I find myself back in the same session with my history intact.

This isn’t going to help with finding commands I typed yesterday, but it will allow me to avoid unnecessary retyping within the same day.


Why use grep to search a source file rather than the more usual FNDSTRPDM command?

Incompetent contractors is the short answer. Incompetent contractors who introduced an unknown number of divide by zero errors is the slightly longer answer.

In RPG, the division operator is / and the comment symbol is //. I could use FNDSTRPDM to search for all the slashes and then manually scroll past all the comment lines. Or I could shortcut this process with the following piped grep:

grep -in '/' /qsys.lib/sourcelib.lib/qrpglesrc.file/program.mbr | grep -iv '//'

I’m lazy. I grep.

flattr this!

First steps in programming

For those that don’t know, Big Trak is a programmable tank. It was popular (with me, at least) in the 1980s and reissued in all its retro glory a few years ago.

Big Trak, if you don’t remember, was an amazingly cool-looking 6-wheeled tank that you could program yourself to move around whilst firing its photon beam. Happily, not much has changed with this new version, which means you can not only relive the fun you had as a kid but, if you’ve got children of your own, pass it on through the family.

A few simple instructions can make your Big Trak go forward a certain number of lengths, fire, and then come back to you. The onboard memory will store up to 16 commands in one go, which means you can easily have your faithful tank-servant completing some complex manoeuvres in no time.

I have one and Alexandre is fascinated by it. So much so that he can now code up the basic manoeuvres himself…

Turning is still a challenge, but we’ll get there.

flattr this!

That Linux feeling… on Windows

I have been trying to get along with Windows Powershell at work for the past couple of months and, while it is a huge improvement on the more traditional Windows console, it is nowhere near as functional as the Bash terminal I spend most of my time in when at home. So I started poking around online and ended up on the Cygwin.

Cygwin is:

  • a large collection of GNU and Open Source tools which provide functionality similar to a Linux distribution on Windows.

This does sound good, but it also sounds like potentially much more than I need. I am, after all, only looking for a terminal that I can use to edit and shunt text files without being driven to curse my keyboard.

Luckily, I do have a small Windows partition on my own laptop, so I thought it would be worth giving it a spin at home before screwing up my work laptop enough to attract the attention of the helpdesk.

Before I go on, I shall reiterate that much of the Cygwin functionality os of no interest to me. I really am just looking for a functional terminal environment that I can use while at work.

The install was easy enough. This being a Windows application, it’s just a case of downloading the setup.exe file and clicking on it. You do need to hang on to this file once the install is completed, though, as it also provides the package management functionality for Cygwin. As someone who frequently bins everything, this felt a tad odd to me – but it’s not a problem.

The install creates its own file structure under C:\cygwin64 which took me a moment to find. That said, it makes sense that the *nix environment isn’t mixed up with the rest of the Windows stuff. It’s easy to find and, once you are aware of this, the Cygwin terminal starts in the expected folder.

And onto Vim. This is installed by default, or appears to be. Even though the initial screen says Vi Improved, it does look like Cygwin is actually installing Vi by default.

So I added an alias (alias vim=vi) to my .bashrc and renamed my .vimrc to .virc and then things went a bit wrong as Vi is unable to support any of the functions in my default .vimrc. So, back to the setup.exe file I went where I found and installed vim-minimal.

This does not seem to have helped as I am still seeing a whole bunch of comman not available errors.

I was also rather unnerved when I tried the ftp command and saw my password being echoed back at me as I typed it.

At this point, one of the twins came in and wanted to play Cat and Mouse and I’d had enough of being in Windows, so tinkering was abandoned. But, based on first impressions, the Cygwin Terminal is going to struggle to meet my needs.

The search continues.

flattr this!


The Akismet spam filter in WordPress really is very good indeed. It does an excellent – and endlessly improving – job of identifying and deleting comment spam that I can simply leave it running and forget about it.

Nothing is perfect, however, and the occasional comment does make it through to my moderation queue. Like this one:

I am John, how are you everybody? This paragraph posted at this network site is really fastidious.

And the post containing this comment worthily fastidious paragraph… Is here.

flattr this!

Using SQL to update one file from another

With a recent interface change, I was asked to go back and fix all of the affected historical data so that it matched the new requirements. Updating a field in one file with a value from a different file is something I have done several times in the past (far too many ah-hoc queries have been launched, if truth be told) and, while you do need to take a bit of care, the approach is pretty simple.

So here is an example (some names have been changed to protect the proprietary):

update target_file upd
set target_field = (select source_field from source_file
                    where source_key_1 = substr(upd.target_key, 1, 16)
                    and digits(source_key_2) = substr(upd.target_key, 17, 5) )
where exists (select source_field from source_file
              where source_key_1 = substr(upd.target_key, 1, 16)
              and digits(source_key_2) = substr(upd.target_key, 17, 5) )

The script is pretty simple. For each record in target_file for which an associated record can be found in source_file, populate target_field with the value in source_field. Obviously, the select clauses will need to reflect the relevant keys of whatever files you happen to be using.

Inevitably, there is a gotcha: for each record in target_file that you want to update, there must be exactly one record returned by the subquery. Handling this can be split into two parts.

The first part is handled by the where exists clause which ensures that the script will only attempt to update records in target_file if there is a record in source_file with which to update it. This ensures you don’t get caught out by subqueries that return zero records.

The second part involves that the subquery returns no more than one record for each record in target_file. This, unfortunately, cannot be solved generically – you just need to be a bit careful to ensure that the subquery selection is returning unique records. If in doubt, a variation on the below SQL can be used to validate.

select source_key_1, digits(source_key_2), count(*)
from source_file
group by source_key_1, digits(source_key_2)
having count(*) > 1

If you can’t find a unique selection criteria, the distinct clause may help and, if all else fails, try arbitarily using either max() or min().

flattr this!

Fat fingered discovery of the day

It’s amazing how much you can learn with a little clumsiness. In my case, all I wanted to do is power off the screen on my Fairphone and, instead, I took a screenshot.

A quick search reveals that this is because I (unintentionally) had my thumb on the volume down button when I pressed the power button.

So now I have a screenshot, so here it is.

flattr this!

Vim in Powershell

Because, why not.

And because I am stuck in Windows Land while at work.

And because I found myself playing around with Windows Power Shell. It’s not as good as Bash by a long stretch, but it is a significant improvement on the old Windows cmd almost-terminal. And, because I like to be able to move from task to task, without having to constantly switch windows, I thought I would give it a try.

The first thing to do, of course, is install a decent text editor. This is easy, a Windows binary exists for Vim so I downloaded and installed it. Then comes the fun bit.

Getting it to work in Powershell isn’t exactly difficult, but there are a few hoops that need to be jumped through and no clear overview of what and where these hoops happen to be. And that’s why I am posting this.

First, you need to allow scripts to run. This is not enabled by default because, obviously, if you have a scripting environment, the last thing you are going to want to do is execute scripts. Fortunately, this is easily checked and altered by means of the execution policy.

To see the current state of your execution policy, use:


This will probably tell you it’s restricted, in which case you need to tell it to run scripts by typing (or pasting):

Set-ExecutionPolicy RemoteSigned

(You can also set the execution policy to AllSigned or Unrestricted, but RemoteSigned is sufficient for now.)

Next, you need a Powershell profile (why is it that Windows terms all feel like they should be wrapped in a blink tag?), which can be created by typing (or pasting):

new-item -path $profile -itemtype file -force

And now you need to edit your profile to add a Vim alias. You’ll need to do this in Notepad:

notepad $profile

And then paste the following:

set-alias vim "C:/Program Files (x86)/Vim/Vim74/./vim.exe"

# To edit the Powershell Profile
# (Not that I'll remember this)
Function Edit-Profile
    vim $profile

# To edit Vim settings
Function Edit-Vimrc
    vim $HOME\_vimrc

(Obviously, you will need to amend the Vim path name to match the reality on your system.)

And you’re done.

I’m not sure how much use I will actually get out of Vim at work as my workflow often involves copying and pasting text from one application to another – and for that Notepad++ is probably still a better fit. However, having an additional tool certainly does no harm and I can certainly see cases where having the power of Vim available will be useful. For now, I will use both and see how each fits into my workflow.

And finally, this post was brought you you with the help of Microsoft, Marlon Abastar and Julian Kay.

flattr this!