Tuesday, May 04, 2010

Repairing a MySQL Table

*this applies only to a MyISAM type table*

This is from the MySQL Manual.

To repair table X:

1. Lock the table
Ref: MySQL Manual

lock tables X as read;


2. flush the table

Ref: MySQL Manual

flush tables X;


3. backup the table

Copy the 3 table data files to a suitable place.

4. Repair the table

Ref: MySQL Manual

repair table X quick;


(generally, its the index which is kaput so the above QUICK is sufficient. see the link for other options).

5. Unlock the table

Ref: MySQL Manual

unlock tables;


Done (hopefully).

Tuesday, April 06, 2010

Good Customer Services and Twitter

I've been waiting for a while now to change my phone; my old brick (a scratched and battered Nokia which has to be dismembered to be turned on or off) is well past it's sell by date and my Vodafone contracrt ran out in October.

So, i've been beating off the iPhone peer-pressure and waiting to get a decent Android phone. The one i've been waiting for is the HTC Desire.

Anyway, got an email from Vodafone on Thursday (1st April as it happens!) with a link to upgrade; the phone was FREE and the data plan was about £30 Brilliant. Ordered the upgrade straight away and got some emails from Vodafone confirming my order.

Weekend passes, during which i'd been charged for the new plan (which i can't really take advantage of with my current brick), but no dispatch emails.

Tuesday morning, email in my inbox. Apologies, but due to high demand, we're out of stock, and it'll take 7-10 days. Balls.

Tried calling Vodafone; busy; no operators.

So, having recently seen Vodafone's latest twitter accounts in action I tweeted VodafoneUKDeals. Short time later I got some replies expressing their dismay.

Another short time later, I got a phone call. They'd tracked down my order from their 'system' and rang to see if they could help. Two conversations later and my previous upgrade is cancelled, with excess charge refunded, a new order placed, and a shiny new Desire is being sent (with confirmation text). Due tomorrow!

I have to say; truly unbelievable service. Gobsmacked.

Friday, March 26, 2010

MySQL Users

not just me i'm sure but creating users on MySQL seems a bit onerous.

Anyway, to create a user (X) and give access to a d/b (D):


create user 'X'@'localhost' identified by 'password';
create user 'X'@'%' identified by 'password';

grant all privileges on D.* to 'X'@'localhost';
grant all privileges on D.* to 'X'@'%';


Here endeth the lesson.

Monday, January 25, 2010

UFRaw

Just a quick post on UFRaw and Gimp.

For the past couple of weekends i've switched to shooting in RAW for the first time. I have a lowly Fuji S5000 and as i've played more and more with post production using GIMP i thought it was about time i tried RAW.

So, i downloaded UFRaw.

The general process is to open up your photo in UFRaw, change exposure, temperature etc and then open it up in Gimp to play with the curves, layers etc etc.

I'm still learning the best way to use it, but i find its greyscale handling to be alot better than Gimps (might simply be because its a RAW file) and got a nice greyscale here.

One gotcha is that when you close UFRaw is that it 'remembers' how various settings were set so when you open the next shot they are used again so it took a while to work out why all shota were being opened in black and white!

Also, my laptop's monitor at home would appear to need calibration as some of the shots seem a lot redder on different machines when viewed, e.g. this one.

I can't compare it to any other RAW handling kit as i've never used any, but for now, whislt i'm still getting to grips with the whole RAW thing, its an interesting piece of free software.

One thing i have had to do is order a bigger memory card; however the biggest xD is still only 2Gb but its better than the tiny one i had.

Friday, January 22, 2010

Beurre Blanc

Made this fantastic rich buttery sauce some time ago, forgot what it was called and managed to find it's recipe today on the BBC Food site. Goes great with fish (Red Mullet).

Ingredients

140g/5oz chilled unsalted butter, cut into small cubes
2 medium shallots, peeled, thinly sliced
½ garlic clove, peeled, thinly sliced
1 sprig fresh thyme
1 small bay leaf
3 black peppercorns, crushed
150ml/5fl oz dry white wine
1 tsp white wine vinegar
sea salt flakes
1-2 tbsp freshly squeezed lemon juice

Method
1. For the beurre blanc, heat one tablespoon of the butter in a non-reactive
pan over a medium heat.
When the butter has melted, add the shallots, garlic, thyme, bay leaf and
peppercorns and fry for 2-3 minutes,
or until the shallots have softened but not coloured.
2. Add the white wine and wine vinegar and bring the mixture to the boil.
Continue to boil until most of the liquid has evaporated, then gradually
whisk in the chilled butter cubes, one at a time, until all of the butter
has been incorporated into the mixture and the sauce has thickened and
is glossy.
3. Strain the beurre blanc through a fine sieve into a warmed bowl, then
season, to taste, with salt and pour over the lemon juice. Keep warm.
(NB: Do not leave the beurre blanc in too warm a place or the sauce may split.)

What also goes really nicely is Chorizo and Broad Beans; simmer some broad beans in a pan then in a small frying pan, fry up some Chorizo, then for the last few seconds add the broad beans as you finish off the chorizo.

Serve the fish, sauce, and chorizo/beans with some crushed potatoes or new potatoes.