Automatically trust all existing Homebrew tap you have added:
brew tap | grep -v "homebrew/" | xargs -I {} brew trust {}Automatically trust all existing Homebrew tap you have added:
brew tap | grep -v "homebrew/" | xargs -I {} brew trust {}| # Dummy |
Nginx can be configured to route to a backend, based on the server's domain name, which is included in the SSL/TLS handshake (Server Name Indication, SNI).
This works for http upstream servers, but also for other protocols, that can be secured with TLS.
nginx -V for the following:
...
TLS SNI support enabled| system.activationScripts.applications.text = let | |
| env = pkgs.buildEnv { | |
| name = "system-applications"; | |
| paths = config.environment.systemPackages; | |
| pathsToLink = "/Applications"; | |
| }; | |
| in | |
| pkgs.lib.mkForce '' | |
| # Set up applications. | |
| echo "setting up /Applications..." >&2 |
| #!/bin/bash | |
| set -e | |
| exec docker run --rm -it -v $(pwd):/pangolin --workdir /pangolin alpine sh -c "wget -O installer \"https://github.com/fosrl/pangolin/releases/download/1.3.1/installer_linux_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')\" && chmod +x ./installer && ./installer" |
| /** | |
| * A backward-compatible for FileReader: readAsBinaryString() method | |
| * @param arrayBuffer {ArrayBuffer} | |
| * @see https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsBinaryString | |
| */ | |
| function readAsBinaryString (arrayBuffer) { | |
| const binary = [] | |
| const arrayBufferView = new Uint8Array(arrayBuffer) | |
| for (let i = 0; i < arrayBufferView.length; i++) { | |
| binary.push(String.fromCharCode(arrayBufferView[i])) |
| #!/bin/bash | |
| # Script is needed because my default firewall rules are messed up and after | |
| # every restart, docker containers can't make connections to the host, notably | |
| # preventing debuggers like xdebug from attaching. | |
| # If networking fails in your containers but works in others, rm and re-create the | |
| # docker network that container is bound to. | |
| set -euo pipefail |
Add a simple Dark Mode toggle to any site without using extensions.
You can add this code to any page using the following bookmarklet:
javascript: (function (d) { sl = d.createElement('style'), s = d.createElement('script'); sl.innerHTML = '.darkmode-layer, .darkmode-toggle { z-index: 500; }'; d.head.appendChild(sl); s.onload = function () { new Darkmode({ saveInCookies: false, label: 'π', right: 'unset', left: '32px' }).showWidget(); }; s.src = '//cdn.jsdelivr.net/npm/darkmode-js@1.5.7/lib/darkmode-js.min.js'; d.head.appendChild(s); })(document)| services: | |
| my-container: | |
| networks: | |
| # Attach the service to the traefik-public network | |
| traefik-public: | |
| deploy: | |
| labels: | |
| # Enable Traefik for this service | |
| - traefik.enable=true | |
| - traefik.http.routers.my-container.rule=Host(`example.com`) |
| /* | |
| Convert an ArrayBuffer into a string | |
| from https://developer.chrome.com/blog/how-to-convert-arraybuffer-to-and-from-string/ | |
| */ | |
| function ab2str(buf) { | |
| return String.fromCharCode.apply(null, new Uint8Array(buf)); | |
| } |