Category Archives: blog

Your PHP installation appears to be missing the MySQL extension which is required by WordPress.

This afternoon’s glorious freelance waste of time was debugging a server’s PHP installation which got broken with a experimental installation of iRedMail — do NOT install iRedMail on a production machine, it’s meant for fresh installs only.

iRedMail’s removal script is great… if you want to remove apache, mysql, php, etc. etc. etc. Don’t do it.

That’s my scenario, you may have gotten this error in a different manner. Either way the solution is similar.

I rebooted my Ubuntu 12.04 Linode VPS (referral link) and found my Rails/Passenger sites came up first time, but my WordPress/mysql reliant php sites failed giving this error, or a variant thereof:

Your PHP installation appears to be missing the MySQL extension which is required by WordPress.

You’ve probably already tried to reinstall your “php5” “php5-mysql” packages already, but found it said they’re correctly installed.

Enter this line to find all packages that are in a “purged” state.

dpkg --get-selections | grep purge

Purged packages are uninstalled but not removed. Which is confusing, as you can’t install over them.

 apache2 purge
 libapache2-mod-php5 purge
 libaprutil1 purge
 php5-cli purge
 php5-common purge
 php5-imap purge

So you want to remove + reinstall the pertinent packages:

sudo apt-get remove php5-common

and then do the apt-get install command as per your original setup. So for me:

sudo apt-get install libapache2-mod-php5 php-pear php5 php5-cgi php5-cli php5-common php5-curl php5-gd php5-json php5-ldap php5-mcrypt php5-mysql php5-pgsql php5-readline

Then

sudo apachectl restart

Your mileage may vary.

CS Lewis, according to Alister McGrath (audio)

Lots of people quote CS Lewis, perhaps not knowing where he actually comes from or what he actually means. A Northern Irish boy, raised in East Belfast, he struggled through early faith journey eventually becoming an atheist before heading to Oxford. That’s not where the story ended. I saw the below quote tweeted in a positive life affirming sense (I imagine,) when in reality Lewis was overtly and unapologetically Christian in his writings after conversion.

“There are far better things ahead
than any we leave behind”

Alister McGrath (Oxford educated scientist, resident theologian, and author of far too many books) spoke today at a pair of events hosted by the QUB Chaplaincies at The Hub on Elmwood Avenue. Below are two recordings provided by The Hub team of the talks.

The former might be described as building the framework behind why we believe, touching on a little of how Lewis was a “travelling companion” to McGrath in his journey into faith; the latter is a broad overview of Lewis, his influences (including how the Northern Irish landscape influenced Narnia) and legacy of thought.

“Why I am a Christian, by a lapsed atheist…”

“CS Lewis’s Vision of Christianity and its relevance today”


For what it’s worth, McGrath’s biography
is available on Amazon.
C. S. Lewis: A Life: Eccentric
Genius, Reluctant Prophet

(affiliate link, current earnings in four years £0.00)

Adding links to PDFs using PHP ezPDF

I’ve been making some changes to a site which already uses the ezPDF class for creating PDFs from PHP. How to insert a link?

Helper methods seem to exist but they are not documented in the code and are a bit confusing to read. Instead, you can just embed a hyperlink into any (I think) text entry and it’ll be converted into a clickable link. Use the syntax below.

A very simple example of a complete PDF generation is shown here:

Note: you can get the complete “R&OS” ezPDF class here

Creating a download click tracker in Rails 4 – Also, Run-ins with Turbolinks

A Friday lunchtime double feature for you.

The task: create a click tracker, to keep a rough (accuracy isn’t of core importance, but why skimp?) measure of the number of time s a link has been clicked by site users.

Here’s some sample code I used for the new version of GiantsLive which contains a digital downloads feature.

The task is a fairly simple one, it doesn’t even require a controller, but here we use a migration to create a stats table, and a model to provide a simple API.

The ‘object_key’ I’ve used refers to an AmazonS3 object’s unique name (within a bucket), this is because each ‘fixture’ has several video files available to download.

Migration

Model

Usage

You could create a helper method to present the detail neatly, but that’s up to you. Hope that code is helpful, if you have any suggestions on how to clean it up any further do use the comments below.

Part 2: Turbolinks causing 403 problems

Or maybe just one. Rails 4.0 introduces a new feature called https://github.com/rails/turbolinks/ which is intended to reduce the amount of server requests caused by a page change, in very simple terms it means that instead of looking for CSS, JS and font files every time you click a link, it just asks for the HTML + images. I was getting a strange quirk in my tracking code whereby every click was creating two increment actions. I finally figured out the problem by looking my logs. An excerpt here:

You’ll notice the “Complete 403 Forbidden” first, then “Completed 302 Found” second. Turbolinks appears to have been requesting the file, failing and then resorting to a page reload. This caused the tracker to be triggered twice, and the statistics to be incorrect.

There is an open ticket on github regarding this issue. [h/t @StuartGibson]

A fix

As per the Turbolinks documentation, adding the html data attribute data-no-turbolink on a parent tag will disable any turbolink action from occuring. So, in my case:

<ul data-no-turbolink="">...

Problem solved.

New Music From Gungor: “Wayward & Torn”

The new album ‘I am Mountain’ is on its way, American Songwriter have a preview of a track. Sounding like a background hum from the set of Justified, it has a moody southern blues feel. While the track is supposedly set apart from the rest of the album, it paves a welcome path.

Listen to the track now

If you haven’t heard of [one of my favourite bands] Gungor… A little context, in the form of a video:

Updated
——-
iTunes pre-order & preview available here.

Sorry, I didn’t quite catch that? — Sally the sign language interpreter

A while ago I launched a new website for my friend Sally, who’s both a PhD candidate at Queen’s and a successful professional sign language interpreter for hire.

Check out the website at
http://signlanguageni.com

The simple site has two aspects: professional and academic. It’s somewhat adaptive (but perhaps not quite ‘responsive’?), has been developed to accommodate video content on each page if a video BSL interpretation is available and in future will allow Sally to receive feedback on various research projects.

Sally is a BSL/English interpreter and a first year PhD translation student. Through her research, she is exploring the demographics of the deaf signing population in Northern Ireland and the resources and opportunities available to this linguistic minority.

She adopts a balanced approach to practice and research, and is currently organising an academic conference on Sign Language and the Politics of Recognition in addition to her studies and interpreting work.

Freelance professional sign language interpretation services in Belfast, across Ireland and the UK.

Converting HD Video for use in an SD DVD project

Why a DVD, why can’t everyone just go digital…?

Unfortunate as it is, real world clients’ requirements tend to rely on 1990s technology.

I’ve been putting together DVDs for the New Wine conference, which is generally consists of:

  • complete the edit…
  • export full quality
  • export to MPEG-2 in Compressor
  • drag into DVD Studio
  • burn the disk

This doesn’t work very well for projects which originate in high definition, partly because of your finely rendered type and partly because of the poor transcoding magic performed going directly from 1080 to 576 for DVD.

WHY ME?

Like me, plenty of people out there have learnt everything they know about videography from working on pet projects and tinkering with the tools they have to hand, and stuff like this just isn’t really “in the manual.”

I think I might’ve finally worked out a workflow that should work, should you need wish to put your beautiful HD Video onto a standard definition DVD.

Starting point:

Most of my video projects are in Apple ProRes — captured live or post-event using my Ninja device. The specific variety of ProRes doesn’t matter, frame rates (60i or 50i) and colour depth aren’t the problem here. We’re in 1080 and it looks pretty great. On the computer. And in whatever web format we tend to use.

Output from the edit:

Using your editing software typically you will typically output a full resolution copy of the edit, or a reference movie — just the audio and rendered parts, with pointers to all your other source video files, hidden in a file much smaller than your full copy.

What you would do for the web:

At this point, I usually drag the reference movie into MPEG Streamclip. Sometimes it misbehaves and doesn’t understand the reference pointers; so it might be best just to output a full QuickTime file for transcoding.

Vimeo (the discerning videographers publishing platform of choice?) has a helpful guide on good settings for upload, but basically I do this (my saved “Vimeo 720” preset):

  • Choose MPEG-4 export, using H.264
  • Bump the quality to 100% (no point compromising here)
  • Limit the data rate to 3500 or 5000Kbps depending on how good you want it to look (I tend to choose 5000 for final exports, 3500 for key drafts, 1000 for quick previews)
  • Do whatever you want with sound, AAC / Stereo / 44.1 / 256kbps
  • I tend to scale to 1280 x 720 for output
  • Choose the right frame right
  • Select “Interlaced Scaling” and “Deinterlace Video”
  • Everything else should be right

And a visual representation of the above, if it helps…

vimeo-720-hq-settingsThis creates a pretty good image and the interlaced/deinterlace couplet fixes most “why did my text go fuzzy” issues.

When creating DVDs:

MPEG Streamclip is not the tool for this job. iDVD is Disney. Toast does burn video DVDs but it [ignorant assumption] won’t give you the ability to make the type of interface that you actually want.

So you need to use Compressor + DVD Studio Pro. Nightmare. But they can do pretty much everything you want them to.

Bad assumption:

You can just use the source file, make it convert using one of the provided DVD formats (in Compressor) or just drop it into DVDSP directly and it will create a useable disk. It will, but it won’t look good. All your rendered images and text will be of very poor quality and while much less noticeable the video itself will not be as good.

Larry to the rescue:

Often you’ll find the answer to a video question is answered on Larry Jordan and this is no exception, though it took me a few days of casual searching to find a link to the article entitled Solving Video Compression Problems When Down-Sizing HD to SD — you may notice some similarity in the title of this article…

The basic solution here is this:

  • Pre-compression” — resize the HD movie to an SD frame size without compressing (transcode to ProRes HQ from 1080 to 1024×576 if you’re working in the PAL world) — full details of which settings to use are in the article
  • Then use that exported file as your DVD track source.

Obviously this will take a bit longer to output, but it will provide far cleaner images from which to produce your DVD. In practice it takes significantly longer: on a 2009 iMac, transcoding five 35 minute files took just over 14 hours. Fine if you’ve nothing else to do!

P.S. If you spot any flaws, or have any suggestions or additions to this article please leave a comment below and I’ll consider updating it.

Mastered DVDs

NI Design Alliance: The Anatomy of Design #002

Just published, here’s part two of the Design Alliance’s series “The Anatomy of Design.”

In this, Matt’s first ever public talk, he discusses the processes involved in creating, managing and implementing design systems in complex products and large organisations; covering mistakes made and how good design makes everything look easy.

Filmed (with young Pete) and edited by yours truly, you can read more about it here.

A Vidiot’s Summer Travels

There’s a busy summer ahead!

(c) 2012 Chris Nelson/New Wine Ireland

First off: sleeping in field Thursday to Tuesday! The Summer Madness festival returns to Glenarm castle, and I’ll be heading up the volunteer technical team and running the on-screen visuals on the main stage. A circus tent. With the pros from Box42 (recurring theme?) we’ll be providing a bit of camera and vision mixer training to use on live screens; recording about 30 seminars; and finally mastering a take-home DVD on the final night, hoping to have a few hundred copies ready to sell to the campers and group leaders on their way home. All of that and hoping to get a few hours sleep each night.

Next step: I’ll be spending a week in [London*]Derry* (* delete where applicable) filming a practical youth service week on the streets of the city. The ‘On The Move’ project is a reimagination of the original ‘StreetReach’ concept and this year is being supported by the festival itself. Looking forward to using some new lighting gear and having loads of time to get good footage and create a cool promo for next year’s event.

Then: off to Sligo town for another big christian summer festival. This time we’ll be setting up projectors + screens, plasma and LCD TVs, cameras and mixers, sound gear and audio recording devices; both in the main meeting hall and around the event’s campus. Looking forward again to the craic and ‘holiday’ and getting to visit places that feel a lifetime away from Belfast!

The rest of July should be filled with video and audio editing. I’ve some available time in August (so if you have any need for a web developer or video bod get in touch!), but whatever’s spare will hopefully be used putting together a little video + community voting mashup website I’ve been plotting for some time.

Sage 50 Accounting Import CSVs

TL;DR Download Excel files provided for Sage 50 Accounting Import *

Trying to say nice things: Sage clearly love money. Any time I’ve had reason to get in touch with their cousins at Sagepay, they have always proved to be very courteous and helpful. Not so with Sage 50 Accounting.

I’m building an import tool to manage the flow between a client’s website and their office software. I tried calling Sage for some data documentation or advice. They took details of me and my client, but said no: you need to pay for the annual support and maintenance package for us to talk to you. Talk!

The annual package which costs over £1000.

You’ll want to provide a file in CSV (comma separated value) or Excel format for import but what, I hear you ask, is the specification? Click File > Import on the software package’s menu and you’ll see a recommendation to backup but no samples. However there’s a little green question mark button to the right hand side – if you click it, it will suggest sample files are available in the Program Files folder.

You can hunt for those or you can download the nine Excel files here. *

The hard part comes next – working out what each file is actually for and doing the import. Have fun.

* This zip file and the files it contains are provided as is, without any instruction or warranty, nor claim of ownership or copyright. They are merely provided to help fellow developers out, in the belief that developers are a software company’s best friend — they can sell your product for you to new clients, suggest improvements and give informed feedback.