This script detects apps with not yet updated versions of Electron.
Repo: https://github.com/tkafka/detect-electron-apps-on-mac
See:
This script detects apps with not yet updated versions of Electron.
Repo: https://github.com/tkafka/detect-electron-apps-on-mac
See:
| #!/usr/bin/env -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | grep -oP 'sha256:[0-9a-f]*')" | |
| # syntax = docker/dockerfile:1.4.0 | |
| FROM node:20 | |
| WORKDIR /root | |
| RUN npm install sqlite3 |
| import collections, random, sys, textwrap | |
| # Build possibles table indexed by pair of prefix words (w1, w2) | |
| w1 = w2 = '' | |
| possibles = collections.defaultdict(list) | |
| for line in sys.stdin: | |
| for word in line.split(): | |
| possibles[w1, w2].append(word) | |
| w1, w2 = w2, word |
Hetzner no longer offers direct install of FreeBSD, but we can do it ourselves. Here is how :)
Boot the Hetzner server in Hetzner Debian based rescue mode. ssh into it.
The Hetzner rescue image will tell you hardware details about the server in the login banner. For example, with one of my servers I see:
| import collections | |
| import random | |
| import timeit | |
| pop = [ | |
| (b := random.randint(1900, 2000), random.randint(b + 1, b + 100)) | |
| for _ in range(10000) | |
| ] | |
| PAT="" | |
| ORG_NAME="" | |
| DEFAULT_JSON={ | |
| "organization": { | |
| "policies": { | |
| "disallow_third_party_application_access_via_oauth": false, | |
| "disallow_ssh_authentication": false, | |
| "log_audit_events": true, | |
| "allow_public_projects": true, | |
| "additional_protections_public_package_registries": true, |
When running FastAPI app, all the logs in console are from Uvicorn and they do not have timestamp and other useful information. As Uvicorn applies python logging module, we can override Uvicorn logging formatter by applying a new logging configuration.
Meanwhile, it's able to unify the your endpoints logging with the Uvicorn logging by configuring all of them in the config file log_conf.yaml.
Before overriding:
uvicorn main:app --reload| { | |
| "annotations": { | |
| "list": [ | |
| { | |
| "builtIn": 1, | |
| "datasource": { | |
| "type": "grafana", | |
| "uid": "-- Grafana --" | |
| }, | |
| "enable": true, |
| /* | |
| STRINGS | |
| */ | |
| Assert.Equal(expectedString, actualString); | |
| Assert.StartsWith(expectedString, stringToCheck); | |
| Assert.EndsWith(expectedString, stringToCheck); | |
| // Some can also take optional params | |
| Assert.Equal(expectedString, actualString, ignoreCase: true); | |
| Assert.StartsWith(expectedString, stringToCheck, StringComparison.OrdinalIgnoreCase); |