Skip to content

Instantly share code, notes, and snippets.

@satabin
satabin / 01-README.md
Last active September 2, 2023 14:26
My service maintenance scripts and units

This gist lists the systemd units, timers, and scripts I am running to maintain my various services.

Backups

Data are backed up in an S3 compatible data store. To add a service using a database, just add the service name and database to the services.json file.

The backup runs as the backup user, which has read-only access to all databases. This is ensured by giving the appropriate role:

GRANT pg_read_all_data TO backup;
@satabin
satabin / openpgp.md
Last active November 15, 2022 17:32

openpgp4fpr:2F119CBF23184108B97EB6CA34BC32BC6BAF2948

@satabin
satabin / 00-import-fs2.scala
Last active August 12, 2021 08:58
Rule Engine Part 2, Post snippets
import fs2._
import cats.syntax.all._
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Keybase proof

I hereby claim:

  • I am satabin on github.
  • I am gnieh (https://keybase.io/gnieh) on keybase.
  • I have a public key ASDNK9KUpG-w4ECAhugd06Fup3x0ZPySQJQWKDxnNJn_Tgo

To claim this, I am signing this object:

package swam
package runtime
import util.pretty._
import cfg._
import cfg.dot._
import decompilation._
import cats.effect._
import cats.implicits._
@satabin
satabin / logged.sc
Last active August 1, 2018 14:09
Compiling text WASM module and run it
import swam._
import swam.text._
import swam.runtime._
import swam.runtime.functions._
import swam.runtime.formats.DefaultFormatters._
import cats.effect._
import java.nio.file.Paths
val tcompiler = new Compiler[IO]
$ curl -d '{"fields":["offset"],"use_index":["versioner","offset"],"sort":[{"offset":"desc"}],"selector":{"offset":{"$exists":true}},"limit":1}' -H "Content-Type: application/json" http://localhost:5984/mydb/_find
{"error":"badmatch","reason":"","ref":3988992018}
@satabin
satabin / bamboo-fun.tablet
Last active January 10, 2017 20:11
bamboo-fun.tablet
# Wacom
# Bamboo Fun
# CTE-650
#
# stylus with two buttons and eraser (EP155E)
# Pen active area: 8.53 x 5.33 in
[Device]
Name=Wacom Bamboo Fun Pen
DeviceMatch=usb:056a:0018
def check(before, pattern, after):
import re
if before:
before = '(?<=%s)' % before
else:
before = ''
if after:
after = '(?=%s)' % after
else:
after = ''