PHPNews

Creating virtual environments with Pyenv

rst2pdf is a Python 2 application that we're making compatible with Python 3. When developing Python applications, I've found it useful to be able to switch python versions easily and also set up clean environments to work in. To do this, I currently use pyenv . This is how I set it up: Install Pyenv On my …

Continue reading »

Written by Rob Allen - - Aggregated on Wednesday July 17, 2019


Running PHP applications on Azure App Engine

Azure App Service is a way to host your web application in a container without having to think about the server. It's the same PaaS concept as AWS Elastic Beanstalk and supports all the main web programming languages. It also supports Windows and Linux OS containers. I have a client that is moving an on-premises …

Continue reading »

Written by Rob Allen - - Aggregated on Wednesday July 3, 2019


Step debugging sphinx-build in PyCharm

I've been trying to solve an issue with the rst2pdf Sphinx extension which allows you to use rst2pdf to create a PDF of your Sphinx documentation rather than using Sphinx's default pdfTeX builder. In order to understand what was happening, I really wanted to inspect variable at certain stages of the process, …

Continue reading »

Written by Rob Allen - - Aggregated on Wednesday June 26, 2019


PHP Architect: Serverless PHP With Bref, Part 2

Part two of my article on using Serverless PHP using Bref has been published! In part one , I introduced Bref as we wrote a simple "Hello World" application. Part follows this up exploring a more complete serverless application, my Project365 website. This S3 hosted static website is build using a serverless …

Continue reading »

Written by Rob Allen - - Aggregated on Wednesday June 19, 2019


Keyboard shortcut to Save as PDF on Mac

I regularly print to PDF on my Mac, This is done from the print dialog by selecting Save as PDF from the drop down in the bottom left of the dialog which is a bit of a pain to get using the mouse. I recently discovered that I could create a keyboard shortcut to make this much easier. In System Preferences …

Continue reading »

Written by Rob Allen - - Aggregated on Wednesday June 12, 2019


Extracting the base name of a file in Bash

I have a handy bash script that transcodes videos using Don Meton's video_transcoding tools . This script was written in a hurry and one limitation it had was that it re-transcoded any source file even if the output file already existed. The script looked like this: #!/usr/bin/env bash readonly source_dir="${…

Continue reading »

Written by Rob Allen - - Aggregated on Wednesday June 5, 2019


Circular dependencies in AWS SAM Policies

I'm trying to tighten up the policies of my AWS Lambda function so that it only has access to the one S3 bucket that it needed, so I added an S3CrudPolicy with the BucketName referencing the bucket that's defined in the template. The relevant part of template.yaml looks like this: Resources: ImagesBucket…

Continue reading »

Written by Rob Allen - - Aggregated on Wednesday May 29, 2019


My Bref Makefile

In order to use Bref efficiently, I've developed a Makefile so that I don't have to remember all the various commands required. In particular, looking up the correct parameters to sam package & sam deploy is a pain and it's much easier to type make deploy and it all works as I expect. It looks like …

Continue reading »

Written by Rob Allen - - Aggregated on Wednesday May 15, 2019


PHP Architect: Serverless PHP With Bref, Part 1

I've written a two-part series on Serverless PHP on AWS Lambda using Matthieu Napoli 's Bref for php[architect] . Part one has been published in the May 2019 issue and if you're not already a subscriber, you should be! If you just want to learn about Bref though, then my introduction to Bref is available …

Continue reading »

Written by Rob Allen - - Aggregated on Thursday May 9, 2019


Slim 4 Cyclomatic Complexity

There's not much wrong with Slim 3 ; lots of people are using it very successfully producing APIs and websites of all kinds. For Slim 4 the main goals have been to support PSR-15, make it easier to use your own PSR-7 implementation, improve error handling and remove assumptions that look magical if you don't know …

Continue reading »

Written by Rob Allen - - Aggregated on Wednesday April 3, 2019


rst2pdf: back from the dead!

Today marks a momentous day! I've released 0.94 of rst2pdf to PyPI ! If you have a need to convert plain text files to PDF, check it out. As the last release, 0.93, was December 2012, I think you could have reasonably assumed that the project was abandoned. So why did I bring it back from the dead? …

Continue reading »

Written by Rob Allen - - Aggregated on Thursday January 24, 2019


Keyboard control of macOS notification alerts

I use Apple's Reminders app to remind me about things that I need to do. It has the useful feature of syncing across my Mac, iPad and iPhone and I can add to it via Siri in my car. When I am notified on my Mac, a notification alert appears with two buttons: Complete and Later . Clicking Later offers a set of …

Continue reading »

Written by Rob Allen - - Aggregated on Wednesday January 9, 2019


Setting up IBM Cloud Object Storage

For a little website that I'm writing, I thought that I'd use IBM Cloud Object Storage (equivalent to AWS S3) as I'm generating the pages using OpenWhisk on IBM Cloud Functions . The documentation is quite good if you want to use the website, but is a bit spread all over the place if you're using the command …

Continue reading »

Written by Rob Allen - - Aggregated on Wednesday January 9, 2019


Serverless PHP on AWS Lamda

Like, Simon Wardley , I think that serverless computing is an interesting space because the billing is granular (pay only when your code executes) and you don't need to worry about maintaining and provisioning servers or containers. So much so, that I maintain the Open Source PHP Runtime for Apache OpenWhisk …

Continue reading »

Written by Rob Allen - - Aggregated on Wednesday January 2, 2019


2018 in pictures

As 2018 draws to a close, I take the time to look at the past year as I have done in years past , I look at the photos that I've taken and reminisce about all that I've done this year. January I started the year with ongoing efforts to reduce the pain in my joints and then visited America for CodeMash in …

Continue reading »

Written by Rob Allen - - Aggregated on Monday December 31, 2018


Autojump is magic

One of my favourite command line utilities is autojump . It's a small command line utility that allows you to change directory without having to remember exactly where that directory is. For example, to start working on OpenWhisk, I simply type: j openw And the current directory is changed to /Users/rob/Projec…

Continue reading »

Written by Rob Allen - - Aggregated on Wednesday December 19, 2018


Upgrading to Bash 4 on macOS

Incredibly, macOS Mojave comes with Bash 3.22 by default still. Apparently this is due to licensing reasons, however Bash 4 has lots of lovely features including associative arrays that I'd like use. Hence, after reading the Internet for a bit, I've installed it on my Mac. This turned out to require just 3 commands: …

Continue reading »

Written by Rob Allen - - Aggregated on Friday December 14, 2018