Quick reference for restarting PipeWire audio services without logging out.
# Stop all PipeWire services
systemctl --user stop pipewire pipewire-pulse wireplumber| # Keycloak containers doesn't come with curl or wget in it, this forces the users to use alternative mechanisms to realise | |
| # health check for the keycloak standard containers. This example leverages the capability of modern Java to dynamically | |
| # compile a *.java source file and execute it on the fly using the `java` command. The HealthCheck class uses | |
| # java.net.URL to open a connection to the `health/live` endpoint of keycloak and exits the process with a non-zero status | |
| # if the http status is not `Ok` | |
| version: '3' | |
| services: | |
| ############################ | |
| # Keycloak service | |
| ############################ |
| * Shows a message while asserting like: | |
| ok: [host] => { | |
| "msg": "disk usage 4.2B of total 20.0GB (21.0%) (should exceed limit 90.0%)" | |
| } | |
| * Note this only looks at first mount point on current node | |
| * Fails if disk is near-full | |
| * Last step pushes to a push-based monitoring service, which will alert us if it doesn't get there after some time | |
| * Need to setup a variable `disk_limit`, which is the max acceptable usage ratio, e.g. set it to 0.8 if you want to keep disks within 80% of max size |
| const strategy = 'keycloak' | |
| export default function ({ app }) { | |
| const { $axios, $auth } = app | |
| if (!$auth.loggedIn || !$auth.strategies[strategy]) | |
| return | |
| const options = $auth.strategies.keycloak.options |
| /** | |
| * Returns SHA-256 hash from supplied message. | |
| * | |
| * @param {String} message. | |
| * @returns {String} hash as hex string. | |
| * | |
| * @example | |
| * sha256('abc').then(hash => console.log(hash)); | |
| * const hash = await sha256('abc'); | |
| */ |
| // Get all users | |
| var url = "http://localhost:8080/api/v1/users"; | |
| var xhr = new XMLHttpRequest() | |
| xhr.open('GET', url, true) | |
| xhr.onload = function () { | |
| var users = JSON.parse(xhr.responseText); | |
| if (xhr.readyState == 4 && xhr.status == "200") { | |
| console.table(users); | |
| } else { | |
| console.error(users); |
The idea is to provide a database as a service to end users in such a way that no one except the user herself can access the data, not even the hosting provider or the database administrator.
| # | |
| # A: | |
| # pubsub = PgPubSub.new('channelname') | |
| # pubsub.subscribe do |data| | |
| # puts "data: #{data} is coming!" | |
| # end | |
| # | |
| # B: | |
| # pubsub = PgPubSub.new('channelname') | |
| # pubsub.publish("hello world") |