Search Results for: HOWTO

Using caffeinate to keep your macbook from sleeping

I use a Macbook Pro, running macOS Catalina, and have often found that it will sometimes go to sleep at unfortunate times. Namely, when I am downloading or uploading stuff. So this little HOWTO will show you one way you can prevent that.

Just use the caffeinate command. Simply open a terminal and enter:

Last login: Sat Jul 11 17:56:01 on console
yourname@your-MacBook-Pro ~ % caffeinate -s

As long as your system is on AC power, that command should prevent your system from entering sleep mode. Now your downloads/uploads will continue uninterrupted. And when you’re done, simply press CTRL+C while focussed on the terminal to cancel the command. You’re welcome.

Wageningen University: sending email using msmtp

I have recently posted a pdf explaining how to configure Mutt if you are a student or employee at Wageningen University and wish to use your WURnet email account on your own computer. In that HOWTO the program used to send mail (msmtp) is configured to use DavMail instead of directly connecting to the universities SMTP server. For those of you who do want to connect directly instead, the following lines may be used in “~/.msmtprc”.

# Configuration for direct connection (no DavMail needed)
account WUR
host smtp.wur.nl
port 25
from <firstname.lastname@wur.nl>
tls on
tls_trust_file /usr/local/share/certs/ca-root-nss.crt
tls_starttls on
auth on
user <firstname.lastname@wur.nl>
password <your WURnet password>

This configuration will work on FreeBSD, where the ca-certificates are found in the location /usr/local/share/certs. If you use a different system, then you may need to specify a different directory. Alternatively, it would also be possible (with decreasing security) to use (a) the tls_fingerprint option or (b) the tls_certcheck option (see “man msmtp”). For the tls_fingerprint option, you will need to specify the SHA1 fingerprint of the certificate that the server uses, which you can find by executing e.g.:

$> msmtp –serverinfo –tls –tls-certcheck=off –host=smtp.wur.nl | grep SHA | sed -r ‘s/.{14}//’

If this also doesn’t work (and it really should!), then you could also just use “tls_certcheck no”. But this can leave your email vulnerable to MitM’ing unpleasantness, so it is best avoided.