Skip to content

Instantly share code, notes, and snippets.

@kare
kare / README.md
Last active May 21, 2023 13:16
Systemd unit file Streamr Broker Node

Streamr Broker Node Systemd Unit file

  1. Place the file to directory /etc/systemd/system/
  2. Customise line 21 --network streamr \ to match your Docker network or remove it to use the default network (not recommended)
  3. Customise line 25 --volume /host/broker/config/dir:/root/.streamr:rw \ replace /host/broker/config/dir with the directory of you broker-config.json file.
  4. Current configuration exposes WebSocket plugin port 7170 to public internet. You may open other ports for plugins if you like. For example to publish MQTT port add: --publish 1883:1883/tcp \
  5. Run sudo systemctl enable /etc/systemd/system/streamr-broker-node.service
  6. Run sudo systemctl start streamr-broker-node
  7. Check logs with sudo journalctl -xefu streamr-broker-node or if you have pino-pretty installed use sudo journalctl -xefu streamr-broker-node | pino-pretty -t
@kare
kare / tail-docker-containers.bash
Last active June 3, 2022 10:08
Tail logs of all Docker containers bash script
#!/bin/bash
set -e -u -o pipefail
function usage() {
local name
name=$(basename "$0")
echo "$name: tail Docker container logs" 1>&2
echo "Usage: $name [-h]" 1>&2
echo " -h Show help" 1>&2
echo "Example: $name" 1>&2
@kare
kare / env-github-actions.txt
Created September 6, 2021 15:55
Output of `env` command on GitHub Actions Ubuntu 20.04 runner
SELENIUM_JAR_PATH=/usr/share/java/selenium-server-standalone.jar
CONDA=/usr/share/miniconda
GITHUB_WORKSPACE=/home/runner/work/io.github.***/io.github.***
JAVA_HOME_11_X64=/usr/lib/jvm/adoptopenjdk-11-hotspot-amd64
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_3fe28a69-5405-4735-a92b-a3dd7ce21bce
GITHUB_ACTION=env
JAVA_HOME=/usr/lib/jvm/adoptopenjdk-11-hotspot-amd64
GITHUB_RUN_NUMBER=52
GRADLE_HOME=/usr/share/gradle-7.2
XDG_CONFIG_HOME=/home/runner/.config
Images Root Filesystems Virtual Filesystems Volumes Temporary Filesystems
Host-Editable Yes No Yes Varied No
Mutable No Yes Yes Yes Yes
Persistent Yes No Yes Yes No
Performance High High Low-Medium High High
Ease of Use Varied Trivial Trivial Varied Complex
@kare
kare / go-unit-test-setup-and-teardown-test-run-single.txt
Created November 24, 2016 13:44
Go unit test setup and teardown test-run-single.txt
=== RUN TestAddition
=== RUN TestAddition/add
--- PASS: TestAddition (0.00s)
math_test.go:6: setup test case
--- PASS: TestAddition/add (0.00s)
math_test.go:13: setup sub test
math_test.go:15: teardown sub test
math_test.go:8: teardown test case
PASS
ok github.com/kare/go-unit-test-setup-teardown 0.012s
@kare
kare / go-unit-test-setup-and-teardown-math_setup_and_teardown_test.go
Created November 22, 2016 17:53
Go unit test setup and teardown math_test.go
package math
import "testing"
func setupTestCase(t *testing.T) func(t *testing.T) {
t.Log("setup test case")
return func(t *testing.T) {
t.Log("teardown test case")
}
}
@kare
kare / go-unit-test-setup-and-teardown-test-run.txt
Created November 22, 2016 17:21
Go unit test setup and teardown test-run.txt
=== RUN TestAddition
=== RUN TestAddition/add
=== RUN TestAddition/minus
=== RUN TestAddition/zero
--- PASS: TestAddition (0.00s)
math_test.go:6: setup test case
--- PASS: TestAddition/add (0.00s)
math_test.go:13: setup sub test
math_test.go:15: teardown sub test
--- PASS: TestAddition/minus (0.00s)
@kare
kare / go-unit-test-setup-and-teardown-math_test.go
Created November 22, 2016 17:15
Go unit test setup and teardown math_test.go
package math
import "testing"
func TestAddition(t *testing.T) {
cases := []struct {
name string
a int
b int
expected int
@kare
kare / go-unit-test-setup-and-teardown-math.go
Created November 22, 2016 17:04
Go unit test setup and teardown math.go
package math
func Sum(a, b int) int {
return a + b
}
@kare
kare / plan9-bind-net-tcp-proc.txt
Created November 18, 2016 09:50
bind /net/tcp /proc; ps -ef # Plan 9
kkn% ps -ef
glenda 1 0:00 0:00 268K Await bootrc
glenda 3 0:00 0:00 0K Wakeme mouse
glenda 5 0:00 0:00 0K Wakeme alarm
glenda 7 0:00 0:00 188K Pread paqfs
glenda 9 0:00 0:00 128K Pread mntgen
glenda 14 0:00 0:00 136K Pread mntgen
glenda 18 0:00 0:00 116K Pread mntgen
glenda 30 0:00 0:00 0K Wakeme aoesweep
glenda 36 0:00 0:00 0K Wakeme rxmitproc