Ayn Rand: The Fountainhead

Probably the best book I’ve read so far.

The creator lives for his work. He needs no other men. His primary goal is within himself.

Howard Roark

This had been recommended to me several times, and while I tried to start a couple of times, I never made it past the first few pages. Then I picked it up (when I found it somewhere buried on my kindle) and without any knowledge of the author, the book,.. and no research done beforehand, read it. It’s amazing.

withings-sync on debian buster

Since Withings migrates to OAuth 2.0 by 2021-09, I felt it was time to update the flaky sync solution I had running so far.

Now running https://github.com/jaroslawhartman/withings-sync with debian’s virtualenv:

apt install virtualenv python3-virtualenv
virtualenv -p python3 withings-sync
source withings-sync/bin/activate
pip install withings-sync
export WITHINGS_USER=you
withings-sync

(get token, then set up a regular job to sync)

$ cat sync.sh
#!/bin/bash
source withings-sync/bin/activate
export WITHINGS_USER=you
export GARMIN_USERNAME=you-but-on-garmin
export GARMIN_PASSWORD=your-garmin-password
withings-sync
$ chmod 700 sync.sh
crontab -e
12 4 * * * cronic /home/you/sync.sh

ufw: reminder

apt-get install ufw
ufw app list
ufw allow "WWW Full"
ufw allow "OpenSSH"
ufw enable
ufw status

neat!

setup smtp relay, via relayhost

Wanted to set up a relay, so I can de-/multiplex smtp to different destinations.

Set up A record for mx.destdomain.tld

In receiving dns zone, set up mx record, add spf:

rcptdomain.tld		MX	0 mx.destdomain.tld
rcptdomain.tld		TXT	v=spf1 a mx -all

Configure postfix: configure as relay, and add relayhost to send mail with

sudo apt-get install postfix libsasl2-modules

vi /etc/postfix/main.cf
myhostname = mx.destdomain.tld
mydomain = destdomain.tld
myorigin = destdomain.tld
virtual_alias_domains = rcptdomain.tld
virtual_alias_maps = hash:/etc/postfix/virtual
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_sasl_tls_security_options = noanonymous
smtp_tls_security_level = encrypt
header_size_limit = 4096000
relayhost = [smtp.sendgrid.net]:587
inet_protocols = ipv4

vi /etc/postfix/virtual
user@rcptdomain.tld user@gmail.com
postmap /etc/postfix/virtual

vi /etc/postfix/sasl_passwd
[smtp.sendgrid.net]:587 apikey:KEY_GOES_HERE
chmod 600 /etc/postfix/sasl_passwd
postmap /etc/postfix/sasl_passwd

/etc/init.d/postfix restart

sources:

https://jichu4n.com/posts/custom-domain-e-mails-with-postfix-and-gmail-the-missing-tutorial/

https://blog.ruanbekker.com/blog/2018/11/23/setup-a-relayhost-with-postfix-to-send-mail-via-sendgrid/

https://www.spf-record.com/generator

https://www.linode.com/docs/guides/postfix-smtp-debian7/