Archive for the ‘Tech’ Category

Mailgun

Wednesday, January 4th, 2017 | Tech

Mailgun is an email sending service made by Rackspace. Specifically, it is designed to be used as an API for sending automated emails.

This is different from a mailing list manager such as MailChimp or Infusionsoft. These allow you to build up a mailing list and send out newsletters. Mailgun is designed to be used by web applications looking to send emails behind the scenes. For example, I use it in my IT contracting course to send out welcome emails when someone registers.

Setup is relatively straightforward. You register, enter your domain name, and then Mailgun gives you a whole host of DNS entries you need to add to your domain. You are then given an API key that your scripts can use to send messages out from. They have a PHP library you can bring in via Composer (and libraries for all the other languages too), so it was just a case of wrapping that in my own code.

Best of all, they have a free tier: you do not pay anything for your first 10,000 emails.

Of course, the real test of success is delivery rates. Time will tell whether that is successful or not. However, my old solution was setting up a gMail account and sending email through their SMTP servers is unreliable (Google occasionally thought I was being hacked and locked my scripts out) and meant the email was coming from an @gmail.com account, which is not very professional. So, this promises to be a big improvement even if delivery rates are only just as good.

Problems validating iTunes Podcast

Friday, December 23rd, 2016 | Tech

traditional-microphone

Recently I launched the Worfolk Anxiety Podcast and as part of that, submitted it to the Apple iTunes Store for listing. The problem was that every time I tried I would get an error:

Unable to read your feed

After searching the web I found a lot of reports that Apple only had limited support for SSL: there were only eight trusted providers and you could not use anyone else. For example, any certificates issued by Let’s Encrypt would not work.

However, this did not make any sense because I had a GeoTrust RapidSSL certificate, and GeoTrust was supported.

I emailed Apple support and we began a backwards and forwards discussion about it. They suggested that although my feed validated on most validators, there were a few that it did not and I should address these issues. The issue was that you cannot use SSL in the strict RSS standard because URLs must begin with http and not https.

I fixed this, and still nothing.

I even tried purchasing an SSL certificate from Comodo in case Apple had a problem with the RapidSSL intermediately between my certificate and the GeoTrust root certificate. That did not help either, so I now have a duplicate certificate that is of absolutely no use.

Finally, Apple sent me the command they were running.

curl --head https://www.worfolkanxiety.com/podcast/feed

Suddenly it all made sense! They were making a HEAD request, rather than a GET request. I am using the Rauma PHP framework (that I also wrote) and you have to specify which verbs you would like to support. That end-point is tagged as a GET end-point, so did not respond to a HEAD request.

Once I added support for HEAD requests, it all started working. I even changed the MP3 files and artwork back to HTTPS and it still worked.

I have since rolled out an update to the Rauma framework so that it automatically adds support for HEAD requests when you add a GET request. However, there are many other frameworks where you specify the verbs you want to support, so if you run into a similar issue, check to see if that is the cause of your problem.

Grammarly weekly report

Monday, December 5th, 2016 | Tech

grammarly

I have started using the free version of Grammarly to double-check my spelling and grammar. I have the standard spell checker on of course, but Grammary catches some mistakes that the spell checker does not. Here is my invite link if you want to give it ago.

More interesting, is that Grammarly send you a weekly report with some stats in it. I have just received the first one, and it contains some interesting stuff.

  • I wrote 2082 words, putting me in the 87th percentile
  • I made 16 mistakes, putting me in the 91st percentile
  • I used 464 unique words, putting me in the 85th percentile

Whether Grammarly has found some statistical trick to massage my ego, or just has a dubious user base I am not sure. It seems like the kind of tool writers would use, which suggests the former. Still, statistically I seem to be doing okay.

It is also worth noting that I am only using the browser plug-in, so it does not monitor the writing I am doing in desktop applications.

Want to become an IT contractor?

Friday, November 18th, 2016 | News, Tech

itmc-box If you work in IT, and have considered making the leap from permanent employee to contractor, you are not alone. Many people want to make the transition because they want to…

  • Earn more money
  • Be able to take more time off
  • Be their own boss

The problem is that having a permanent job is easy: you just turn up five days a week and people give you money. Finding the motivation to research contracting is a tough ask, especially when there are so many minefields and potential trip hazards to avoid.

it’s a shame, because being a contractor is awesome. I get this immense feeling of freedom knowing that the only person I am truly working for: is me. I like running my little contracting company, I like being able to provide for Elina and Venla, and I like the fact that when I get bored of a contract I just terminate it and move on.

So, to help anyone else who feels the same way but needs some help making the switch, I am launching the IT Contracting Master Class. A course that takes you step-by-step through setting yourself up as a contractor and continues all the way through to what to do once you find your first contract and start working for yourself.

I have been there and done it all already, so I can save you the heavy lifting. The instructions are specific: I tell you exactly what to do and where to go. None of this “well, you could do A, B, or C”. I will give you the options, but then tell you exactly which one is the right answer and why.

Sound good?

You are probably wondering how much I am charging for such a course. That is the best bit: it is free! You can sign up for zero cost and get access to the first batch of lessons, and to my eBook First Steps in IT Contracting. If you like what you see, you can upgrade to the full course at a later date.

itmc-get-started

Register now for immediate access or visit the website to learn more.

Introducing Bedtime

Saturday, October 15th, 2016 | Tech

introducing-bedtime

Cook: “Here at Apple, we’re proud to announce our latest innovation. It’s called Bedtime, and it can improve your sleep quality by 160%.”
Ive: “Tim, I think bed time is already a thing.”
Cook: “NO, we invented it!”

How we built Rena Men

Monday, October 3rd, 2016 | Programming, Tech

rena-men-september

Recently I launched a new website, Rena Men. It is deployed onto the Heroku platform and does quite a bit of cool stuff, so I thought I would document what I have done here.

Code

It is implemented in PHP, using the Rauma framework. Rauma is a project I developed for Learn Finnish and subsequently open-sourced.

Rena Men is built in several modules. There is a website, a content management system (CMS) and an image server. Because they use common functionality like the entity classes, there is also a shared library which is brought in as a Composer dependency.

The website itself is fairly straight forward. Beyond the PHP, there is only the CSS, pre-processed with SASS, and a tiny amount of JavaScript loaded in with require. The CMS is a bit more complicated, using Babel to transpile the ES6 JavaScript, and styled up with Bootstrap.

Deployment

Each module is deployed onto the Heroku platform. This makes it really easy to do as I can roll out an update just using git push. The code itself is stored in a series of private repos on BitBucket, and the Heroku build process fetches them from there.

In the case of the CMS, it also uses the Node build pack to run a Bower install. Third-party additions such as Bootstrap are pulled in on-the-fly just like we do with Composer dependencies. Heroku does not have SSH key integration for Bitbucket (it does for Github) so I’m using a ready-only account with Basic HTTP auth access.

The database is provided by one of the Heroku app add-ons. The storage is provided by Amazon S3. Heroku is built in AWS, so that fits nicely. We store originals in the file system and then crop them on-demand using the image server.

Delivery

Because cropping images is expensive, the image server originally had a local file cache where it would store each crop. However, as Heroku has an ephemeral file system, you cannot write to it, so I had to turn that off in production.

Instead, we’re using the AWS CloudFront CDN. This was super easy to implement. I just created the settings in AWS, pointed CDN subdomain at AWS and it started working. Like other web proxies, it caches your content based on the headers you send it.

iA Writer review

Tuesday, September 27th, 2016 | Reviews, Tech

ia-writer

Recently I trialled using iA Writer as my word processor of choice for writing. Previously I would use Google Docs, which has been very good. It has all the features you would expect from a word processor and automatically generates a navigation structure on the left hand side so you can quickly jump around the document.

iA Writer is very different in that it is a pure text editor. It uses the Markdown syntax, so instead of a WYSIWYG editor, you get text on one side, that you have to use markup in, and a preview pane on the other. The big advantage for me, over Google Docs, is that it can handle large files. Google Docs works great, but as you start getting up to 50,000+ plus it starts to really struggle.

iA Writer handles these large files fine, but the rest is a mixed bag.

It looks really nice

The idea behind iA Writer is to allow you to concentrate on the words. This is does very nicely. You get a simple interface that you can take full screen to remove all distractions, and the layout and style are well thought out. You can enable typewriter mode so the current line is always centred on the screen, though this feels a bit like a gimmick so far.

The image support is not great/strong>

You can embed images in your articles, but you have to give them a URL. Markdown requires this, but I would have expected URI support. So I could just drop an image into the directory and say image 5 is “example.jpg”. Not so. The only way to do it is to upload it to the web, or use a full file path, such as file:///Users/me/Documents/Book/images/example.jpg.

Preview panel scrolls independently

This is one of the most annoying features: the text panel and the preview panel are not properly synced. As I scroll down one, the other one scrolls, but at a slightly different speed. Therefore the text and preview panel are always out of sync. You cannot see what you are working on, and if you scroll to that point in the preview panel, you lose your place where you are writing.

There is no navigation

Google Docs automatically generates a navigation bar on the left, based on all of your chapter titles and sub-headings. iA Writer does not do this, so the only way to navigate around a large document is to remember all of your headings and use the text search to locate them again.

This comes up a lot because you have to put references in the bottom of the document, so I am constantly scrolling down to the bottom, adding a reference, then trying to find where I was writing so that I can insert the appropriate footnote marker and continue working.

Summary

iA Writer is a nice piece of software. However, it feels like nobody has put a really large document in there and thought “is this usable?” Given it is specifically targeted at writers, I am not sure how they imagined it would be used, or maybe did not think through the use-cases beyond somebody writing fiction linearly.

The City Talking: Tech in Leeds

Saturday, August 6th, 2016 | Tech, Video

Interesting documentary about technology in Leeds. I was already familiar with the history of our tech scene, but it is always nice for a refresher. Many people may be surprised with just how involved we were with the early internet.

Google Chrome and the missing hard disk space

Tuesday, June 14th, 2016 | Tech

I was recently clearing space on my laptop hard drive when I noticed Google Chrome was taking 20gb of space. You read that correctly: 20gb.

google-chrome-size

After some searching, people suggested it could be old versions of Chrome. You can see into the package by right-clicking on it and clicking “Show Package Contents”. Inside I did indeed find dozens of old versions of Chrome and deleted them all. However, this only brought the size down to 19gb.

I wondered if the cache might be stored inside the app. I wouldn’t expect it to be, as typically it is stored in the user directory. However, when I went to clear out the cache, it only had 400mb in it away, so that ruled out that as a problem.

Next, I went through all the files in Finder to see if I could spot any large files. I could not. This made me suspicious, so I opened up terminal and checked it from there.

cd /Applications
du -sch ./* | grep Chrome
195M	./Google Chrome.app

Google Chrome isn’t actually using the space: Finder is just reporting it incorrectly. However, it clearly showed up on Daisy Disk before, and disappeared after I cleared out all of the old versions. So whether they were contributing or not I’m not sure.

Travis CI

Monday, May 30th, 2016 | Programming, Tech

travis-ci

Travis CI is a cloud-based continuous integration tool. Notably, it is also free for open source projects. They do paid subscriptions as well if there is a private repo you want to test. If you just want to test a public GitHub project though, it’s free and really easy to set up.

You can log in with your GitHub account. Once you have done this, you are given a list of your projects and you can turn on Travis CI for each one individually. Using the GitHub hook, you can configure Travis CI to automatically run a build every time code is pushed to the repo.

It supports an array of different languages and platforms. To get up-and-running, you need to add a config file into your repo. This is pretty simple. Here one I am using for a PHP project:

language: php

php:
– ‘5.5’
– ‘5.6’
– ‘7.0’

install: composer install

This configures it to run it on three different versions of PHP, and install the dependencies before starting the test. It comes with many of the common PHP extensions already enabled, and an additional list of ones you can enable if you need them.