We can export a mermaid diagram to PNG very simply using the official Mermaid CLI Tool.
Installation via npm
npm i -g mermaid.cli
Usage:
We can export a mermaid diagram to PNG very simply using the official Mermaid CLI Tool.
Installation via npm
npm i -g mermaid.cli
Usage:
#!/bin/bash | |
# -- | |
# Test if Docker daemon disk space usage is above a given limit in bytes. | |
# | |
# Example 1: Docker disk space usage is above limit | |
# | |
# $ source is_docker_disk_space_usage_above_limit.sh | |
# $ is_docker_disk_space_usage_above_limit 1 | |
# Docker disk space usage is above limit (actual: 1050000005B, limit: 1B) | |
# $ printf $? |
Download Manjaro Distribution
Format USB Drive
To find the volume identifier of our USB stick, we run
This is more or less a note-to-self.
Note: this doesn't seem to be the simplest solution. See edit from 27th June 2021 below.
If ZSH's compaudit
complains about insecure directories on a Mac, removing write permissions will fix the issue (see this SO answer):
chmod g-w ${insecure-directories}
If you run a multi-user setup, [Brew][brew-home]'s doctor command will likely report lack of write permission on directories under /usr/local
(e.g. /usr/local/etc
).
The suggested fix is to chown -R $(whoami) ${directory}
for all directories ${directory}
without write permission by the current user.
While this is a quick fix, it will force us to do the same procedure over again when we change to another user.
A better solution is to create a brew user group and add every user to this group that uses Brew as detailed [in this blog post][brew-multi-user]. While it's possible to add a user group via the command line. The simpler solution is to just use System Preferences > Users & Groups.
Once the group is created — called brew-users in this example — we can run the following to change the group for all files/directories managed by Brew (i.e. those stored under $(brew --prefix)
) to the Brew user group and give the group writing
I stumbled upon this today when I wanted to get a precommit hook running again that runs tfsec.
If we want to ignore multiple errors with tfsec, then we can use the -e
flag and a comma separated string.
E.g. if we have a s3.tf violating AWS001, AWS002, and AWS017, we'll get the following output from tfsec:
$ tfsec
The import statements in Python code generated from factored Protobuf files do not correctly point to the modules to be imported.
Note: By factored, I mean at least two files a.proto
and b.proto
with potential of mutual dependencies.
We want to send some protobuf serialized data to an implemented RPC API endpoint for testing.
Note: This is especially helpful if you work with [Twirp][3] and code in Python since the code generator does not yield a JSON Protobuf client.
You can use the protoc
command to generate binary data and then pass them to curl
(see [1] and [2]).