Not exactly a blog, but a few of what I think are the more interesting things I've posted on the web. There's also more articles from the archives here.
Dynamic hostnames from shell variables in Apache
I was recently working within a development team that works on a web application and we each have our own
individual development virtual machines (dev VMs) to work on an on-line application. We therefore needed to have
Git controlled local VM configs so that all developers' local VMs (and ideally all network staging VMs) use the
same set of Apache configuration files and that these can be easily maintained and updated by developers using
Home-made "spider" omnidirectional wireless / wifi antenna
Quite a few years ago now, my colleague Dave wrote this
article on building your own omnidirectional wireless antenna. Dave's introduction tells the story "This
omni directional antenna, nicknamed the Spider Omni, was built in response to finding a simple diagram in an old
book. After scaling to the correct frequency, it was built to help augment an 802.11b vehicle-based community
wireless network effectively and cheaply. The original prototype is still working well after three years. This
document explains how it was made." ... well an antenna made shortly after the original prototype is still
working well after twelve years!
Example of field auto-complete and form auto-populate and using a foreign database in Drupal 7
I was recently needing to make an improvement to a development skateboard that I'd done for some users a few
months prior. The users had had a requirement for a new system to be delivered in a time frame that meant
implementing it in Drupal seemed like the right thing to do.
The application worked and the users were able to get on with their jobs.
However, over time it emerged that they were loosing time having to rekey information from one of our existing
systems (written in Perl with MySQL as it's back-end) into the Drupal application I had made for them.
How to delete a directory with millions of files in under Linux - everything else was hanging
I had an enormous number of files in a directory* that I couldn't delete and I couldn't work out how to do it. I
tried lots of things, the basic rm -rf, putting it through xargs, and then some suggestions of writing something
custom in PHP, in C and I also tried Perl myself; all of them eventually caused a massive load on the server
(presumably in building a list of the files it was to build) and had to be aborted. My hunch is that Linux
cannot handle the huge number of inodes (the internal things that represent the files) and with most commands it
tries to build an index of all the inodes and effectively exhausts its memory.
Fadaiat 2004: Wireless 802.11b link across the Strait of Gibraltar
Back nearly ten years ago in 2004 I was involved in a No Borders
HackLab project in Spain called Fadaiat. As part of the HackLab we set up a wireless link between the Castle of
Guzman El Bueno in Tarifa, Spain, and nearby to CafÃ© Hafa in Tangiers, Morroco.
Here is an article that I wrote all about it. It was also
featured in the Spanish-made documentary En Busca de Hackers (In Search of Hackers), which you can watch on YouTube.
"Neutrino" - my old PowerBook Titanium
I recently got my old PowerBook G4 Titanium (aka Neutrino) going again. I have an old huge and heavy 320GB LaCIE
hard drive that is Firewire 400 and formatted in UFS (Unix File System) and I couldn't find any modern
device to access it. I used the laptop for lots of festivals and events and lots of activism-type things back
10-12 years ago, so it's got a lot of nostalgia for me.
The paint's come off from around the plastic surround and the track pad no longer works, so I have to plug a
mouse in ....
One of the hinges is missing as it seized up. I've also lost the screws (replacing the hard-drive) and the thing
is held together with some sticky tape...
It's not the original keyboard, but a replacement, but I'd lost a key, so the "O" comes from an old defunct iBook
The power lead had a nasty encounter with a gas ring on a cooker hob one day... so a few bits of insulation tape
and a bit of solder did the trick.....
OS X 10.4 is the most modern version of OS X I can run on this machine... I could do with upgrading the RAM a bit
from the (these days) measly 512MB; seemed like loads at the time...
And the top's all covered in stickers that show of my then activist kudos, a bit of history there....
But the thing still works fine (battery doesn't last very long these days) as a basic computer (more a Desktop
than a laptop). I can visit most web sites and they work okay using Safari and Firefox. The main issue is
finding versions of software that will still run on PowerPC....
I'm hoping it'll last for many more years to come... I wonder what year it'll become completely redundant...
A very simple link shortener / simplifier written in PHP
There's lots of web sites that provide link shorteners (bit.ly, tinyurl.com, imc.li, tiny.booki.cc; to name but a
few). In the past I'd always used tinyurl.com, but then I started working on a project to provide a book of useful technical
tips for political activists and grassroots campaigners and some people on the project were concerned
about the security implications of third parties logging the redirects, having to have a named account in order
to edit the links and the potential of the links being taken down due to policy or petition. The commercial
offerings were therefore not fit for purpose for this project.
And so we cunningly used a free, non-commercial link shortener for our links. All seemed good, but then what
happened was that the destination links changed (without notice I might add). We were unable to change the
shortened links as there was no management side, nor did we manage to get in touch with the authors to get them
to do it for us. Another link shortener being offered to us to use didn't offer any editing of the links either,
so I thought to myself how hard could it be to write one? Not very hard surely...?
Using real names in Drupal 7
For a project I'm doing, I recently migrated to Drupal 7. This was no mean feat in itself: I did try to upgrade
from 6 to 7, but the differences between the two meant that this really didn't work. Luckily the site was still
in development with only test data in the database, so I bit the bullet in deciding to completely ditch my work
in D6 and start again from scratch in D7. It took some time to do, but overall, the end result is better than
the D6 version, not only because I implemented things better the second time round, but also because of the fact
that D7 has more stuff in core that works, such as image field handling; but not, note, Views. One wonders how
come it's taken until version 7 to have custom fields and image fields as core functionality of a CMS and
Drupal 7's Access Control module prevents View of user's own unpublished content
I was pulling my hair out about some Drupal 7 Views weirdness! For some reason my normal users weren't able to
view their own unpublished content even though they had the permission View own unpublished content
permission set under the Node section. Users could view and edit the node if they went
to the node directly, but it wasn't possible to show the node in a view, unless the user was an Administrator
that is. I had got to the point of installing and using the Views Unpublished module, but this seemed like an
Renewal battery calculator
couple of friends have been asking me about what batteries they require to run a 12volt sound system. I spoke to
them about it a bit, recalling what I'd learnt from folks such as Raymundo and Clive Magrec. Then I had a bit of
a read up on good old Wikipedia and thought I'd put a summary of it together for them; I got a bit carried away
Check it out online at this wonderful
Mandlebrot and Julia set explorer using HTML5 Canvas
interactive Mandelbrot and Julia set explorer, with no other code. All that's left is to add a zoom function :P
Take a look at the Mandelbrot and Julia
set generator using HTML 5 canvas element.
There's also an archive of old Fractal work I
did with Dan Grace back in the Eighties. This program, called the Fractal Engine, was a Mandlebrot and Julia set explorer written
in GFA Basic for the Atari ST.
Clone and fork this project at GitHub
(c) 2017 Mike Harris & Broad Bean Productions Ltd. Copyleft where specified.