Generating a LetsEncrypt cert for Dovecot

I have web hosting with with a provider and use their DNS service. But I don’t use their IMAP server – I host my own at home. Email clients like Thunderbird are averse to self-signed certs. So I generate a LetsEncrypt signed cert for my Dovecot IMAP server.

On my home machine:

  • install the certbot utility (FreeBSD port : py37-certbot)
  • run certbot:
certbot certonly --manual --preferred-challenges=dns --agree-tos --email=<my email address> -d <imap host name>
  • confirm that I’m OK with my IP being logged

On the provider’s control panel web site:

  • Add a DNS TXT record with the name and value generated by certbot
  • Wait a few minutes for the DNS record to be served

Back on my home machine:

  • Press Enter at the certbot prompt
  • Wait for certbot to clean up and show the names of the files containing the cert
  • Edit the Dovecot config file to point the ssl_cert and ssl_key lines to the files generated by certbot. Note that the first less-than sign on each line is part of the config. E.g.
ssl_cert = < <generated fullchain.pem file name>
ssl_key = < <generated privkey.pem file name>
  • Restart Dovecot

When I need to renew the cert in a couple of months time, I can just do:

certbot renew

, , , , , ,

No Comments

Visualiser for QHostAddress in Visual Studio

I’ve been using Visual Studio to debug Qt programs for some time now. Every time I come to a variable of type QHostAddress, I cringe – I can’t see its contents (says something about QHostAddressPrivate). So I finally got around to decoding it. This is very crude – I’m sure it can be done more elegantly. It works for Qt-5.9.8 although I would expect other versions to be very similar. It only works for IPv4 addresses.

To enable it, edit your qt5.natvis file (mine lives in C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\Packages\Debugger\Visualizers). Add the following snippet inside the top level of the AutoVisualizer section:

<Type Name=”QHostAddress”>

        <DisplayString>{{ IPv4Addr = {(((uint32*)d.d)[8]>>24)&amp;0xff,d}.{(((uint32*)d.d)[8]>>16)&amp;0xff,d}.{(((uint32*)d.d)[8]>>8)&amp;0xff,d}.{(((uint32*)d.d)[8]>>0)&amp;0xff,d} }}</DisplayString>


, , , ,

No Comments

Toblerone mousse

  • 400g Toblerone
  • 210g white marshmallows
  • 2 cups thickened cream

Microwave Toblerone and marshmallows on high for 3 minutes. Beat cream until it peaks. Blend cream into chocolate mix. Pour mixture into small bowls and refrigerate for 5 hours. Top with crushed Tolberone and serve.

No Comments

Chow Mein


  • 80g vermicelli noodles
  • 3 tbsp olive oil
  • 500g pork/beef/chicken mince
  • 1/2 tsp Chinese five spice
  • 1/2 tsp chilli powder
  • 1 large brown onion
  • 4 cloves garlic, finely chopped
  • 5cm piece ginger, grated
  • 3 long green chillies, thickly sliced
  • 1 Chinese cabbage (wombok) thinly sliced
  • 125ml chicken stock
  • 125ml oyster sauce
  • 3 tsp tamari sauce or soy sauce
  • 3 tsp sesame oil
  • 150g frozen peas
  • 1 handful green beans, thinly sliced
  • 6 green shallots, sliced diagonally
  • 100g bean sprouts
  • Crispy vermicelli noodles, to serve


  1. Put vermicelli in a large bowl and cover with boiling water. Set aside for 10 minute. Drain well and chop into 5cm lengths. Set aside.
  2. Meanwhile, heat 2 tbsp of the olive oil in a wok over a high heat. Add mince and cook, stirring constantly for 3-5 minutes or until browned. stir in five spice and chilli powder. Transfer to a bowl. Set aside.
  3. Return wok and add remaining olive oil. Add onion, garlic, ginger and chilli and stir fry for 1 minute or until fragrant.
  4. Stir in cabbage and hot water, then add sauces and sesame oil. Cook for 8 minutes or until just soft, then add peas, green beans and green shallots.
  5. Stir in softened vermicelli, bean sprouts and mince. Divide chow mein among serving bowls and top with crispy vermicelli to serve.

No Comments

Stir fried pork with kimchi

  • 2 tablespoons vegetable oil
  • 450g deboned pork belly (skin on) sliced into 5mm thick slices
  • sea salt
  • freshly ground white papper
  • 100g kimchi
  • 4 green spring onions sliced
  • 1 garlic clove finely chopped
  • ½ teaspoon chilli powder
  • ½ teaspoon sesame sauce
  • ½ teaspoon roasted sesame seeds
  • ¼ cup coriander leaves
  • 1 tablespoon water

Heat oil and add pork. Season with salt and pepper. Cook over a high heat for 10 minutes or until browned (don’t overcook). Add kimchi, garlic, onions, chilli powder, sesame sauce, and water. Cook and stir slowly. Serve with rice and garnish with sesame seeds and coriander.

No Comments

Liam’s Lankan Lamb

  • 500g lamb backstrap
  • 1½ red onions
  • 2 tomatoes
  • 2 teaspoons curry powder
  • 2 teaspoons marsala
  • lime juice
  • coriander leaves
  • little vegetable oil
  • coconut oil

Cut onions and tomatoes into eighths. Cook one onion, one tomato, curry powder, marsala, cumin, mustard, lime juice, and chilli in oil. Add thinly sliced lamb and cook. Add other onion and tomato and cook for a minute. Serve with rice and garnish with coriander.

No Comments

Printing to an HP Laserjet 1020 from FreeBSD 8 using CUPS and foo2zjs

This is an update to my post for FreeBSD 7. I’ve now upgraded to FreeBSD 8 and things are done a bit differently.
Read the rest of this entry »

, , , ,


Printing to an HP Laserjet 1020 from FreeBSD using CUPS and foo2zjs

I’m setting up my Soekris box as a printer server. The printer is a Hewlett Packard Laserjet 1020. I’m running FreeBSD 7-Stable as the operating system and I want to use CUPS as the print manager.

There are a few guides around that show parts of how to do this, but I didn’t find one that had it all in one place. Hence this post.

Read the rest of this entry »

, , , ,

1 Comment

Installing FreeBSD on a Soekris net5501 using PXE and dnsmasq

I’m the proud owner of a new Soekris net5501. This is a low power SBC (Single Board Computer) that I intend to use as a:

  • router,
  • firewall,
  • name server,
  • wireless access point,
  • VPN end-point,
  • PBX,
  • SMTP server,
  • IMAP server,
  • NTP server,
  • file server (both NFS and SMB),
  • UPS monitor,
  • print server,
  • database server, and
  • source control server

for my home network. My preferred operating system is FreeBSD and I’m installing the most recent stable release – 7.2.

Read the rest of this entry »

, , , , ,


Birth of Thomas

Thomas Anthony was born today. Photos are here.




No Comments