21 Apr 2020

What I want from my new blog

In my last post, I mentioned that I want to finally migrate my blog away from Blogger. After 10 years, my blog is looking a bit dated, and could do with a refresh. I am also keen to reduce my dependence on Google products.

I thought it would be interesting to blog about the process of moving to a self-hosted blog, with regular updates abou this project. This post is going to detail my requirements for the blog migration project.

Requirements

  • Allow me to self-host my blog. This will probably be on Azure initially, but I want the freedom to host wherever I want.
  • Make use a static site generator (SSG) to generate HTML pages. The SSG should be:
    • Built using a programming language I'm interested in learning - Python/Golang or Rust
    • Open source
  • Have ability to draft blog posts in Markdown
  • Make use of a blog template that uses minimal, vanilla JavaScript for progressive enhancement where required
  • Allows me to integrate various little apps (like my Reading List) and dashboards into the site
  • Removes third party dependencies, such as:
    • Google Spreadsheets to power the Reading List
    • FeedBurner for RSS
    • The Google Search integration
  • Is fully accessible for screen readers and other assistive technologies (as verified by an accessibility audit).
  • Does not use any analytics or tracking packages (while I have removed my own Google Analytics integration from this blog some time ago, Blogger has a basic default integration with Google Analytics that cannot be removed)
  • Use an SSL certificate on my blog - possibly from Let's Encrypt
  • Allows me to easily include code snippets
  • The migration will allow me to maintain what little SEO I've picked up from Google over the years - basically, I'll need some way of updating any legacy URLs to point to any updated links.
  • Allows me the freedom to explore the RSS club or Indieweb

As part of my plans to revamp my blog (and stave off boredom during the lockdown), I'm planning on blogging weekly updates on the blog migration project. The next installment will be on selecting an SSG to use.

What I'm Reading

Eureka Street

I'm re-reading Robert McLiam Wilson's classic novel about Belfast during the IRA ceasefire.

Mad Max: Fury Road as a Sequel to Brokeback Mountain, really

An unexpected gem of a film review. I loved it!

Why I’m leaving Elm

A tale of open source woe from the Elm programming language. Scratch Elm from the list of programming languages I'm interested in learning. The discussion about this article on the Orange Hell Site is also worth reading.

The WHO v coronavirus: why it can't handle the pandemic

A long read on the Guardian about the World Health Organisation and why it is struggling with the Coronavirus pandemic. The author's interview with the Guardian's Today in Focus podcast team is also available.

8 Apr 2020

Andy Uses This

I’m a big fan of the Uses This website, which posts interviews with people asking them about the tools and productivity techniques they use to get stuff done. The interviews range from the awful (Apple fanboys salivating over their Macs, or <shudder/> Emacs diehards) to the sublime, when the interviewee gives you an insight into their personal philosophy, and forces you to question your own outlook.

My personal favourites include interviews with:

As I’m very unlikely to ever get interviewed for the site, I thought I would post my own ‘Uses This’ interview.

Photo of Andy Parkhill

Andy Parkhill

Software developer and eejit.

Who are you, and what do you do?

In no particular order, I’m a dad, husband, son, brother, Christian and an eejit. I’m really only any good at being the later. I’ve been working as a software developer for the past 15 years. I mainly work with Microsoft technologies, such as Office 365 and the Azure platform. In the past, I spent many years working with SharePoint (on-premise) but rarely touch it now. I’m currently working for the Queen’s University in Belfast, where I work on a range of different projects (developing mobile apps, building custom sites and bespoke line of business applications).

You can some of my open source code on GitHub, though I mainly use GitLab these days, and most of my projects are private. I’m on StackOverflow (though I use it less and less these days), and also on WeChat (essential for speaking to family in China), but otherwise I avoid social media. I do have a Twitter account, but I’m currently on a long term break from it. I feel a lot better when I’m not spending time on sites like Twitter, Facebook, Instagram, and LinkedIn, so I have blocked them across all my devices. I have started using WhatsApp to stay in touch during the Coronavirus lockdown.

What hardware do you use?

The most important hardware I use are a notebook and pen. I think best when I commit my thoughts to paper, and I'm most productive when I plan my day in advance using a journal. For the past 5 years, I have been using Pukka Pad’s Jotta A5 notebooks, with BIC Orange Original Fine (0.8mm) ballpoint pens which fit nicely within the notebook’s spiral. The books and pens are cheap, decent quality and can be found everywhere. I also use a ridiculous number of post-it notes daily.

My work PC is a Dell Optiplex 7040 with i7-6700 DPU @3.40 GHz processor and 16 GB RAM, running Windows 10 Pro. It is around 18 months old at this point. I use a Dell USB SK-8115 keyboard – this is an older keyboard that is a bit more solid and sturdy than the flimsy one that came bundled with the PC. I use an Anker ergonomic vertical mouse, which I simply love. I use the exact same model of mouse at home, and a wireless version for when I'm travelling with my laptop. Similarly, I use identical Fellowes crystal gel mouse pads and keyboard rests at work and home. I have a dual monitor setup in the office, using 2 mismatched Dell monitors.

I have recently started using an old Surface Pro 2 tablet at work. It has a i5-4200 CPU @ 1.6 GHz processor and 4 GB RAM, and runs Windows 10 Pro. I quite like having it for meetings, but it is useless for any development work.

My other main hardware in work are my Sennheiser HD202 headphones. This is my second set of the same model – I had the initial set for 6 years and liked them, so I didn’t see any point looking at other headphones when I had to replace them.

At home, I have just received and setup my new laptop, a Dell Inspiron 14" 2-in-1 (5491) touch enabled laptop, with a i7-10510U CPU @ 4.9 GHz, with 8GB RAM installed, and another 8GB arriving shortly from Crucial. I have it for under a month, and absolutely love it. My previous laptop was also a Dell, an Inspiron 15 (7537) that was over 7 years old, and that I finally managed to brick after it stopped supporting Windows 10. At the minute, I don’t use a monitor along with my laptop at home. Otherwise, my accessories at home match my work setup – a sturdy generic keyboard, Anker vertical mouse, and identical mouse pad and keyboard rest.

My home laptop uses Windows 10 Pro – after several attempts to use a Linux desktop, I have given up spending my free time messing around in dotfiles and trying to get things working, and instead focus on spending my time getting things done. Windows 10 allows me to do that, and the introduction of WSL means I no longer need to setup a dual boot drive if I ever need to use Linux. Additionally, my laptop is our main PC at home, so my wife also uses it, and she definitely prefers using Windows over Ubuntu.

I currently use an iPhone 5s, having finally given up on my beloved iPhone 4s a few months ago. The iPhone 4s was my first ever Apple product, as I had previously been using Android phones. It was a present from my then-girlfriend (now my wife), so I couldn’t say no... It was second hand when I got it, and after using it for around 5 years, the increasing number of unsupported apps and poor battery life meant it was time to upgrade.

Like most people working in IT, I have a number of other older devices kicking around at home – an iPad mini that I inherited from my wife when she upgraded and that I no longer use, an older model iPad that needs repaired (stuck in a boot loop), and an old Toshiba laptop that I’m still trying to find some use for. Also, a number of old Android phones in various states of repair.

Other notable pieces of hardware:

  • A decent desk, and an sturdy, comfortable office chair that I got when a previous employer moved to smaller premises
  • Lego – Our son has a large tub of Duplo sets, and a small but growing amount of Lego City sets, and it always keeps him entertained.
  • Sennheiser CX 870 ear buds – I carry these everywhere in my...
  • Swissgear laptop backpack – I’ve had this bag for over 7 years now and it appears to be indestructible

As you can tell, I prefer to using decent low to mid-range hardware. If possible, I max out the RAM for a device, and then continue using it until it fails.

And what software?

Any important information I put in my paper journal will eventually end up in OneNote, which is the best digital notebook and organiser I have came across (the OCR functionality in particular is excellent). I still use the desktop app, as opposed to the web application. My notes are then synched and available across all of my devices.

Using the same OS across my home and work devices means I can have a consistent setup across them all. I use this Windows 10 setup script to automate my setup, and I create a PC specific PowerShell script for installing any programs using this template. I then have a checklist to complete the my Windows 10 setup (mainly configuring security and privacy options, and application specific configuration). I haven't yet taken the time to automate this, but probably should. It is worth pointing out that my Windows 10 configurations are mainly hiding the new feature bloat (has anyone ever used 3D objects?), and returning it to the classic Windows 7 desktop configuration. To help with this, I also use the Open Shell for the classic Windows 7 Start menu.

The main desktop applications that I use are:

  • Dropbox – despite its growing cost, and increasing feature bloat, this is still the best synchronization tool I've came across.
  • My main browser is Firefox, and I sync my profile across my various devices. I work hard to minimize my use of extensions for security, and to avoid being fingerprinted by sites. My main extensions are CanvasBlocker, Privacy Badger, and uBlock Origin. I use Startpage.com for search.
  • I occasionally use Chromium for web development.
  • Visual Studio 2019 for development (generally C# but also a little Python).
  • Visual Studio Code for lightweight code and text editing.
  • Git and Git Extensions for source control.
  • Notepad++ for occasional text editing (specifically for any serious regex work).
  • Launchy – an application launcher. It isn’t really required for Windows 10, but I've grown so used to it that I prefer using it to the built-in launcher.
  • Greenshot for taking screenshots.
  • Cobian – a backup tool for Windows.
  • LibreOffice at home, instead of Microsoft Office (though I debate if I still need to install it, given how good the Office 365 web apps are now).
  • MarkdownPad – a Markdown editor for Windows (I have a license for the Pro version).
  • I use KeePass as my password manager.
  • Signal for secure messaging across my devices.
  • PureText – a tiny utility for stripping out the formatting of any text copied to the clipboard.
  • The Authy desktop client for 2FA.

I also have some console apps that I use to limit my distractions by blocking social media and any advertising on my various machines.

The main web applications/sites that I use are:

  • Gmail
  • Google Calendar
  • Wallabag, an open source alternative to Pocket
  • Feedly for managing my RSS subscriptions
  • Google Spreadsheets
  • Microsoft To Do

I am slowly but surely starting to reduce my use of Google products. I still use Blogger to host this blog, but I've decied to start self-hosting later this year.

I try hard to limit the number of apps I install on my mobile, but...

  • The iOS Mail and Calendar apps
  • OneNote
  • Microsoft To Do
  • Dropbox
  • Authy for 2FA
  • MiniKeePass
  • Signal
  • WeChat for keeping in touch with family
  • WhatsApp for keeping in touch with friends and work colleagues
  • Pleco
  • Nemo for Cantonese
  • Shortcuts for iOS
  • Apple Health app for tracking my weight, along with the Lose It! app for tracking my food intake.
  • A generic Interval Timer for circuit training

After writing this list, I reckon I could do with culling the number of apps even further. I use the iOS Screen Time settings to track and limit my use of my phone.

What would be your dream setup?

When I wrote the first draft of this post, my main wish was for my own home office setup, rather than just a desk in our bedroom. Now, in the midst of the Coronavirus lockdown, I actually have a home office with the same desk in the same bedroom, but with (relative) peace and quiet during the working day from my family. It is working out a lot better than I thought, but there are still issues around distractions.

Ideally, I would love to move away from using Google products and, where possible, start self-hosting open source alternatives (like NextCloud, or my own Wallabag instance). Similarly, it would be great to be more involved in open source, and to start programming in other languages outside of the .NET ecosystem. I have started looking at Python, but would love to do more than just Hello World projects.

But that all takes time and I don't have a huge amount of time for programming outside of work these days... I suspose what I am really asking for is more free time - and it turns out Coronavirus has cleared all our social calendars for the foreseeable future. We'll see what I manage to achieve in the next few months.

29 Mar 2020

10 Years of Blogging

Ten years ago today, I posted for the first time on this blog. At the time, I had given my resignation in my job and had some free time while working my notice. So instead of working for my employer, I decided to do something for myself, and this blog was born.

My first article was on Turing machines. My second was about my new job. The third detailed why I was blogging and what I hoped to blog about - which was really about my side projects and anything technical that jumped out at me. I then started a weekly round-up of links useful to developers, focusing on the .NET space, but also including local developer events and job postings. The weekly roundup died after 4 months, but while posting that, I was also blogging about TV, random technical topics. I blogged a few times on scripting on PowerShell (my most popular post is from 2012, and is on calling other programs from PowerShell).

Over the past few years, I have been blogging less frequently (job and family life have been eating up all my time), but I managed to write a long series on SharePoint Development that I'm quite proud of. Though looking back and reading it now, I should have edited ruthlessly down to just 2-3 articles. I have also written a few personal posts over the past 10 years. Altogether, I have posted 106 times. Amazingly, there are people out there who take the time to read my nonsense.

This blog started because I had some free time and wanted to do something for myself. Ten years later, as I write this at home with my family, we are self-isolating in the middle of a global pandemic. I have some time again for myself, in a way I haven't in a long time. I want to do something for myself - I want to write again, and learn with some side projects. I already have a few draft posts ready to publish. But more importantly, I'm looking at my blog, and realising that I need to invest in it. It is looking tired - I need to move it off Blogger, and onto a new platform that will allow me to do more with it. Here's looking to another 10 years of blogging. And thank you for reading.

7 Oct 2019

Parenting

For the last month, I’ve been looking after my son on my own. My wife has been in China dealing with a family emergency, and due to its nature, it was thought best that she go alone. I am lucky enough to have an employer that could allow me to take unpaid leave to look after Matthew, and we are also lucky enough to be in a position financially to afford to take it.

For the past month Matthew and I have been together pretty much 24/7. It was pretty intense, and at times, an absolutely exhausting time. Our father/son relationship has deepened greatly, and my appreciation for the work done by my wife Mei in looking after Matthew has grown exponentially. I considered myself a pretty involved father before – I now know I was kidding myself.

Matthew playing with Duplo

Tomorrow I go back to my regular work, writing text files for a computer. Compared to parenting, it is by far the easier job of the two.  The past month has been tough at times – but so are most things that are worth doing. I suspect that in the future, I look back at this as one of the most productive times in my life.

3 Apr 2019

Setting Row and Column Formats in SharePoint Online with PowerShell

I’m currently spending most of my time working in Office 365, in particular SharePoint Online (along with Microsoft Flow and PowerApps). While the new modern page look is a major improvement on the classic SharePoint on-premise look, customers still want to be able to customize the default look.

To allow customisation of how lists and libraries appear, Microsoft allows you to set view formatting. This uses a JSON object to describe how elements are displayed when a row is loaded in a list view. A useful repository of open source JSON formatting samples is available at https://github.com/SharePoint/sp-dev-list-formatting.

Similarly, you can apply a JSON object to customize how a field (column) is displayed in a list view. Note, neither row or column formatting changes the data in the list item or file; it only changes how it’s displayed to users who browse the list.

While there is a lot of documentation around setting the JSON formatting using the SharePoint Online UI, there is little documentation around using PowerShell to do this. I came across this method of setting the JSON formatting object:

# Get the raw content for the JSON Definition
$listViewFormattingJSON = Get-Content -Raw -Path '.\ViewRowFormat.json';

# Update the List View Formatting Definition
$view = Get-PnPView -List $list -Identity $viewName
$view | Set-PnPView -Values @{CustomFormatter = $listViewFormattingJSON.ToString()}
Invoke-PnPQuery

And similarly, to set the column formatting:

$statusFieldFormattingJSON = Get-Content -Raw -Path '.\StatusColumnFormatting.json';
$statusField = Get-PnPField -List $ListName -Identity 'Status'
$statusField | Set-PnPField -Values @{CustomFormatter = $statusFieldFormattingJSON.ToString()}
Invoke-PnPQuery

These code snippets help to set the customized view below:

List view showing both view and column formatting

Note, I use the SharePoint Patterns and Practices (PnP) PowerShell library to provision and manage my SharePoint Online solutions.

13 Dec 2018

PowerShell Core

I recently read a great post by Paul Cunningham on career advice for IT professionals, and this line stuck with me: ‘Change is a constant’. This really resonated, especially as I belatedly caught up with the recent changes in PowerShell.

I started using PowerShell in 2008, after a more experienced colleague advised me to start spending one afternoon a week learning about new technologies and tools as part of my professional development. This is great advice, by the way, and I would recommend every developer to do it. I also would suggest not asking your manager for permission to do this – if you’re a professional software developer, you need to make time as part of your job to learn new technologies. It is for both for your benefit (professional development) and your company’s (they get a more efficient developer), even if they may not always realise it.

So I started using PowerShell 10 years ago, and I quickly started using it daily, especially as my career started involving more and more SharePoint development, support and administration. However, sometimes I don’t follow my own advice, and I haven’t been keeping up with the major changes happening with PowerShell. It was only when I realised that development had stopped on the AzureRM PowerShell module, and that Microsoft was instead focusing on a new cross platform Az module , that I realised that I had missed a number of major announcements about PowerShell and the direction it was heading. With the release of .Net Core in 2016, Microsoft had started implementing a cross platform version of PowerShell, now known as PowerShell Core 6.0. This was released to general availability back in January 2018. I had missed a major change in an essential developer tool that I use daily.  Change really is constant, and I hadn’t been prepared for this particular one!

The major differences between PowerShell Core and the legacy Windows PowerShell are:

  1. PowerShell Core is cross platform and can be run on Windows, Linux and Mac systems.
  2. PowerShell Core is open source.
  3. Currently, the major breaking changes in PowerShell Core are:
    1. PowerShell Workflows are not available.
    2. The Out-Gridview command is not available in PowerShell Core
    3. PowerShell Core does not support the WMI v1 cmdlets and a large number of other Windows OS specific cmdlets.
    4. While Windows PowerShell ships with the ISE editor, PowerShell Core encourages the use of Visual Studio Code.
    5. PowerShell core is case-sensitive, as it must now run on Unix operating systems.

As PowerShell Core uses the less feature-rich .NET Core and .NET Standard, it currently only offers a subset of the functionality offered by Windows PowerShell. This will change over time as the Powershell Core framework matures, and as more functionality is developed for it. While Windows PowerShell will continue to be maintained (with bug fixes and security updates), there will be no new functionality added to it.

It is pretty easy to get started using PowerShell Core. It can be installed and run alongside your existing Windows PowerShell. I use Chocolatey to install (almost) everything on my Windows PCs, as it allows me to configure automatic updates. To install PowerShell Core using Chocolatey, run:

choco install powershell-core

Once installed, it is worth configuring the following:

  1. Modify your profile. The profile path in PowerShell Core is different to that of Windows PowerShell, and is at C:\Users\{username}\Documents\PowerShell\Microsoft.PowerShell_profile.ps1
  2. Modify VS Code to use the PowerShell Core Integrated Terminal.
  3. Install the Windows Compatibility module to allow PowerShell Core to invoke commands that are currently only available in Windows PowerShell. This will allow you to run existing PowerShell scripts in PowerShell Core without any changes.

As I’m spending a lot of time in Azure, the first new PowerShell Core module I installed was the new Az module, which replaces the older AzureRM modules. Once the module is installed, to ensure compatibility with existing AzureRm scripts you should run the Enable-AzureRmAlias cmdlet, to enable aliases for your existing scripts for the current session only.