Gerrit Niezen

100DaysToOffload

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

I've been using Elementary OS for just over 4 months now:

When I installed it, I created a second partition on my drive after shrinking the size of my Ubuntu partition. Now that I haven't used my Ubuntu partition for months, and after running into some “disk pressure” issues while using Kubernetes, I thought I'd remove that partition and resize the Elementary partition to fit the entire drive.

Deleting the Ubuntu partition was simple enough using the Disks app, but then I realised that while I could shrink the Elementary partition, I could not enlarge it when it was mounted as the root partition. I used Balena Etcher to write the latest edition of Elementary OS onto a USB flash drive and rebooted. It took me a while to figure out that I had to press F2 to set the boot order correctly in order to boot from the flash drive. Once running the Live version of Elementary OS, it was very easy to run the GParted partitioning tool, drag the sliders to make the partition fit the entire drive, and click Apply. Not an fdisk in sight.

Even though everything was so easy, it was still pretty nerve-wrecking to wait half an hour for all my data to be copied across the drive. After I came back from a short 30 minute walk, I could reboot into the resized partition and everything was working as expected. Phew! 😅️


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

#100DaysToOffload #day20 #elementaryOS

I just noticed that @kev@fosstodon.org, the originator of #100DaysToOffload, has changed the format from a post a day for 100 days, to doing 100 posts in a year.

His rationale is that he wants more time to work on each post, in order to produce higher quality content. I agree with him that it's too time-consuming to produce a great blog post every day, but I'm going to continue with the 100-day format for the following reasons:

  • I'm interested in building the daily habit of writing again, as I've successfully written 100 consecutive days in the past
  • I see this more of a daily diary than “providing quality content”
  • People like Seth Godin and Austin Kleon have shown that it's perfectly possible to write great shorter form blog posts and get something out every day

One change that I will be making is not to use the format “100 Days to Offload: Day X” as my title heading anymore, as the title is the only thing that gets federated to Mastodon, and I want people to know what the actual content of the post is about. I'll still use the #100DaysToOffload hashtag and will also add the day as a hasthag.


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

#100DaysToOffload #day19

Starting a garden diary

As part of the permaculture course I mentioned in previous posts, I'm planning on staring a garden diary/journal to keep track of our food growing experiments.

We have a small raised bed of 1 by 3 metres, in which various sugarsnap pea plants are growing pretty happily. We also have potatoes growing vigorously in two potato planters filled with compost from the local tip. I also have a bunch of garlic plants growing in pots, thanks to the lovely @GwenfarsGarden@kith.kitchen, who sent me hardneck garlic cloves for free, including instructions on how to grow them.

There's also some thyme, parsley, mint and rosemary growing in pots outside, and inside I have a little hydroponic setup with a small habanero chilli plant that's fruiting pretty heavily at the moment. We also planted more seeds over the weekend, that I haven't even been keeping track of. Therefore the decision to keep track of everything in a garden journal.

There's a very pretty garden journal in the video above, but I'm going to try and keep it simple, having attempted Bullet Journals in the past. I still have a pack of Field Notes notebooks I received as a gift, and the one entitled “Gardening” is still empty.


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

#100DaysToOffload