Leandro Santiago
April 29th 2025
---
Language files blank comment code
---
Go 387 10282 3234 39579
Vuejs Component 32 669 221 6890
PO File 11 734 838 1770
JavaScript 14 204 109 1141
SVG 13 1 42 964
Markdown 20 511 32 962
Text 13 177 0 873
YAML 3 24 6 323
Python 5 129 49 254
XML 1 6 0 195
CSS 1 30 0 141
make 1 64 8 125
Bourne Shell 9 42 21 110
Properties 5 26 25 30
Dockerfile 1 11 1 26
HTML 1 1 2 17
---
SUM: 525 12911 4588 102061
---
$ git shortlog -s -n
1012 Leandro Santiago
301 Sam Tuke
266 Marcel Edmund Franke
173 suela
41 suelaP
14 Weblate Admin
11 nico
5 Kristina Qejvanaj
5 Weblate
2 Lightmeter Weblate Bot
2 Slavomir
1 Dirk Weise
1 Ergis
1 N J
1 Suela
1 Suela Palushi
Jan 20 19:48:05 srv0 postfix/smtpd[2467304]: connect from unknown[1.2.3.4]
Jan 20 19:48:04 srv0 postfix/smtpd[2467304]: B9996EABB6: client=unknown[1.2.3.4], sasl_method=PLAIN, sasl_username=sender@internal.org
Jan 20 19:48:05 srv0 postfix/cleanup[2467311]: B9996EABB6: message-id=<h-74f3afb0208ad285a794d760c8feb0eee631@internal.org>
Jan 20 19:48:05 srv0 opendkim[12864]: B9996EABB6: DKIM-Signature field added (s=key, d=internal.org)
Jan 20 19:48:05 srv0 postfix/qmgr[1937864]: B9996EABB6: from=<sender@internal.org>, size=2239, nrcpt=2 (queue active)
Jan 20 19:48:05 srv0 postfix/smtpd[2467304]: disconnect from unknown[1.2.3.4] ehlo=1 auth=1 mail=1 rcpt=2 data=1 quit=1 commands=7
Jan 20 19:48:07 srv0 postfix/smtp[2467312]: B9996EABB6: to=<recipient1@external.org>, relay=example-com.mail.protection.outlook.com[12.11.12.13]:25, delay=2.7, delays=1.3/0.06/0.33/1, dsn=2.0.0, status=sent (250 2.0.0 OK 1642704487 v125si7680590wme.216 - smtp)
Jan 20 19:48:07 srv0 postfix/smtp[2467312]: B9996EABB6: to=<recipient2@external.org>, relay=example-com.mail.protection.outlook.com[13.11.12.13]:25, delay=2.7, delays=1.3/0.06/0.33/1, dsn=2.0.0, status=sent (250 2.0.0 OK 1642704487 v125si7680590wme.216 - smtp)
Jan 20 19:48:07 srv0 postfix/qmgr[1937864]: B9996EABB6: removed
Postfix log tracking is painful
Fast startup, small download.
First rule of distributed systems: Do not distribute.
Optimize for single node: memory is much faster than network
Prefer local IPC (including go channels) and Unix domain sockets for communication
$ rg errorutil.MustSucceed -g '!*_test.go' | wc -l
86
$ rg '\brecover\(\)' -g '*.go'
deliverydb/recover_release.go
16: if r := recover(); r != nil {
deliverydb/recover_dev.go
16: if r := recover(); r != nil {
$ rg '\selse\s' -g '*.go'
recommendation/cmd/gen.go
86: } else if resp.StatusCode >= 400 {
tracking/tracking_test.go
248: // as there are use cases where a message is trriggered via something else than authenticated SMTP (local scripts, for instance)
dashboard/dashboard.go
142: case d.direction when @Outbound then d.sender_local_part else d.recipient_local_part end as local_part,
143: case d.direction when @Outbound then d.sender_domain_part_id else d.recipient_domain_part_id end as domain_part_id,
tools/poutil/poutil.go
56: } else {
tools/go2po/main.go
167: } else if ident.Name == FuncI18n {
205: } else {
237: } else {
240: } else {
notification/email/email_test.go
99: Recipients: "recipient@example2.com, Someone else <recipient2@some.other.address.com>, a.third.one@lala.com",
130: Recipients: "recipient@example2.com, Someone else <recipient2@some.other.address.com>, a.third.one@lala.com",
163: So(msg.Header.Get("To"), ShouldEqual, "recipient@example2.com, Someone else <recipient2@some.other.address.com>, a.third.one@lala.com")
Being SQLite specific allows using it in its full power instead of the “least common denominator” of SQL.
“microservices” inside a monolith?
$ ls /var/lib/lightmeter/workspace/
auth.db
auth.db-shm
auth.db-wal
connections.db
connections.db-shm
connections.db-wal
http_sessions
insights.db
insights.db-shm
insights.db-wal
intel-collector.db
intel-collector.db-shm
intel-collector.db-wal
logs.db
logs.db-shm
logs.db-wal
logtracker.db
logtracker.db-shm
logtracker.db-wal
master.db
master.db-shm
master.db-wal
rawlogs.db
rawlogs.db-shm
rawlogs.db-wal
fopen(3)
).TL;DR; have a single writer and an an arbitrary number of readers.
The writer connection or transactions or are never exposed, to prevent misuse.
Not really a new idea.
Apple introduced similar idea the Grand Central Dispatch in 2007.
// Publisher
type publisher struct {
// A queue of actions, which are simply functions
actions chan<- dbrunner.Action
}
func (pub *publisher) Publish(r postfix.Record) {
// Queue new action
pub.actions <- func(_ *sql.Tx, stmts dbconn.TxPreparedStmts) error {
return stmts.Get(insertLogLineKey).Exec(r.Time.Unix(), r.Sum, r.Line)
}
}
Writer implementation here.
You can define custom functions and they execute in the same process as the rest of your application.
Uncle Ben’s quote goes here.
If it’s too much, you should probably write your functions in C/C++/Rust/Zig
...
release/1.9.0 Mon Oct 4 15:49:52 2021 +0000
release/1.9.1 Mon Oct 11 12:54:13 2021 +0000
release/2.0.0-RC1 Dec 11 19:31:31 2021 +0000
release/2.0.0-RC2 Dec 13 19:44:15 2021 +0000
release/2.0.0-RC3 Dec 15 22:10:12 2021 +0000
release/2.0.0-RC4 Jan 21 23:01:12 2022 +0000
release/2.0.0-RC5 Feb 24 19:12:05 2022 +0000
release/2.0.0-RC6 Mar 8 11:14:42 2022 +0000
release/2.0.0-RC7 Mar 16 13:39:51 2022 +0000 --
release/2.0.0-RC8 Feb 28 09:36:09 2023 +0000 --
release/2.0.0-RC9 Aug 22 09:16:35 2023 +0000 --
Control Center ultimately became a client for a subscription service we were trying to sell
go:embed
,
no generics, etc.).Most users use GMail and Outlook.
There was big demand demand for Lightmeter ControlCenter in 2019.
2025 has shown us that the world can no longer depend on American companies.
I believe the need to host e-email indepedently will grow again.
We (Lightmeter) failed to understand the users’ needs and build a sustainable product to address them.
I believe I am in a better position to understand them now.
https://gitlab.com/leandrosansilva/controlcenter
https://www.forbes.com/sites/davidjeans/2021/03/01/elastic-war-on-amazon-web-services/
https://github.com/tobinjt/ASO
https://www.johntobin.ie/publications/sgai-2008.pdf
https://sqlite.org/deterministic.html
Leandro Santiago
social@setefaces.org