@ssxio

Scott Robinson

Human · Software Developer · PHP, JS, APIs, DevOps, Mobile & Open Source.

About Me

Mozilla have unveiled a really useful and secure way to send one off files to friends, family and colleagues.

In a Laravel Nova based project I had a list of domains that sometimes grew to take up most of the row it was in. I discovered the following pattern to show a limited field on the index view and a full field on the edit view.

Over the Christmas period, I’d read a few threads online about whether developers should register domains on behalf of clients. A domain name is the core piece in every company’s online presence. I’ve always had a firm, emphatic answer to this question which is no. Always get clients to hold their own domain registration.

At the start of every year, I write myself a set of aims that I'd like to complete in the next year - all realistic and do-able.

I recently worked on a project that needed an export for an Orders view within a Laravel Nova panel. If you have simple requirements, for example, exporting all fields with titles – that is relatively simple to produce. However, I needed to update fields and merge others with some other custom changes.

I recently asked on Twitter on what people used for screen capturing. I actually wanted terminal recording to highlight some commands being ran for a talk about serverless. I then came across the brilliant Giphy Capture app and it’s so simple to use and produces perfect results every time.

I’ve seen quite a few people posting to Twitter recently that they’ve tried or are actively trying out Mastodon as an alternative to Twitter.

The backup service Ottomatik implemented webhooks last year (at my request, ha!) to send success or failure payloads to a URL of your choice. As Ottomatik doesn’t yet provide a Slack integration. Most teams around the world use Slack to pipe notifications into their channels and it’s a pretty good way of doing things.

If you have a file such as php-fpm.cgi that won’t delete no matter what you try, it’s likely immutable. You can remove the immutable flag using:

For a Titanium project I recently needed to install an older version of the Android SDK tools (build tools API 24) to build an old project.

<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 30 seconds"
ExpiresByType text/html "access plus 15 days"
ExpiresByType image/gif "access plus 1 months"
ExpiresByType image/jpg "access plus 1 months"
ExpiresByType image/jpeg "access plus 1 months"
ExpiresByType image/png "access plus 1 months"
ExpiresByType text/js "access plus 1 months"
ExpiresByType text/javascript "access plus 1 months"
</IfModule>

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.example.com$
RewriteRule (.*) https://www.example.com$1 [R=301,L]
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]

I’ve noticed over the past few months my usage of the Laravel validation engine has increased a lot. I’ve even used it in some non-Laravel applications just because I’m a fan of the interface. I had the idea of sharing some of the validation rules with the community but there wasn’t too many people doing the same.

I recently ran into an issue where a Magento site that had been duplicated for development kept redirecting to the original site URL. Turned out that the culprit was a setting called SSL_OFFLOADED which needed to be turned off.

If you’re in the UK, you can easily stop a lot of marketing calls by signing up for the Telephone Preference Service. It’s extremely simple to do, send a text message to 85095 with ‘TPS email@address.com” – don’t forget to remove the quotes and add your email address in.

I recently started a new project and wanted to give Laravel’s new test framework Dusk a try. Locally, this was quick to do and it worked first time – however when I then connected up CircleCI I needed to do a little extra work to get up and running. In short, the version of Google Chrome needs updating to a newer version and then things should be running well.

This is a pretty neat new feature from Zapier to allow developers to build the little modules that connect apps together. They’ve released a CLI tool which will scaffold an app. You can take a look over on their developer blog in this post.

If for some reason you find yourself needing to use `nano` in a Docker container, you can set the terminal type and then you’ll be able to use it. Say for example you ran `bash` with the exec command, you can then run:

This is a nifty little app that will allow you to share a terminal console with others. It’s called teleconsole, check it out if you have a use case.

Minor issue this morning where Vagrant wouldn’t fetch a box completely, turns out that the local cache looked corrupted and you would get this error:

If you use couscous.io to generate documentation and Laravel Forge, you can set up auto deployment and publishing quite easily. Setup the site in Forge, making sure you have a composer.json and an empty public directory in your repo.

If you’ve often seen things looking for a directory called .well-known on your HTTP server access logs, you’d be like me if you were surprised to know there is actually quite a lot more to that directory name. It provides information about services and a whole bunch more. You can read a lot more on Mattias’s blog post about it.

This script will send an email when a file changes in the given path. Can’t remember where I picked this up from but it’s useful to have when you need to debug something that writes files.

If you’re a Virtualmin user and use the iptables based firewall, you may have issues with outbound FTP working. The FTP connection can often be made, but then stalls at receiving data.

I’ve seen a few pieces of API code dotted around the web recently where people have written simple JSON APIs but their error handling still returns HTML instead of JSON for 404 errors and the likes. This is pretty simple to solve with Laravel or Lumen and easily testable too. The cleanest way I’ve seen of handling this was written by Paul Redmond in his book ‘Writing APIs with Lumen’ which you can purchase on Leanpub.

If you’re a Laravel user and you’ve been looking for something to profile your application, try Anbu. It’s created by a friend, Dayle Rees and is currently in early beta but would be great for you to try and help out testing.

One thing that I often forget about is a nice feature in Laravel that allows you to push scripts or other blocks of code into another part of your templates, so for example:

In the recent update of GenyMotion (Android Emulator) there’s a change which breaks its compatibility with Titanium Studio. You’ll need to open Terminal and create a symlink to fix it, start by opening Terminal and running:

Each email box can store a max of 3GB if you’re using IMAP – but if you add the IMAP account to your phone and computer, they’ll stay in sync (ie, read messages, new mail etc). If you’re using POP3, it downloads the messages permanently to your computer and nowhere else (first to fetch gets the message).

I’m happy that PHP7 has finally been released, I’ve been wanting to correctly return type hint for such a long time. You can now do this comfortably:

If you’re a Paypal user and use their IPN functionality, the link to get to the history page is hard to find. You can find it at:

I recently had to replace a hard disk in our OSX server at work. It had been a while since I had done this so I noted down the steps here to run through and change it. Work out which disk in your machine is faulty and replace it with a new drive.

This short post is just a reminder for myself when writing supervisord configuration files, it’s extremely useful for running daemon workers (such as Laravel’s queue workers). You’ll need the supervisor Ubuntu package installed.

If you use a few Ubunutu servers then you may have come across their management product called Landscape. It’s a pretty complex solution to set up, however with advances in Docker and useful work from the UK Home Office, there is now a Docker image you can use to run it, take a look at this Github repo for more information.

Just a note more to myself as I always forget the syntax of this one. To delete a tag both local and remote:

If you’re a Vagrant user that uses Virtualbox to host your machines, sometimes the Virtualbox tools in the guest VM will get out of date. There’s a great Vagrant plugin that will run an update for you. Run the following command to install it:

Something I always tend to have to Google for the right syntax is generating a CSR for an SSL along with a set of keys for it, this post by Google themselves has a good reference:

I recently switched tweekly.fm over to serve as SSL via Cloudflare and for the most part, this has been a good transition for most people. There have been the odd reports of people having issues though. I looked into this a bit more and it comes down to the types of certs stored in some phones and browsers – I don’t think they’re out of date per-se, but I don’t think they support a certain cipher, which is what makes them fail.

If you’re reading this post, you are most likely a user of Tweekly.fm. I’d like to take a little time to write about the changes that have recently happened on the site.

Just a quick note, if you have previous used the Runkeeper platform and want to migrate your data over to Strava, there is a fantastic online tool that will do it for you called tapiriik.com. I’ve used it to bulk import all of my ride data over and it’s been flawless.

I watched a good documentary this morning talking about Jeffrey Zeldman. If you’ve been in the web industry for a long time, it’s a really good watch and triggers quite a few memories.

Both at work and personally, I run a lot of Ubuntu servers. It’s now the standard OS choice for any new servers too. To help with management of these servers, I’ve settled on a combination of New Relic’s server monitoring (and app monitoring for a certain few apps) and the self-hosted/dedicated version of Canonical’s Landscape Dedicated Server.

If you’re a PHPStorm user and also use oh-my-zsh, you can set your default shell to be ZSH in the settings. Head into the preferences, select Terminal, then there is a box for Shell Path, stick in your zsh path – usually /bin/zsh on the mac, like so:

I came across this web page a few days ago which describe an issue with ThamesLink trains having their doors getting stuck due to GPS blackouts. You can read the full article over at ciras.org.uk.

I need to find an app of some type (preferably Mac or iOS) to log my travel around the world. I currently use TripIt pro to arrange travel which does its intended job very well, however what I would love to be able to do is have an app where I can store notes, routes, locations and photos from my trips around the world. I have previously used Knapsack for Mac which was great but is sadly discontinued.

There’s a fantastic website that you can run curl to fetch a list of the blacklist and simple mail checks to ensure any of your servers that send mail aren’t blacklisted.

If you’re using Digital Ocean’s Gitlab droplet, it’ll give you a fully configured instance for you to start using straight away. The most often case for people using Gitlab is for private repositories, if that’s the case for you then it’s worth creating a file at:

It’s been quite a few months for the tweekly.fm project. The original plan was to rewrite the user facing side of the service. Instead of just this, the entire platform was rewritten. The API’s that power the publishing of updates and collection of user data were rewritten from the ground up.

If you need to format an encrypted disk on OSX, you’ll need to use the command line diskutil as Disk Utility won’t let you do anything with the device.

I read this week about Twitpic closing down and it left me feeling disappointed. It’s not the first time that Twitter have pulled a move like this. For me, the difference with Twitpic is that it was one of the first services that offered something Twitter didn’t do at the time.

If you’re a Slack user (and you should be) and wish to use the Mac app, it’s a bit tedious for those of us who are in multiple teams. They’ve recently released a beta version that has support for multiple teams in a much better interface.

We’ve all been there. A friend sends you a link to an internet shock site. If you’re familiar with the hosts file on your machine, then you can use this large sync-able list to compliment your own rules. If you using a Mac, you can use the nifty Gas Mask program to edit your hosts file without having to jump into a shell.

I recently had to do some work on an older site that used the PHP implementation of ActiveRecord. One of the issues I had was that the queries being ran weren’t produced the expected result. I found two commands to help with this an issue the last run query:

I recently wanted to replace my statically generated sitemap.xml file with a dynamically one generated by ghost. It ended up being pretty trivial to do, but the following two links helped immensely. At present, it’s a hack to the core which you’ll have to repeat if you upgrade – but that’s a small price to pay for having your sitemap generated dynamically.

A while ago I wrote a post about using the basic ftp command to recursively fetch remote FTP files, it seems this doesn’t completely fetch them recursively. A great little program called NCFTP will do this accurate and pretty quickly. Install NCFTP if you haven’t already, then run the program:

Quick tip, if you need to find the version of a CS Cart based website, simply append ?version to the query string, so for example if you shop name is mysupershop.co.uk, point your browser at:

On the 15th May, a work colleague and I attended Laravel London for a couple of talks by Aussie Kirk Bushell and Maks Surguy. Both were great presentations, Kirk spoke about abstracting validation away to use across your application and Maks spoke about the pitfalls of ajax file uploads.

You can add a whole folder of eBooks to your iOS device by opening iTunes, select the files and then drop them onto the device name. It’ll take a few seconds to copy over (or minutes if you have a lot of books).

Maldet is a malware scanner that’s useful on servers that accept file uploads. I use it especially on servers where I have WordPress sites hosted and it alerts me to the fact that people have used themes with Malware tucked away inside.

A recent post by the saasclub.com newsletter had a good article in it by Clément Vouillon which was titled “9 Lessons Learned Building SaaS”. Effectively they had asked a few members of eFounders what the lessons they learned when building their services.

Tech companies, this is your chance to get a little free advertising. I’ll be attending the wonderful Laracon EU 2014 conference in Amsterdam this year and I’ll happily wear a t-shirt from your company while I’m there.

A neat feature I came across this week was the Google Apps toolbox. If you’re a user of Google Apps then this can be very useful to track down issues and configuration problems.

I often have the need with jQuery validate to test whether or not a value is equal to a predetermined one. The method below provides that functionality:

If you install Laravel 4 and you’re using Apache with a certain Virtual Host configuration (specifically using VirtualDocumentRoot in my case) then you’ll need to include a RewriteBase directive within the .htaccess file in public/ to correct it.

Just a quick note, it looks as though you can’t use a forward slash in the name of a beanstalkd queue name.

I had to fetch a few thousand files across a few directories on a remote server recently and I was going to use NCFTP, however I’d remembered that the stock ftp program on linux can in fact do a recursive fetch. You need to remember to turn the interactive prompts off as well, because if you don’t then you will have to press the ‘Y’ key to download each file.

PHP interfaces are still quite new to most. Below is a simple demonstration of their usefulness. I think I’d seen this within one of the many fantastic laravel books.

I had to fix an issue recently where Apache Solr wasn’t returning any results for German words. After altering the schema to accommodate the German language, the same issue of being unable to search for German words was still there. It turns out that earlier version of Apache Tomcat aren’t UTF-8 enabled by default, it’s a configuration option that you need to explicitly set the URI encoding used.

Recently I’ve been doing quite a lot of work that required UUID generation. There is two PHP libraries for generating UUID’s. One of them hasn’t been updated in a long, long time and the second one has absolute no documentation for it. After spending a few moments trying to guess the function names that this newly compiled extension provided, I found that PHP has a command called get_extension_funcs() which does exactly what it says on the tin. It will provide you with a list of functions that an extension can provide.

Over the holiday period this year, I decided to get a few things off my to-do list that have been sitting around for a while. I decided the contents of my Christmas geekery would be worth of a blog post and that is the one you’re reading now.

// PHP: Get Accurate User IP Address  
function strFindCorrectIP() {  
    $headers = array(
        'HTTP_CLIENT_IP',
        'HTTP_X_FORWARDED_FOR',
        'HTTP_X_FORWARDED',
        'HTTP_X_CLUSTER_CLIENT_IP',
        'HTTP_FORWARDED_FOR',
        'HTTP_FORWARDED',
        'REMOTE_ADDR'
    );

Over the years I’ve written numerous blog posts both on my own site and around the web too. They have ranged from topics close to home and choices in life that I’ve made, to being focused on programming and technology. I’ve often used my blog to share code snippets and to ask opinion on programming methods. As a person, I’m always keen to listen to others, both in technology and life.

I’ve just had the following email from TFL explaining that they’ve now placed all my Oyster travel journeys into the online portal. Can’t wait to see if they expose this data via the API too.

I recently got the book “MongoDB and PHP” by Steve Francia which had an interesting paragraph in the first chapter that talks about how the use of stored data has changed in recent years:

The current version of Virtualmin ships with an issue for ProFTPd on CentOS due to two modules that it needs to track connections not being loaded. There is a quick fix for this, you’ll need to edit the iptables-config file located at:

There are quite a few circumstances where you may need to force a site, app or page to serve over a secure SSL connection. In PHP development there are two ways to approach this problem depending on your setup. If you’re using Apache to serve your site and you have the ability to use .htaccess files then you can use a rewrite rule to simplify this task server side.

As you probably know, I was in Toronto for a couple of weeks earlier this year. In a new respectful habit I’m trying to force myself into I’m making my views on locations visited know via Foursquare and Google Places. The list below contains all the name worthy places I’d visited and a short review of each venue.

A lot of things get my attention in the news now-a-days but a piece from Kuala Lumpur impressed me. A new law has been passed in Kuala Lumpur that stipulates food and drink outlets must now provide free wireless internet in order to be granted or to renew a license to operate. I think this is a fantastic step from the local government as Internet access has been a must have for most people in recent years.

For a recent piece of PHP I was writing I needed to find the start and end timestamps for a given week. I came up with the following piece of code to achieve getting the timestamps.

A couple of times recently I’ve needed to create new Google accounts. If you’ve recently needed to do this you probably noticed that Google’s default form now wants you to effectively create a ‘screen name’ which will come with GMail.

One of the less common server tasks during the year is the setup and maintenance of SSL certificates for web services. There has always been the air of dread when this comes around but I’m not too sure where the reason for that comes from. The process is simple enough to go through and you have two choices in how you use SSL.

An odd bug in OSX Lion means that the keyboard repeat rate options in the Keyboard preference pane doesn’t get honoured. To enable this, you can run the following command at a Terminal prompt:

One of the most often asked questions for me when it comes to Facebook is how administrators of pages and profiles can set usernames. In the past, Facebook haven’t really pushed this feature but in the age where social marketing and name based branding is becoming more important – setting your username is a bonus point when it comes to promoting your brand.

A lot of people use Skype now-a-days and one convenient feature is the ability to use the skype:// protocol handler for creating actionable links on the web. Examples of this are to initiate a call, or add a user as a friend. The list below details the types of links that you can use:

One task I had to recently complete was cleaning up the Facebook ecosystem for a particular business. Around Facebook there were a few groups, profiles and pages purporting to be the business which needed removing. There are two types of infringement that you can report to Facebook and get actioned, explained below.

commercial— id: 38 title: What is a QR Code? date: 2011-09-17T15:37:15+00:00 author: Scott Robinson layout: post guid: http://beta.dor.ky/2011/09/17/what-is-a-qr-code/ permalink: /what-is-a-qr-code/ categories:

  • Uncategorized

One of the most popular posts that I wrote previously for my blog was regarding the Twitter API and email addresses. That post has since been permanently archived and is no longer available It seems as though this topic is very popular among new developers to the Twitter ecosystem. In this post, I’m going to revisit that topic once again.

The eTrex Vista HCx is a fantastic little GPSr. The one that I currently have is from Matthew who loaned it earlier this year when our Dakota malfunctioned. After being out in the Roaches, the eTrex suffered an impact injury and began to rattle. Fortunately this was easy to fix as it was only a cover of the speaker inside the GPSr.

Garmin provide many types of maps for their devices but each costs quite a large sum of money. Thankfully in recent months this process has become a lot easier for the end user to do. This short guide will explain where to find the correct map file and how to install it using a Dakota 10 GPSr, a Mac and Garmin”s free software.

An all too common sight with the iPhone ApplicationA lot of what I talk about these days seems to be Geocaching related. The concept of Geocaching has long been around and at present the biggest central location of cache information is at geocaching.com which is owned by Groundspeak. The website, applications and tools are pretty average to use and no real changes have been made to the way that users interact with the site for a long time. The iPhone application is clunky at best and is a difficult to use at times. The reliability of the application over mobile connections is also questionable. All of the caching data is held by Groundspeak and although premium members can retrieve data via Pocket Queries (multiple caches in a single GPX/LOC file) and single file downloads (one cache per GPX/LOC).

Earlier this year T-Mobile announced that they were merging with Orange. This didn’t matter too much to most at the time but its changed a little now. For a while they’ve been testing network sharing and its now live for customers to use. If you’re on T-Mobile you need to first text ‘Yes’ to 2121. This will switch your account to use both networks and whichever has a signal. You’ll get a text back saying that your account has been changed. Remember that at present if you’re a T-Mobile customer using the Orange network you only get 2G, not 3G so things like YouTube won’t work (unless you’re jailbroken and forcing it to).

One thing that appears to be a recurring theme on the Twitter API development mailing list and in the IRC channel of Freenode is the question of getting access to a users email address. I’ve always found this frustrating and have never seen a good reason why a users email address should be given out via any API method. The following list contains the reasons that are most often given when you ask why an email address is desired:

This weekend marked the first GeoCaching event that I’ve been to. “To Cache a Kippa” was held at the Keele University KPA and they placed ten new caches around the campus that we got a few first-to-finds on. It was really nice to meet fellow cachers and share stories about being out caching. We have met a few other local cachers while being out like Mick and Mandy. I also speak to a few cachers quite often and it was nice to be able to put faces to names on Saturday evening.

For a long while now I’ve been visiting a place in the Roaches called Luds Church. From Gradbach to Luds Church is a good 15 to 20 minute walk that you would take, the only people you used to see on your way is at the old mill which is now a Youth Hostel. In winter the chasm is beautiful to the extreme with stalagmites and icicles hanging down all over and the peacefulness and tranquillity usually associated with an actual Church.

As many of the regular readers of this site and my Twitter account will know, I’ve very much integrated GeoCaching into my daily life. Just like pringles you won’t be able to stop once you’ve started. GeoCaching is a very simple premise that is similar in principle to the old idea of letter-boxing. You can sign up at geocaching.com for an account an begin looking for GeoCaches in your area straight away. You will need some form of GPS receiver such as a Garmin. This article provides a little information on how to find a GeoCache and the best ways to hide your own caches.

After living in Stoke-on-Trent for quite a while again now I’ve come to realise like many others that when needing to find something out about local government – generally you head to stoke.gov.uk. This is an old site that has been online for a number of years without too much improvement. For a lot of topics you can actually find the information you’re looking for eventually, but the problem is that the lack of updated information throughout the site and its lack of usefulness to the general public are just two points on a list of problems for the site.

You can get quick information about any of your Apple devices by using their self service warranty information page, located here. For serial numbers from iPhones and iPads it’ll show supported networks, current warranty status and a little more. Its also useful for checking legitimacy of serial numbers.

While working on the new cache pages for this site I came across the interesting task of parsing GPX files with PHP. SimpleXML is quite easy to use and with the children() function you can use namespace extensions – for example with GeoCaching exported GPX files. You can get an awful lot more information from a GeoCache GPX than with standard XML parsing.

There is an emerging trend that local business won’t be able to ignore for too long. At the moment, all the rage with mobile devices seems to be location based services and games with Gowalla, FourSquare and Yelp being the primary platforms although Facebook is to launch its own version shortly which may comprise of an amalgamation of all three. These platforms reward users with points, prizes and badges the more they ‘check in’. I haven’t had chance to test out Yelp more yet, so I’ll exclude that from the results below.

In January this year when I first undertook the Tweekly.fm project in ran in a very different way than what it does now. I’ve completely rewrote the code base that the system works from. It now runs a lot faster and we can support more users than previous. I now run both statistics for Twitter (tweekly.fm) and for Facebook (laststat.us). The past few days I’ve pushed changes out that change the way the system interacts with Last.fm and how we store your data.

The system of rewarding customers with points, cards or discounts is a fairly standard practice amongst today’s modern business. This reward model is based around rewarding for purchases of goods and services and then allow these customers to choose a gift in return to reward their loyalty. The existing implementation are this reward network is singular in nature except for organisations such as Sainsbury’s nectar.

Over the past six years we’ve seen major developments around the world in online services and computing. Traditional web sites such as Google, Amazon and eBay have now transformed into multinational platforms offering more than just a site to use. All of the services I’ve just named still provide their main web site, but isn’t it about time we started referring to them as platforms rather than sites. In my opinion, it is.

Quite a while back now in Internet history a system called ‘robots.txt’ was introduced to control the content that web crawlers and services are permissible to crawl. This file details a map which denotes what crawler/bot is allowed to crawl a site. At tweekly.fm I deal with a lot of user traffic and the complicated nature of our queries means that its quite intensive to generate the user pages.

The best thing about building a project that gets popular is the same as the worst things about a project that grows rapidly. Tweekly.fm is currently gaining 1,500 users per month most of which decide to publish on a Sunday. This increases the load and run time of the delivery engine that pushes tweets outbound. The other side of an increased user base is that user pages get more popular. Although this is a good thing overall and shows our popularity – it also has its downsides.

I spent some time yesterday extending the StokeTraffic platform to include support for eye witness reports provided by users of the service. This now means that the service will include real time eye witness reports of problems and conditions of the roads in and around Stoke on Trent. All users are invited to participate in this extension of the service by using the new feature. If you’re travelling in or around Stoke on Trent and spot a problem then you can alert us by posting a tweet similar to the following:

This is the first in a series of posts I’ll be writing about how to get to and see parts of The Roaches and other Peak District places. I’ll also be making an effort to update parts of Wikipedia to reflect these changes too. Over time, paths change and the ways of getting to a lot of places change too. As I live in North Staffordshire I’m in a great location to be close to The Roaches and the Peak District and I’ll attempt to keep sites such as Wikipedia updated as well as my own collection of posts here.

I completely found myself in shock earlier today when I had to use the ‘forgotten password’ feature on geocaching.com. To my complete amazement, they emailed my password back to me in plaintext. Now, bearing in mind that most of their site is basic in features I’m sure they haven’t generated their own two way encryption so that means they’re storing passwords plaintext which in this modern age is suicidal.

This is a screenshot of the bandwidth usage for the Fonera router I flashed last week. Everything seems to be working fine. A couple of PDF documents that I found useful can be downloaded here and here.

A few people have asked about more details for the wireless bridge I’ve set up within my local network. You can find more information about it here. Its a pretty simple process and you end up with a router running DDWRT.

I’ve just written a request for more information from Google as I’m astounded to find no accessible API for Latitude. I find that completely shocking on their part.