Wednesday, 17 December 2014

Quoting something a spider makes (Websiting)

So, what have I been doing lately no-one is wondering. Well, no-one, I'll tell you:

On Sunday I wrote an article for my photo tips website.

On Monday I did some work on my pano website and made some Eccles Cakes.

On Tuesday I was mainly just working on my pano website.

Today (Wednesday) I was again working on my pano website. Quite a bit of time was spent just waiting for the various android SDK packages to download so I could test my site in the android emulator. I also made some Choux buns.

Friday, 12 December 2014

Sculping

Yesterday I was still working on the article for my photo tips website, recording some videos for it and inserting all the images, then proof-redaing it when it was finished.

I had some trouble recording the videos as at first my microphone seemed not to be working. Then I realised that actually no sound at all was working. I had to reinstall the drivers for my sound card. I'm not sure why they didn't work the first time. Possibly they did work then windows update installed some not working ones. Any way, at least it is working now.

This morning I prepared my pog website update and watched a couple of photography business related videos.

Most of the afternoon was spent checking my emails. I also updated the resizing embedded youtube videos javascript I worked on the other day. The issue was that I was firing it on the window's resize event, with no throttling. Now I've throttled it, so it will only run once every 250ms while window is resized.

In the evening I listed to Wilhelm Challenger and did some sculpey with Billy. (Well Billy actually did painting). I was working on a frog that I'll do for HAH. Making the colours took quite a long time. Then I needed to make the model. And after that I had to make another one and take photos of the process for the instruction leaflet.

Wednesday, 10 December 2014

Not Blogging

I think I ought to start blogging more often again. I often wonder where my time has disappeared to, and if I record what I've been doing in my blog, then at least I'll know.

Monday this week I was fixing some website stuff.

Yesterday (Tuesday) in the morning I went down town to post an ebay item (my old broken sandisk ssd) and try to get a christmas present for Mauser. In the afternoon and evening I prepared Mauser's present package, researched the postage costs, purchased and filled out all the related postage stuff, and started work on an article for my photo tips website.

The vast majority of today I was working on the article I started yesterday. In the morning I went out to try and get some photos to work on for it. I had to install Photoshop Elements trial, which took ages to download and then quite a long time to install.

In the afternoon I also made some Japanese Scotch Eggs. But I cooked the egg a bit too much so the yolk wasn't gooey, and I didn't actually like the flavour of the meat much either.

In the evening I watched an episode of Power Rangers with Billy and played a few online Mario Kart races. Then the rest of the evening was spent working on my article. I'll have to try and finish it off tomorrow.

Monday, 8 December 2014

Fixing setAttribute(...) is undefined error when setAttribute actually is defined

I was fixing up some website issues today. One of the problems was with a page that contained a youtube video. Because Youtube uses static sizing on their embed codes, the video was breaking out of the page on small screen sizes. I found a solution to this issue here: Fluid Width Video.

The site this was for uses plain js rather than jQuery, so I re-wrote the solution given in the CSS Tricks article. However, when I ran it, I recieved the following error:

TypeError: vid.setAttribute(...) is undefined

Yet I could go into the console and run vid.setAttribute (with the script paused where the error occured) with no problem. After much head scratching I finally decided to try the page in Chrome, rather than FireFox, which is what I was using. And I now saw what the real problem was - Chrome did not report that .setAttribute was undefined, but rather that .removeAttribute was not defined, which was the line below. Firefox (Firebug) was confusingly throwing the error a line early.

I was trying to use chaining, but setAttribute does not return the element you are calling it from. So you can't use chaining with it. The lesson - if the debug info in one browser doesn't make sense, try another.

Saturday, 22 November 2014

Writing and moving words

The past week I've mainly been putting the church magazine together and working on a couple of articles for my photo tips website. This morning I made some Gingerbread Latte syrup. I had some in a Coffee with plenty of milk, but it didn't seem very tasty. Maybe you need 1½ teaspoons to taste it better.

Monday, 3 November 2014

Giving up on Vagrant

Well, I probably haven't got everything working with my Vagrant box yet, but I can at least access a local copy of my website through it.

The first issue I had today was that Nginx wasn't starting with the machine, and my @reboot cron job wasn't being run either. I found the reason and a solution here: If Nginx doesn’t restart on Vagrant up. The problem is because vagrant (virtualBox) only mounts the shared folders after init and cron have run. So, in my case, the nginx conf files were in my shared folder, and the script I wanted to run @reboot was too. The solution is to add an init conf file to /etc/init that will start nginx / run the script when the vagrant shared folders are mounted.

Another issue I had was that although I had imported my mysql database, the users / privileges didn't seem to have carried over. I found the solution to this here: How can I export the privileges from MySQL and then import to a new server?. Strangely there were quite a few privileges for tables that no longer existed, so I had to delete those to get the import to import everything successfully.

So far, there are three points that seriously hamper the usability of Vagrant for me. Actually, these aren't really related to Vagrant, but problems using shared folders with VirtualBox when running a linux guest OS on a Windows host OS:

  1. Permissions can't be set properly. You can set permissions for a whole folder through the mount_options when mounting a shared folder, but this applies to the whole folder contents, and is a bit of a kludge.
  2. You can't create symbolic links in the shared folder. If you do it from Windows, then the VM can't read the link.
  3. Shared folders aren't mounted early enough, causing issues with init scripts and @reboot cron jobs.

Despite these problems, I intend to persevere, at least for the moment. The issue with using a standard VM without shared folders is that even if you only change 1 byte of code in a single file, then you have the whole VM to backup. I guess you could always just backup the files from the VM, but that means having to start up the VM and use FTP whenever you want to backup.

Aggh! I just found another issue with the shared folders - it seems that the VM has the same restrictions as windows when working with long filepaths in the shared folders! There is a possible solution given here: VirtualBox bug tracker: long paths (>260chars) cannot be created using a host:win + guest:linux setup.

However, I couldn't get that to work in combination with Vagrant. I tried specifying the path in the VagrantFile, but that gave an error about //?/E not being valid when trying to vagrant up. (I was using an absolute path to a folder on my E: drive). I tried running the command, which added the folder, but VirtualBox would not auto mount it. And you couldn't set the Auto Mount option for it using the VirtualBox GUI (the OK button was greyed out).

I also tried setting that up, then using a standard path in my VagrantFile, but the path in the VagrantFile overwrote the path set up using VBoxManage.exe. Thus the \\?\ at the start of the path was lost.

So it seems to me that with all these issues, Vagrant using VirtualBox with Shared folders on a windows host OS is just not usable at the moment. I'm going to go back to my VMWare Ubuntu VM for now. It took me over a week to try and set up this VM, only to have to abandon it. But I did learn some things along the way. Most of them I'll probably forget, but hopefully I can take a look at replacing my current shared hosting account with a VPS at some point.

Sunday, 2 November 2014

Spyro Gyra got played on "HFM through the night" (no DJ)

Today I was still trying to get my Vagrant box set up. I'm getting closer, but still not quite there yet. I think if I've learned one thing from this process, it's that I really ought to be using VPS hosting so I don't have to compile everything from source. It would make installing, and just as importantly, keeping everything up to date, so much easier.

I also had another issue with Vagrant / VirtualBox, which is that as well as not being able to create symlinks in a shared folder, it can't read them either. Quite annoying, as I was thinking that creating the symlinks from windows might have been a solution in some instances.

I was quite happy with myself today as I managed to start writing an article in the afternoon, and had it ready to publish by 9pm. As usual finding and inserting the pics took a lot longer than the actual writing process, but I was able to find relevant pics a lot faster than I usually can.