Saturday, 31 January 2009

Vectoring pogman and going on a walk

This morning I finished off vectoring the picture of pogman sitting in a pile of pogs that I was vectoring yesterday. It took ages to vector all the pogs.

Mac and Ben walking
After that I went on a walk with Mac and Ben.

Old railway line between Harborough and Lubenham
Despite it not raining for the last couple of days, the ground was still very wet and there were lots of big puddles.

When we got back it was lunch time, then after lunch I played Excite truck with Ben and Mac for a bit. Then I went on my comp and checked my spleenmail. After that I setup the panachallenge site in netbeans, and netbeans handily integrates with the CVS system used on the site, so any files I change I are highlighted green, and I can right-click on them and choose to revert the changes I've made (so it downloads the copy from the CVS Server) or upload my version to the Server. And I didn't do anything to set this up - it just works automatically.

I did some work on the panachallenge website for the rest of the day (didn't get much actually done though).

The weather today was sunny through a thin layer of cloud most of the day and overcast later in the afternoon.

Breakfast: Lemon marmalade toast sandwich; cup o' tea.
Lunch: Mature cheddar cheese sandwich with bread-maker-made bread; honey on slice of bread-maker-made bread; clementine; American style chocolate brownie cookie; cup o' tea; Sainsbury's Caramel Chocolate.
Dinner: Toad in the hole (made with delee sausages); potatoes; broccoli; carrots; gravy. Pudding was ice cream with chocolate sauce and wafers.

Friday, 30 January 2009

CSSing, javascripting and Vectoring

This morning I checked my email (this seemed to take over an hour, don't know how though) and got Granny breakfast. I also did some more work on website. I added round corners to an element using -moz-border-radius, -webkit-border-radius (and although I don't think any current browsers support it, border-radius. For IE7, IE8 and Opera I used my javascript borders function with some .pngs of the borders.

To detect whether the browser was IE or Opera, I used conditional comments for IE and set a javascript variable inside them e.g.
<!--[if IE 7]>
<script type="text/javascript">
var IE7 = true;

Then for detecting Opera (and making sure the effect wasn't applied to webkit or Firefox browsers), I checked whether the CSS border radius properties were set on the element I wanted to style. Information on how to do this cross browser is available here: Reading applied element styles. Since I already knew whether a browser was IE and what version of IE it was, I didn't need to include the bit that gets the style in IE. Then you can do this:
var myEl = document.getElementById('elementIwantToStyle');
if(IE7 || IE8 || (!IE6 && typeof(window.getComputedStyle(myEl, null).MozBorderRadius) == 'undefined' &&
typeof(window.getComputedStyle(myEl, null).WebkitBorderRadius) == 'undefined' && typeof(window.getComputedStyle(myEl, null).borderRadius) == 'undefined' ))
{//style myEl;}

If the browser supports the CSS property on the element, then its typeof() will be 'string', if it doesn't support it, then it will be 'undefined'. Strangely, when alerting the CSS border-radius properties, if it is supported, then it will alert a blank string, rather than the actual border-radius.

In the morning I also checked dealextreme, ebay and froogle for ball heads as I want a cheap ball head with an Arca Swiss compatible Quick Release Clamp to go on my monopod. The Benro ball heads seem very expensive now, I don't know if now they have become more well known and put their prices up. The prices of everything has gone up as well due to the large drop in the value of the British Pound. Anyway, I bought a unbranded KS-1 Benro rip-off ballhead from dealextreme for about $55. Quite expensive, but I didn't want to wait for the pound to drop more and it get even more expensive.

I ordered the KS-1 ball head rather than the KS-0 ball head as it is rated for a larger weight, and one of the comments on the KS-0 said it would hold an SLR and medium lens. The MP-E and MT-24EX isn't too heavy, but not exactly really light either, so I bought the KS-1 just to be sure. Better to have something more capable than what you need than risk getting something not capable enough. I also ordered a pack of small throwing knives from there. Unfortunately the SATA hotswap HD bay was out of stock and wouldn't let me order it.

In the afternoon I did some more work styling my website. Safari was displaying the text on my site much bolder than all the other browsers, so I googled about that and came across this helpful thread: Designer's control over bold text in Safari?. The solution is given in the last post there - apply this CSS to the body elementtext-shadow: #000000 0 0 0px;, and then the text will display with a normal font weight. Great!

I looked at styling my login form, and looked at how other website style their login forms: Moneyweek,, and ebay. I was wondering mainly about whether the title of the form (Login) should go in the legend (in which case it interrupts the border and could cause problems for getting a round border with my javascript function), or if it should go in the main content of the form.

I did some googling to try and find examples of how to style forms well, and found this great example that styles all the form elements using javascript and images. I coded something similar myself last summer, but got stuck getting the drop down select box working properly.

I decided not to use that for the moment, but keep it in mind for possible future use. I got on with styling my login form in Firefox and found that the form was always 100% width of its parent element. I originally fixed this by using width: -moz-fit-content;, but it seems display: inline-block; also does the same thing. The only problem is that I was using margin: 0 auto; to center the form, and this doesn't work for centering the inline-block element. I think if I set text-align: center; on the form's parent element, this should center the form again though.

There's a bit of info about -moz-fit-content and similar CSS properties here: New CSS in Firefox 3.

After dinner I played Excite truck with Mac and Ben for a while. I started doing a vector of pogman sitting in loads of pogs, watched an episode of Blinky Bill with Ben, then did a bit more of the pogman vector. Vectoring all the pogs he's sitting in will take ages, so I'll have to try and finish it tomorrow.

The weather today was misty and overcast in the morning, then a bit sunny from about lunch time to 3pm, then overcast again.

Breakfast: Lemon marmalade toast sandwich; cup o' tea.
Lunch: 2x cheese on toasts; salad; clementine; digestive chocolate bar; cup o' tea.; ⅔ Cadbury's dairy milk 50g chocolate bar.
Dinner: Battered fish portion; baked beans; chips. Pudding was chocolate swiss roll with tinned mandarin segments and coffee custard. Coffee.
Supper: Oreo; Coffee.

Thursday, 29 January 2009

Getting annoyed by Internet Explorer and CSS

This morning I went on Animal for about an hour, then the rest of the day I was working on my website, getting annoyed by different browser (mainly IE) css problems. Remiz has written a nice behaviour for IE that mimics curved corners by using a roundrect VML shape. However, it didn't work for me when I had one curved border inside another curved border, and didn't work in IE8 at all. I also tried writing my own behaviour to do the same thing, but it didn't work. For some reason the shape was always only a couple of pixels big, no matter what size I set for it.

In the evening I also played Excite truck with Mac and Ben a bit and watched the latest episodes of Lost and Flight Of The Conchords.

The weather today was misty and overcast in the morning, then by lunchtime it was just cloudy, and by about 3pm the sun had come out. Then it clouded over again, but a thin cloud that the sun could shine through. There was a bit of a sunset, but not much really.

Breakfast: Lemon marmalade toast sandwich; cup o' tea.
Lunch: Ham with mustard and salad sandwich; banana; chocolate digestive bar; cup o' tea.
Dinner: Slice of Pepperoni pizza; slice of cheese & tomato pizza; peas; potato. Pudding was 2x American style chocolate brownie cookies. Coffee.

Wednesday, 28 January 2009

Getting annoyed by VMWare and CSS

This morning I went on Animal for a bit, Nook was buying turnips for about 147 bells each, so I sold him my turnips. I now have just over 8,000 bells from my starting investment of 10,000, so it's taking me a long time to make my money back after that loss in my initial week of trading.

After that I checked my email and the websqueeze, and found out about Safari (which is color space aware) rendering my images a different colour to the background. When I loaded the images into Photoshop, it said that they didn't support a color profile. If I saved them with an sRGB profile, then they would be the same colour as the background. I thought that the default color space Safari uses must not be sRGB. I did some googling and came across Web Browser Color Management Tutorial. In that article it says you shouldn't embed color profiles since it increases file size, and you should use Photoshop's save for web function.

The images I was having trouble with were saved normally in Photoshop (which has a default color space of AdobeRGB) from an Imported Illustrator document, which was saved without an embedded color profile. I opened the images again in Photoshop and re-saved them using save for web, and it worked, the images now matched the background colour.

I also tried running the images through pngCrush, but this only shaved about 2bytes off one of the images, and the other two were still the same size. I guess the info about Photoshop being bad at compressing pngs is older versions of Photoshop, and CS3 is actually quite good.

After getting that working I started Ubuntu, and installed VSFTP so I could ftp files across to it instead of having to burn and mount an ISO each time I want to copy files across. Much to my surprise setting it up and getting it working was pretty easy. I followed this guide: Ubuntu FTP Server and this guide: VSFTP chroot or jail users - limit users to only their home directory howto. After testing I found that the files couldn't be accessed from an internet browser, I had to change/uncomment the umask 022 line in the /etc/VSFTP.conf file. I was wondering why the umask is 022, but then I read that
Umask is the inverse of permissions. It masks out permissions, not allows them. Files are generally created with 666; umask masks out those you specify.

After getting that working I found that copy/paste from my Windows Host to the Ubuntu guest wasn't working when I was logged into Ubuntu as a different user to the default user. In the VMWare Server 2.0 control panel I put to install VMWare tools since I thought that it must need to be installed on a per user basis. But then before I actually installed VMWare tools again, I tried running vmware-user, and it said it was already running.

I tried doing some googling, but couldn't see anything about vmware tools working/not working with multiple user accounts on a virtual machine. I think the problem may be because I switch user rather than logging off with one user and then logging on again as the other user.

Ubuntu downloaded some updates, and needed to restart. But after restarting it said there weren't any network adapters, so it couldn't connect to the internet. I spent a lot of time googling, testing stuff and restarting trying to get it to work again. I thought it must have been one of the updates Ubuntu downloaded that broke it.

After lunch I carried on trying to fix the networking in Ubuntu. Eventually I found the problem - VMWare tools wasn't installed and needed to be re-installed. When I had done that the networking worked again. I guess when I clicked to install VMWare tools in the VMWare Server 2.0 Control panel it must have uninstalled the existing installation of VMWare tools. Ubuntu didn't say it was uninstalling anything, and I thought all it did was to insert the VMWare tools ISO into the CD drive. Anyway at least it's working again now.

Copy/paste in my other user account in Ubuntu still doesn't work, so I have to just ftp the file(s) to Ubuntu and then copy the bits of text I want. I did find an article about the networking problem between windows and Ubuntu with VMWare: VMWare on Ubuntu Linux with bridged network to XP, however that article is about running windows in VMWare with Ubuntu as the host, whereas I'm running the other way round (and also Vista x64 rather than XP). It does say in the comments on the article that you should be able to do the same fix in windows by disabling 'checksum offloading' on your network card. However, I couldn't see any reference to this in the propties of my network adapter, or in the Asus WiFi-AP Solo program, which my adapter uses.

After getting Ubuntu working again I did some work on my website, mainly css stuff, and I spent ages trying to find out how to get my top menu to center vertically. In modern browsers and IE8 you can use display: table-cell; vertical-align: middle; to set the elements out like table cells. This works okay, except obviously if your viewport is small, one cell won't wrap underneath the other one.

It would be possible to get it working in IE by wrapping the menu and an element set to the same height as the image in a span, e.g. see the vertical-align on inline elements example. However, I don't really want to add stupid extra elements to my menu just to make to it center vertically in IE. I think I'll either use a css expression or just leave it not centered vertically in IE.

Hmmm... actually after doing some more testing on my actual site rather than just a testpage, the vertical align on inline elements works fine AND is cross browser AND allows the menu to wrap under the image if the viewport is too small. I had a bit of trouble trying to get IE6/7 display the menu as inline-block (so the whole menu wraps in one go rather each item in the menu wrapping indivdually), but then I read this: CSS Howto: Cross-browser inline-block. Very useful, all you need to do is declare the element as inline in IE6/7 after you've already set it to inline-block.

In checking my page in different browsers I first ran it through the W3C Validator to try and make sure any problems appearing weren't due to invalid code. My page failed because I had some <wbr> elements in some urls to stop them breaking the page in IE. I did some googling and found that you can use the word-wrap: break-word; CSS property instead.

I spent the evening still messing about with CSS and googling trying to get things to work. I am making progress, though about as slow as a lowveresnewt of Po.

The weather today was rainy all morning and overcast the rest of the day.

Breakfast: Lemon marmalade toast sandwich; cup o' tea.
Lunch: Mature cheddar cheese with salad sandwich; packet of prawn cocktail flavour crisps; banana; chocolate digestive bar; cup o' tea.
Dinner: Roast Chicken; green beans; Roast potatoes; Roast parsnips; gravy. Pudding was orange jelly/mandarin flan with squirty cream - delee! Coffee.
Supper: Oreo; milk chocolate digestive; cup o' tea.

Tuesday, 27 January 2009

More working on custom borders

This morning I went on Animal for a bit, Nook was offering about 112 bells per turnip, so probably a fews bells more than what I bought for. I didn't sell though, hopefully he'll go up to about 150 bells on Wednesday or Thursday. I also saw Sahara and gave her 3 old carpets, which she gave me a classroom floor for, and said it was rare. I asked every animal in the village for their old carpets, so three was the maximum amount of old carpets I could get. I wonder if you could store the old carpets the animals give you until the next time Sahara comes, then get 3 more carpets, and you;d be able to give her 6 old carpets and maybe get a really rare floor?

After that I checked my spleenmail and did some more testing of my custom borders javascript function. I spent quite a bit of time creating a new corner / borders images. Getting that working took probably most of the morning.

After lunch I went on Animal again and Nook was now accepting about 106 bells per turnip, so I still didn't sell. I tried my custom borders page in IE6, and some of the images were slightly off by a pixel or so. Also they were trashed since I was using .pngs with alpha transparency as the background images. I spent a lot of the rest of the afternoon trying to get that working. Unfortunately the normal IE6 png alpha transparency fix (an MS Filter) doesn't work for tiled/repeating background images.

It seems you can get tiled/repeating backgrounds with transparency in pngs by using them in a VML element. However, the edges of the element fade to transparent (wierd). Drew Diller has written a script that will convert .pngs to VML elements, however this didn't work in my case, I think because in IE6 the heights/widths of some of the elements are an expression, rather than a set width.

While I could work on making my custom borders script create VMLs rather than divs with backgroud images for IE6, I don't think it's worth the hassle at the moment, and will probably just settle for a plain border in IE6.

After Ben came home from school I played on Excite truck with him for quite a while, then did more work on the custom borders in IE6 issue.

After dinner I re-tagged and renamed some mp3s, then did a backup. Then I watched 'Battlestar Trashlactica: Razor' with Mac. It was quite boring, I'm glad we didn't watch it all in one go. After that I watched 'The Office (US)' with Mac, which was as good as usual (quite good), then watched s02e01 of 'Flight Of The Conchords' with Mac, the episode was good, but the songs weren't up to much.

The weather today was misty and frosty first thing. The frost melted quite quickly and the mist had gone by mid morning. At lunch time it was sunny and cloudy, then in the afternoon it became overcast, and was overcast for the rest of the day.

Breakfast: Tangerine marmalade toast sandwich; cup o' tea.
Lunch: Cheese on toast; salad; ½ chicken tikka sandwich spread with salad sandwich; clementine; chocolate digestive bar; cup o' tea.
Dinner: Bacon quiche; peas; potato; butter. Pudding was not very gingery ginger sponge with white sauce/custard stuff. Coffee.
Supper: 2x Oreos; cup o' tea.

Monday, 26 January 2009

Creating custom borders javascript function

I spent most of today writing a javascript function for adding custom borders to an element. It seems weird that it took most of the day, since it's not a particularly complicated or long function, and most of the postioning/css work I'd already done yesterday.

One part that took me quite a while was working out how to pass the variables to the function. I wanted it so you can just specify what variables you want to pass to the function and their values. Unfortunately you can't create variable variables like you can in php e.g. $myvar = 'hello';
$$myvar = 'goodbye';
echo $hello; //prints 'goodbye'

The nearest you can get to this is javascript is var myvar = 'hello';
window[myvar] = 'goodbye';
alert(hello); //alerts 'goodbye'
. Or if you don't want the variable to have global scope you have to do var myvar = 'hello';
this[myvar] = 'goodbye';
alert(this.hello); //alerts 'goodbye'
. This isn't as good as the php method as you can only have a global method or an object property.

In the end I decided to just pass an object to the function, then get the variables from the object e.g. function myfunc(params)
var hello = params.hello || 'defaultValue';

myfunc({'hello':'goodbye'}); //alerts 'goodbye'
. Then in the actual function I set the vars I need to whatever they are set in the object, so I can pass the function variables to set each corner to a different height and width, or if all corners are the same width and height, I can just pass it the height of one corner and the background images it needs.

I'm not sure if the way I've done it is best, I will probably post on the websqueeze and ask the knowledgable people there.

In the morning I also played on Animal for about an hour and paid off my final mortgage. Nook said he'd put a flagpole outside my house. Now I need to save up to get a million in the bank, and also contribute towards the town fund.

In the afternoon I went on Animal again (just to check the afternoon turnip prices) and vacuumed my room. I also went in the garden for a bit. Where it was sunny it was nice standing outside in my T-shirt. There were some midgey style flies flying around, the honeysuckle by the green house had new leaves, and the Sallow bush had buds all over it, so Spring is coming, yay! Sadly though, there was a dead sparrow by the greenhouse. It looked okay so I think it must have just flown into the glass, although I couldn't see any splat marks.

In the evening I watched a bit of Battlestar Trashlactica with Mac (he came back from Worksop/Mansfield yesterday afternoon). It was too boring though so we only watched about an hour of it (it was a special about the Battlestar Pegasus).

After that me, Mac and Ben played a bit of Excite truck, then I played around with my custom borders javascript a bit more. The hard part is getting the images you want to use aligned and sized properly. I kept editing them, saving them, checking the page, then repeating this process until it worked properly. I probably could of just passed the different image dimensions to the function to get it to work (haven't tried this yet), but wanted to get the image correct since the images should be the same size.

The weather today was mainly cloudy and overcast. It brightened up in the afternoon, then clouded over again near sunset, but there wasn't cloud in front of the sun, so the sun lit up the bottoms of the clouds nice and orange as it set. I don't think the sky was very interesting after the sun had set though.

I listened to American folk/bluegrass music all day, mainly Iron Horse and New Grass Revival.

Breakfast: Tangerine orange marmalade toast sandwich; cup o' tea.
Lunch: Mature cheddar cheese with salad sandwich; clementine (I think, I can't actually remember eating it, but I nearly always have some fruit for lunch); Raspberry kiss (Raspberry version of strawberry shortcake); cup o' tea.
Dinner: Pasta; meatballs; mixed veg; ground black pepper; grated parmesan cheese. Pudding was a hot cross bun with butter. Coffee; Cadbury's Dairy Milk Turkish.
Supper: Milk Chocolate digestive; cup o' tea.

Sunday, 25 January 2009

rounded/custom borders soln

This morning I went on Animal Crossing, and bought some white turnips and a red turnip seed from Sow Joan. It was also flea-market day today, which meant that you could go into other Animals' houses (so long as they were in) and buy stuff in their room off them. The prices were normally quite a bit lower than what you would pay Nook. The Animals didn't want to sell all their posessions though. Also when you're in your own home, animals will come in and see if they want to buy anything from you.

Since I only had my normal stuff (which obviously I want to keep) out, I didn't sell anything. You could pack away all the stuff you want, and take out all the stuff you don't want, then barter with the interested Animals to sell the items, but that was too much bother for me.

After playing on Animal for a bit we (me and Ben) went off to church. After church I was waiting around for ages for Ben to come out of Sunday School as he had left his coat in Church next to me. Eventually I found him in the big hall bit eating a croisant. He said he hadn't come out because he was going to go to Sainsbury's with Clare. It would have been nice if he could have just come out when church finished and told me so I didn't have to stand around for ages.

When I got home I went on Animal a bit more, did some more fishing since I didn't have any money on me, sold the fish and then after a few rounds of fishing and selling I had a few thousand bells, so I went to the city. When I got to the city I went to Crazy Redd's and bought a painting. It was only about three or four thousand bells, so I think it might be fake. Also the way he was laughing and saying 'sucker' or something similar under his breath makes me think I might have been ripped off.

After dinner I went on my comp and managed to get custom borders working. I used absolutely positioned divs and set their top, left, bottom, and right positions as appropriate to make the divs stretch to cover the area needed. IE6 doesn't support this method, and if I set a div to 100% width, it would stretch 100% of the page size, rather than 100% of its container width, even though its container was floated and positioned. So in IE6 I used a CSSexpression to set the divs to the width/height of the container minus the margins needed.

I added 10 divs in total - 4 for the corner images, 4 for the top and bottom side images, 1 that can be used for a background, and 1 to hold the original content of the container div. The div for the background isn't entirely necessary, as you could apply the background you want to the content div, but then the content div would need to be positioned so as not to overlap the corner images (normally this would be the case, having a seperate div for the background just increases the flexibility).

The custom borders are created from 3 images - one of the corners, 1 of the left and right sides that can be repeated and 1 of the top and bottom sides that can be repeated.

So as well as custom borders, the div can also be filled with a gradient, image or pattern. If it's filled with a pattern or image, then the content div would need to have the background applied to it.

I just got it setup using hardcoded divs and css, it would certainly be possible to write a javascript function to do the work. If I want to style more than 1 div with different custom borders, then I think setting up a javascript function to do the work would certainly be worth it.

When I had got my custom border css working I played Excite truck with Ben for a bit. After that I backed up my comp, then played Excite truck with Mac.

After tea I checked my spleenmail and also tried to work out why Microsoft Virtual PC 2007 would crash VMWare Server 2.0. I looked at the log for the Virtual Machine, and found it said 'Panic: can't get userlevel lock'. A quick google turned up this thread: Can't start VMWare Server 2.0 and Microsoft Virtual Server 2005 R2 VM at same time? Error message: "VCPU 0 RunVM failed: -2", which gives a very easy answer: Turn off hardware-assisted Virtualization in Microsoft Virtual PC 2007. I did this and it fixed the problem. I also changed the Network option on my VMWare Virtual Machine to 'NAT' instead of 'Bridged'. It didn't seem to make much difference though. I could still browse the internet on the virtual machine, but still couldn't access files on the host machine from the guest (and vice versa) through the network.

Later in the evening I watched some Mahabharat with Ben and Maccy. After that I took some photos of a succulent flower.

The weather today was rainy early in the morning, then overcast all day. I listened to bluegrass/American folk music most of the day.

Breakfast: Tangerine orange marmalade toast sandwich; cup o' tea.
After church snack: milk chocolate digestive; coffee.
Dinner: Chicken & vegetable curry; green beans; rice; sultanas. Pudding was Neapolitan ice cream. Coffee; Small chocolate Santa; Sainsbury's caramel chocolate.
Tea: Mustard ham with salad sandwich; most of a packet of prawn cocktail flavour crisps; 2 bits of waffle with golden syrup and squirty cream; clementine.

Saturday, 24 January 2009

More looking at rounded corners/custom borders

This morning (and a bit of the afternoon) I did some more work trying to work out how to give a box custom borders. Unfortunately I couldn't work out how to get it working in IE6, which seemed to just not display some elements for no reason, and webkit, which seems to increase the padding size when you increase the text size.

I haven't actually tried using the 456 Berea Street method I posted about yesterday yet, but the problem I can see with is is that if you have an element with a gradient as a background, and the box needs to stretch to a reasonable size, then the box image you need to create will be quite large (in terms of KB). If you are just using a plain background, then although the image is large in terms of px, it doesn't take up much in terms of KB.

Before lunch I went on Animal Crossing, Nook had a special in - A Samurai suit, so I bought that. Sadly you can't wear it, it's just a piece of furniture.

In the afternoon I tried to setup file sharing between Ubuntu and Vista, but failed. Although Ubuntu can see other PCs in the house, it can't see my PC. And although Vista can see Ubuntu, it won't let me access the shared folder and says that the username/password I enter are incorrect. I am guessing it must be because Ubuntu is just in a VM and actually on the same machine as Vista, even though it has its own IP address.

After dinner I played on Excite Truck with Ben for a bit (Mac has gone to see his mate in Worksop for the spleenkend).

In the evening I was wondering whether .png was lossless, and it turns out that 24bit is, so that's good. I read this very helpful article: When and how to use internet image formats (JPEG, PNG, GIF).

I also tried out the 456 Berea Street method for custom borders, and unfortunately it didn't work for my box that had a gradient fill, so it looks like I'll have to keep on working on this.

Breakfast: Tangerine Orange Marmalade toast sandwich; cup o' tea.
Lunch: 1½ Mature cheddar cheese with salad sandwich made with fresh bread-maker-made bread; honey on a slice of fresh bread-maker-made bread; Clementine; cup o' tea.
Dinner: Delee cumberland sausage; delee apple & pork sausage; mashed potato; baked beans. Pudding was 2x mince pies with squirty cream. Coffee.

Friday, 23 January 2009

rounded/custom borders

This morning I played around with the Raphael javascript library, trying to create a rounded corners background for a div.

There were a few problems though:
  • IE8 didn't work. I tried replacing
    document.createStyleSheet().addRule('vml\\:*', 'behavior:url(#default#VML)');

    but it that made it break in all IEs, I don't know why though.
  • When I set the size of the svg/vml to a percentage value, it broke in IE.
  • The webkit browsers (Safari, Chrome) resize the svg when you increase/decrease the text size

So I gave up on svg/vml.

Before lunch I played on Animal for a bit and saw Pascal! It's the first thyme I've seen him. I also thought that I had enough money to pay off my mortgage, but then the mortgage was nearly 600,000 bells, when I thought it was about 500,000 bells. So I guess Nook must charge interest on your mortgage. I'd been keeping all my money in my bank account rather than paying off the mortgage since I thought that way I'd earn interest on the money saved until I had enough to pay Nook. But it seems like that was a bad idea and I would have been better just paying off the mortgage as I went along. Never mind, another week or so and I should have made another 100,000 bells.

After lunch I looked into other methods of getting rounded/custom corners and borders. In terms of rounded corners, you can use the css attributes -moz-border-radius and -webkit-border-radius for round corners in Firefox and webkit based browsers. You can also use an SVG for a background in Opera: Example showing -moz-border-radius, -webkit-border-radius and an SVG background for rounded corners in Firefox, Safari, Chrome and Opera.

The best solution I found though, was Cross Browser Transparent custom corners and borders - version 2, from 456 Berea Street.

After dinner I watched The Adventures of Baron Munchausen with Ben and Mac, then watched some Loituma videos and joined a japanese video sharing website, which has writing across the videos all the time. I don't know why though, since I don't know Japanese.

The weather today was very windy. In the morning it was raining, then this turned to snow mid morning. By lunchtime it had stopped snowing/sleeting and was just overcast. Later in the afternoon the clouds cleared, and there was quite a nice sunset.

Breakfast: Orange marmalade toast sandwich; cup o' tea.
Lunch: 2x Cheese on toasts; apple; chocolate digestive biscuit bar; cup o' tea.
Dinner: 2x fish cakes; peas; mashed potato; tomato ketchup. Pudding was strawberry whip with sliced Kiwi fruit and squirty cream. Coffee; Cadbury's Dairy Milk Turkish; Chocolate Coin.
Supper: Milk chocolate digestive; German biscuit; cup o' tea.

Thursday, 22 January 2009

Doing stuff that doesn't work

This morning I tried setting px values on the svg I was creating for the upside down text, but webkit would still resize both the text and the svg, resulting in double text size increase or decrease when changing text size in the browser. So I gave up on that, and tried to make a page that displays a website upside down in an iframe. While I could get it to work in Firefox, the contents of the iframe were still the right way up in webkit, so I gave up on that as well.

After lunch I started downloading Lost s05e01 on Mac's PC, he had already started downloading s05e02 in the morning, but episode 1 wasn't available then (weirdly). I went on Animal and sold my turnips for about 146 bells (bought at about 98 bells). So now after 1 week's loss and 2 weeks gain I have about 6,000 bells from my initial 10,000 bells investment. When Mac got home he said that the turnips price change in the morning and the afternoon every day (we thought they just changed every day).

Also Nookway is now Nookington's, and is very posh. They also have an upstairs now with Nook's nephews or whoever they are.

After that I setup a copy of panoguide on my PC as I've volunteered to help them out with some coding (though not sure how much help I'll actually be).

Then I tried to reset the router to get the domain based access for it working again. First of all after resetting it, it just didn't work at all (lights were on but the PC couldn't connect to it). I tried resetting it again, and it still didn't work. Finally I tried holding down the reset button with the power off, and then letting go when I put the power in, and thankfully it got the router working again.

After that me and Rad looked around for a while to find out what the default password for the router was, eventually Rad found the CD for it so I looked on the manual on the CD and found the password, but it didn't work. I tried the password that we'd set before, and it did work. It seems the reset didn't actually work (although it must have done something since it broke the router for a while). I checked the domain for the router (, and it worked.

Then I tried it on my PC, and it didn't work. I tried it on Mac's PC and it did work. Both Rad's PC and Mac's PC only had the deafult settings in their windows hosts file, so I don't know why my PC can't connect to the router via a domain name, when theirs can. I checked the hosts file on the router, and it was back to the default and the hosts_backup file I had created was gone too. I assumed the reset had got rid of them.

I edited the hosts file to add a new entry, and backed it up as well, and then tried the new entry from Mac's PC. It didn't work, just went to the normal website for that domain name, but still worked. I thought that maybe the modem needed resetting for the change to take effect, so I switched it off for a couple of minutes, then switched it on again. But the domain I'd added still didn't go to the IP address I'd set.

I looked at the hosts file on the modem again and it had gone back to how it was previously, and the backup hosts file had gone as well. I edited the hosts file again, did a kill unet-d or whatever it is that stops you telnetting into it, then enabled telnetting on it again and logged back in, and my changes to the hosts file were still there, so it seems they only get lost when resetting the router.

I tried acessing the domain from Mac's PC, and it still didn't work. I tried adding a new hosts entry in Ubuntu, and it took effect immediately without having to reset it, so I don't know why changing the hosts file on the modem doesn't work. Anyway, unfortunately it seems you can't add DNS records to the modem.

After dinner I played on Excite truck with Ben, then me, Ben and Mac watched Lost (yes, surprisingly both episodes downloaded already, and in 720p as well!) After that I read the canon lens forums on dpreview for a bit.

The weather today was rainy in the morning, then sunny/cloudy in the afternoon, but cold and windy, then rainy and overcast again later in the afternoon.

Breakfast: Blackcurrant jam toast sandwich; cup o' tea.
Lunch: Chicken tikka sandwich spread sandwich; clementine; white grapes; cup o' tea.
Dinner: Spaghetti; herby tomato sauce stuff; bacon. Pudding was 2x small sponge cakes with apricot jam. Coffee.
Evening snack: German biscuit; Sainsbury's caramel chocolate; white chocolate coin; Coffee.

Wednesday, 21 January 2009

Trying to get the Wii to connect to my named virtualhost

I spent this morning trying to make it so I can access my local website from the Wii. I read this thread: Hack to browse the internet with the Wii, which is actually about re-directing the Wii shop channel website, but is basically the same as what I want to do - redirect a website address to a different ip address.

I followed the guide to setting up your PC to change the IP address the Wii shop channel points to, but the Wii said it couldn't connect to the internet. So I added the router's ip address as the secondary DNS server, and the internet worked, but it seemed the Wii was just using the router - when I typed in my local site's name, it just went to the real website, not the local one.

In the same thread, it was also suggested that you could add the site on the modem and direct it to your local ip there. I looked at all the different settings on the modem/router, and couldn't see anywhere to do this other than a section that blocks domains (but doesn't allow directing what ip address to send them to).

I tried telnetting onto the modem/router from the teriminal in Ubuntu like suggested, but the connection was refused. So I did some more googling, and found that you can go to on my modem/router to enable telnet. This isn't the original page where I found the info, but is quite a good overview of different stuff you can do on the netgear modems: Mel's Notes - Netgear DG834G. The other important command to note on there is killall utelnetd, which you type in the terminal when you've finished telnetting, to disable telnet again.

One I was into the modem, I spent ages and muchos googling trying to find out how to edit the hosts file, it seemed like there wasn't a text editor installed on it so you couldn't actually edit the files. Eventually I found out that you need to use cat. I had looked at cat earlier, but dismissed it as the page I read when I googled for 'Linux cat command' said it takes 2 files, concatenates their contents, then prints the result to screen.

Actually, you can view and edit files using the cat command. I found a nice PDF that explains how to use it (amongst other text editing methods in Linux): Simple Ways to edit files on SVU Hosts.
To view the contents of a file you just do cat filename
To add the new host to the file you just do cat >> filename Then enter your new host you want to add like
Then press Ctrl+D to save. I added a linebreak/return after adding the new line, so if I want to add any more lines, then I don't have to start off by adding a line break, because it's already there.

Before I made any changes to the hosts file, I backed it up as well cp /etc/hosts /etc/hosts_backup

But after doing all that, it didn't work! When I went on (or any of the sites already listed in the hosts file) it just went to the website rather than the local ip address set in the hosts file. I think that probably it has been like this for quite a while, maybe always. However I'm not sure, as I always access the router through the ip address rather than a name, so it could be possible that I somehow stopped it from referencing the hosts file while I was trying to figure out how to view/edit it.

I checked the file permssions on the files (ls -l), Linux Files and File Permission gives a good overview of what the different letters and number mean. But the permissions were set the same for hosts as for hosts_backup and most of the other files, so it looked okay to me.

So I posted a question to the netgear forum to see if anyone can help me there.

The other thing to note, is that one of the commands available when telnetted into the modem is mount. I'm not sure how you would mount a drive, since the modem doesn't have a usb port (I think) or any way of attaching a drive directly to it. However, when you go to 'attached devices' in the router setup (In a web browser, not through telnet), it lists the PCs that are attached to it. So maybe you could mount your PC's filesystem? If you could, then you could type up your hosts file on your PC, then telnet into the modem, mount your PC's filesytem, then copy the hosts file from your PC to the modem. I haven't tried.

After lunch I checked my email and ebay. The guy who sold a Canon 500mm/4 IS for £2400 and then relisted it and sold it at a buy it now of £2200 it seems did actually sell 2 lenses, as he has got positive feedback from the different buyers for both transactions. Great deal for those guys that won the auctions.

I went on Animal for about half an hour, I normally go on it for about an hour each day, but Nook's was closed for remodeling. Also, when I was rolling a snowball over a bridge, it rolled down the other side into a tree and smashed :(

Then I did some more work trying to get a menu reflection. I tried copying the menu into a foreign object in an SVG, then applying a matrix transform to the foreign object to flip it upside down. It worked in Firefox, Safari and Chrome, but in Opera the page background turned white, the menu items in the SVG all went onto new lines, like they had magically been turned into block elements, and they would also disappear and Opera would crash.

I did some googling about this and read that Opera may crash when an SVG contains a foreign object, but this has been fixed in version 10 Alpha 1. So I downloaded that, but it still crashed.

I decided to press on and see if I could make it work in FF/Webkit. I tried applying a fill to the foreign object, but this didn't work. I tried creating an svg (in Illustrator) with a mask, but the mask wasn't recognised in Webkit. I tried creating and svg with 2 blocks blended in Illustrator, and when I looked at the code it was just loads of rectangles with slightly different colours and placed slightly higher/lower than the last one, which creates an impression of a blend.

After that I found that the webkit browsers make the upside down text much larger/smaller when changing text size than Firefox. I think that probably they resize the svg and also resize the html text inside the svg, so it effectively gets resized twice. I tried giving the text inside the svg a font-size specified in px, but it still resized the same.

In the evening I watched Hellboy 2 with Mac, which was good.

The weather today was sunny most of the day (though quite cold) and then overcast around sunset, then rainy in the evening.

Breakfast: Maple & Pecan crunch cereal with added cornflakes and rice crispies; cup o' tea.
Lunch: ½ beetroot slices in vinegar sandwich; ½ Mature cheddar cheese with crunchy salad sandwich; packet of Flame Grilled Steak McCoy's ridged crisps; white grapes; cup o' tea.
Dinner: Beef burger with mature cheddar cheese, tomato ketchup and crispy salad in bun; bowl of vegetable fake cup a soup; ½ bun. Pudding was rice pudding with blackcurrant jam. Coffee; Oreo.

Tuesday, 20 January 2009

More SVG/VMLing

This morning I checked my email and downloaded the IE8 and IE6 .vhds for Microsoft Virtual PC 2007, since my current ones had expired. I tried one of the test pages I made yesterday in IE8, and it didn't work very well. One of the vml images didn't display at all, and the text in the other one was very blocky and pixelated. I checked the VML text examples on the Microsoft Developer Network site, and they worked fine, so it must be my code that is wrong.

IE8 doesn't support svg or <canvas>. Looking at the posts and comments on the IE Development Blog, it seems that IE8 is still going to be very buggy and not supporting many things that other browsers have supported for ages. I think that maybe on my site I will have a 'Get Firefox' ad inside an IE conditional comment, so only IE users see it.

In the afternoon I did some more work on my web design mockup, trying to integrate a banner ad. I posted my latest design to the web squeeze for comments/critique, then read some of the threads there.

I played on Excite truck with Ben for a bit, then it was dinner time. After dinner I played Excite Truck with Ben and Mac a bit, then we watched a raddish Planet Earth thing that's like a bonus episode except it's just bits from planet earth you've already seen (and not really the best bits either) plus people saying boring stuff about how everything is going to be extinct.

After that I started work writing some js to create an svg/vml that reflects some text. So far I have got it to copy some text and display it as an svg/vml. But I have run into a problem already - when I insert the svg into a span in Opera, it is making the text smaller. When I insert it into a div, it doesn't. I will carry on with this tomorrow.

The weather today was quite nice and sunny all day, though a bit windy.

Breakfast: Maple & Pecan crunch cereal with added cornflakes and rice crispies; cup o' tea.
Lunch: Mature cheddar cheese sandwich; clementine; white grapes; cup o' tea.
Dinner: Lasagne; potato; green beans. Pudding was Jamaica ginger cake with golden syrup and custard. Coffee.
Evening snack: 2x Oreos; coffee.

Monday, 19 January 2009

text with transparent gradient - SVG, VML and <canvas>

Today I was checking into how to get a transparent gradient on text to display on the web.

Text in an SVG with a gradient mask filter works on Opera 9.6 and Firefox 3. It doesn't work on webkit browsers (Chrome and Safari), the text will display but solid. Webkit browsers won't apply a standard gradient to a text element in an svg file, and they won't use a text element as a clipping path either. SVGs don't work in IE unless you install the Adobe SVG viewer (discontinued).

The <canvas> element can be used in Firefox, Opera and webkit browsers (not IE again). You can create a gradient going from full opacity to no opacity (or whatever you like) using <canvas>, but it doesn't support text, so no good for me. I'm not sure whether it is possible to make canvas elements with %age or em sizes either, as the createLinearGradient and fillRect methods both use px values (you set x1,y1,x2,y2). Mozilla have a good <canvas> tutorial.

VML only works in IE. Unfortunately Illustrator doesn't export to VML, and I've not been able to find any programs to convert SVG files to VML. You can set gradients in VML (including gradients on text), and you can use a filter on images (including VML that contains text) to set an opacity gradient ( = 'progid:DXImageTransform.Microsoft.Alpha(opacity=0,style=1,finishOpacity=100,startx=0,starty=0,finishx=150,finishy=150)';). I think IE also has a filter to flip text upside down, which is what I want for my text reflection.

So using an opacity gradient on text is relatively easy in Firefox and Opera (can just use the svg files that Adobe Illustrator produces), not difficult in IE (just have to type the code manually), but seemingly impossible in webkit. Webkit does have a CSS extension to handle gradients, however none of their examples worked in Google Chrome or Safari for me.

If you have a plain coloured background, then adding gradients to text is relatively easy: CSS Gradient Text Effect. However, this is no good if your background is a pattern or, as in my case, a gradient. What I am hoping to do is to use a copy of the background gradient, but with a transparent gradient applied to it, and saved as a png. This will then need to be absolutely positioned to make sure it lines up with the real background gradient. It will overlay the text, being solid at the bottom, fading to transparent at the top. This should give the impression of the text fading.

Another alternative would be to use Flash. I haven't tried this because I don't know Flash, and I'm not sure how it would work with text based zooming (It's important to me that the text and it's reflection zoom when the text size is increased). Possibly I may look at Flash tomorrow, but I might not bother.

I spent most of the day reading about svg, vml and canvas and also changing different things in example code to see how they worked and try and get the effect I was looking for. But I also went on Animal Crossing and sold last week's red turnip for 16,000 bells. In the evening I watched the last episode of Season 4 of Lost with Mac and Ben and also some rubbish extra stuff. Now we're ready for season 5 starting in a few days. I watched the latest season of The Office (US) with Mac as well.

I also got my google adsense account re-activated, which took quite a while and going round in circles.

Breakfast: 2 slices of malt loaf with butter; cup o' tea.
Lunch: Mature cheddar cheese with crunchy salad sandwich; white grapes; cup o' tea.
Dinner: Ham quiche; potatoes; peas; butter. Pudding was, erm, I don't think I had anything for pudding. Coffee; 2x Oreos.
Supper: German biscuit; cup o' tea.

Sunday, 18 January 2009

SVGs and browser compatibility

This morning I went on Animal and bought 40 white turnips and 1 red turnip seed from Sow Joan. I also got a letter from the HRA to say my rating was over 100,000, (must be due to completing the snowman collection) and they sent me another house model.

After that I watched Ben and Mac go on Animal, then we went to church, which was a Churches Together Service at the Church of England Church in the middle of town. When we got there the downstairs was totally full, so we sat upstairs. They had a proper choir and you had to sing some prayers in a Gregorian chant style.

When we got home I checked Deviantart, Luminous Landscape, Andy Rouse's blog, and Moose News Blog, then it was dinner. After dinner me, Mac and Ben watched Lost, then I finished reading Moose News Blog, read a bit of the dpreview canon lens forum, and checked Flickr.

I did a little bit of work to see if you can use svgs with an opacity gradient in web pages, and have the text in them increase in size when zooming text. Then we had a hot cross bun, then I watched another episode of Lost with Mac and Ben.

I did a bit more work on the svg problem, then played on Excite truck a bit with Mac and Ben. I did some more work on the svg problem, then we had tea.

After tea I spent the the rest of the evening looking into whether you can use svgs with an opacity gradient in web pages, and have the text in them increase in size when zooming text. The answer seems to be that it will work in Firefox and Opera, but not in webkit browsers (I tried Safari and Chrome). SVGs won't work in IE, but IE has its own version of SVG. I didn't try converting an SVG to the MS format, maybe I will try that tomorrow.

Breakfast: Blackcurrant jam toast sandwich; cup o' tea.
After church snack: Deutsche biscuit; coffee.
Dinner: Chilli con carne; rice; Tortilla chips; grated cheese. Pudding was small cherry bakewell tart with custard. Coffee; Oreo; Crunchie; Sainsbury's caramel chocolate.
Afternoon snack: Hot cross bun with butter; cup o' tea.
Tea: Delee sausage with mayonnaise and crunchy salad sandwich; clementine; slice of iced lemon madeira layer cake; cup o' tea.

Saturday, 17 January 2009

Reading up on web design

This morning I checked my email and got granny breakfast. After that I went on Animal for a while. It was the dab fishing tourney, which meant you had to try and catch the biggest dab. I did lots of fishing, but only caught one dab, which luckily was the biggest caught so far, so if no-one else gets a bigger one, then I'll win the trophy!

I think I also have the complete snowman collection now, it seems that you don't get any duplicate snowman items until you've completed the collection. The items sell for 8,888 bells at Nook's, so it's still worth trying to make perfect snowmen even after you've completed the snowman set.

After that I made my bed then read a bit about web design. Before dinner I started watching a video with Chase Jarvis, David Hobby and some other bloke talking about blogging.

After dinner I watched Lost with Mac and Ben, then finished watching the video about blogging I was watching earlier. Then I read some more about web design.

Breakfast: Tangerine marmalade toast sandwich; cup o' tea.
Lunch: Peppered ham sandwich made with bread-maker-made bread; slice of bread-maker-made bread with honey; slice of bread-maker-made bread with blackcurrant jam; slice of Iced lemon Madeira cake; cup o' tea.
Dinner: 2x Delee sausages; potato; mashed potato; roast parsnips; baked beans; carrots. Pudding was Apricot yoghurt and 3½ mini ring doughnuts. Coffee.
Supper: Oreo (always makes me think of Doeo); cup o' tea.

Friday, 16 January 2009

Being rubbish at website design

This morning I tried to get OSX86 installed on a VMWare virtual machine. Although I could get it installed, I could never get it to run. I tried quite a few times, with different Virtual Machine configurations and different settings when installing, but no luck.

At lunch loads of pigeons and a couple of crows kept flying around and they ate all the bits of burnt toast that have been out on the grass for the last couple of days. After lunch I did some work on a mock-up design for my website.

After dinner I watched Lost with Mac and Ben, and then Planet Earth: Ocean Deep. After that I did some more work on my website design. I'm really rubbish at it so I think I'll have to read a book/some internet articles to try and get better at it. I also posted my mock-up to the web squeeze for critique.

The weather today was mainly overcast and a bit rainy, though it was sunny for a bit in the afternoon.

Breakfast: Tangerine marmalade toast sandwich; cup o' tea.
Lunch: Mature cheddar cheese sandwich; Clementine; slice of Madeira cake; chocolate wafer biscuit; cup o' tea.
Dinner: 2x fish cakes; tomato ketchup; potato; peas. Pudding was 2x apple pies with custard and squirty cream. Coffee; Sainsbury's caramel chocolate; Cadbury's Dairy Milk Jason Statham's character from 'Snatch'.

Thursday, 15 January 2009


This morning I checked what files I could access using php includes, and found that I could access files within the user's folder (and owned by the user) both with permissions of 622 and 620. I could access files in a different user's folder (and owned by a different user) with permissions of 622, but couldn't access their file with permission of 620.

The apache directory directives only seem to affect to what you can access via your browser e.g. a directory with deny from all could be accessed by a php script, but you wouldn't be able to access html files or images stored in it from the browser.

After lunch I went on Animal for a bit and Nook actually had a decent price for turnips (about 146 bells ea., I bought them at about 108 bells ea.). Then I did some more work on my website, and I now have it running on Ubuntu. I had a problem with Konqueror opening loads of windows saying about loading a Kwallet Daemon, one window for every image on the page. So I did some googling and deleted the kwallet file, and it seems to be working okay now.

I also saw that Apache had an error saying that you can't use SSL with named virtual hosts, but after doing some googling I read that actually SSL does work with named virtual hosts, just it's not supported properly. I tried connecting to my 2 virtualhosts using https, and both of them resolved to the correct directory, so I think that SSL does work with named virtualhosts. The other alternative it seems would be to use mod_gnutls.

After dinner I watched an episode of The Equalizer, then watched Lost with Mac and Ben. After that I watched a bit of The Wizard Of Oz with Mac. Then I tried to install OSX86 on VMWare, but didn't have much luck.

Breakfast: Tangerine Marmalade toast sandwich; cup o' tea.
Lunch: Bag of The Real McCoy's Ham and Mustard flavoured crisps; Smoked Cured Roasted Peppered ham sandwich; clementine; slice of madeira cake; chocolate wafer biscuit; cup o' tea; Sainsbury's caramel chocolate.
Dinner: Shepherd's pie; broccoli; carrots. Pudding was 2x American style chocolate brownie cookies. Coffee.
Supper: 2x German Biscuits; cup o' tea.

Wednesday, 14 January 2009

Getting phpMyAdmin working in Ubuntu

This morning went on Animal for an hour until just before 10am, then went on my comp to do some work with my website.

First I googled about chrooting my virtualhosts/user, and couldn't find much that I could understand. Two links I found useful were VSFTP chroot or jail users - limit users to only their home directory howto and Stuart Herbert's PHP blog, which has a few posts on the different methods of securing a shared hosting environment.

After reading that for a bit, I checked if I was chrooted on my webhost, and I wasn't. So I guess finding out how to chroot a virtualhost isn't important. I did find that I could access non-php files outside of the user's home directory (in my local environment, didn't try it on the webserver!), which seemed like quite a security risk if this was how the webserver was set up (which it very likely isn't).

Later on I realised I could fix this problem by changing permissions on files/folders outside the user's home root so that the permissions for 'Others' was 'List files only' rather than 'Access files'. An easier way would probably be to set Apache2 to default folder/file permissions to deny from all, then just change to allow for the user's home folder in the virtualhost setup.

Before lunch a couple of guys came round to install the green cone which I ordered back in December.

After lunch I followed a bit more of the netbeans tutorial in setting it up to work with php, which involved installing the Xdebug apache module. Because I was using php5-cgi rather than mod_php5 I had to make a couple of manual changes to php.ini to get it to work. Weirdly php.ini didn't have any links to the gd, mysql, mysqli or PDO modules, but phpinfo() said these were all loaded.

After getting that set up I needed a way to setup databases and users in mysql, so I installed phpmyadmin. First off I couldn't get phpmyadmin to load, it just had a message about unknown file type .phtml or sumat, and a download box popped up for index.php. I figured this was something to do with suPHP and not having suPHP set up for the localhost virtualhost. So I tried accessing phpMyAdmin via my main working virtualhost, and that gave a suPHP error message to say that that the file was outside the area that the user was allowed to execute php scripts. I think that was the error, or otherwise it was about the UID of the file being less than the UID of the user. Eitherway, I got both those of those errors, one after fixing the other one.

I did some googling, but couldn't see how to fix this, so I just setup a new virtualhost for phpmyadmin, and a new user webapps. I set the virtualhost document root to '/usr/share/phpmyadmin' and the webapps home dir to there as well. I also had to 'chown -R webapps:webapps /usr/share/phpmyadmin' as well, as before the file files were all owned by root in group root, so suPHP couldn't execute them. In the virtualhost block I made sure I changed the user and group to run php scripts as to webapps.

Finally after much testing and messing around I got phpMyAdmin to load, but it had an error sumat like "conf error change password in $cfg['blowfish_secret']". After some googling I got it working by adding "$cfg['blowfish_secret'] = 'holla';" to '/etc/phpmyadmin/'. But then I tried changing the password in '/var/lib/phpmyadmin/' and that broke it. I messed around for a while, then finally gave up and reinstalled phpMyAdmin through the Synaptic package manager. But the file still had the password I'd made up in it, so I deleted the file, then reinstalled phpMyAdmin again. Then I added "$cfg['blowfish_secret'] = 'holla';" to '/etc/phpmyadmin/' again and it worked again.

After logging in as admin I found I couldn't add databases. So I tried logging in as root, and it worked and I could now add databases. Next I exported my database from my MySQL database in windows. I couldn't copy across a file from windows to my Ubuntu virtual machine. I did some googling and it seems that you can't copy files across with VMWare Server 2 and need VMWare Workstation for this ability. Oh well. It seemed the solution was to setup FTP on your virtual machine and then ftp the files across to it. I don't expect to be needing to transfer files from Windows to Ubuntu or Ubuntu to windows very often, so I didn't bother setting up ftp.

I copied the sql from the MySQL export operation, and pasted it into a file on Ubuntu and then did the import. There didn't seem to be any way to export a user, so I had to set up a new user on the Ubuntu MySQL installation and hope I did it the same as what was already setup in my windows environment and on the webhost.

After getting that setup I needed to copy all my website files across from windows to the Ubuntu VM. I used Nero to create an ISO file with the files on it, which I inserted into the Ubuntu Virtual Machine. There was some trouble with Nero being weird, but I did get it to work eventually.

After copying all the files across from the virtual CD to my working web directory on Ubuntu I had to change the Access permissions on all the files to be read-write by the owner and read by the group. The .htaccess files were owned by root, so I had to switch back to my admin account so I change their ownership to the user whose directory the site is in. I have to do this switching back forth between accounts quite a bit, and it gets quite annoying as you have to put your password in again each time you switch accounts.

I did find a useful tip when I googling for help on one of the many problems I was having - you can run sudo synaptic from terminal, and then you can edit, delete, copy files, and change permissions easily rather than having to do it all from the terminal window.

After sorting this out, I tested my site, but got an error that it couldn't connect to the database, the user was rejected. After some more googling and messing around, I found the problem was that I had setup my user for any host, and I needed to change it so it was for localhost only. After that it worked.

After getting that working it was dinner time. After dinner I watched Lost with Mac and Ben. I did a bit more website stuff in Ubuntu, then watched Fargo with Mac.

Breakfast: Tangerine orange marmalade toast sandwich; cup o' tea.
Lunch: 2x cheese-on-toasts; ½ honey sandwich; slice of madeira cake; chocolate wafer biscuit; cup o' tea.
Dinner: Slice of pepperoni deep pan pizza; slice of 4 cheese deep pan pizza with added yellow pepper; chips; peas. Pudding was a peach and passion fruit creamy yoghurt and a dark chocolate digestive biscuit. Coffee; Sainsbury's caramel chocolate; white chocolate coins.
Supper: Tangerine orange marmalade toast sandwich; cup o' tea.

Tuesday, 13 January 2009

Processing pics

This morning I went on Animal, then took Granny to the hospital buidling on the way into town for her appointment about a hearing aid. When we got back it was lunch time.

After lunch I finished reading my free copy of Moneywise magazine, which I guess was okay for a freebie, but I didn't think much of it really. The investment advice in it seemed to be very general e.g. suggesting investing in various funds depending on your risk appetite rather than specific share recommendations. It seemed as if they didn't want to give specific investment advice in case they got sued for giving bad advice. I don't think they mentioned investing in gold at all. Certainly not worth the £4.20 price they put on the cover.

After that I carried on processing pics I took on a walk with Rad on 9th January. Then I geo-tagged the images, and while that was processing I checked my spleenmail. I also checked my ebay, and the Canon 500mm/4 IS lens that was sold on ebay the other week for £2400 had been re-listed and sold for £2200 buy it now. The buyer had left positive feedback for the seller as well, so it must have been genuine. Strangely the seller hadn't put any reason for the relisting, they hadn't left any feedback for the original auction winner, and the original auction winner hadn't left any feedback for them either.

I finished renaming the images after dinner, and copied them across to My Pictures folder. I watched Lost with Mac and Ben, then sorted some flower photos, and made a moth photo into a desktop size image, which I uplodaded to deviantart. After that I checked the websqueeze.

The weather today was a mixture of cloud and sun in the morning, then it got windier and overcast in the afternoon, and rained in the evening.

Breakfast: Blackcurrant jam toast sandwich; cup o' tea.
Lunch: Honey & mustard ham with babyleaf salad sandwich; apple; slice of madeira cake; chocolate wafer biscuit; cup o' tea; pieces of Sainsbury's caramel chocolate.
Dinner: Steak pie; mashed suede; potato; green beans; gravy. Pudding was a creamy strawberry yoghurt. Coffee; White chocolate coin.

Monday, 12 January 2009

Processing photos from this year

After breakfast went on Animal for a bit, then generated JPGs for the photos I took on a walk with Rad on 9th January. While that was processing I tidied up my room a bit, then vacuumed it.

When that was done I sorted through the pics and started processing them. I also checked my email.

After lunch I carried on processing the pics and went on the pinternet a bit while I waited for stuff to save/load/process.

After dinner I watched Lost then Planet Earth with Mac and Ben. After that me and Mac looked at holidays on, and There was a good holiday to Tirol on about £270 per person for a week and a week holiday to Tokyo on opodo/expedia for about £750 per person, so it would be good to go on both of those holidays.

The weather today was overcast all day, and it rained most of the day.

Breakfast: Blackcurrant jam toast sandwich; cup o' tea.
Lunch: Mature cheddar cheese with babyleaf salad sandwich; mandarin; slice of madeira cake; chocolate wafer biscuit; cup o' tea; bag of Cadbury's chocolate buttons.
Dinner: Bacon; baked beans; eggy bread with bovril. Pudding was fruit sponge (microwave christmas cake) with custard. Coffee; White chocolate coin; piece of Cadbury's Dairy Milk Turkish.

Sunday, 11 January 2009

Processing photos from last year

Went on Animal and bought some white turnips and a red turnip seed from Sow Joan, then we went to church.

After church I processed some photos from a walk I did with Rad on 22nd December.

After dinner I watched Lost with Mac and Ben, then processed some more photos from a walk I did with Rad on 22nd December.

After tea I finished processing the pics, then watched Planet Earth: Shallow Seas with Mac & Ben. Then I geo-tagged and re-named the photos from the walk. While the geo-tagging was processing I checked my email, deviantart and dpreview.

The weather was overcast, windy and quite mild all day.

Breakfast: Hot Cross Bun with butter; cup o' tea.
Dinner: Chicken curry; rice; sultanas. Pudding was Cherries; tinned pear half; trifle sponge. Coffee; Mini Cadbury's flake; a couple of pieces of Sainsbury's caramel chocolate.
Tea: Peppered ham with baby leaf salad sandwich; ½ Mature cheddar cheese with baby leaf salad sandwich; Manadarin; Slice of coffee cake; Chocolate wafer biscuit; cup o' tea; Piece of Sainsbury's caramel chocolate; Weird Cadbury's popping chocolate Elf bar.

Saturday, 10 January 2009

Watching stooef

This morning me, Mac and Ben went in the garden and saw how thick the ice on the pond was. It wasn't as thick as it had been a couple of days ago. We smashed a bit of it then pulled it up and I took photos of Mac and Ben looking through a hole in it where the football had been.

After that we went on Animal, and I beed bored for ages while Ben went on it. I went on my comp for a few minutes, looking at pictures of Ben and Mac with Mac, then it was lunch time.

After lunch me, Mac and Ben watched 'The Shootist', a John Wayne film, but he didn't do much shooting. The start was the best bit, but then the rest was a bit boring. He stayed at a guest house run by a widow, and I kept expecting him to tell her to get in the kitchen, but weirdly he didn't. It also featured Scatman Crothers, but his part was only quite small. I think it would have been much better if he was playing the widow whose house Wayne lodges at. The film also features James Stewart, who has a skill voice. I gave it 6/10 on IMDB.

When we finished watching that we went on walk, before we went out I checked the pond, and it had iced over again, so I knew this meant the ground should still be frozen and not muddy, so we walked up the big hill on the way to Lubenham.

When we got back I did some work on my photos from a walk I did with rad on 22nd December.

After dinner I watched Lost and Planet earth with Mac and Ben, then we all went on Animal again and got a song from KK.

The weather today was below zero and overcast all day.

Breakfast: Bowl of Frosties; cup o' tea.
Elevenses: Grapefruit marmalade toast sandwich; cup o' tea.
Lunch: Slice of bread-maker made bread; peppered ham sandwich with bread-maker made bread; honey sandwich with bread-maker made bread; 2x cherries; cup o' tea.
Dinner: Tinned beans & sausages; jacket potato; grated cheese. Pudding was 2x Apple pies & custard with spleenvap. Coffee.
Supper: Hot chocolate; dark chocolate digestive; nice cream.

Friday, 9 January 2009

Went on a walk and trying to get Illustrator to import a Photoshop file

This morning I checked my email and tried to see if I could disable SSLv3 at the localhost level, but then enable it at the .htaccess level, but I couldn't.

My pet moth had gone to sleep in the milk lid with honey in it, and had got a bit of honey on itself, so I took it out and tried to take some more photos of it, and it had honey on its eyes!

After lunch I did a bit of work on my website design (photoshop mockup), then I went out on a walk with Rad. I took my Lowepro S&F Deluxe belt with the 65AW, Lens Case 1, Lens Case 1S, and Lens Case 3 attached along with the D200 & 18-70mm, Tokina 10-17mm fisheye, 50mm/1.4 and 70-300VR lenses. I also wore the Slingshot 300AW bag, since I needed to carry the gps, rocket blower and lens pen as well, and didn't have any more cases on the belt to fit them in. Wearing the bag and belt was fine, since the bag was virtually empty I could hardly tell it was there. The belt was quite heavy though, particularly due to the 70-300VR lens and the D200 when I stored it in the 65AW. The 65AW was also quite difficult to close.

Changing lenses was certainly a lot easier and quicker than without the pouches, though still not quick enough to keep up with Rad. I don't think it would be possible to change lenses any faster though. Next time I will try just the Tokina 10-17mm fisheye, 50mm/1.4, and a case for the 18-70mm (when using a different lens) on the belt, and then the D200 with whatever lens is attached to it and the 70-300VR in the Slingshot bag.

A couple of other ideas for carrying I had was a fishing vest, and just put the lenses in the pockets. Probably would need the Slingshot bag as well for holding the camera and 70-300VR lens. Or my other idea was the Slingshot 300AW bag with all the internal dividers removed and the lens cases (with lenses) inside the bag.

After the walk I rearranged the bags on the Lowepro belt and went on the pinternet a bit.

After dinner I took my pet moth into Maccy's room, but then he scared it and it flew on the ceiling so I had to catch it in an old coffee jar and then put it back in its tank. Then me, Mac and Ben watched Lost and then Planet Earth: Grass. We also watched some weird youtube videos.

After that I tried to import my website photoshop mockup into Illustrator, but it said that Version Cue didn't have enough memory. I did some googling, and the adobe website said to open the Version Cue item in the control panel. But there wasn't one. So I tried opening the Version Cue server from Illustrator, but that said an error had occured and been recorded in the log. Unfortunately it didn't tell you where the log was.

I couldn't see any Adobe version cue files anywhere on my PC where I would expect them to be, so I searched my C: drive for files containing 'Cue'. Eventually it found the folder with the version Cue program files in: C:/Program files (x86)/Common files/Adobe/Adobe Version Cue CS3/

I tried starting version cue manually from there, but it didn't work. I went on the Windows Services and tried to start Adobe Version Cue CS3 from there, but that didn't work either. I googled to try and see where Verson Cue saves its log files, but couldn't find the info anywhere. So I ran msConfig and ticked the service item and startup program entries for Version Cue. Then I restarted the PC.

After that when I double clicked the Version Cue in Illustrator, it opened a Version Cue page in Firefox. I had to fill in some info and go through the setup process, but it didn't ask about how much memory Version Cue could use anywhere. I checked all the options, but it didn't have a memory option. I checked in control panel, still no Version Cue CS3 listed.

So I restarted the PC again. Still Version Cue CS3 wasn't listed in the control panel. I googled about it and found a post that said to run 'C:\Program Files (x86)\Common Files\Adobe\Adobe Version Cue CS3\Server\bin\VersionCueCS3.cpl'. So I ran that, and the contral panel loaded. So I increased the RAM to 1000, applied the settings and then tried loading the photoshop file in Illustrator again, but it still said there wasn't enough memory. So I opened the Version Cue control panel again, but the memory was set at 916MB and wouldn't let me set it any higher.

I googled but couldn't see anything about this, so I tried looking at the various config files, and after a bit found one that had the memory set to 916MB - C:\Program Files (x86)\Common Files\Adobe\Adobe Version Cue CS3\Server\config\StartupOptions.xml. I changed the memory setting to 4000, then loaded up the Version Cue control panel, but the memory was still set at 916MB.

I restarted the PC again, but the memory was still set at 916MB in the version cue control panel. I thought that maybe the control panel was broke, and the seting did work, just that the control panel can't display any more than 916MB. So I tried loading the Photoshop file in Illustrator again, but it still said not enough memory. So I disabled Version Cue again in msconfig, and I guess to do a version of the design in Illustrator I'll have to start all over again.

The weather today was mostly cloudy and overcast, though it was sunny and cloudy while me and Rad were walking, then was overcast (and a bit foggy) again by the time we got back home.

Breakfast: Bowl of Frosties; cup o' tea.
Lunch: Cheese on toast; ½ Peppered ham sandwich; mandarin; slice of coffee cake; cup o' tea.
Dinner: Battered fish portion; peas; potatoes; mushrooms; salt; ground black pepper. Pudding was a slice of chocolate swiss roll with chocolate custard. Coffee.

Thursday, 8 January 2009

Writing yesterday's blog entry

Before I was going to bed last night I looked at my pet moth, and it was drinking some of the honey, which I thought was good. It seemed to have its front legs in the honey though, so I hope it doesn't get too sticky. It wasn't stuck in the honey this morning.

This morning I backed up all my stuff, and then wrote yesterday's blog entry since I forgot to do it yesterday. I have to say again how impressed I am with Synkron's sync all feature, I got the backups done pretty quickly. Writing the blog entry somehow took nearly all morning though.

I started checking my email, had lunch, then finished checking my email. My 2 comics that I ordered from the Federal Reserve ('Once Upon A Dime' and 'A Penny Saved') arrived, so I read them. Funny how the US Federal Reserve will post them to someone in the the UK for free.

After that I tried to get copy/paste working between Vista and Ubuntu. After much messing about, googling, reading and re-installing, I found that all I needed to do was to add /usr/bin/vmware-user to autostart in System > Preferences > Sessions. (I had already installed VMWare tools before).

Then I tried to get suPHP working how I wanted. After dinner I carried on trying to get suPHP working how I wanted, but couldn't, so I sent a message to the suPHP mailing list to see if anyone could help me. Then I watched Lost with Mac and Ben. After that I checked the websqueeze. Someone had asked about how to enable SSL3, so I tried to look into that, which involved setting up SSL for apache in Ubuntu since it wasn't enabled before. These tutorials were helpful: Install and Configure Apache2 with PHP5 and SSL Support in Debian Etch and How to Enable SSL version 3 and TLS (Transport Layer Security) version 1 in Apache hosts.

Breakfast: Grapefruit marmalade toast sandwich; cup o' tea.
Lunch: 2x cheese on toasts; mandarin; piece of slightly garlic flavoured flapjack; cup o' tea.
Dinner: Toad in the hole; carotts; potato; gravy; mustard. Pudding was fruit salad. Coffee; A couple of pieces of Cadbury's Dairy Milk Turkish.

Wednesday, 7 January 2009

First try using combineZP

Last night when I went to bed I kept hearing my pet moth flying around so I kept switching my light on and looking for it. Eventually I did find it, I caught it in a jar. Then I had to go downstairs and get the insect tank, then put the milk bottle lids with honey and sugary water in the tank, then put the jar with the moth in in the tank.

After breakfast I checked my spleenmail, I tried to add a sender to my safe senders list, but hotmail said my safe senders list was full, so I spent a long time editing my safe senders list, removing indivdual email addresses and just adding domains instead. However when I went back to checking my email, it was saying email from sender's wasn't safe, even though their domain was in my safe sender's list. Hopefully Hotmail is just slow to update their lists and it will work tomorrow, otherwise there doesn't seem to be any point to adding a domain to your safe senders list.

This morning I took some macro photos of a blue crystal, I was trying to get it so I could light up the background behind the crystal in a sort of circle shape, kind of like how Jill Greenberg does. Unfortunately I couldn't get it to work, I tried using a pen lid on the flash to make the area lit by the flash very small, but it still didn't work.

After that I took some photos of my pet moth. When doing a 5x shot of its face I noticed it had some nice nostrils, but couldn't get them in focus as well as the eyes so I tried shooting a stack. Composition was very difficult and for shooting the stack I just had to adjust the 'zoom' on the lens, which of course moves the whole camera a little bit. Really I could do with a focus rail for shooting static subjects from a tripod.

After that I looked through the dpreview canon lens forum to see if I could find any posts recommending focus stacking software (I knew there was one called CombineZM but I thought there was a newer (and better version) called CombineZ(some other letter). I looked for a bit, then it was lunch time.

After lunch I played on Animal for a bit. Then I carried on reading through the dpreview canon lens forum. After a while I'd read quite a bit but hadn't found the info I was looking for, so I just did a search for CombineZM, then on the CombineZM page it said there was a new version called CombineZP. So I did a google search for 'CombineZP', and that found the thread on dpreview that I had been trying to find. Indeed, CombineZP was the new version that was recommended there.

So I downloaded CombineZP and tried it out. It was very simple to use, and after doing the combine (which takes quite a while when doing all the different combine methods) I saved the combined images and had a look at them. Unfortunately, it looked like the focus was on the moth's nose rather than the eyes, because I hadn't started the stack with the focus far enough back.

So I took the moth out again and took some more photos, starting with the focus further back. Then I copied these to the PC and did a focus stack using CombineZP. I didn't include the first the 2 photos as I thought the focus was too far back, but when I looked at the combined images when CombineZP was finished combining, I realised that actually I did need those images.

So I re-processed again using those images as well. The resulting images (I used all methods again since I don't know what method works best) looked pretty good, especially considering that the moth moved a little bit between shots and the camera/lens must have moved a bit between shots as well. There were a few artefacts though. I put all the combined images CombineZP had just produced into Photoshop and started doing a bit of post procesing, then I put the moth back in the insect tank as I didn't think I would need/want to take any more photos of it at the moment.

I finished processing the image in photoshop. I don't know if CombineZP already does processing on the images, or if it does if you can turn it off. Also the files it produces don't have a color space and are 8bit (I used 16bit TIFFs as the input files for it). I guess if I do any more stacks I will have to try and look and see wheat options are available in CombineZP. Anyway, I was quite impressed with the image it produced considering the images weren't aligned exactly.

I posted a web size version of the final image to deviantart and got like 3 comments on it, which is my most commented deviation ever I think. Normally I get 0 comments. I guess people just saw it on the front page of deviantart, since it shows the last 15 or so submitted deviations on there. I don't expect to get any more comments on it because so many deviations are submitted that it would have got pushed off the front page after a few seconds.

I checked my deviantart messages and new images from people I'm watching as well. After that I think I read something on the internet, can't remember what it was. Maybe it was an article about MySQL and scalability. In a sitepoint email I got the author said they wanted to learn CouchDB and Python in 2009. From the MySQL scalability article I was reading, it sounded like CouchDB might be a good thing to learn (and I'm sure Python would be good to learn as I think Google use it a lot).

Before dinner Clare found my book people delivery by the side gate (wonder why they left it there since I was in all day today and yesterday), the box was rather damp and also torn along one of the bottom sides. Ben opened it up for me (he likes openng parcels) and thankfully both the books were in good condition. They were both hardback books as well, and bigger than I thought they would be. I got 'Birds: The definitive visual guide' and 'Ray Mears and some other bloke: Wild Food' for £9 total.

After dinner I watched s04e01 of Lost, as Maccy got the Blu-ray of season 4 today. Then after that we watched Planet Earth: ice. Then I tidied up my room a bit as it had photo stuff lying around and on my bed. I think I did sumat on my comp (cannae remember what) and then went to bed.

The weather was overcast all day today and most of the snow melted.

Breakfast: Bowl of Frosties; cup o' tea.
Lunch: Mature cheddar cheese sandwich; satsuma; slice of home-made jam victoria sponge cake; caramel Rocky; cup o' tea.
Dinner: Totally delee Asda (I Tom Hink) fajita kit chicken fajitas (although they were slightly too hot); rice. Pudding was Neapolitan ice cream with wafers (nice to cool your mouth off after the hot chili chicken. Coffee; Bailey's chocolate truffle (my last one [:(] ); piece of Sainsbury's caramel chocolate.

Tuesday, 6 January 2009

Getting virtual hosts and suPHP on Ubuntu working

This morning I looked in my fishtank and the moth wasn't there. I took all the stuff off the top of the fishtank, and it wasn't sitting up near the top of the tank either. Somehow it had managed to escape despite the top of the fishtank being blocked off with a folder and picture frame covering it. I've no idea where it is now. I looked round my room, but couldn't see it anywhere. It must be around my room somewhere.

After that I tried to help Rad with his external hard drive that isn't working properly. I also carried on trying to get virtualhosts working in Ubuntu. Eventually I got it working, with much trial and error, and following this tutorial: Ubuntu Feisty - Apache Virtual Hosts, only the virtualhost block needed to be *:80 rather than just *.

Probably after getting that working I had lunch, but I cannae remember exactly when it was.

After getting that sorted I moved on to checking if suPHP worked. It did, but apache gave an error when I added in suPHP_UserGroup user group to the virtual host configuration.

So after some googling I uninstalled suPHP, and then followed this guide: How To Set Up suPHP With PHP4 And PHP5. I did come a bit unstuck at one point when my make didn't work, but after a bit I realised that I needed g++ (GNU C++ complier) installed (had to read the error message to see I needed it, duh!). After installing that I followed the rest of the guide (well not about setting up php4 and php5) and it all went smoothly. The latest version of suPHP (0.7.0) that I downloaded didn't need the changes making to the code either.

I had to chmod the php file I wanted to run as I had created it as root rather than the user I specified in the virtual host configuration settings. After this, I could access the page okay, and display the phpinfo() file I'd made.

When Ben came home from school we went in the garden to see how thick the ice was, we could actually walk on the pond without falling in!

After this I checked my email and read a bit about using Ubuntu since I'm new to Linux. One of the things I read was that you can press Alt + Print Screen to take a screenshot of just the window you have in focus at the moment. I tried it on windows Vista, and it worked too. I never knew about that.

Most of the day I was also trying to get Rad's external harddrive to work, but gave up about 5pm when it still didn't work even after deleting the partition table. Whenever you try and format a partition, windows will format it, then when it's finished say an error occurred and the partition could not be formatted properly. Rad also tried a program create and format the partitions, but that didn't work either. Seatools didn't recognise the drive as a Maxtor/Seagate drive, and couldn't run any tests on it, so I think the drive must be trashed.

The weather today was cold all day (probably at or below zero in the shade), and the snow on the road/pavement that got sun on it didn't melt much (probably just reflected most of the heat from the sun). The snow on the grass across the road did melt though. The snow in the back garden didn't melt, but that hardly got any sun on it. I don't know if I said about the snow before. It snowed a bit yesterday, not enough to make a snowman with or anything, the grass is still easily visible through the snow. The sky was clear with a few clouds and the sun shone all day, plus there was a really nice sunset.

In the evening I watched Lost Missing Pieces with Mac and Ben, went on Animal, then watched an episode of Planet Earth.

Breakfast: Grapefruit marmalade toast sandwich; cup o' tea.
Lunch: Mature cheddar cheese sandwich; packet of prawn cocktail flavour crisps; clementine; slice of home-made jam victoria sponge cake; cup o' tea.
Dinner: Shepherd's pie; peas; carrots; tomato ketchup. Pudding was spotted dick with the sponge being lemon flavoured & custard. Coffee; Cadbury's chocolate buttons; Werther's original.

Monday, 5 January 2009

Trying to get virtual hosts setup on Ubuntu

Last night when I was trying to get to sleep I heard a loud fluttering noise, like a really big moth in the corner above my bed or a bird trying to get in the window. After a bit I switched the light on to see what it was, and there was a moth in the spanish caterpillar tank. Wierd how it sounded so loud and near my head (the tank was actually on top of the fishtank at the end of my bed.

Clare was just going to bed so I told her and she had a look at it and said that Ben had prayed that the Spanish caterpillar would be alright or hatch earlier this evening, so obviously his prayer worked! I guess my room must have been too warm since I don't think the moth should have hatched until Spring. I put the tank out on the landing for the night so it wouldn't fly around and keep me awake, though it still took me ages to get to sleep as normal.

This morning I took some photos of the moth, it was very good and sat on some paper and didn't fly away. Unfortunately it was just sat on the edge of some paper, and I couldn't get it to move further in on the paper, so most of the photos have the dge of the paper in them. After a bit the batteries in the flash wore out, so I put the moth in my fishtank along with a milk bottle lid with a bit of honey in it and a milk bottle lid with some water mixed with icing sugar in it.

After that I went on my comp and did some reading about setting up Ubuntu as a web server. I carried on doing this after lunch, and into the evening, but didn't have much luck, apache kept giving me an error saying no virtualHosts were defined for NameVirtualHost *:80, even though they were.

Later in the evening I watched some Lost extras with Mac. I bid on a Canon 500mm/4 IS lens + case, luckily I was outbid. It went for about £2,400, which is very cheap, although it was a new seller with 0 feedback selling it. They said they wanted payment by paypal (I checked the paypal buyer protection guarantee and although on the item listing it only says you're protected up to £150 when paying by paypal, apparently you're protected for the full item cost, but only protected up to £150 if you're not in the UK), so seemed legit. They were also in Northampton, so possibly I could have gone and collected it, though they were offering free postage if the auction went over £1600 anyway.

Why I'm glad I got outbid was is although very cheap, £2,400 is still a lot of money to me (I bid just over £2000, though I did think of bidding £2500 since they normally sell for around £3,500-£4,000 on ebay). Also I might not use it that much since I am busy doing lots of other stuff and still have lots of stuff I could be shooting with my current cameras and lenses.

Breakfast: Grapefruit marmalade toast sandwich; cup o' tea.
Lunch: Mature cheddar cheese sandwich; apple; slice of flapjack; cup o' tea.
Dinner: Pasta; sauce stuff; mixed veg; chicken nuggets. Pudding was 2x home-made biscuits. Coffee.

Sunday, 4 January 2009

Setting up Ubuntu on VMWare Server as Web dev env

This morning got up about 8.50am, so just had time for breakfast, then had to go to church.

After church I went on Animal for a bit, but Ben had a mardy because Mac was going on his PC so Ben wanted to go on the Wii, so I let Ben use the Wii. I had got a bit of a headache so I just lay on the sofa bed and floor for a few minutes until Jin the Pinner thyme.

After dinner I went on my comp and tried a few more times to get Ubuntu (installed on a Microsoft Virtual PC 2007 virtual machine) to work at a decent resolution, but still couldn't do it. I gave up and downloaded VMWare Server 2.

After installing VMWare Server 2, I started it up, it opened Firefox but had an error about an invalid security certificate. So I googled about this, and found a troubleshooting page on the VMWare website, that says to add an exception. But there wasn't an option to add exception, just an okay button on the alert box to tick.

So next I tried it in Opera. This time it just said it couldn't find the page. I looked at the VMWare troubleshooting page again, and changed the url it was trying to connect to to (local loopback address) instead of my PC's name. That got me into the VMWare Server.

The first problem I had was that it wanted a username and password to login, but it hadn't given me a choice of setting any when installing. I read some of the VMWare Server User's Guide about how to set up a machine, install an OS etc and found it was just my username and password for the host OS.

Next I tried setting up a virtual machine. I wanted to use an ISO file for the CD drive, but when I went to locate the ISO file it wouldn't let me browse my computer, and just had a datastore called 'standard'. What I had to do was exit the create a new VM procedure, then on the right hand side of the screen in the 'Commands' box, I needed to 'Add Datastore', then select the directory where the Ubuntu ISO was saved. After that I could create a new Virtual Machine and choose the ISO file from the new datastore I'd just created.

While VMWare Server 2.0 can handle 64 bit OSes (unlike Microsoft Virtual PC 2007 it seems), I decided to just install the 32 bit of Ubuntu as I figured it might have more compatible programs than the x64 version.

When my virtual machine was set up, I booted it up, but nothing happened (other than the machine showing as being switched on in the browser). I read the user guide a bit more, then tried it in IE7. It needed to install a plugin, but then it worked and loaded up the Virtual Machine okay. First thing I tried after it had loaded the live version of Ubuntu, was to change the resolution. There was a large choice of resolution options, I chose the same one that I currently have Vista (the host OS) set at (1280x960) and it worked fine. I guess I should have just installed VMWare Server yesterday and saved myself all the trouble trying to mess around getting it to display at a decent resolution in Microsoft Virtual PC 2007.

I had set the networking option on the Virtual Machine to bridged, which should make the machine appear on the network. When I was using VMWare before (Workstation/player I think) bridged networking didn't allow me to connect to the internet (from Win XP anyway), but I tried the internet and it worked. I installed Ubuntu, and then had to install the updates, which takes quite a while.

While Ubuntu was updating itself and I was installing some other programs I checked Luminous Landscape, Moose News Blog and Andy Rouse's blog.

The other programs I installed were:
  • Konqueror (sudo apt-get install konqueror)
  • Java 6 JDK (sudo apt-get install sun-java6-jdk)
  • Netbeans 6.5 IDE PHP (download from, then right click on file and on permissions tick execute, then okay and open the file.)
  • Apache2, PHP5, MySQL (sudo aptitude install apache2 php5 php5-gd mysql-server php5-mysql)

I was following the Netbeans guide to Installing and configuring PHP, Apache, and MySQL for PHP development in Ubuntu. As soon as I finished installing those programs, I checked in Ubuntu, and it came up with a message saying 'It works!'. So that was good. The next thing I needed to check was that it would be accessible from my host machine, as there's not much point going to the hassle of developing my site in Ubuntu on a virtual machine if I can't test how the site's working in Internet Explorer.

So I got the IP address of the virtual machine by ifconfig in the terminal. I typed the IP in from my host machine, and got the same 'It works!' message, so looking good. What I would like to do is get a web development environment setup in Ubuntu the same as my web server, then this should make developing my site easier, since it should work the same in my local environment as it does on the webserver.

After tea I played on Animal for a bit, and caught a string fish. I also made another good snowman, and caught 2 Football fishes in a row.

After that I installed VMWare tools to the Ubuntu guest OS, then when that was installed I added a drawer to my taskbar and put Konqueror and a fish inside it:

I checked ebay for Lowepro bags, but couldn't see any at a decent price that would hold the 450d + 100mm/2.8 macro or MP-E 65mm/2.8 macro + MT-24EX attached, ready to take out and shoot. I installed Vista SP1, but haven't checked if it's broken anything yet. Ben and Mac went to bed a while ago, so I think I'll go to bed now and see what Vista SP1's broken tomorrow.

Breakfast: Grapefruit marmalade toast sandwich; cup o' tea.
Dinner: Ham quiche; half a sausage; potatoes; peas; butter. Pudding was: flapjack; dried tropical fruit pieces. Coffee; Belgian milk chocolate.
Tea: Beef Pastrami with mustard sandwich; apple; slice of victoria sponge cake with jam; small bag of milk chocolate buttons; cup o' tea.