Thursday, January 3, 2013

Gallery3 - really quick method of resetting the content of the gallery

If like me you can't find out how to delete multiple images at the same time, here's a very quick method of resetting gallery3 back to it's original configuration in 2 steps.
This will delete all of the photos and the settings of gallery3, but will leave the added modules installed but not enabled. Use this process at you your own peril.

Step 1 - Delete Gallery3's var folder, usually maintained under /var/www/gallery3/var.

rm -rf /var/www/gallery3/var/*
 Step 2 - Drop the database.
$> mysql -u root -p (prompts for the root password interactively)
mysql> show databases;
| Database                 |
| information_schema |
| gallery3                   |
| mysql                      |
| performance_schema |
| test                          |
4 rows in set (0.00 sec)

mysql> use gallery3;
mysql> drop gallery3;
mysql> exit

Now, reconnect to gallery3 with a web browser and reconfigure gallery3 from scratch.

Monday, May 28, 2012 Modus operandi: Ignorance of customers is bliss!

Nearly a month later, I'm still without an invoice! I have tried to submit my expense in work using the shipping email which they sent me when I placed the order, but it has been bounced for re-approval. I strongly suspect that are not VAT registered in the UK, or are trading illegally, so providing a VAT invoice may provide a financial trail which they are keen to avoid doing. But of course, this could be completely incorrect and they may be a legitimate company just unable to satisfy customer needs in the most basic sense. Sad really considering that if they can't find the focus to keep their business working in a recession, they won't survive. More (one-sided) updates as soon as I have them!

For the curious, here is the email thread!

From: Customer Name
Sent: 16 May 2012 11:06
To: 'Homechip Orders'
Subject: RE: [CASE:139xx] Invoice query Enquiry from HomeChip
Importance: High


I'd appreciate a quick turnaround on this simple request.
I have spent a lot of money with you over the last year and I feel that the response time to requests is not acceptable.
As I paid for this with my personal credit card as you do not take AMEX corp cards, it is delaying the repayment from my employer. A previous request which I sent you many months ago was also ignored and I received no response.
Is this the way to do business in a recession? Do you actually want my business?


From: Customer Name
Sent: 14 May 2012 16:15
To: 'Homechip Orders'
Subject: RE: [CASE:139xx] Invoice query Enquiry from HomeChip

Hi Benedicte,
I have not received the invoice. Could you please resend it?

From: Homechip Orders []
Sent: 10 May 2012 15:51
To: Customer Name
Subject: RE: [CASE:139xx] Invoice query Enquiry from HomeChip

Dear Customer,

Invoice 345xx has bee emailed separately. 

Best regards, 


On 03/05/2012, 03:32pm, Customer Name (Customer wrote:
Order ID: 244xx


Could I please request an invoice be sent to me in PDF format for my purchase under order number 244xx.

Customer Name

Monday, May 21, 2012 not responding to customers

Following my post last week, I still have had no response from It's not like I'm asking them for something difficult, it's just a PDF copy of an invoice which I'm entitled to. Amazingly bad customer service from Not a happy customer.

Thursday, May 17, 2012

EDS OW-SERVER-ENET and my experiences with

I recently made a purchase with to outfit one of our IT datacenters with some 1-wire thermal management devices based on the Embedded Data Systems OW-SERVER and a bunch of T-sense probes. Given that the probes have RJ45 connections, it makes light work of wiring them in-situ rather than using discrete components. The OW-SERVER does use RJ11 sockets, but this isn't a problem all things considered.
I'll locate the probes in both the hot-aisle and cold aisle and also on the output of the overhead AC units. The OW-SERVER uses allows SNMP access to the readings from each probe, so it make for easy integration into scripts or even Nagios/Cacti or the like.
I plan on pulling data from the cold, hot and AC areas, averaging each group and then writing the result into an RRD database for easy graphing.

As can't accept our Amex corporate card, I had to make the purchase on my personal credit-card to claim the expense (£350) back later on. The order for the equipment was processed quickly and the parts despatched, so I requested an invoice in PDF format so that I could submit it electronically in the office.
Well, that was requested on the 3rd of May, some 15 days ago, and while homechip told me that they have sent the PDF "has bee emailed separately" I have not yet received it despite asking twice. We do have spam filters on the incoming mail, but I have received no notification to say that the message has been blocked, plus they also have my gmail address under my account. It's not the first time either - months ago I asked them if they could source a specific 1-wire component for me, but I had no follow-up then.

It makes you wonder - in a recession, is basic customer satisfaction not a priority? How do I claim my £350 without a headed invoice that isn't just a simple email?

Monday, February 1, 2010

Configuring RRDtool to display 1-wire results

I can't claim much credit for the scripting I used to generate graphs as it's all based on this excellent guide on owfs's site: owfs Gardening

Here's something I learned though...
Run the script provided to make the database, but notice the following: The script provided uses '--step 300' and 'AVERAGE' settings. These two items are critical to understand, otherwise like me, you'll be wondering why the rrdtool graphs don't update if you run the data collection script very frequently (for example, every minute).

rrdtool create temperature.rrd --step 300 \
DS:temp:GAUGE:600:-273:5000 \
RRA:AVERAGE:0.5:1:1200 \
RRA:MIN:0.5:12:2400 \
RRA:MAX:0.5:12:2400 \
The sample rrdtool create statement from rrdcreate's man.

To explain this as best I can, rrdtool is fed with a batch of results retrieved from the temperature sensors at 1 minute intervals (assuming you setup cron to do so). As the step is set for 300 seconds, it doesn't populate it's main table with these results until 300 seconds after the last update, instead it retains them in an 'archive'. Then on the 300 second mark, it averages the results and publishes them.
So, if you took 5 readings in that 300 second period, lets say of 5, 10, 15, 20, 15, you won't see this displayed in the graph, instead it will be replaced by the average of 13.

This is well explained in the rrdcreate man.

This leads into a separate question... considering I created the initial database using a step of 300, how can I modify this to a shorter step retrospectively? Well you can do it, but just be aware that it doesn't maintain data integrity.
As the values published to the database are 'points in time' of 300 seconds each, modifying the step will cause the data points to assume this new time-scale. In my case, I ran the command 'rrdtool dump temperature.rrd >> database.xml' to output the database into an XML file. I then modified the step values in the second line of the database from 300 to 120 seconds. I then backed-up my old database and exported or 'rrdrestor'ed the data into a new database with the command 'rrdrestore database.xml temperature.rrd'.

On generating graphs with the new database I noticed that the shorter step of 120 seconds caused the newly graphed data-set to compact, effectively making each of the individual records into 120 second events, rather than the 300 second ones which they really were.

Hence, I believe it's true to say that there is no method of retrospectively adjusting the step of an rrdtool database as it affects the 'point in time' nature of the events contained within it.

Saturday, January 30, 2010

Installing and configuring OWFS under Ubuntu Karmic Koala (9.10)

Just after the very cold spell in early January 2010, I read a post by a guy called Dave (ravydavygravy) in which he queried the use of 1-wire systems in weather monitoring.
Having an interest in this subject, I read up on this system and was immediately interested in it's capabilities. I have often looked for a simple method of measurement and control and this 1-wire system coupled with owfs seems to offer it. Of course it's early days yet, but I placed an order for a couple of parts online and set about getting this working on Ubuntu 9.10. Here's how...

I ordered the following from homechip in the UK :
6x DS18B20 1-wire temperature sensor
1x DS9490R - USB 1-Wire / iButton Adapter (RJ11)
and a few RJ11 crimp-plugs.

I tested the basic 1-wire system on a breadboard and I used the software test-tool which Maxim supply to initially, and very simply, read the temperatures from a couple of sensors.
OneWireViewer Demo

All functioning, I set about getting it running under OWFS, which proved a test of my limited bash skills.

Instructions came from the ever helpful community.

Generally, I'm not into having to build applications at all under Linux. Having had a bad run-in or two with kernel builds in RedHat 6.2; having to type 'make'-anything left a taste in my mouth. :)
I find that there is variance in Linux/Ubuntu builds, hence it's never a straight-forward process.

So I set about installing the packages to support building OWFS:
'apt-get install automake autoconf autotools-dev gcc g++ libtool libusb-dev fuse-utils libfuse-dev swig python2.4-dev tcl8.4-dev php5-dev'

I got 404's on some packages and a hint from apt that Ubuntu may be short a couple of updates. I realised at this point that my test system hadn't been booted in 4 or more months, so apt wasn't up to date.
So, I ran 'apt-get update' and then re-ran the apt-get as above again. All worked OK this time.

I moved the downloaded source code into directory /usr/src as directed.
Then onto the simple matter of extracting the files:
'tar zxpf owfs-2.7p26.tar.gz'

Move into the /usr/src/owfs directory and then start the process of building in earnest.

While ./configure passed off without issue, I remembered from the past that I had problems with permissions when running the 'make' part of the process, so I sudo'd the command just to be sure.
'sudo make && make install'

Unsurprisingly, to myself anyhow, I got an error:
'/bin/mkdir: cannot create directory `/opt/owfs': Permission denied'.

So, I did a ...
'make clean'
And then retried 'sudo make && make install'

It failed with the same errors.

Rereading over the readme notes which were included with the .tar, it mentioned installing the USB DS9490R controller before running make. So, I attached the USB dongle as instructed and ran:
'sudo make && make install'

This time, it builds OK and installs.

(Note here that in the owfs readme, it mentions running 'make install' as opposed to 'make' and then 'make install'. Try this if you still have issues.)

Then onto the home-run... or so I thought...
'sudo mkdir /var/lib/1wire'

Then I ran
'modprobe fuse'

And I got "FATAL: Module fuse not found."

I reinstalled fuse from apt again but the same error returned. I simply ignored the step and continued on regardless.

I created a directory in mnt called 1wire and used that in the statement instead of the /var directory.

On running :
'/opt/owfs/bin/owfs -U -F /var/1wire'

as per the instructions in the 'community', it gave:
'./owfs: invalid option -- 'U''

I checked the man for owfs and found that the command 'owfs -U -F...' should use a small u instead of a capital U.
Tried this and got a more postive response.

'sudo ./owfs -u -F /mnt/1wire/'

'DEFAULT: ow_ds9490.c:DS9490_sub_open(552) Opened USB DS9490 adapter at 006/002.
DEFAULT: ow_ds9490.c:DS9490_detect_found(412) Set DS9490 006/002 unique id to 81 D0 3C 2C 00 00 00 A9'

'sudo ls /mnt/1wire' shows:
'28.2F8B87020000 81.D03C2C000000 bus.0 simultaneous structure uncached alarm settings statistics system'

So above, I see a number of devices attached to the USB dongle - one reporting a '28.x' family name.
You can lookup the family names here and you'll see that 28 is a thermal sensor.
So, I've got the devices reporting on the bus, that's enough for the moment...

Monday, January 11, 2010

Tefal Quick Cup modification

I purchased a Tefal Quick Cup back in 2007 soon after they launched. I initially thought it was a great idea to have 'boiling' water in measured quantities. Not long after, it fell out of favour at home here as the temperature of the water wasn't up to scalding teabags.
I measured the water temperature with a spirit thermometer, coming out at a chilly ~75 degrees C. Couple this with a cold cup and you have insufficient heat to brew tea.

The decision to modify it was simple - it either had to be assigned to the attic as a poorly designed fad-item or get placed in the WEEE recycling bin!

Warnings: I'm not including photos of the process here as anybody who tries this needs to know what they are doing, or face possible electrocution (no, I won't personally administer it). This process will void your warranty on your already useless Quick-Cup. I accept no responsibility for any damage caused or harm done.

T-15 star bit.
Flat-blade long shaft screwdriver (>15cm).
1x 10k ohm PCB mountable variable resistor.
1x 4k7 ohm resistor. (a 0.25W or mini-resistor should be fine here.)

1. Open the Quick Cup by removing the two star screws from the underside. Using the cord, lift the base away from the shell of the unit. The base is push-fitted into the body, so needs some force to free it.
2. When the base is loose you will note that the internal piping connects to silicon tubing via push-fit connections. Note the layout of the piping, pump and mains cord. Pull the base away from the pump to free it.
3. Disconnect the pump from the body and disconnect the power leads. The pump is not electrically polarised, so the two grey wires need not be replaced in the same position.
4. Looking into the body, locate the 5 locking tabs which retain the top button-panel to the body. Using the long shaft screwdriver, push the tabs outwards and then down to free them. Work on the tabs in a circular pattern to free the rear of the panel, then pull the panel off once all 5 tabs have been freed. This will expose the circuit board.
5. Loosen the PCB.
6. Remove the heater element and PCB from the body by withdrawing it through the bottom of the base. The heater element is retained with a silicon connection which slides open easily.
7. Observe the heater element connection with four cables running to it. The outer two of these (salmon coloured) serve to deliver power to the element, while the inner two (white) are the thermistor. The thermistor reads ~107k ohms at room temperature (~22 degrees C).
8. Observe the PCB track layout from the two white wires. One of these PCB tracks runs to a resistor (220 ohm I think) and the track is exposed and easily cut.
9. Solder the 10k variable resistor and 4k7 resistor in series on a suitably long twin-core wire to allow it to be installed alongside the PCB.
wire=--------| 4k7 |-------| 10k var |------------=wire

10. The variable resistor needs to be installed in series with the thermistor on the heating coil. This is done by soldering one end to the solder pad for the 220 ohm resistor already on the PCB and the associated solder pad for the connection block for the thermistor, again on the PCB.
11. Break the PCB trace between the resistor and the connector pad. Check the new connection with a multimeter - you should read anything from 4k7 ohms to 14k7 ohms.
12. Using a multimeter, adjust the variable resistor to near to 0 ohms.
13. Reassemble the unit *on the base*, but leave the top button cover off. Reassembly is not the reverse of disassembly.
  • With the plastic body of the Quick-Cup aside, attach the pump to the water holder connector, noting the directional flow arrow on the body of the pump.
  • Attach the pump to the silicon pipe which leads to the heater unit and push-fit this to the base.
  • Attach the wiring to the pump and orientate the wiring so the connections point skywards.
  • Ensure that all the wiring passes through the centre of the heater.
  • Pass the plastic body down over the PCB and heater element and push-fit onto the base.
  • Locate the heater onto the pipe which runs into the neck of the Quick-Cup. Fitting will seem loose as it's a silicon connection again.
  • Fit the PCB in place, routing the new variable resistor to the side of the unit.
  • Check and double-check your work.
14. The unit will now be fully reassembled except for the button-panel. Do not replace this just yet as it will lock in place and you won't be able to adjust the variable resistor.
15. *SAFETY WARNING* When plugged in, the PCB is LIVE and has exposed mains wiring. Assume that the variable resistor is also LIVE. DO NOT adjust the variable resistor when the unit is plugged in! Water and mains electricity do not mix!
16. Replace the water holder with a quantity of water which has been allowed to rise to room temperature and plug the unit into the mains.
17. Using an INSULATED screwdriver and one hand behind your back, carefully press the hot water delivery button on the PCB.
18. Measure the temperature of the water at the spout.
19. If the water temperature is too low, DISCONNECT the Quick-Cup from the mains, then adjust the variable resistor to 2k ohms. Retest the water output. DO NOT set the water higher than ~93 degrees (~2.5k ohms on the variable resistor) as the water will boil and splatter on exit.
20. Once the unit has been setup as required, Insulate the variable resistor with electrical tape and locate it safely in the upper lid of the Quick-Cup.
21. Replace the button-panel and also replace the star screws in the base.

Enjoy near boiling water from your Quick-Cup.

A modification of this would be to use a panel-mountable variable resistor and mount this in an accessible part of the quick-cup body. This will allow for temperature changes in the incoming water. I have found that water which comes directly from the tap (at ~7 degrees C) doesn't get up to temperature effectively. This may be a limit on the power of the heater versus the flow-rate of the pump, but I haven't tested this to be sure.