This script spins up the Pico W as a Wifi Access Point. It assigns itself the IP 192.168.4.1 and assigns new Clients some IP starting at 192.168.4.16 or so.
import network
from machine import Pin
led = Pin("LED", Pin.OUT)
The sketch is not by me, it's reduced to a minimum and to document for myself how I connected the display 😅
Strapi is a great project, but lacks of a good documentation concerning customization. This gist presents some of my findings / experiments to customize strapi.
My use-case: find
and findOne
need to be active to keep nested queries on other user-relations. But if I allow authenticated users to access these routes, they can access all users. So I customize these routes with my own policies:
To give access to a role from the users-permissions model in Strapi v4, you need to create a permission and add it to the role.
Useful for testing. Gives authenticated users access to the provided routes.
import request from "supertest";
import { setupStrapi, stopStrapi } from "../../../../tests/helpers/strapi";
import { createUser } from "../../../../tests/user/factory";
let user;
// Taken from https://codesandbox.io/s/wg9317 | |
// Thanks, you helped me a lot! https://github.com/haysclark | |
import strapi, { Strapi } from "@strapi/strapi"; | |
import { compile } from "@strapi/typescript-utils"; | |
import * as fs from "fs"; | |
let instance: Strapi; | |
export const setupStrapi = async (): Promise<Strapi> => { |
If you have an M1 Mac and want to compile and execute x86_64 assembly code, make sure you install Rosetta 2 and nasm
(brew install nasm
).
Than, take a 64 Bit assembly program, e.g. from this tutorial page (https://cs.lmu.edu/~ray/notes/nasmtutorial/) in Section
"Your First Program" for macOS, save it to a file called hello.asm
.
Compile, link and execute the program:
nasm -f macho64 hello.asm
ld hello.o -o hello -macosx_version_min 11.0 -L /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib -lSystem
./hello
This solution is based the code snippet provided @nsteinmetz in this issue.
If you deployed mattermost via the helm chart, you might experience the same problem as we at @schnaq did: the mounted volumes belong to root but not to the mattermost user. This is a problem if you want to install settings, or new plugins (e.g. the playbook or the focalboard).
To fix this, we checked the id
of the mattermost user in our running pod:
# Vorher: pip install jwt[crypto] | |
import jwt | |
# Hier ein Beispiel mit einem Testtoken, er wurde mit folgenden Befehlen erstellt: | |
# | |
# ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key | |
# openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub | |
testing_private_key = """ |
#!/usr/bin/env bb | |
;; Code based on https://gist.github.com/roman01la/c6a2e4db8d74f89789292002794a7142 | |
;; We converted it work with babashka. Start it with `bb re_frame_subscriptions.clj` | |
(ns re-frame-subscriptions | |
(:require [clojure.set :as set] | |
[babashka.pods :as pods])) | |
(pods/load-pod "clj-kondo") |
To cache the layer containing the dependencies from your Clojure project, you can execute a command without starting a REPL. This downloads all common dependencies, which are then be cached.
For example:
FROM clojure:openjdk-14-tools-deps-alpine
# Cache and install Clojure dependencies
COPY deps.edn .