Photo of Jamie & Lion

The personal site of Jamie Knight, a slightly autistic web developer, speaker and mountain biker who is never seen far from his plush sidekick Lion. View the Archive

Topics: Autism Development

My MacBook is Disposable.

The value of my MacBook is low compared to the value of the data on it. Replacing my MacBook would cost about £1000, but i cannot replace my photos, media collection, work and other files at any cost. Finally, if i lost my business records, it could cost me everything.

This is a really important point when i think about how i manage my data. I need to manage my data in such a way that if my laptop was lost, stolen or damaged i would not loose my important files.

I have done this in the past using a backup service called Backblaze to backup my laptop. I have also kept a local time machine copy. This was okay, but it limited my storage space to 500gb. What i could fit on my MacBook.

I have outgrown that space now, so i had to think about what to do.

I could sell my MacBook and upgrade to a model with more space. The cost to get a new model with 1tb of storage was £1799. That’s a £1000 upgrade to get an extra 500gb of space. No way, too small for too much money.

External USB storage was an option, but i’m not keen. It ends up being a pain to backup and manage.

Finally, i could just go to third party services. Using iCloud or Dropbox etc as my main storage. I did consider this, long and hard but i just dont feel ready to trust all my data to other people. It’s worth too much to me.

My solution has been to sort out my own server. I have brought a little Mac Mini server and stuck a large 2tb drive in it. It meets my storage needs for now and i can add extra storage in the future if required. It’s cost less than 30% of the “upgrade” cost on a new MacBook, plus its doing far more than just being storage.

As it has a fast processor and lots of storage space, i have been using it to create optimised versions of my media for my other devices. This means i can use the space i have more effectively.

I am migrating and consolidating all my data there, then setting it up to have a healthy offsite backup and a local backup too.

Turning back to my MacBook. Once this is complete, i will format my laptop entirely and treat it like an iOS device. From a data perspective it will be disposable.

Published: 22 January 2016 | Categories: , Permalink

Using imgix: easy responsive images.

A few months ago I built a little website to house my autism related content. It was built while I was off work recovering from my operation and the focus was on the content not the website.

To build the site i used Twitter bootstrap for the front end and the wonderful Perch CMS for the backend.

The site has done well. It’s certainly done well enough to warrant a proper custom design in the future.

However for now I am just looking to make little improvements as and when I have the time.

The main flaw with the site is that it is slow. I never setup anything to handle responsive images so the site was serving ~1mb of images on the index pages. This was only getting worse as every new content item added an image to the page.

It was starting to be a problem, so this seemed like a great place to start.

Why use imgix

Imgix is a hosted image processing service and CDN. You show it where your ‘master images’ are stored and it produces variations of those images and hosts them for you.

They charge for master images and bandwidth. There’s no costs to have thousands of variations ready for use. The minimum charge is $10 a month.

This sounded ideal for a responsive image solution to me. I heard them advertised on ATP.fm and saw them on Daring Fireball and thought it would be worth a go.

I was looking at their site too see how I would go about hacking up a responsive image solution and then saw they had already done it for me. Awesome

I had it up and running in 30 minutes.

Here’s why I like it:

Another reason I like it is that all the image transforms are done on Mac Pros. As a Mac geek, that makes me smile.

Perch only resizes files at upload. This means that if I change the sizes I need for my website I have to reupload all the images. Imgix is much simpler.

Code.

Installation was easy. I downloaded the latest library and put it on my server. Then I added it to the global head.

I then swapped around my img tags to set the data-src to be the path.

This didn’t work quite as I expected. Perch always returns the root path, yet my source folder is the end of the path. So I added a couple lines of JS to fix the paths before the library calls them. A bit ugly. But it works.

In all I changed about 15 lines of code within the side.

Outcome.

The largest page I had was 1.2mb on all device.. It’s now ~340kb on my phone and about ~600kb on my retina MacBook Pro.

On my home wifi, the page load time is around 500ms and on the 3G network in my flat it’s about 800ms. Before imgix the pages took upwards of 2 seconds to load on wifi and anything up to 5 on 3G.

The major downside is that some images no longer load for users without JavaScript. This is not ideal. So I will probably add a link to the original image into each page.

The images I have optimised are all decoration images with empty alt attribute so I am comfortable with them being added by progressive enhancement.

Final words.

My next planned improvement is a new homepage. Which will be quite image heavy so this work is a good foundation.

During the my development I did spot an interesting bug in the library. I found a work around, and also emailed the support. They got back to me quickly with a helpful response and were very polite. Always a good sign.

I have other projects in mind which are very image based. So having something flexible is a great start. There plenty of headroom for growth within my account. I’m able to think a little more creatively knowing that images of ‘the right size’ will be easy to generate as required.

Imgix is not for everyone. I could achieve something ‘close enough’ with some time. But having a nice well maintained solution is a better use of my time.

Published: 21 January 2016 | Categories: Permalink

A new Mac Mini

It’s been a little over 16 months since i sold my very high spec 2012 Mac Mini. I sold it because it didn’t do the job i needed it to do very well considering the cost. At half the cost, i would have been over the moon, but as it was the money was better spent on a MacBook.

A couple of days ago, a rather amazing series of events led to me having a new Mac Mini, direct cost to me, zero. Someone was extremely kind and gifted me the Mac Mini.

Whenever i buy new hardware i give it a bit of a hard run before i trust it. So ive spent lots of time with it over the last few days and have got it setup. Its such an impressive little machine.

Hardware.

The Mac mini is a great bit of kit. They pack am impresive amount of CPU grunt into a small space. The 2014 models are disapointing as they cannot be upgraded and the price for a strong configuration is huge. However the older models are really flexable.

The Mac mini i have is a slightly stripped mid spec server model from 2011. It’s got the 2ghz Quad Core i7 CPU and connectors for two hard drives. It didn’t come with the original drives, instead it has one slot free and an older 250gb drive in the other slot. I suspect they took the drives out for security.

Performance wise, it is the 2nd fasted computer i have ever owned. It’s about mid way between my MacBook and my old Mac Mini with a geekbeench score of about 9000. It’s faster than any 2014 Mac Mini at a fraction of the cost. In use, it feel much slower as it does not have an SSD, but once it gets going it goes really well.

The only change I have made is to spend some money to buy a larger hard drive. All the things i want to do with it require lots of storage. A 2TB drive (the largest i have every had in a computer!) cost me £70.

It has 4gb of RAM installed, which is plenty for the uses i have in mind at the moment. If needed, it might get a RAM upgrade in the future as an 8gb kit is only £25-30. Im going to hold off till i see a need.

What im using it for?

The Mac Mini is both powerful and always on. That lends itself to a number of useful functions. Here are some of the projects and plans i have in mind:

1. Media Server – my main media library (including all my iTunes purchases!) will live on the Mac Mini. I haven’t had my library in one place for a long time due to space limits on my Mac. I have no backups of some of my iTunes purchases (!) so will redownload them and store them safetly on the Mini. The Mini is also plugged into the TV, so i can use it for watching back my high quality bluray files.
2. iOS Sync – with the extra storage space, i can afford to keep mutiple different file sizes around. So i plan to use the Mac Mini to create and host a iOS optimised copy of all my media. This means i can make better use of the storage space on my iPhone etc. These files wil also be the ones i load onto my MacBook.
3. Photos.app – i plan to also host an instance of photos.app where it will download and store the originals for all of my Photos. I also plan to merge all my libraries into a single photo library going back to 2003.
4. Time Machine – it will be the time machine target for my MacBook. Ensurng my work files are always being backed up!
5. Hue Server – i also plan to use it to host my various Phillips Hue smart light control scripts. For example, using an amazon dash button by the front door as a master lightswitch and using a dash button in my bed as an emergency nightlight. (see: hub.com/JamieKnight/dash-hue and http://github.com/JamieKnight/xbox-node-hue)
6. Satelite TV Recording – i have a satelite tuner and plan to set it up on the Mac Mini to recored major TV Shows like Dr Who or Agents of S.H.I.E.L.D.
7. iOS App Development – in the future, when i have been able to add some more RAM and an SSD, i’d also like to use the Mac Mini for iOS development. The CPU grunt will make building apps way quicker! In the mean time, i might use it as a build server.

Final Words.

I am really excited to see how this Mac Mini works out. It’s been a while since i had a new computer to play with. I am now looking forward to the new hard drive arriving so i can enjoy a bit of hardware assembly as well.

Published: 17 January 2016 | Categories: , Permalink

Older Articles