Mikedowney.co.uk
What's New
Site Map

Diary
Astronomy
Bits N Bobs
Computing
Food And Drink
Links
Photography
Welcome


Recipe Collections
Recipe A Week 2013
Recipe A Week 2010
A-Z of Regional Cakes


Selected Entries
Pinhole Photography
Keeping Quail
Coventry
Recipes
A different recipe each week
Friends websites
Oven Temperatures and Measuring Cups


Most popular stories
A Hamster's Home is his C...
Hamster Peanuts
Simple HDR photography wi...
A Tangfastic Mess
Halloween Animal Beds
Pizza, Hamsters and Ballo...
Hamster Baby Update
Decaffeinated Coffee
More Squirrel Photos
Not Quite HDR photography
Giant Sunflowers


RSS Feeds:
RSS Feed Entire Site.
RSS Feed Diary only.



Powered by Blosxom


Pinhole Photography Ring
pinhole webring logo
powered by RingSurf
Next | Previous
Random Site | List Sites

A few things I have learned this week

Story location: Home / Blog /
06/Mar/2009

I have been using Skype to talk to Emma while she's away for the week. I started by using the USB microphone which came with Guitar Hero but earlier today I found out that my laptop has a built in microphone. I can't find a mention of it in the user manual. For some reason Dell have decided to keep quiet about it.

I saw the Diet Coke advert with Duffy riding her bike and singing. It is an awful pile of !"#*%. Her voice sounds terrible.

A cup of hot chocolate, thickened with cornflour, makes a quick and easy chocolate custard.

And talking of hot chocolate, I tried a chocolate peanut drink, by stirring a couple of spoons of peanut butter into a mug of cocoa. I couldn't really taste the peanuts properly, and since I only had crunchy peanut butter in the house, the lumps didn't fit with the rest of the drink.



The annoying marquee tag

Story location: Home / computing /
11/Feb/2009

I regularly use a few forums (fora?) and one of the other members has started using the <marquee> tag in his signature. It's rather annoying to have text whizzing across the screen while you're trying to read something.

With Firefox it's possible to disable the marquee tag, so the text doesn't move. There is a file called userContent.css which is located in the chrome subdirectory of the Profiles folder, which in turn can be found hiding in the C:\Documents and Settings\<username>\Application Data\Mozilla\Firefox\ directory (at least that's where it is in Windows XP).

Load this file into a text editor, or create the file if it doesn't exist. Add the line:

 marquee { -moz-binding: none; }

then restart the browser. The annoying marquee text will no longer move.

Update: On the mac, the profiles folder lives in the Library/Application Support/Firefox subdirectory of the user directory. With newer versions of Firefox, this can be found by clicking on Help->Troubleshooting Information



Funny Google Background Colours

Story location: Home / computing /
26/Sep/2008

I recently changed the default background colour on Firefox from white to grey so that I could check the transparency on some images before uploading them to the site. I didn't bother to change the colours back because I didn't think I needed to. I expected that these days most web pages would define a background colour if they needed one.

The normal google home page looks ok but some of the other pages seem to expect the default white. The Google logo and icons appear with white backgrounds but the rest of the page is defiantly grey.

Google with grey background



New CAPTCHA for comments

Story location: Home / welcome /
18/Aug/2008

I've modified the comments system to use the reCAPTCHA system, rather than my home-made one which relied on the user to count the number of animals in a photo.

reCAPTCHA helps digitise old books by letting people type in words which are a challenge to OCR systems. More information can be found by clicking on the link above.

UPDATE:

Not impressed so far. Only an hour after installing the reCAPTCHA, I received 2 spam comments. Under my old system I rarely got any spam comments. I'll give it a day and if it stays like this I'll put the old CAPTCHA back.

UPDATE UPDATE:

Two hours later and another spam comment. I'm putting the old CAPTCHA back. I had hoped that reCAPTCHA would work. I didn't expect to get more spam with it installed.



Trying to prevent image theft 2: Watermarking images

Story location: Home / computing /
14/Apr/2008

Yesterday I mentioned using the .htaccess file with Apache to prevent people hot-linking images. That would only be a temporary solution, which would stop current hot-links from working. Any future image theft would involve people downloading images and re-uploading them somewhere else.

See more ....
One way of stopping that is to add a watermark to each image. There are a lot of websites explaining how to do that manually in Photoshop or Gimp, but I needed a simple way of adding a watermark to several hundred images.

I had heard about Image Magick and thought it might have a way of doing it. There are instructions here explaining how to do it.

The images on my website are spread across a lot of directories, so I wrote a small perl script to watermark all the images in a directory (including subdirectories):

#!/usr/bin/perl
# use ImageMagick to add copyright watermark to images

use File::Find;
use strict;

my  = "jpg|png";    # file extensions to apply watermarks to
my /computing = "/images";      # directory holding the images
my  = "/copyright3.png";    # full path to watermark image

sub processFile{
    return if ($_ !~ /.*\.[]/);
    my  = ::name;

    `composite -dissolve 10% -tile  "" ""`;
}

find(\&processFile,/computing);

The /computing and `` variables should hold the full path for the directory and watermark file. You'll need to produce an image with a transparent background for the watermark.

Changing the 10% value gives a ligher or darker watermark, depending on how obvious you want it to be.



Trying to prevent image theft 1: Using .htaccess

Story location: Home / computing /
13/Apr/2008

I've had a problem recently with people stealing images from my website - either hot-linking them or re-uploading them to other sites. My first attempt to stop this was by modifying the .htaccess file on the web server, telling it to only allow image requests from recognised places.

See more ....
This works because most browsers send a 'referrer' value which tells the web server where the request came from. If I display an image on my site, the referrer should be 'mikedowney.co.uk', which would be allowed. Requests from other sites would be disallowed.

This should work with most sites hosted on an Apache server. I added the following lines to the .htaccess file:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?mikedowney.co.uk [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.(\.)? [NC]
RewriteRule \.(jpg|jpeg|gif)$ /image_error.png [NC,R,L]

The first line tells the server we are using the RewriteEngine to change how some URLs are handled. The next 3 lines specify which referrers are allowed to link to images. We have:

  1. Empty referrer. This is because some browsers may not correctly fill in the 'referrer' line when requesting images.
  2. This website - it would be pointless to disallow me from showing my own images.
  3. Any of the google servers - so that the google image search will work properly. The (.)? bit at the end should match different countries, such as google.com or .co.uk etc.

The final line gives the file types this applies to and the file to display if it matches. In this case, an image with an error message.



Previewing Posts

Story location: Home / computing / blosxom /
05/Apr/2008

The Blosxom blogging system doesn't have a built in way of previewing posts before making them publicly visible. There are various plugins available but for me they seemed to overcomplicate things.

I have been using the Blosedit post editor which includes a preview option but if any Blosxom plugins are used to alter the page appearance (such as Markdown or photo galleries) then the page won't display correctly.

My solution requires the entriescache plugin to keep track of posted stories. Normally, any stories will only show if entriescache knows about them. I set the delay variable to a high number eg.

$delay = 9999;

to stop the index from being rebuilt unless I say so. This means that I can add new posts without them showing, until I tell it to rebuild the index.

To display all posts, not just those in the index, I made the following change to entriescache:

sub start {
    # Force a reindex
    $reindex = 1 if (CGI::param('reindex'));
    return 0 if (CGI::param('preview'));
    return 1;
}

Entries are written as normal, then they are viewed by adding ?preview=yes to the end of the URL. If am I happy with the entry, I put ?reindex=yes instead.

This method can also work with the wikieditish plugin too, by adding:

<input type="hidden" name="preview" value="yes" />

to the form in the foot.wikieditish file.



The Crap Supercomputer

Story location: Home / computing /
22/Jan/2008

I was searching for some information about the Cray Y-MP computer. The article I found was a PDF scan of an old paper. The OCR seems to have got slightly confused. I didn't realise there was a Crap 2 computer or a Gay Y-MP.

The Crap-2 computer



Why I hate DRM

Story location: Home / computing /
02/Jan/2008

I have never had a positive experience with DRM (Digital Rights Management). I can appreciate why content producers use it, to restrict unlimited copying of their copyrighted materials, but in my experience it just doesn't work.

Part of the problem is that it relies on proprietary (and possibly untrustworthy) software which often demands a specific computer setup. The original version of the BBC iPlayer insisted on Windows XP and the latest version of Media Player. Pretty much the same configuration was specified for Channel 4's 4OD system. Despite my computer complying with all of the requirements, neither system would work on it. I never managed to work out why. I eventually managed to get iPlayer to work on my new laptop.

See more ....

At least the BBC now let you watch episodes on-line, using Flash and streaming, but XP/Media Player are still required if you want to download episodes. Downloading or streaming is usually only available for a week after broadcast, but downloading has the edge because you then get 28 days to watch the episode, which is handy if you don't have time to watch an episode straight away.

My main gripe with DRM is the complete lack of control I get. I cannot copy episodes to a portable media player, so I can only watch them on my laptop pc (which I can't connect to my TV) rather than on my Creative Zen (which I can).

I have had TV episodes 'expire' and refuse to play, despite the download library claiming I had several days left on the 'licence'. The worst experience was with music I downloaded from the '3 Music Store'. All of the music files were infested with DRM and somehow the licence files managed to get corrupted. All the files I had downloaded during the last year or so suddenly refused to play. The backup licence also failed to work. One good thing about the 3 Music Store is that it allows you to re-download the files at a later date. This only worked if I downloaded the files on my other computer, but at least I managed to get the files working again.

I will never consider buying any music or video which contains DRM (the '3' files were downloaded as part of the monthly allowance with my phone contract). There is no way I'll pay for music where somebody has the ability to deny me access to it. I'd rather buy a CD or DVD which should work on different machines, won't force me to upgrade my computer before playing and would be less likely to suddenly stop working.



Setting up the Backup Software

Story location: Home / computing /
15/Oct/2007

Read Part 1.

Part 2

On the Desktop Computer

Setting up the FTP server was straightforward. After installing the programme, select the User Manager and click 'New' to add a new user.

See more ....
Setting up the FTP Server
You'll need to:

  • Set the password. If the computer is behind a firewall and can't be reached from outside, it'll be safe to set it to blank.
  • Add a 'root' directory. This will be the directory where the files to be synchronised are. The name used on the FTP server doesn't have to relate to the actual name on the computer.
  • Don't forget to give the remote user access to the directory by clicking on it and selecting read/write/create permissions.

On the Laptop

Setting up the SyncBack software was slightly more complicated, due to the extra options available. From the Profiles menu, select 'New' and choose 'Synchronisation'.
Setting up SyncBack
Give the profile a sensible name, then click 'OK'. The profile settings box should appear. Click on Expert to open up more options.
Setting up SyncBack
The 'Source' directory is the directory on the computer which is to be synchronised with the server. The 'Destination' is the directory name we chose on the FTP server. Most of the other settings can be left as they are, apart from the FTP tab.

After typing in all the details, it would be sensible to do a few tests first. Clicking on Test FTP Settings will check whether the serve is reachable. After making all the changes and clicking OK, SyncBack will do a 'test' run to see what files will be transferred.

Once everything is set up, it's only a few mouse clicks to synchronise the data between the two computers. This could be speeded up by telling SyncBack to always run the profile every time you double click on the icon. To do this, right-click on the desktop shortcut and select 'Preferences'. Add the name of the profile after the application name (in this case, work). When the icon is double-clicked, SyncBack will run the profile and then exit.
Running a profile on startup

The only potential problem I can foresee is that a file deleted from one computer but not both will re-appear after synchronising.



Synchronise Files between two computers

Story location: Home / computing /
14/Oct/2007

Part 1

I have been given a laptop computer for work but when I work at home I sometimes use my home desktop computer. I decided I needed some way of synchronising files between the two machines, so that I could easily keep both up to date.

Both machines have Bluetooth, which I could use to transfer the odd file manually, but I decided I needed something I could automate. All of the bluetooth syncing software I could find was designed for transferring between a computer and a phone, not between 2 computers.

I found other solutions which expected the files to be on a networked drive, but would keep local copies available for editing. I can't change the network settings on my work computer so it would be tricky for me to set up something like that.

See more ....

The only solution I could think of was to use FTP to copy the files between the machines. One computer would run an FTP server while the other would run some sort of backup software which would synchronise the files.

I found 2 programmes which looked suitable:

  1. Cerberus FTP Server. I'd used this a few years ago and it was fairly easy to set up.
  2. SyncBack. This comes in free and paid-for versions. The free version seemed to do everything I needed.

Both the programmes were fairly straightforward to install. Then came the tricky bits - setting up the computers to talk to each other.

Both computers can access the Internet through our router, and both would normally get assigned automatic IP addresses. I needed a fixed name or address to use, so that the laptop could find the server, so I set the desktop machine to request a fixed IP address from the router. I did this by opening the 'Wireless Network Connection Status' in windows by double-clicking on the wireless network icon which Windows places in the 'tray' in the taskbar. Clicking on 'Properties' then 'Internet Protocol (TCP/IP)' then 'Properties' again got me to a screen where I could specify an IP address.
Specify an IP Address
IP addresses on my network start at 192.168.1.1 for the router and .1.2 onwards for any computers. I chose .1.9 because it's unlikely that we would have 8 computers connected, so that address should always be free.

Read Part 2.



Spam Ahoy

Story location: Home / computing /
19/Sep/2007

When I check my email this morning, I was surprised to find 64 emails sitting there wanting attention. I was more surprised to find that most of these were 'delivery failure' notices, all from emails which I hadn't sent. Even more surprising was that these were all send during a brief time window between 21:51 and 21:59.

I hope nobody out there is receiving junk email from this domain, but I can assure everyone that I'm not sending any out myself. This is most likely due to spammers inserting my domain as the 'from' address. Some information about the problem can be found here.



Why is Windows Search so crap?

Story location: Home / computing /
25/Jul/2007

I've opened an Explorer window to a directory with several thousand files in it. I need to find a particular group of files so I click on 'Search' and tell it to search for files with a particular set of numbers in the filename.

Now Windows already has all the file names because it has displayed them in the directory window. You would expect any decent program do be able to do this search in a millionth of a second and filter the directory listing to show the files. After all, it already knows the file names and I told it only to look in the one directory.

After a minute or so, the useless pile of crap is still searching. I ended up stopping it and looking for the files myself, which was much quicker. I would like to know what Windows XP was actually doing during that minute - it could have indexed the whole drive in that time.

This was a networked drive with a very deep directory structure so I couldn't have easily navigated to it in the command prompt. And I was using a company computer so I couldn't install anything like the useful 'Open Command Prompt Here' powertool from Microsoft themselves. How hard would it have been for them to put some kind of 'filter filenames' option in Explorer? Something like the 'select files' command in WinZip, which allows wildcards to let you specify which files you want.

What we really need is something that combines the bits of windows which work with the bits of linux which are better... and probably end up with something like Mac OSX.



Apple Store

Story location: Home / computing /
05/Jul/2007

Earlier this week, Apple Computers advertised a hard drive at about one tenth it's intended price. As you would expect, a lot of people placed orders. Apple realised their mistake and decided to change the orders without telling anyone.

The original order said:

Iomega 1TB Value Series Hard Drive with USB 2.0 Interface
TM258ZM/A £16.98 1 £16.98

but a few days later they strangely changed to:

DYMO LABELWRITER LARGE ADDRESS LABEL-ZML
TM258ZM/A £1.00 1 £1.00

The product code was the same but the price and description had changed. There was nothing on the page to explain what was happening. A phone call to the Apple Store revealed that they admitted their mistake and were cancelling the orders. It was a whole day before an email was received explaining the situation, in fairly patronising terms:

Dear Apple Store Customer,

We regret to inform you that your recent order for the Iomega 1TB Value Series Hard Drive. Which you placed on the online Apple Store has not been accepted.

Due to a temporary inaccurate pricing issue on the store, the price of the product was listed incorrectly as £19.95. Whereas the correct online Apple Store price is £199.95 i.e. the listed price was approximately 10% of the correct price.

We would like to draw your attention to clauses 2.4 and 2.5 of the Apple Online Store Terms and Conditions under which if Apple cannot accept your Order, we will contact you.

Furthermore, we would like to draw your attention to clause 2.6 of the Apple Online Store Terms and Conditions under which Apple reserves the right to cancel your order in case of a price error on the Apple Online Store.

We understand the inconvenience that this pricing inaccuracy may have caused you, and we sincerely apologize.

Kind Regards,

The Apple Store

The wording of the T&Cs was obviously chosen to allow them to weasel out of any such mistakes - they must have learnt from the mistakes of others, such as when Argos advertised a £300 television for £3. Apple aren't breaking any laws but they probably won't win any new friends this way. I'm not suggesting they should honour all the orders and sell the hard drives at such a giveaway price, but some other goodwill gesture would have been better than just an apology which was worded to make the customer sound like they were being told off.



RSS feed

Story location: Home / welcome /
30/Dec/2006

I've added an rss feed to the website. I originally set it up a few weeks ago so my facebook profile could pick up blog entries but I've now added the appropriate code so that firefox can automatically pick up the feed. It's still a bit experimental at the moment. I'll add a button to the sidebar as soon as I'm sure it works properly. In the meantime, the link is here:

RSS Feed Entire Site.
RSS Feed Diary only.