Archive for category Computing

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>

    </Type>

, , , ,

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 »

, , , ,

3 Comments

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 »

, , , , ,

2 Comments