Jekyll2023-12-26T15:56:04+00:00https://blog.sgawolf.com/feed.xmlSimon Wolf’s BlogSometimes random, occasionally focused, rarely proof-read.Simon WolfFrom Digital To Physical Media2023-12-26T08:00:00+00:002023-12-26T08:00:00+00:00https://blog.sgawolf.com/post/from-digital-to-physical-media<p>This morning the YouTube algorithm suggested a video called <a href="https://youtu.be/5HjX6RtOoBY">“Wait, what happened to HMV?”</a> to me. It covered the decline and then revival of the company and ended wondering if it would survive with people buying physical albums on CD or vinyl or whether streaming or digital purchases would ‘win’.</p>
<p>I’ve never been massively into music but I’ve always had a good collection of films and TV shows, first on VHS (mostly recorded rather than bought) and then on DVD. However, back in 2008 I embraced the arrival of Apple’s digital stores and I switched to buying films and TV shows from them. The arrival of the Apple TV and the iPad further cemented this and I built up a large library of digital media (over 500 films and over 100 TV shows).</p>
<p>At the start of 2020 I started to fall out of love with some of Apple’s ecosystem. I stopped using Apple’s computers for work and as other problems occurred I would move away rather than trying to fix them. For example, ‘ownership’ of my contacts and calendar was migrated to <a href="https://www.fastmail.com">Fastmail</a> who I had used for a long time for email after iCloud decided to duplicate all of my contacts. And whilst this shift was happening I realised that my biggest tie-in was going to be my digital purchases.</p>
<p>In early 2022 I decided that I wanted to start re-building my physical media library. My VHS tape collection was long gone but I had kept the majority of my DVDs so at least I was not starting from scratch. Initially I intended to just buy titles I did not already own but, as time has gone by, I have bought physical copies of some of the digital ones and I have bought Blu-ray versions of some of my old DVDs (Blu-ray become a thing during my digital years).</p>
<p>Adding to my library has given me a lot of pleasure. As well as buying titles from obvious sites like Amazon, I’ve spent time on eBay tracking down titles which are no longer widely available, I now enjoy being dragged into charity shops by my daughter because, whilst she looks for vintage clothing, I can find and pick up some absolute bargains. And I’ve also rediscovered HMV.</p>
<p>I lived in London during the 1990s and I spent a fair amount of time (and money) in the HMV store on Oxford Street. Initially it would mainly have been on VHS tapes and computer games but I am pretty sure that I bought my first DVD player there in 1997 and I definitely bought my first DVD there. Fast forward 25 years and I rediscovered HMV; this time my local branches in Bath.</p>
<p>The original Bath store was a gloomy, slightly seedy place and it was split over three floors. The DVDs were down in the basement but there was a lot of floor space and therefore a wide variety of titles to browse. However, after 30 years it closed in January 2022 and a new store opened a few weeks later a short walk away. It is much brighter and more modern but it is also much smaller and accordingly it has a smaller selection of titles. However it is still a regular haunt and there is still a lot of pleasure to be found in popping in, having a good browse and deciding that there is a title or two I must just have.</p>
<p>And next time I am in London I will be going along to Oxford Street to visit the HMV store. It is going to be very different from when I was last there, and not just due to time. The original store closed in 2019 but it was re-opened a month ago in November 2023. Whilst Tower Records and the Virgin Megastore are long gone, it is lovely to have one of the giants back again.</p>
<p>I hope that HMV and other stores selling physical media are around for many more years. I hope that the love of physical media, whether it be DVD, Blu-ray, vinyl or CD continues and isn’t just driven by nostalgia and that genuine ownership of entertainment media continues to be valued. You do not have any tie-in to individual companies and the media cannot be altered or removed. And like any good collection, they have an intrinsic value and, as some titles become rare and sought-after, can even appreciate in value.</p>
<p>I will still subscribe to and watch the streaming services but I also hope that companies like Amazon and Netflix continue to release some, ideally more, of their own titles on physical media too. And maybe the fact that they do this at all should be the reassurance I need – even they realise that people do not want to be tied to their service forever and maybe they realise that they may not be around for 102 years like HMV has been.</p>Simon WolfThis morning the YouTube algorithm suggested a video called “Wait, what happened to HMV?” to me. It covered the decline and then revival of the company and ended wondering if it would survive with people buying physical albums on CD or vinyl or whether streaming or digital purchases would ‘win’. I’ve never been massively into music but I’ve always had a good collection of films and TV shows, first on VHS (mostly recorded rather than bought) and then on DVD. However, back in 2008 I embraced the arrival of Apple’s digital stores and I switched to buying films and TV shows from them. The arrival of the Apple TV and the iPad further cemented this and I built up a large library of digital media (over 500 films and over 100 TV shows). At the start of 2020 I started to fall out of love with some of Apple’s ecosystem. I stopped using Apple’s computers for work and as other problems occurred I would move away rather than trying to fix them. For example, ‘ownership’ of my contacts and calendar was migrated to Fastmail who I had used for a long time for email after iCloud decided to duplicate all of my contacts. And whilst this shift was happening I realised that my biggest tie-in was going to be my digital purchases. In early 2022 I decided that I wanted to start re-building my physical media library. My VHS tape collection was long gone but I had kept the majority of my DVDs so at least I was not starting from scratch. Initially I intended to just buy titles I did not already own but, as time has gone by, I have bought physical copies of some of the digital ones and I have bought Blu-ray versions of some of my old DVDs (Blu-ray become a thing during my digital years). Adding to my library has given me a lot of pleasure. As well as buying titles from obvious sites like Amazon, I’ve spent time on eBay tracking down titles which are no longer widely available, I now enjoy being dragged into charity shops by my daughter because, whilst she looks for vintage clothing, I can find and pick up some absolute bargains. And I’ve also rediscovered HMV. I lived in London during the 1990s and I spent a fair amount of time (and money) in the HMV store on Oxford Street. Initially it would mainly have been on VHS tapes and computer games but I am pretty sure that I bought my first DVD player there in 1997 and I definitely bought my first DVD there. Fast forward 25 years and I rediscovered HMV; this time my local branches in Bath. The original Bath store was a gloomy, slightly seedy place and it was split over three floors. The DVDs were down in the basement but there was a lot of floor space and therefore a wide variety of titles to browse. However, after 30 years it closed in January 2022 and a new store opened a few weeks later a short walk away. It is much brighter and more modern but it is also much smaller and accordingly it has a smaller selection of titles. However it is still a regular haunt and there is still a lot of pleasure to be found in popping in, having a good browse and deciding that there is a title or two I must just have. And next time I am in London I will be going along to Oxford Street to visit the HMV store. It is going to be very different from when I was last there, and not just due to time. The original store closed in 2019 but it was re-opened a month ago in November 2023. Whilst Tower Records and the Virgin Megastore are long gone, it is lovely to have one of the giants back again. I hope that HMV and other stores selling physical media are around for many more years. I hope that the love of physical media, whether it be DVD, Blu-ray, vinyl or CD continues and isn’t just driven by nostalgia and that genuine ownership of entertainment media continues to be valued. You do not have any tie-in to individual companies and the media cannot be altered or removed. And like any good collection, they have an intrinsic value and, as some titles become rare and sought-after, can even appreciate in value. I will still subscribe to and watch the streaming services but I also hope that companies like Amazon and Netflix continue to release some, ideally more, of their own titles on physical media too. And maybe the fact that they do this at all should be the reassurance I need – even they realise that people do not want to be tied to their service forever and maybe they realise that they may not be around for 102 years like HMV has been.15 Years of Twitter2023-05-20T08:00:00+01:002023-05-20T08:00:00+01:00https://blog.sgawolf.com/post/15-years-of-twitter<p>Today marks 15 years since I signed up for Twitter according to a notification they pushed to me.</p>
<p>It seemed like the perfect time to delete my account, partly so that I am in no way supporing what is becoming more and more a toxic environment, partly to stop me casually checking in and getting depressed or enraged by the posts their algorithm suggest to me, and partly to stop friends from sending me DMs which I am usually slow to respond to because I was not checking things regularly.</p>
<p>As I <a href="https://social.sgawolf.com/@simon/110401847039194961">posted on Mastodon</a>, it was a sad and hard decision because over the years Twitter has given me so much laughter, friendship, and jobs and it has also helped me learn so much about myself, the world and the technologies that are part of my work life.</p>
<p>Maybe Facebook will be next…</p>Simon WolfToday marks 15 years since I signed up for Twitter according to a notification they pushed to me. It seemed like the perfect time to delete my account, partly so that I am in no way supporing what is becoming more and more a toxic environment, partly to stop me casually checking in and getting depressed or enraged by the posts their algorithm suggest to me, and partly to stop friends from sending me DMs which I am usually slow to respond to because I was not checking things regularly. As I posted on Mastodon, it was a sad and hard decision because over the years Twitter has given me so much laughter, friendship, and jobs and it has also helped me learn so much about myself, the world and the technologies that are part of my work life. Maybe Facebook will be next…My Twitter Wind-Down2023-01-16T08:00:00+00:002023-01-16T08:00:00+00:00https://blog.sgawolf.com/post/twitter-wind-down<p>Last Friday Twitter disabled the API keys of the major Twitter clients, including Tweetbot, my client of choice, with no notice, and no communication with the app developers or their customers.</p>
<p>There was some uncertainty about whether this was deliberate or not but the silence from Twitter was followed by the Tweetbot developers switching to an alternative API key which was then also disabled so the presumption is that this was intended. Presumably the idea is to ‘encourage’ people to use the Twitter website or official apps.</p>
<p>I have used Twitter clients for most of my 14+ years on Twitter and they have the advantages or keeping your timeline in order, not showing adverts and not promoting tweets from random strangers. The official apps are horrible and I find all of the negativity and conflict on Twitter which they seem to actively promote terribly disheartening.</p>
<p>When I started using Mastodon more back in October last year I half-decided to mainly use Twitter in a form of read-only mode… I’d use it to see what friends and organisations I follow are doing but not actively post there unless I wanted to retweet or quote-tweet something. That had been working well and I had unfollowed a lot of people who had set up Mastodon accounts so the volume of new posts I would see was pretty minimal. Now that I am even less inclined to keep an eye on Twitter I am going to reduce the number of accounts I follow even further and I do not think it will be too long before Twitter is no longer something I use unless I really need to.</p>
<p>Twitter has generally been a wonderful experience for me and since I joined in 2008 when I was going to Apple’s developer conference and wanted a way to keep in touch with other attendees. I have met some wonderful people and formed many lasting friendships. I have not been involved in too many arguments or conflicts and discovering new products, services, companies and ideas has been invaluable. The sadness with it all falling apart for me is however tempered by an increasing conviction that Mastodon will slowly fill the void and I hope that, much like Twitter in the early years, companies and organisations will discover it and sign up and start to use it more and more.</p>
<p>Finally, because I’m essentially ‘retiring’ from Twitter I am removing the link to my account from my blog.</p>Simon WolfLast Friday Twitter disabled the API keys of the major Twitter clients, including Tweetbot, my client of choice, with no notice, and no communication with the app developers or their customers. There was some uncertainty about whether this was deliberate or not but the silence from Twitter was followed by the Tweetbot developers switching to an alternative API key which was then also disabled so the presumption is that this was intended. Presumably the idea is to ‘encourage’ people to use the Twitter website or official apps. I have used Twitter clients for most of my 14+ years on Twitter and they have the advantages or keeping your timeline in order, not showing adverts and not promoting tweets from random strangers. The official apps are horrible and I find all of the negativity and conflict on Twitter which they seem to actively promote terribly disheartening. When I started using Mastodon more back in October last year I half-decided to mainly use Twitter in a form of read-only mode… I’d use it to see what friends and organisations I follow are doing but not actively post there unless I wanted to retweet or quote-tweet something. That had been working well and I had unfollowed a lot of people who had set up Mastodon accounts so the volume of new posts I would see was pretty minimal. Now that I am even less inclined to keep an eye on Twitter I am going to reduce the number of accounts I follow even further and I do not think it will be too long before Twitter is no longer something I use unless I really need to. Twitter has generally been a wonderful experience for me and since I joined in 2008 when I was going to Apple’s developer conference and wanted a way to keep in touch with other attendees. I have met some wonderful people and formed many lasting friendships. I have not been involved in too many arguments or conflicts and discovering new products, services, companies and ideas has been invaluable. The sadness with it all falling apart for me is however tempered by an increasing conviction that Mastodon will slowly fill the void and I hope that, much like Twitter in the early years, companies and organisations will discover it and sign up and start to use it more and more. Finally, because I’m essentially ‘retiring’ from Twitter I am removing the link to my account from my blog.My Git Notes2022-12-14T12:00:00+00:002022-12-14T12:00:00+00:00https://blog.sgawolf.com/post/my-git-notes<p>This blog post is a personal reference in that I wanted to document the <a href="https://git-scm.com/">Git</a> commands I use the most now that I use the command line more and more. I am publishing it as a blog post so that I can refer back to it quickly and easily. It is not a complete guide and is likely to be updated regularly.</p>
<h1 id="branching">Branching</h1>
<p>List the local and remote branches:</p>
<p><code class="language-plaintext highlighter-rouge">git branch -a</code></p>
<p>Create the specified branch and check it out:</p>
<p><code class="language-plaintext highlighter-rouge">git checkout -b <new-branch></code></p>
<p>Check out the specified branch:</p>
<p><code class="language-plaintext highlighter-rouge">git checkout <branch></code></p>
<p>Check out a remote branch.</p>
<p><code class="language-plaintext highlighter-rouge">git checkout -b <branch> origin/<branch></code></p>
<p>Delete the specified branch but only if all changes have been merged:</p>
<p><code class="language-plaintext highlighter-rouge">git branch -d <branch></code></p>
<p>Force delete the specified branch:</p>
<p><code class="language-plaintext highlighter-rouge">git branch -D <branch></code></p>
<p>Delete the specified remote branch but only if all changes have been merged:</p>
<p><code class="language-plaintext highlighter-rouge">git push origin -d <branch></code></p>
<p>Rename the current branch to <code class="language-plaintext highlighter-rouge"><branch></code>:</p>
<p><code class="language-plaintext highlighter-rouge">git branch -m <branch></code></p>
<p>Remove local branches that have been tracking remote branches that have been deleted:</p>
<p><code class="language-plaintext highlighter-rouge">git fetch --prune</code> or <code class="language-plaintext highlighter-rouge">git remote prune origin</code></p>
<h1 id="reviewing--changing-history">Reviewing & Changing History</h1>
<p>List commits:</p>
<p><code class="language-plaintext highlighter-rouge">git log</code></p>
<p>Show the details (including the diff) of the last commit:</p>
<p><code class="language-plaintext highlighter-rouge">git show --source</code></p>
<p>Edit the last commit message. Files can also be added via <code class="language-plaintext highlighter-rouge">git add <filename></code> or removed via <code class="language-plaintext highlighter-rouge">git rm <filename></code> before running this command.</p>
<p><code class="language-plaintext highlighter-rouge">git commit --amend</code></p>
<p><em>If the commit has been pushed then the <code class="language-plaintext highlighter-rouge">--force</code> parameter will be needed: <code class="language-plaintext highlighter-rouge">git push --force</code> (note that this is more dangerous with repositories which others may be using).</em></p>Simon WolfThis blog post is a personal reference in that I wanted to document the Git commands I use the most now that I use the command line more and more. I am publishing it as a blog post so that I can refer back to it quickly and easily. It is not a complete guide and is likely to be updated regularly. Branching List the local and remote branches: git branch -a Create the specified branch and check it out: git checkout -b <new-branch> Check out the specified branch: git checkout <branch> Check out a remote branch. git checkout -b <branch> origin/<branch> Delete the specified branch but only if all changes have been merged: git branch -d <branch> Force delete the specified branch: git branch -D <branch> Delete the specified remote branch but only if all changes have been merged: git push origin -d <branch> Rename the current branch to <branch>: git branch -m <branch> Remove local branches that have been tracking remote branches that have been deleted: git fetch --prune or git remote prune origin Reviewing & Changing History List commits: git log Show the details (including the diff) of the last commit: git show --source Edit the last commit message. Files can also be added via git add <filename> or removed via git rm <filename> before running this command. git commit --amend If the commit has been pushed then the --force parameter will be needed: git push --force (note that this is more dangerous with repositories which others may be using).Mastodon2022-10-30T12:00:00+00:002022-10-30T12:00:00+00:00https://blog.sgawolf.com/post/mastodon<p>If you use Twitter and are seeing this blog post then there is a good chance you know that <a href="https://joinmastodon.org/">Mastodon</a> is an alternative social network which is similar to Twitter but with enough differences to make it seem odd.</p>
<p>I’ve tried to use it before but have always had a problem in that it was just really, really quiet whilst Twitter provides me with hundreds of messages a day to skim over.</p>
<p>But this weekend things started to change and, after Elon Musk bought Twitter, Mastodon saw a surge in users and it became a much more lively place… comparatively anyway.</p>
<p>I’m going to try an experiment for a little while. I’m going to try having more of my social media interactions over on Mastodon (you can find me at <a href="https://social.sgawolf.com/@simon">@simonw@social.sgawolf.com</a>) and use Twitter for what I will call ‘read-only information gathering’.</p>
<p>If you want to try Mastodon then that would be great but it is not as straightforward as Twitter so here are some pointers…</p>
<p>Think of your username and account as being more like email than a Twitter handle. There are numerous servers (also called instances) which comprise the service and they may come and go over time because, at the moment, they are largely run by individuals. Like changing your email address when you switch to a different service, you can move your Mastodon account from one instance to another (there is some detailed information about it <a href="https://docs.joinmastodon.org/user/moving/">here</a>). You can also run your own instance if you want to and this may be what larger organisations start to do if Mastodon becomes more popular. If you want complete control over your messages and to have your own, more permanent identity without running a dedicated server then there are also Mastodon hosting providers you can use. More details about running your own server and hosting options are <a href="https://docs.joinmastodon.org/user/run-your-own/">here</a>.</p>
<blockquote>
<p>After starting out on the https://mastodon.social server which was getting hammered by load as people migrated to it I decided to try a hosted server and I am using <a href="https://masto.host/">mastohost</a>. Hugo who runs it was incredibly quick to help me out with a DNS issue (add a <code class="language-plaintext highlighter-rouge">.</code> at the end of the CNAME value if your registrar appends the domain name automatically).</p>
</blockquote>
<p>Each server has its own public timeline of messages posted by people on that instance. It is easy to browse and this is one of the reasons why the suggestion is that you join a server which is hosting like-minded people. You’ll meet new people who have the same interests as you.</p>
<p>Each server’s moderator(s) can view your public posts and your direct messages so do not consider it as a private, secure messaging system. There are plenty of other services and ways to swap private messages with people but Mastodon is probably not one of them.</p>
<p>And that’s the basics of it. Pick an instance and start meeting people. It may or may not take off in the same way that Twitter has and it may not be a long-term thing but it is always fun to try something news, particularly when the old things are stale and pretty hostile, even if you try to keep within your own bubble.</p>Simon WolfIf you use Twitter and are seeing this blog post then there is a good chance you know that Mastodon is an alternative social network which is similar to Twitter but with enough differences to make it seem odd. I’ve tried to use it before but have always had a problem in that it was just really, really quiet whilst Twitter provides me with hundreds of messages a day to skim over. But this weekend things started to change and, after Elon Musk bought Twitter, Mastodon saw a surge in users and it became a much more lively place… comparatively anyway. I’m going to try an experiment for a little while. I’m going to try having more of my social media interactions over on Mastodon (you can find me at @simonw@social.sgawolf.com) and use Twitter for what I will call ‘read-only information gathering’. If you want to try Mastodon then that would be great but it is not as straightforward as Twitter so here are some pointers… Think of your username and account as being more like email than a Twitter handle. There are numerous servers (also called instances) which comprise the service and they may come and go over time because, at the moment, they are largely run by individuals. Like changing your email address when you switch to a different service, you can move your Mastodon account from one instance to another (there is some detailed information about it here). You can also run your own instance if you want to and this may be what larger organisations start to do if Mastodon becomes more popular. If you want complete control over your messages and to have your own, more permanent identity without running a dedicated server then there are also Mastodon hosting providers you can use. More details about running your own server and hosting options are here. After starting out on the https://mastodon.social server which was getting hammered by load as people migrated to it I decided to try a hosted server and I am using mastohost. Hugo who runs it was incredibly quick to help me out with a DNS issue (add a . at the end of the CNAME value if your registrar appends the domain name automatically). Each server has its own public timeline of messages posted by people on that instance. It is easy to browse and this is one of the reasons why the suggestion is that you join a server which is hosting like-minded people. You’ll meet new people who have the same interests as you. Each server’s moderator(s) can view your public posts and your direct messages so do not consider it as a private, secure messaging system. There are plenty of other services and ways to swap private messages with people but Mastodon is probably not one of them. And that’s the basics of it. Pick an instance and start meeting people. It may or may not take off in the same way that Twitter has and it may not be a long-term thing but it is always fun to try something news, particularly when the old things are stale and pretty hostile, even if you try to keep within your own bubble.NixOS, Phoenix and Sass2022-07-27T12:00:00+01:002022-07-27T12:00:00+01:00https://blog.sgawolf.com/post/nixos-phoenix-and-sass<p><a href="https://elixir-lang.org/">Elixir’s</a> web application framework, <a href="https://www.phoenixframework.org/">Phoenix</a>, is moving away from needing a dependency on <a href="https://nodejs.org/en/">Node</a> to make projects easier to maintain and thing in general just a bit simpler. The most recent step towards this was the release of a <a href="https://github.com/phoenixframework/tailwind">Tailwind Elixir library</a> which installs and runs a standalone copy of the Tailwind CLI.</p>
<blockquote>
<p>If you don’t need <a href="https://alpinejs.dev/">Alpine.js</a> then you can probably be Node-free in your Phoenix projects right now.</p>
</blockquote>
<p>A really good guide to incorporating Tailwind into a Phoenix project is <a href="https://pragmaticstudio.com/tutorials/adding-tailwind-css-to-phoenix">Adding Tailwind CSS to Phoenix 1.6</a> by <a href="https://twitter.com/clarkware">Mike Clark</a>, one half of the excellent Pragmatic Studio team.</p>
<p>About half way through that tutorial he covers Nested CSS with DartSass which relies on the <a href="https://github.com/CargoSense/dart_sass">DartSass Elixir Library</a> which installs and runs a dart-sass implementation.</p>
<p>Unfortunately the pre-built binary of dart-sass which gets installed into your <code class="language-plaintext highlighter-rouge">_build</code> folder is a dynamic binary and dynamic binaries don’t work on <a href="https://nixos.org/">NixOS</a> because it does not conform to the <a href="https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard">Filesystem Hierarchy Standard</a> of Linux.</p>
<blockquote>
<p>A dynamic binary loads code from external binaries (.so files) while in a static binary any library code is included in the binary at build time (from static .a libraries).</p>
</blockquote>
<p>Fortunately there are various solutions to this and the one I will cover uses <a href="https://github.com/Mic92/nix-ld">nix-ld</a>.</p>
<p>The project’s README does a good job of explaining how nix-ld works its magic and how you can use it so I’ll just cover the steps I followed to get DartSass working for my Phoenix project.</p>
<p>I use a <a href="https://nixos.org/manual/nix/stable/command-ref/nix-shell.html"><code class="language-plaintext highlighter-rouge">nix-shell</code></a> to create a development environment for my Phoenix project. Here is my <code class="language-plaintext highlighter-rouge">shell.nix</code> file:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>{ pkgs ? import <nixpkgs> {} }:
with pkgs;
let
inherit (lib) optional optionals;
erlang = beam.interpreters.erlangR24;
elixir = beam.packages.erlangR24.elixir_1_13;
nodejs = nodejs-14_x;
sass_version = "1.53.0";
sass_src = fetchurl {
url = "https://github.com/sass/dart-sass/releases/download/${sass_version}/dart-sass-${sass_version}-linux-x64.tar.gz";
sha256 = "MXSHrU96WHQMNgxKPPyHdIl8+wXI2KL7cNvDsWZoZKI=";
};
in
mkShell {
buildInputs = [
cacert
erlang
elixir
file
nodejs
rebar3
inotify-tools
];
NIX_LD_LIBRARY_PATH = lib.makeLibraryPath [
stdenv.cc
];
NIX_LD = builtins.readFile "${stdenv.cc}/nix-support/dynamic-linker";
shellHook = ''
# this allows mix to work on the local directory
mkdir -p .nix-mix
mkdir -p .nix-hex
export MIX_HOME=$PWD/.nix-mix
export HEX_HOME=$PWD/.nix-hex
export PATH=$MIX_HOME/bin:$PATH
export PATH=$HEX_HOME/bin:$PATH
export LANG=en_US.UTF-8
export ERL_AFLAGS="-kernel shell_history enabled"
if [ ! -d .sass ]; then
echo "Unpack sass..."
mkdir .sass
tar -C .sass -xf ${sass_src}
fi
export LD_LIBRARY_PATH=$PWD/.sass/dart-sass/
export MIX_SASS_PATH=$PWD/.sass/dart-sass/sass
export MIX_SASS_VERSION=${sass_version}
'';
}
</code></pre></div></div>
<p>Breaking out the DartSass elements…</p>
<p>We define the version, URL and SHA-256 hash for the DartSass binary file we are going to download and use.</p>
<blockquote>
<p>The lazy way to find hashes is to set them to 52 zeros and then NixOS will show an error saying that the SHA is invalid and show you what the file’s actual SHA is.</p>
</blockquote>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> sass_version = "1.53.0";
sass_src = fetchurl {
url = "https://github.com/sass/dart-sass/releases/download/${sass_version}/dart-sass-${sass_version}-linux-x64.tar.gz";
sha256 = "MXSHrU96WHQMNgxKPPyHdIl8+wXI2KL7cNvDsWZoZKI=";
};
</code></pre></div></div>
<p>DartSass only links to standard libraries so we just need to use <code class="language-plaintext highlighter-rouge">stdenv.cc</code> to shim things.</p>
<blockquote>
<p>If you download a pre-built binary and then run <code class="language-plaintext highlighter-rouge">ldd sass-linux-x64</code> you will see the libraries that the program needs.</p>
</blockquote>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> NIX_LD_LIBRARY_PATH = lib.makeLibraryPath [
stdenv.cc
];
NIX_LD = builtins.readFile "${stdenv.cc}/nix-support/dynamic-linker";
</code></pre></div></div>
<p>In the <code class="language-plaintext highlighter-rouge">shellHook</code> we store our downloaded binary if it is not already there. I store it in a folder called <code class="language-plaintext highlighter-rouge">.sass</code> which can be easily included in my <code class="language-plaintext highlighter-rouge">.gitignore</code> file. The path of the folder containing the binary is then stored in the <code class="language-plaintext highlighter-rouge">LD_LIBRARY_PATH</code> environmental variable.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> if [ ! -d .sass ]; then
echo "Unpack sass..."
mkdir .sass
tar -C .sass -xf ${sass_src}
fi
export LD_LIBRARY_PATH=$PWD/.sass/dart-sass/
</code></pre></div></div>
<p>And that is all that is needed to shim the DartSass binary so that it will run under NixOS.</p>
<p>However two other environmental variables are set which then help with our Phoenix configuration:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> export MIX_SASS_PATH=$PWD/.sass/dart-sass/sass
export MIX_SASS_VERSION=${sass_version}
</code></pre></div></div>
<p>The first is the path to the <code class="language-plaintext highlighter-rouge">sass</code> executable file. The second is the version of DartSass we have used. These allow us to configure DartSass in the <code class="language-plaintext highlighter-rouge">config/config.exs</code> file in a way which allows the same code to be used in NixOS or another distribution:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># Configure DartSass
config :dart_sass,
version: System.get_env("MIX_SASS_VERSION", "1.49.11"),
path: System.get_env("MIX_SASS_PATH"),
default: [
args: ~w(css/app.scss ../priv/static/assets/app.tailwind.css),
cd: Path.expand("../assets", __DIR__)
]
</code></pre></div></div>
<p>We set the <code class="language-plaintext highlighter-rouge">version</code> to the one we downloaded or, if the environmental variable does not exist, we use the version that the DartSass Elixir Library uses. This is probably the version listed in <a href="https://hexdocs.pm/dart_sass/DartSass.html#module-profiles">the DartSass documentation</a>.</p>
<p>We set the <code class="language-plaintext highlighter-rouge">path</code> to the one we defined in the environmental variable but if that does not exist then the config will automatically fall back on the default location DartSass uses which is in the <code class="language-plaintext highlighter-rouge">_build</code> folder.</p>
<p>And that’s it. You don’t need to fall back on the Node version of Sass (even if you are using Node for something like Alpine.js) and your Phoenix project will now work on both your NixOS machines in a <code class="language-plaintext highlighter-rouge">nix-shell</code> environment or on any other distribution where you don’t need to worry about dynamic binaries.</p>Simon WolfElixir’s web application framework, Phoenix, is moving away from needing a dependency on Node to make projects easier to maintain and thing in general just a bit simpler. The most recent step towards this was the release of a Tailwind Elixir library which installs and runs a standalone copy of the Tailwind CLI. If you don’t need Alpine.js then you can probably be Node-free in your Phoenix projects right now. A really good guide to incorporating Tailwind into a Phoenix project is Adding Tailwind CSS to Phoenix 1.6 by Mike Clark, one half of the excellent Pragmatic Studio team. About half way through that tutorial he covers Nested CSS with DartSass which relies on the DartSass Elixir Library which installs and runs a dart-sass implementation. Unfortunately the pre-built binary of dart-sass which gets installed into your _build folder is a dynamic binary and dynamic binaries don’t work on NixOS because it does not conform to the Filesystem Hierarchy Standard of Linux. A dynamic binary loads code from external binaries (.so files) while in a static binary any library code is included in the binary at build time (from static .a libraries). Fortunately there are various solutions to this and the one I will cover uses nix-ld. The project’s README does a good job of explaining how nix-ld works its magic and how you can use it so I’ll just cover the steps I followed to get DartSass working for my Phoenix project. I use a nix-shell to create a development environment for my Phoenix project. Here is my shell.nix file: { pkgs ? import <nixpkgs> {} }: with pkgs; let inherit (lib) optional optionals; erlang = beam.interpreters.erlangR24; elixir = beam.packages.erlangR24.elixir_1_13; nodejs = nodejs-14_x; sass_version = "1.53.0"; sass_src = fetchurl { url = "https://github.com/sass/dart-sass/releases/download/${sass_version}/dart-sass-${sass_version}-linux-x64.tar.gz"; sha256 = "MXSHrU96WHQMNgxKPPyHdIl8+wXI2KL7cNvDsWZoZKI="; }; in mkShell { buildInputs = [ cacert erlang elixir file nodejs rebar3 inotify-tools ]; NIX_LD_LIBRARY_PATH = lib.makeLibraryPath [ stdenv.cc ]; NIX_LD = builtins.readFile "${stdenv.cc}/nix-support/dynamic-linker"; shellHook = '' # this allows mix to work on the local directory mkdir -p .nix-mix mkdir -p .nix-hex export MIX_HOME=$PWD/.nix-mix export HEX_HOME=$PWD/.nix-hex export PATH=$MIX_HOME/bin:$PATH export PATH=$HEX_HOME/bin:$PATH export LANG=en_US.UTF-8 export ERL_AFLAGS="-kernel shell_history enabled" if [ ! -d .sass ]; then echo "Unpack sass..." mkdir .sass tar -C .sass -xf ${sass_src} fi export LD_LIBRARY_PATH=$PWD/.sass/dart-sass/ export MIX_SASS_PATH=$PWD/.sass/dart-sass/sass export MIX_SASS_VERSION=${sass_version} ''; } Breaking out the DartSass elements… We define the version, URL and SHA-256 hash for the DartSass binary file we are going to download and use. The lazy way to find hashes is to set them to 52 zeros and then NixOS will show an error saying that the SHA is invalid and show you what the file’s actual SHA is. sass_version = "1.53.0"; sass_src = fetchurl { url = "https://github.com/sass/dart-sass/releases/download/${sass_version}/dart-sass-${sass_version}-linux-x64.tar.gz"; sha256 = "MXSHrU96WHQMNgxKPPyHdIl8+wXI2KL7cNvDsWZoZKI="; }; DartSass only links to standard libraries so we just need to use stdenv.cc to shim things. If you download a pre-built binary and then run ldd sass-linux-x64 you will see the libraries that the program needs. NIX_LD_LIBRARY_PATH = lib.makeLibraryPath [ stdenv.cc ]; NIX_LD = builtins.readFile "${stdenv.cc}/nix-support/dynamic-linker"; In the shellHook we store our downloaded binary if it is not already there. I store it in a folder called .sass which can be easily included in my .gitignore file. The path of the folder containing the binary is then stored in the LD_LIBRARY_PATH environmental variable. if [ ! -d .sass ]; then echo "Unpack sass..." mkdir .sass tar -C .sass -xf ${sass_src} fi export LD_LIBRARY_PATH=$PWD/.sass/dart-sass/ And that is all that is needed to shim the DartSass binary so that it will run under NixOS. However two other environmental variables are set which then help with our Phoenix configuration: export MIX_SASS_PATH=$PWD/.sass/dart-sass/sass export MIX_SASS_VERSION=${sass_version} The first is the path to the sass executable file. The second is the version of DartSass we have used. These allow us to configure DartSass in the config/config.exs file in a way which allows the same code to be used in NixOS or another distribution: # Configure DartSass config :dart_sass, version: System.get_env("MIX_SASS_VERSION", "1.49.11"), path: System.get_env("MIX_SASS_PATH"), default: [ args: ~w(css/app.scss ../priv/static/assets/app.tailwind.css), cd: Path.expand("../assets", __DIR__) ] We set the version to the one we downloaded or, if the environmental variable does not exist, we use the version that the DartSass Elixir Library uses. This is probably the version listed in the DartSass documentation. We set the path to the one we defined in the environmental variable but if that does not exist then the config will automatically fall back on the default location DartSass uses which is in the _build folder. And that’s it. You don’t need to fall back on the Node version of Sass (even if you are using Node for something like Alpine.js) and your Phoenix project will now work on both your NixOS machines in a nix-shell environment or on any other distribution where you don’t need to worry about dynamic binaries.My Linux Life2022-05-22T12:00:00+01:002022-05-22T12:00:00+01:00https://blog.sgawolf.com/post/my-linux-life<h2 id="introduction">Introduction</h2>
<p>After I wrote about my love of <a href="https://starlabs.systems">StarLabs’s</a> 11” laptop, <a href="https://starlabs.systems/pages/starlite">the StarLite</a>, someone asked me about the software I run on it, how I work with people who use Windows and macOS and whether things like using a laptop with 8GB of RAM is a problem. It all seems like good content for a follow-up on my original posts about switching to Linux from <a href="https://swwritings.com/post/2020-01-19-the-year-of-linux-on-my-desktop">January 2020</a> and <a href="https://swwritings.com/post/2020-02-19-the-month-of-linux-on-my-desktop">the follow-up</a> I wrote the following month.</p>
<p>As I mentioned yesterday, my laptop is a StarLite and my main work machine is, as per my blog post from February 2020, still the Hades Canyon NUC.</p>
<h2 id="software">Software</h2>
<p><strong>Operating Systems</strong></p>
<p>On my desktop computer I’m still using <a href="https://ubuntu.com/">Ubuntu</a> 20.04. I’m currently undecided if I will simply update to 22.04 or move over to <a href="https://getfedora.org/">Fedora</a> or <a href="https://nixos.org/">NixOS</a>.</p>
<p>My 2nd generation StarLite has been used to try out various flavours of Linux and to try window managers instead of desktop environments <a href="https://www.linuxfordevices.com/tutorials/linux/desktop-environment-vs-window-manager">explanation</a>. It currently has NixOS installed on it and I will be carrying on playing with it and seeing if I can get comfortable enough to switch to it on my desktop or not. I need to learn more about NixOS packages before I can get an up-to-date version of <a href="https://www.meteor.com/">Meteor</a> installed properly for example.</p>
<p>My 4th generation StarLite will be set up with Fedora. This will allow me to install everything I need to work with easily so that my NixOS journey doesn’t hold things back.</p>
<p>All three computers use the <a href="https://www.gnome.org/">GNOME</a> desktop but as part of my NixOS tinkering I will be playing with window managers again. This is mainly because I really like keyboard-driven environments but they are also less resource intensive than a full desktop environment so would be an added bonus on my StarLite.</p>
<p><strong>Software Development</strong></p>
<p>Until mid-April I’d spent three years working at <a href="https://www.sketch.com/">Sketch</a> as a backend developer but I am now self-employed again and working in the family business that my sister and I co-own, <a href="https://mindme.care/">Mindme</a>. I’m still focusing on writing <a href="https://elixir-lang.org/">Elixir</a> code along with some <a href="https://www.python.org/">Python</a> so the only major change to my development requirements has been not needing Docker any more.</p>
<p>I use <a href="https://code.visualstudio.com/">VSCode</a> as my code editor and even when I was still using macOS I would use VS Code for Python development. It’s a great IDE and is very versatile and has some incredibly useful plugins.</p>
<p>I’m a bit of a Git klutz so don’t just rely on using it from the command line. For the last couple of years I have been using <a href="https://www.gitkraken.com/">GitKraken</a> which is great but it contains more and more features I don’t need. I’ve been trying <a href="https://github.com/jesseduffield/lazygit">LazyGit</a> as a possible alternative and it is really good but I’m not comfortable enough to switch to it entirely yet.</p>
<p>For managing programming languages I use <a href="https://asdf-vm.com/">asdf</a> and the only time I might use something else in the foreseeable future is NixOS’s <a href="https://nixos.wiki/wiki/Development_environment_with_nix-shell">nix-shell</a> feature which allows you to define and run fully containerised development environments meaning that you can run specific versions of Python or Elixir or a database server for each project you are working on. In very simple terms it could be thought of as an alternative to Docker.</p>
<p>Other development tools I use or am trying include:</p>
<ul>
<li><a href="https://insomnia.rest/">Insomnia</a> as an API client.</li>
<li><a href="https://www.beekeeperstudio.io/">Beekeeper Studio</a> as a SQL client.</li>
</ul>
<p><strong>Office & Admin</strong></p>
<p><a href="https://www.libreoffice.org/">LibraOffice</a> is my go-to replacement for Word/Pages, Excel/Numbers and PowerPoint/Keynote. It seems to handle opening and editing Microsoft Office documents without much drama and can save documents in the <a href="https://opendocumentformat.org/">OpenDocument Format</a> or as MS Office files.</p>
<p>I use <a href="https://www.thunderbird.net/en-GB/">Thunderbird</a> for emails, contacts and calendar and I use <a href="https://www.fastmail.com/">FastMail</a> as the provider/host for all three after giving up on iCloud for contact and calendar management after a second occurrence of having things duplicated. The native iOS Mail, Calendar and Contacts apps can all connect to third-party services so this is not a problem.</p>
<p>I use <a href="https://www.mozilla.org/en-GB/firefox/">Firefox</a> as my web browser and I also use it on my iOS devices with synchronisation enabled between them all.</p>
<p>I use <a href="https://daringfireball.net/projects/markdown/">Markdown</a> a lot for writing and I’ve been using <a href="https://typora.io/">Typora</a> on my desktop but it is very Ubuntu-centric and doesn’t have installers for other distributions so I may have to find something else if I start using Fedora as my main distro. Fortunately there are a lot of alternatives available and maybe I’ll finally start using <a href="https://www.vim.org/">Vim</a> as a replacement.</p>
<p>I still use <a href="https://www.dropbox.com">Dropbox</a> but might switch to a private instance of <a href="https://nextcloud.com/">Nextcloud</a>.</p>
<p><strong>Productivity / Other</strong></p>
<p>Other applications I tend to use are:</p>
<ul>
<li><a href="https://telegram.org/">Telegram</a>, <a href="https://www.signal.org/">Signal</a> and <a href="https://www.whatsapp.com/">WhatsApp</a> for messaging.</li>
<li><a href="https://1password.com/">1Password</a> as my password manager.</li>
<li><a href="https://teams.microsoft.com">Microsoft Teams</a> and <a href="https://zoom.us/">Zoom</a> for video calls.</li>
<li><a href="https://www.virtualbox.org/">Oracle VM VirtualBox</a> for virtualization which for me is running Windows 10 to configure the GPS devices we sell.</li>
</ul>
<h2 id="cross-platform-compatibility">Cross-Platform Compatibility</h2>
<p>If you look at the list of applications I use then I think that almost all are cross-platform (Typora is too but, as mentioned above, it has limited installation options for non-Ubuntu Linux distributions).</p>
<p>In terms of documents, LibreOffice seems to handle what has usually been the biggest pain-point admirably. Most documents seem to be Word or Excel files and handling them in non-Microsoft applications is pretty good these days.</p>
<p>I do have problems if someone sends me an Apple Pages, Numbers or Keynote document but they can usually either convert then to the Word, Excel or PowerPoint equivalent or I do it myself on one of my iOS devices.</p>
<p>iMessage is obviously restricted to my iOS devices but other messaging services like Signal or Telegram or WhatsApp are all available for Linux (WhatsApp in a browser).</p>
<h2 id="lower-spec-hardware">Lower Spec Hardware</h2>
<p>Having covered all of that, how does this sort of setup work with a low spec computer, and in my case, a laptop with 8GB of RAM?</p>
<p>The short answer is that it is perfectly fine for me. I don’t notice things being slow or have to sit and wait as things chug along, probably because the StarLite comes with a very respectable SSD so even if memory is paging to the drive it tends not to be a big problem.</p>
<p>You need to be careful of things like Firefox which can chew through RAM if you have a lot of tabs open but for part-time development, some office work and general web browsing or YouTube video watching a low RAM machine is more than adequate.</p>
<p>One of the joys of Linux is that there are distributions which are designed for older or lower spec hardware but the mainstream distributions and desktop environments will run perfectly well and be completely usable on something like the StarLite which, you have to remember, has been designed and built for running mainstream Linux distributions.</p>
<h2 id="some-final-thoughts">Some Final Thoughts</h2>
<p>After two years of using Linux I have no plans to go back to using Windows or macOS. I’m lucky that my confidence with computers allows me to try new things so there is no great inertia caused by familiarity and I am also lucky that my work does not need me to use a specific operating system (if I were still developing macOS or iOS apps I’d have to use a Mac).</p>
<p>Linux these days is a world away from where it was when I first tried it in the early 2000s and it is stable, easy to maintain, well supported and getting more and more polished. Of course there are some rough edges and the tight integration between things like iOS and macOS is missing as are some of the integrations you get between apps in macOS or iOS.</p>
<p>I don’t expect Linux to become as mainstream or well known as Windows or macOS but it does provide a great alternative and as manufacturers create more and more computers which are designed for or come pre-installed with Linux then the barriers to entry get lower and lower. It is a viable alternative to Windows or macOS and even if you are not driven by the ideology of <a href="https://opensource.com/resources/what-open-source">open source software</a> then it may just provide you with a comfortable, stable and functional computring environment which is not being driven by marketing requirements and the need to innovate and re-invent itself every few years.</p>Simon WolfIntroduction After I wrote about my love of StarLabs’s 11” laptop, the StarLite, someone asked me about the software I run on it, how I work with people who use Windows and macOS and whether things like using a laptop with 8GB of RAM is a problem. It all seems like good content for a follow-up on my original posts about switching to Linux from January 2020 and the follow-up I wrote the following month. As I mentioned yesterday, my laptop is a StarLite and my main work machine is, as per my blog post from February 2020, still the Hades Canyon NUC. Software Operating Systems On my desktop computer I’m still using Ubuntu 20.04. I’m currently undecided if I will simply update to 22.04 or move over to Fedora or NixOS. My 2nd generation StarLite has been used to try out various flavours of Linux and to try window managers instead of desktop environments explanation. It currently has NixOS installed on it and I will be carrying on playing with it and seeing if I can get comfortable enough to switch to it on my desktop or not. I need to learn more about NixOS packages before I can get an up-to-date version of Meteor installed properly for example. My 4th generation StarLite will be set up with Fedora. This will allow me to install everything I need to work with easily so that my NixOS journey doesn’t hold things back. All three computers use the GNOME desktop but as part of my NixOS tinkering I will be playing with window managers again. This is mainly because I really like keyboard-driven environments but they are also less resource intensive than a full desktop environment so would be an added bonus on my StarLite. Software Development Until mid-April I’d spent three years working at Sketch as a backend developer but I am now self-employed again and working in the family business that my sister and I co-own, Mindme. I’m still focusing on writing Elixir code along with some Python so the only major change to my development requirements has been not needing Docker any more. I use VSCode as my code editor and even when I was still using macOS I would use VS Code for Python development. It’s a great IDE and is very versatile and has some incredibly useful plugins. I’m a bit of a Git klutz so don’t just rely on using it from the command line. For the last couple of years I have been using GitKraken which is great but it contains more and more features I don’t need. I’ve been trying LazyGit as a possible alternative and it is really good but I’m not comfortable enough to switch to it entirely yet. For managing programming languages I use asdf and the only time I might use something else in the foreseeable future is NixOS’s nix-shell feature which allows you to define and run fully containerised development environments meaning that you can run specific versions of Python or Elixir or a database server for each project you are working on. In very simple terms it could be thought of as an alternative to Docker. Other development tools I use or am trying include: Insomnia as an API client. Beekeeper Studio as a SQL client. Office & Admin LibraOffice is my go-to replacement for Word/Pages, Excel/Numbers and PowerPoint/Keynote. It seems to handle opening and editing Microsoft Office documents without much drama and can save documents in the OpenDocument Format or as MS Office files. I use Thunderbird for emails, contacts and calendar and I use FastMail as the provider/host for all three after giving up on iCloud for contact and calendar management after a second occurrence of having things duplicated. The native iOS Mail, Calendar and Contacts apps can all connect to third-party services so this is not a problem. I use Firefox as my web browser and I also use it on my iOS devices with synchronisation enabled between them all. I use Markdown a lot for writing and I’ve been using Typora on my desktop but it is very Ubuntu-centric and doesn’t have installers for other distributions so I may have to find something else if I start using Fedora as my main distro. Fortunately there are a lot of alternatives available and maybe I’ll finally start using Vim as a replacement. I still use Dropbox but might switch to a private instance of Nextcloud. Productivity / Other Other applications I tend to use are: Telegram, Signal and WhatsApp for messaging. 1Password as my password manager. Microsoft Teams and Zoom for video calls. Oracle VM VirtualBox for virtualization which for me is running Windows 10 to configure the GPS devices we sell. Cross-Platform Compatibility If you look at the list of applications I use then I think that almost all are cross-platform (Typora is too but, as mentioned above, it has limited installation options for non-Ubuntu Linux distributions). In terms of documents, LibreOffice seems to handle what has usually been the biggest pain-point admirably. Most documents seem to be Word or Excel files and handling them in non-Microsoft applications is pretty good these days. I do have problems if someone sends me an Apple Pages, Numbers or Keynote document but they can usually either convert then to the Word, Excel or PowerPoint equivalent or I do it myself on one of my iOS devices. iMessage is obviously restricted to my iOS devices but other messaging services like Signal or Telegram or WhatsApp are all available for Linux (WhatsApp in a browser). Lower Spec Hardware Having covered all of that, how does this sort of setup work with a low spec computer, and in my case, a laptop with 8GB of RAM? The short answer is that it is perfectly fine for me. I don’t notice things being slow or have to sit and wait as things chug along, probably because the StarLite comes with a very respectable SSD so even if memory is paging to the drive it tends not to be a big problem. You need to be careful of things like Firefox which can chew through RAM if you have a lot of tabs open but for part-time development, some office work and general web browsing or YouTube video watching a low RAM machine is more than adequate. One of the joys of Linux is that there are distributions which are designed for older or lower spec hardware but the mainstream distributions and desktop environments will run perfectly well and be completely usable on something like the StarLite which, you have to remember, has been designed and built for running mainstream Linux distributions. Some Final Thoughts After two years of using Linux I have no plans to go back to using Windows or macOS. I’m lucky that my confidence with computers allows me to try new things so there is no great inertia caused by familiarity and I am also lucky that my work does not need me to use a specific operating system (if I were still developing macOS or iOS apps I’d have to use a Mac). Linux these days is a world away from where it was when I first tried it in the early 2000s and it is stable, easy to maintain, well supported and getting more and more polished. Of course there are some rough edges and the tight integration between things like iOS and macOS is missing as are some of the integrations you get between apps in macOS or iOS. I don’t expect Linux to become as mainstream or well known as Windows or macOS but it does provide a great alternative and as manufacturers create more and more computers which are designed for or come pre-installed with Linux then the barriers to entry get lower and lower. It is a viable alternative to Windows or macOS and even if you are not driven by the ideology of open source software then it may just provide you with a comfortable, stable and functional computring environment which is not being driven by marketing requirements and the need to innovate and re-invent itself every few years.The StarLite Laptop2022-05-19T14:00:00+01:002022-05-19T14:00:00+01:00https://blog.sgawolf.com/post/starlite-laptop<p>I do pretty much all of my development work on my desktop computer but I still need a laptop for those times I just want to work from the sofa or for when I am travelling. It doesn’t need to be massively powerful or have a great spec but I do need it to be small and light.</p>
<p>In April 2018, when I was still doing macOS development, I bought a 12” MacBook. It was very small and light and definitely powerful enough (I bought the top-of-the-line model which cost £2,000). The only real down-side to it was the terrible keyboard that Apple was making back then.</p>
<p>Two years later <a href="https://swwritings.com/post/2020-01-19-the-year-of-linux-on-my-desktop">I had started using Linux</a> but I was working for <a href="https://www.sketch.com/">Sketch</a> and still needed a Mac computer to occasionally run Sketch itself even though I was now a backend developer writing <a href="https://elixir-lang.org/">Elixir</a> code. However I wanted to play around with Linux distributions and after some research came across <a href="https://starlabs.systems">StarLabs</a> and their <a href="https://starlabs.systems/pages/starlite">StarLite laptop</a>.</p>
<p>Finding companies who sell laptops with Linux is not terribly easy and in a post-Brexit UK where import duties from Europe suddenly make imports noticeably more expensive it becomes even harder. StarLabs would have been a great discovery as just a UK-based supplier of Linux laptops but they are also very helpful and friendly which makes it a joy to buy from them and support them.</p>
<p>My StarLite cost me £360 which was an absolute bargain after 15 years of buying apple computers and worth it have a machine I could play around on and inevitably break things and need to do clean installs. The laptop I got was a second generation machine.</p>
<p>I fell in love with it and was astonished at the build quality for the price and it was a perfectly capable laptop for me. It ran all of the software I needed it to and any performance trade-offs were minimal. Rather than writing a detailed review I’ll point you to <a href="https://www.gadgetoid.com/2020/12/23/star-labs-lite-mkiii-reviewed/">Gadgetoid’s review</a> of the 3rd generation StarLite which I think sums it all up brilliantly (although I disagree with him about the keyboard which I really liked).</p>
<p>Fast forward another couple of years and this morning my 4th generation StarLite arrived and I couldn’t be happier. £400 for a perfectly capable, extremely well built laptop is extraordinary. For now I’ll be installing <a href="https://getfedora.org/">Fedora</a> on it and continuing to use my 2nd generation StarLite to play around with <a href="https://nixos.org/">NixOS</a> (which is another story I will blog about at some point).</p>
<p>If you want to dip your toe into the world of Linux or are looking for an affordable, well built, capable laptop which is streets ahead of the low-end machines created by the usual computer manufacturers then I highly recommend StarLabs and the StarLite. And no, all this gushing about them is not sponsored or in return for a free machine… it’s just genuine praise from a very happy customer.</p>Simon WolfI do pretty much all of my development work on my desktop computer but I still need a laptop for those times I just want to work from the sofa or for when I am travelling. It doesn’t need to be massively powerful or have a great spec but I do need it to be small and light. In April 2018, when I was still doing macOS development, I bought a 12” MacBook. It was very small and light and definitely powerful enough (I bought the top-of-the-line model which cost £2,000). The only real down-side to it was the terrible keyboard that Apple was making back then. Two years later I had started using Linux but I was working for Sketch and still needed a Mac computer to occasionally run Sketch itself even though I was now a backend developer writing Elixir code. However I wanted to play around with Linux distributions and after some research came across StarLabs and their StarLite laptop. Finding companies who sell laptops with Linux is not terribly easy and in a post-Brexit UK where import duties from Europe suddenly make imports noticeably more expensive it becomes even harder. StarLabs would have been a great discovery as just a UK-based supplier of Linux laptops but they are also very helpful and friendly which makes it a joy to buy from them and support them. My StarLite cost me £360 which was an absolute bargain after 15 years of buying apple computers and worth it have a machine I could play around on and inevitably break things and need to do clean installs. The laptop I got was a second generation machine. I fell in love with it and was astonished at the build quality for the price and it was a perfectly capable laptop for me. It ran all of the software I needed it to and any performance trade-offs were minimal. Rather than writing a detailed review I’ll point you to Gadgetoid’s review of the 3rd generation StarLite which I think sums it all up brilliantly (although I disagree with him about the keyboard which I really liked). Fast forward another couple of years and this morning my 4th generation StarLite arrived and I couldn’t be happier. £400 for a perfectly capable, extremely well built laptop is extraordinary. For now I’ll be installing Fedora on it and continuing to use my 2nd generation StarLite to play around with NixOS (which is another story I will blog about at some point). If you want to dip your toe into the world of Linux or are looking for an affordable, well built, capable laptop which is streets ahead of the low-end machines created by the usual computer manufacturers then I highly recommend StarLabs and the StarLite. And no, all this gushing about them is not sponsored or in return for a free machine… it’s just genuine praise from a very happy customer.Choosing A New Bike2020-09-13T16:00:00+01:002020-09-13T16:00:00+01:00https://blog.sgawolf.com/post/choosing-a-new-bike<p>After realising that <a href="https://www.swwritings.com/post/2020-09-13-weight-and-health">my weight and fitness</a> were in a bad way again I turned my attention to researching bicycles.</p>
<p>I have had <a href="https://www.swwritings.com/post/2020-09-13-my-bicycle-history">a varied history</a> of bike ownership. Some I have loved. Some I have disliked. Some I have wanted to love but they were uncomfortable because they were too big. One I should have hated but loved anyway.</p>
<p>The main mistake I have previously made was in buying bikes which were too large for me and which then ended up being uncomfortable and less fun to ride than they could and should have been.</p>
<p>In addition to having a frame which fits me I also wanted a step-through bike. During 2020 I have had some issues with my knees so removing the need to swing my leg over the crossbar and instead being able to step through the frame easily was a big attraction.</p>
<p>In amongst the sometimes random YouTube recommendations I get, one was for <a href="https://www.youtube.com/watch?v=nvx3hRDnAxA">a video</a> by the Fully Charged Show where they visited the Fully Charged (not relation to them) bike shop in London. In the video they talk about some of the makes of bikes they stock and one of them really intrigued me: <a href="https://www.ternbicycles.com/bikes/472/gsd">the Tern GSD</a> (the section starts at <a href="https://youtu.be/nvx3hRDnAxA?t=460">7m 40s</a> in the video).</p>
<p>When I was researching the GSD I discovered that Tern make a slightly smaller model called the <a href="https://www.ternbicycles.com/bikes/471/hsd">HSD</a> which has several benefits such as a more recent motor, a belt drive and being slightly lighter.</p>
<p>I was still wavering over whether it was going to be the right bike for me (I didn’t necessarily need the cargo carrying capacity) when I decided to go and have a test ride at a local bike shop, <a href="https://www.avonvalleycyclery.co.uk">Avon Valley Cyclery</a> (AVC) in Bath. I immediately fell in love with it.</p>
<p>The bike is very comfortable and because it has a one-size-fits-all design it means that I didn’t have to worry about the frame size. You adjust things until it fits and feels right for you. It is solid yet it feels nimble and fun. It has character and personality and has been designed to be practical too. How many other bikes can stand on end to help people with limited space store them?</p>
<p>Tern also seems to be a company with a good ethos. They engage with their customers on social media, they encourage their customers to go and buy from local bike shops rather than buying directly and I also read stories about people being able to swap bikes which weren’t working for them for different models.</p>
<p>Speaking of local bike shops, AVC is a great one. As well as offering me good advice whilst I was thinking about what to buy they pushed me to try a couple of other bikes and even went as far as checking that an HSD would fit into the back of a Ford Fiesta (which remarkably it does). Luke and the team there are very friendly and engaging and the intimidation which often comes from visiting bike shops when you are not a serious rider was non-existent.</p>
<p>And so my new bike is a Tern HSD and I love it. I’ve cycled more and further in the last ten days than I have in the previous nine months and I hope that not only will I continue to cycle but that I will also fulfil my plan of replacing the car with it for some shopping trips.</p>
<p><img src="https://www.swwritings.com/images/2020-09-13-choosing-a-new-bike-01.jpeg" alt="My Tern HSD S+" width="100%" /></p>
<h2 id="additional-notes">Additional Notes</h2>
<h3 id="research">Research</h3>
<p>The above is obviously just my views on one particular bike which I picked based on my own specific requirements. However I did do a fair amount of research and most was via YouTube. There are some great channels and video reviews of bikes which help enormously and I would strongly recommend watching some if you are thinking about getting a new bike.</p>
<p>The <a href="https://www.youtube.com/c/PropelbikesUSA/">Propel Electric Bikes</a> channel is incredibly useful but a few specific videos I liked are:</p>
<ul>
<li><a href="https://www.youtube.com/watch?v=SnHFJrB1sXk">Tern HSD Review</a></li>
<li><a href="https://www.youtube.com/watch?v=TE3yUXNRpGc">GSD vs HSD</a></li>
<li><a href="https://www.youtube.com/watch?v=0vpjcTEx2LI&t=543s">Automatic Shifting Ebike - Tern HSD S+</a></li>
<li><a href="https://www.youtube.com/watch?v=TCmQb0NQba0">Top Tern HSD E-bike Accessories</a></li>
<li>Tern’s <a href="https://www.youtube.com/watch?v=tCWfnVpymG0">HSD Owner Briefing</a></li>
</ul>
<h3 id="the-alternatives">The Alternatives</h3>
<p>During my research there were two other serious candidates which tempted me.</p>
<p>The Riese & Müller <a href="https://www.r-m.de/en-en/bikes/tinker/">Tinker</a> is a lovely bike (although in a September 2020 refresh they dropped the lovely yellow/orange colour option) and I’d be interested in having a test ride on one at some point but it is also more limited in terms of cargo carrying capabilities and might be more of a town bike (the HSD probably is one in most people’s minds but its size and styling make it feel more of a workhorse and it feels completely at home on country lanes too).</p>
<p>Just before I bought my HSD Tern announced updates to the GSD which added some great options and the top-of-the-line model now has a belt drive and, more interestingly for me being in a hilly area, a Rohloff internal hub. The bike’s specification is very impressive but it is also very expensive (around £8,000) and won’t be available for another four or five months at the earliest. And because it is slightly longer than the existing GSD which in turn is slightly longer than the HSD it wouldn’t fit into my car which is one of those things that makes life that little bit more complicated.</p>Simon WolfAfter realising that my weight and fitness were in a bad way again I turned my attention to researching bicycles. I have had a varied history of bike ownership. Some I have loved. Some I have disliked. Some I have wanted to love but they were uncomfortable because they were too big. One I should have hated but loved anyway. The main mistake I have previously made was in buying bikes which were too large for me and which then ended up being uncomfortable and less fun to ride than they could and should have been. In addition to having a frame which fits me I also wanted a step-through bike. During 2020 I have had some issues with my knees so removing the need to swing my leg over the crossbar and instead being able to step through the frame easily was a big attraction. In amongst the sometimes random YouTube recommendations I get, one was for a video by the Fully Charged Show where they visited the Fully Charged (not relation to them) bike shop in London. In the video they talk about some of the makes of bikes they stock and one of them really intrigued me: the Tern GSD (the section starts at 7m 40s in the video). When I was researching the GSD I discovered that Tern make a slightly smaller model called the HSD which has several benefits such as a more recent motor, a belt drive and being slightly lighter. I was still wavering over whether it was going to be the right bike for me (I didn’t necessarily need the cargo carrying capacity) when I decided to go and have a test ride at a local bike shop, Avon Valley Cyclery (AVC) in Bath. I immediately fell in love with it. The bike is very comfortable and because it has a one-size-fits-all design it means that I didn’t have to worry about the frame size. You adjust things until it fits and feels right for you. It is solid yet it feels nimble and fun. It has character and personality and has been designed to be practical too. How many other bikes can stand on end to help people with limited space store them? Tern also seems to be a company with a good ethos. They engage with their customers on social media, they encourage their customers to go and buy from local bike shops rather than buying directly and I also read stories about people being able to swap bikes which weren’t working for them for different models. Speaking of local bike shops, AVC is a great one. As well as offering me good advice whilst I was thinking about what to buy they pushed me to try a couple of other bikes and even went as far as checking that an HSD would fit into the back of a Ford Fiesta (which remarkably it does). Luke and the team there are very friendly and engaging and the intimidation which often comes from visiting bike shops when you are not a serious rider was non-existent. And so my new bike is a Tern HSD and I love it. I’ve cycled more and further in the last ten days than I have in the previous nine months and I hope that not only will I continue to cycle but that I will also fulfil my plan of replacing the car with it for some shopping trips. Additional Notes Research The above is obviously just my views on one particular bike which I picked based on my own specific requirements. However I did do a fair amount of research and most was via YouTube. There are some great channels and video reviews of bikes which help enormously and I would strongly recommend watching some if you are thinking about getting a new bike. The Propel Electric Bikes channel is incredibly useful but a few specific videos I liked are: Tern HSD Review GSD vs HSD Automatic Shifting Ebike - Tern HSD S+ Top Tern HSD E-bike Accessories Tern’s HSD Owner Briefing The Alternatives During my research there were two other serious candidates which tempted me. The Riese & Müller Tinker is a lovely bike (although in a September 2020 refresh they dropped the lovely yellow/orange colour option) and I’d be interested in having a test ride on one at some point but it is also more limited in terms of cargo carrying capabilities and might be more of a town bike (the HSD probably is one in most people’s minds but its size and styling make it feel more of a workhorse and it feels completely at home on country lanes too). Just before I bought my HSD Tern announced updates to the GSD which added some great options and the top-of-the-line model now has a belt drive and, more interestingly for me being in a hilly area, a Rohloff internal hub. The bike’s specification is very impressive but it is also very expensive (around £8,000) and won’t be available for another four or five months at the earliest. And because it is slightly longer than the existing GSD which in turn is slightly longer than the HSD it wouldn’t fit into my car which is one of those things that makes life that little bit more complicated.My Bicycle History2020-09-13T15:00:00+01:002020-09-13T15:00:00+01:00https://blog.sgawolf.com/post/my-bicycle-history<h2 id="the-roses">The Roses</h2>
<p>This isn’t a bike model but rather my first memory of cycling. I was probably five or six and it was a hot summer day and so I was just wearing shorts. My stabilisers were removed and I was let loose on our opposite neighbour’s lawn which was large and hazard-free…. apart from the circular bed of roses in the middle of it. The circular bed of roses which probably seemed ideal for me to cycle around and around. The circular bed of roses I inevitably ended up veering into. 35 years later I made sure my daughter learnt to balance on a clear, hazard-free stretch of quiet road.</p>
<h2 id="the-budgie">The Budgie</h2>
<p>My first bike was a blue <a href="https://www.doyouremember.co.uk/memory/raleigh-budgie">Raleigh Budgie</a> and I think I had it until I was about 7 or 8 but I don’t really remember riding it much. Looking at pictures of it now it was probably a fairly grim experience.</p>
<h2 id="the-grifter">The Grifter</h2>
<p>Bike number two was a <a href="https://en.wikipedia.org/wiki/Raleigh_Grifter">Raleigh Grifter</a>. It must have been a MK2 model which I would have been given for Christmas in the early 1980s. I remember my dad and his best friend putting it together on a Christmas Eve and in retrospect I’m amazed it was ever safe to ride because neither of them were terribly practical.</p>
<p>I loved it dearly and remember going for some great adventures on it. My aunt, uncle and cousins used to drive from Rome to England each summer to visit my grandparents and Theo, my elder cousin, and I used to cycle a lot.</p>
<h2 id="the-bmx">The BMX</h2>
<p>My third bike was a <a href="https://en.wikipedia.org/wiki/Raleigh_Burner">Raleigh Burner</a> which I think I got around the age of 12. They were the must-have bike at that time but for me it was a big mistake because it was no fun to ride compared to the Grifter. I only had it for a year or two and I remember struggling to keep up with Theo on our rides over the summer.</p>
<h2 id="the-racer">The Racer</h2>
<p>The BMX was replaced with a black Peugeot racer which I loved. It was fast and looked great and it was much more fun than the BMX had been. The first summer I had it I remember that the tables had turned and this time my cousin was the one lagging behind.</p>
<p>And then it was stolen from the garage belonging to the former neighbour whose roses had played such a large part in me getting going. I’d left it at their house and it, along with a mower and some tools, was taken one night. Because it wasn’t their bike it wasn’t insured and so it wasn’t replaced and it was the last bike I owned as a child.</p>
<h2 id="the-london-hybrid">The London Hybrid</h2>
<p>In 1999 I was living in London and had a girlfriend who lived a few miles from me but it was a nightmare getting to her flat by public transport so I bought a bike. I have no recollection about what it was and I didn’t own it more than a few months because my girlfriend’s grandmother gave up driving and we got her old Vauxhall Nova. The bike was sold on to a friend (and stolen weeks later).</p>
<p>Back then, rather than a five mile bike ride, I endured a one hour commute each way to and from work via busses and trains. I should really have used the bike to get to work. But I’m also pretty sure that cycling into central London in the late 1990s was not for the faint of heart.</p>
<h2 id="the-clunker">The Clunker</h2>
<p>By 2007 I was living in Somerset and was given a clunker of a bike by a work colleague who was moving house. I can’t remember why I wanted it or even going for many rides but at some point I signed up for a 35 mile charity bike ride and with almost no preparation I had a fabulous few hours on the Somerset levels with a couple of hundred other people. It was a huge amount of fun and rekindled a love of being out on a bicycle.</p>
<p>However the bike itself was awful. It was heavy and was probably marketed as a mountain bike back when that just meant that a bike had knobbly tyres. I wanted something nicer to ride.</p>
<h2 id="the-galaxy">The Galaxy</h2>
<p>By this time the Government had launched a Cycle to Work scheme where employers could buy bikes for employees who would, over a few years, rent it from them and then, after a few years, buy it from them. Using the scheme I bought a gorgeous <a href="https://en.wikipedia.org/wiki/Dawes_Galaxy">Dawes Galaxy</a>. The only problem was that the local bike shop I bought it from had gotten the sizing wrong and it was too big for me and because it was uncomfortable to ride I didn’t ride it as much as I should have done. However it did get a fair amount of use, partly thanks to a work colleague who was a keen cyclist and used to encourage me to go out cycling with him. However the bike was never one I loved and it ended up being passed on to another friend a few years later.</p>
<h2 id="the-trek">The Trek</h2>
<p>In the spring of 2012 I still wanted to find a bike I would fall in love with and I bought a <a href="https://archive.trekbikes.com/us/en/2012/Trek/7_5_fx#/us/en/2012/Trek/7_5_fx/details">Trek FX 7.5</a>. The bike was the right size and comfortable to ride and I enjoyed using it. However by now I was living in a small village in the <a href="https://en.wikipedia.org/wiki/Mendip_Hills">Mendip Hills</a> and working from home. Rides were restricted to me choosing to go out for exercise but the hills restricted my range. I never seemed to get fit enough to find the hills easier and the bike spent longer and longer undisturbed in the shed. Eventually it was donated to a local bike charity.</p>
<h2 id="the-oxygen">The Oxygen</h2>
<p>In 2017 a friend in the village let me have a go on his electric bike. This was a bike he’d converted himself with a kit and it was great fun. Hills suddenly seemed much less intimidating and I did a bit of research, found a local dealer and ended up buying an <a href="https://www.oxygenbicycles.com/shop-2/s-cross-cb/">Oxygen S-Cross CB</a>. The Oxygen was a nice bike but, like the Galaxy, it was too big for me. I enjoyed riding it but it was not comfortable for more than a few miles and that made it less fun that it should have been. Added to this, I had started to have knee problems and an overly-large bike with a crossbar was really not something I wanted to battle any more.</p>
<h2 id="the-tern-gsd">The Tern GSD</h2>
<p>My next bike is a <a href="https://www.ternbicycles.com/bikes/471/hsd">Tern HSD</a>. You can read about why in my post about <a href="https://www.swwritings.com/post/2020-09-13-choosing-a-new-bike">choosing a bicycle</a>.</p>Simon WolfThe Roses This isn’t a bike model but rather my first memory of cycling. I was probably five or six and it was a hot summer day and so I was just wearing shorts. My stabilisers were removed and I was let loose on our opposite neighbour’s lawn which was large and hazard-free…. apart from the circular bed of roses in the middle of it. The circular bed of roses which probably seemed ideal for me to cycle around and around. The circular bed of roses I inevitably ended up veering into. 35 years later I made sure my daughter learnt to balance on a clear, hazard-free stretch of quiet road. The Budgie My first bike was a blue Raleigh Budgie and I think I had it until I was about 7 or 8 but I don’t really remember riding it much. Looking at pictures of it now it was probably a fairly grim experience. The Grifter Bike number two was a Raleigh Grifter. It must have been a MK2 model which I would have been given for Christmas in the early 1980s. I remember my dad and his best friend putting it together on a Christmas Eve and in retrospect I’m amazed it was ever safe to ride because neither of them were terribly practical. I loved it dearly and remember going for some great adventures on it. My aunt, uncle and cousins used to drive from Rome to England each summer to visit my grandparents and Theo, my elder cousin, and I used to cycle a lot. The BMX My third bike was a Raleigh Burner which I think I got around the age of 12. They were the must-have bike at that time but for me it was a big mistake because it was no fun to ride compared to the Grifter. I only had it for a year or two and I remember struggling to keep up with Theo on our rides over the summer. The Racer The BMX was replaced with a black Peugeot racer which I loved. It was fast and looked great and it was much more fun than the BMX had been. The first summer I had it I remember that the tables had turned and this time my cousin was the one lagging behind. And then it was stolen from the garage belonging to the former neighbour whose roses had played such a large part in me getting going. I’d left it at their house and it, along with a mower and some tools, was taken one night. Because it wasn’t their bike it wasn’t insured and so it wasn’t replaced and it was the last bike I owned as a child. The London Hybrid In 1999 I was living in London and had a girlfriend who lived a few miles from me but it was a nightmare getting to her flat by public transport so I bought a bike. I have no recollection about what it was and I didn’t own it more than a few months because my girlfriend’s grandmother gave up driving and we got her old Vauxhall Nova. The bike was sold on to a friend (and stolen weeks later). Back then, rather than a five mile bike ride, I endured a one hour commute each way to and from work via busses and trains. I should really have used the bike to get to work. But I’m also pretty sure that cycling into central London in the late 1990s was not for the faint of heart. The Clunker By 2007 I was living in Somerset and was given a clunker of a bike by a work colleague who was moving house. I can’t remember why I wanted it or even going for many rides but at some point I signed up for a 35 mile charity bike ride and with almost no preparation I had a fabulous few hours on the Somerset levels with a couple of hundred other people. It was a huge amount of fun and rekindled a love of being out on a bicycle. However the bike itself was awful. It was heavy and was probably marketed as a mountain bike back when that just meant that a bike had knobbly tyres. I wanted something nicer to ride. The Galaxy By this time the Government had launched a Cycle to Work scheme where employers could buy bikes for employees who would, over a few years, rent it from them and then, after a few years, buy it from them. Using the scheme I bought a gorgeous Dawes Galaxy. The only problem was that the local bike shop I bought it from had gotten the sizing wrong and it was too big for me and because it was uncomfortable to ride I didn’t ride it as much as I should have done. However it did get a fair amount of use, partly thanks to a work colleague who was a keen cyclist and used to encourage me to go out cycling with him. However the bike was never one I loved and it ended up being passed on to another friend a few years later. The Trek In the spring of 2012 I still wanted to find a bike I would fall in love with and I bought a Trek FX 7.5. The bike was the right size and comfortable to ride and I enjoyed using it. However by now I was living in a small village in the Mendip Hills and working from home. Rides were restricted to me choosing to go out for exercise but the hills restricted my range. I never seemed to get fit enough to find the hills easier and the bike spent longer and longer undisturbed in the shed. Eventually it was donated to a local bike charity. The Oxygen In 2017 a friend in the village let me have a go on his electric bike. This was a bike he’d converted himself with a kit and it was great fun. Hills suddenly seemed much less intimidating and I did a bit of research, found a local dealer and ended up buying an Oxygen S-Cross CB. The Oxygen was a nice bike but, like the Galaxy, it was too big for me. I enjoyed riding it but it was not comfortable for more than a few miles and that made it less fun that it should have been. Added to this, I had started to have knee problems and an overly-large bike with a crossbar was really not something I wanted to battle any more. The Tern GSD My next bike is a Tern HSD. You can read about why in my post about choosing a bicycle.