Gerrit Niezen

Maker of open-source software and hardware.

I've mentioned previously that I started doing yoga using the Peloton app at the beginning of April. Note that I've never done any form of yoga before in my life. I found joining a yoga class too intimidating, so being able to learn the basics from the comfort of my living room is great. I've now done nine workouts, which averages to about once a week. Today I did my first 30 minute session, and I found it just as enjoyable as the 20 minute sessions I've done previously.

I'm using my wife's yoga mat, and bought some yoga blocks off eBay. All that's needed for most sessions is a mat, blocks and a blanket. Any blanket or throw will do. I've seen some sessions that require a yoga strap, but I've not needed it yet.

If I do it first thing in the morning, it really sets the tone for the day and helps me to calm my mind. I'm also learning how to stretch my body, which I've usually just considered as something to move my head from place to place. I hope I can keep this going – so far it's been intrinsically motivating, as in I haven't had to force myself to do it.


I’m publishing this as part of 100 Days To Offload. You can join in yourself by visiting https://100daystooffload.com.

#100DaysToOffload #day30

I've been growing sprouts as part of the permaculture course I mentioned in previous posts. The first time round I grew alfalfa sprouts in a mason jar, using a piece of cloth held together with a rubber band as a lid. The cloth didn't drain that easily, so I wanted something a little bit more suited to the task.

I recently got hold of some mung beans to grow proper bean sprouts, and decided to 3D print a sprout growing mason jar strainer I found on prusaprinters.org.

So far it's been working great, and I'll be printing another one with smaller holes for the alfalfa seeds as well.


I’m publishing this as part of 100 Days To Offload. You can join in yourself by visiting https://100daystooffload.com.

#100DaysToOffload #day29

I've known for a while that the water in a can of chickpeas, also called aquafaba or chickpea brine, can be used as an alternative to egg whites, but never actually tried it. Today I was making some hummus, and saved the chickpea water to attempt to make a chocolate mousse recipe I found online.

The only thing I'm regretting is that I haven't tried this sooner. It only requires three ingredients:

  • aquafaba / chickpea water
  • chocolate pieces/chips
  • cocoa powder

If you put aquafaba (120mL, the amount in a can of chickpeas) in a bowl and refrigerate it for 10 minutes, it takes less than 10 minutes (depending on the quality of the aquafaba) to whip it up with an electric mixer that it forms stiff peaks. Then you add 100g melted (and cooled down) chocolate chips while still mixing, a tablespoon or two of cocoa powder and continue mixing until everything's combined. Spoon it into glass cups, put it in the fridge for 30 minutes and you've got a delicious chocolate mousse (that doesn't taste like chickpeas at all!).


I’m publishing this as part of 100 Days To Offload. You can join in yourself by visiting https://100daystooffload.com.

#100DaysToOffload #day28

Last week our toilet started filling very slowly after a flush. I opened up the cistern and removed a screw cap from the inlet valve. I cleaned it and put it back, not realising that there was a small diaphragm washer that fell out and got flushed the next time I pulled the lever. Now the toilet was not stopping when filling. Oops.

After finding a brand name (Siamp), i was able to identify the actual model: a Compact 99B bottom entry inlet valve. Turns out you can't buy them from most of the DIY stores in the UK, but the replacement diaphragm washers can be found everywhere. These washers appear to be quite prone to wear and tear, and need to be replaced every so often.

I ordered a new diaphragm washer off eBay for £2.75 (including P&P), and a couple of days later it arrived. I replaced it, but the inlet valve still wouldn't stop filling. I watched a bunch of instructional videos on YouTube, all related to replacing the diaphragm washer of this specific model of inlet valve.

Even after making sure each of the various notches were correctly aligned, the inlet valve would not stop filling. I finally accepted that I'll have to replace the whole inlet valve, and came across this post suggesting an alternative brand that's more readily available and comes with a brass shank.

We picked up the new inlet valve from Click & Collect at Screwfix the next day. I installed the valve, only to have it leak out of the bottom of the cistern. Turns out there's an uneven bump next to the hole in the cistern that prevents the rubber seal from fitting properly. After re-fitting the inlet valve a bunch of times, I finally managed to get a proper seal by using the backnut from the old valve that could be tightened using a spanner.

Am I a plumber now?


I’m publishing this as part of 100 Days To Offload. You can join in yourself by visiting https://100daystooffload.com.

#100DaysToOffload #day27

A couple of days ago I mentioned that I'm attempting to compile libmtp under MSYS2/MINGW64. Steps so far:

  • Install MSYS2
  • Do pacman -Syuu repeatedly after first start until everything is up to date
  • Install git: pacman -S git
  • Install base-devel for basic development utilities
  • install mingw-w64-x86_64-toolchain (as we need mingw-w64-x86_64-gcc to not get _spawnv errors, see https://github.com/libimobiledevice/libplist/issues/136)
  • Install mingw-w64-x86_64-libiconv
  • Install mingw-w64-x86_64-libusb
  • Remember to run autogen.sh before running ./configure
  • Run make

Some useful MSYS2-specific things:

  • Use cd /c/ to get to the C: drive
  • pacman -S to install, -R to remove and -Ss to search
  • To access Windows path (e.g. to run node/npm, which can't be installed in MSYS2), add -use-full-path to the mingw64 app shortcut, or set environment variable MSYS2_PATH_TYPE to inherit

Now, after all of this I still got the following error:

unicode.c: In function 'utf16_to_utf8':
unicode.c:91:23: error: 'PTPParams' {aka 'struct _PTPParams'} has no member named 'cd_ucs2_to_locale'
   91 |   nconv = iconv(params->cd_ucs2_to_locale, &stringp, &convlen, &locp, &convmax);
      |                       ^~
unicode.c: In function 'utf8_to_utf16':
unicode.c:126:23: error: 'PTPParams' {aka 'struct _PTPParams'} has no member named 'cd_locale_to_ucs2'
  126 |   nconv = iconv(params->cd_locale_to_ucs2, &stringp, &convlen, &unip, &convmax);

Turns out, it's a known issue. Based on a potential fix linked to in that GitHub issue, I was able to write a fix for a different file:

diff --git a/src/unicode.c b/src/unicode.c
index 2adc94e..b14274b 100644
--- a/src/unicode.c
+++ b/src/unicode.c
@@ -87,12 +87,14 @@ char *utf16_to_utf8(LIBMTP_mtpdevice_t *device, const uint16_t *unicstr)
   size_t convmax = STRING_BUFFER_LENGTH*3;

   loclstr[0]='\0';
+  #if defined(HAVE_ICONV) && defined(HAVE_LANGINFO_H)
   /* Do the conversion.  */
   nconv = iconv(params->cd_ucs2_to_locale, &stringp, &convlen, &locp, &convmax);
   if (nconv == (size_t) -1) {
     // Return partial string anyway.
     *locp = '\0';
   }
+  #endif
   loclstr[STRING_BUFFER_LENGTH*3] = '\0';
   // Strip off any BOM, it's totally useless...
   if ((uint8_t) loclstr[0] == 0xEFU && (uint8_t) loclstr[1] == 0xBBU && (uint8_t) loclstr[2] == 0xBFU) {
@@ -121,7 +123,7 @@ uint16_t *utf8_to_utf16(LIBMTP_mtpdevice_t *device, const char *localstr)

   unicstr[0]='\0';
   unicstr[1]='\0';
-
+  #if defined(HAVE_ICONV) && defined(HAVE_LANGINFO_H)
   /* Do the conversion.  */
   nconv = iconv(params->cd_locale_to_ucs2, &stringp, &convlen, &unip, &convmax);

@@ -130,6 +132,7 @@ uint16_t *utf8_to_utf16(LIBMTP_mtpdevice_t *device, const char *localstr)
     unip[0] = '\0';
     unip[1] = '\0';
   }
+  #endif
   // make sure the string is null terminated
   unicstr[STRING_BUFFER_LENGTH*2] = '\0';
   unicstr[STRING_BUFFER_LENGTH*2+1] = '\0';

Lo and behold, I got it to compile!


I’m publishing this as part of 100 Days To Offload. You can join in yourself by visiting https://100daystooffload.com.

#100DaysToOffload #day26 #libmtp

I've tried various approaches to minimising distractions from my phone in the past, including How to Configure Your iPhone to Work for You, Not Against You when I still had an iPhone.

Now that I have a Fairphone (€25 referral discount), I tried a similar approach on Android, but it was just not cutting it.

Now that I'm doing the Highlight course, I've decided to go all in on The Distraction-free Android phone. I've deleted my Instagram web app, my Tusky Mastodon client (i.e., Twitter alternative), my Fastmail app, Slack and even disabled GMail.

It felt super strange to not check Instagram and Mastodon first thing when I woke up this morning. Instead, I read the first chapter of a book I've been meaning to read for a long time, but just never got around to. The rest of my day also felt so much better, as I left checking Instagram and Mastodon on my computer until around 5pm in the afternoon. And guess what: I didn't miss anything. I'm looking forward to see what effects this change will have in the long run.

Hey, I'm also one quarter into #100DaysToOffload! 🎉️


I’m publishing this as part of 100 Days To Offload. You can join in yourself by visiting https://100daystooffload.com.

#100DaysToOffload #day25

While an Android device can be accessed from Windows over USB, it doesn't mount with a drive letter, like USB mass storage devices (e.g., flash drives) do. Well, earlier Android devices used to, but newer ones only support MTP and/or PTP. This means it's really hard to access them programmatically if you're developing a cross-platform app and not using the Windows APIs.

A while ago I wrote a module for Node.js to access MTP devices, documenting the process in three parts. Now, this works great on Linux and macOS, but due to how Windows handles USB devices, the underlying libmtp library works differently under Windows.

If you don't want to ask the user to navigate to a file on an Android device on Windows themselves, one option would be to automate the task using PowerShell. I've taken that approach in the Tidepool Uploader, where I use the node-powershell module to find and download a file from an Android device. It mostly works, but in a small number of cases this approach fails.

This makes me wonder if I can get my node-mtp module working under Windows, even if it means installing a USB driver for the Android device so that libusb can access it. First step: Getting libmtp compiled under Windows using MSYS2/MINGW64.

PS: If you know of a better way to do this, get in touch: gerrit at tidepool.org.


I’m publishing this as part of 100 Days To Offload. You can join in yourself by visiting https://100daystooffload.com.

#100DaysToOffload #day24

This morning I was again reminded of how the best tools are the ones that do one thing really well.

While showering I discovered that the drain was blocked and water was pooling everywhere, as it's a wet room without a separate shower basin. I removed the drain cover and pulled out a tangled-together hairball, but it stayed blocked. I was about to start looking at which chemicals I could pour down there, when I remembered we have a plunger in the cupboard right next to the bathroom.

One quick push and pull with the plunger, and the drain was unblocked. No chemicals and no gunk to remove, because the blockage itself goes down the drain. Such a simple design, and when it works, it works really well.


I’m publishing this as part of 100 Days To Offload. You can join in yourself by visiting https://100daystooffload.com.

#100DaysToOffload #day23

Just over a week ago @aadil@merveilles.town tooted about a subreddit called Eat Cheap and Vegan. On there I discovered this thread which talked about an app called Plant Jammer.

I've been looking for an app like this for a long time. Basically I want to put in some ingredients I have and then find out what I can make with those ingredients, without having to go to the grocery store to find that one missing ingredient. Especially in the current pandemic crisis, I want to minimise the number of times I need to go to a grocery store.

I've tried using using Supercook, where you put in some ingredients and it searches recipe websites for possible options, but the recipes it suggested just wasn't that great. I thought Plant Jammer would be something similar, but it's a different beast altogether.

With Plant Jammer you first decide what type of meal you want to make, for example Italian, Thai, or Mexican. You then give it a couple of ingredients that you want to use, and based on the type of meal it will ask you to select a couple of other ingredients that you have in the house. All of this is done using a type of flavour wheel, where an algorithm determines whether the resulting dish will have the right flavour profile. For example, it may suggest adding apples or walnuts for extra crunch, or some miso paste for extra umami flavour.

The algorithm then generates a recipe based on your ingredients, figuring out the exact amount of each ingredient you need, and even writes down the steps to prepare it. 🤯️

So far I've used it to make a smoothie and a pasta salad, and the flavours were pretty good. It was great at using up some leftover fruit, veggies and nuts we still had around, and I'm looking forward trying to use it to plan a dinner.


I’m publishing this as part of 100 Days To Offload. You can join in yourself by visiting https://100daystooffload.com.

#100DaysToOffload #day22

I keep on thinking about that article I mentioned at the beginning of the week, on why trying new things are overrated and how repetition creates space for reflection and can bring unexpected joy.

One way in which I've been trying it out is to listen to my “On Repeat”, “Repeat Rewind” and “Your Top Songs” playlists on Spotify. And it's true: Re-listening to the same songs bring joy, while requiring less cognitive load, so that they fade into the background letting me focus on the task at hand.

This morning I started up my “Top Songs 2017” playlist, and found myself singing along to some of the songs while still being able to focus. Even in that playlist there were songs that felt new, as if I've never heard them before.

This makes me even more excited to try some kind of depth period, where I re-read, re-listen and re-use what I already have instead of always chasing off to search for new experiences, which feels like it's been the default mode for most of my life.


I’m publishing this as part of 100 Days To Offload. You can join in yourself by visiting https://100daystooffload.com.

#100DaysToOffload #day21

Enter your email to subscribe to updates.