snabelen.no is one of the many independent Mastodon servers you can use to participate in the fediverse.
Ein norsk heimstad for den desentraliserte mikroblogge-plattformen.

Administrert av:

Serverstatistikk:

449
aktive brukere

#cli

5 innlegg5 deltakere0 innlegg i dag

#ReleaseWednesday Just pushed a new version of thi.ng/block-fs, now with additional multi-command CLI tooling to convert & bundle a local file system tree into a single block-based binary blob (e.g. for bundling assets, or distributing a virtual filesystem as part of a web app, or for snapshot testing, or as bridge for WASM interop etc.)

Also new, the main API now includes a `.readAsObjectURL()` method to wrap files as URLs to binary blobs with associated MIME types, thereby making it trivial to use the virtual filesystem for sourcing stored images and other assets for direct use in the browser...

(Ps. For more context see other recent announcement: mastodon.thi.ng/@toxi/11426498)

Stupid-but-works tip on how to add inline documentation comments for multi-line shell commands in scripts: Combine command substitution with grave accents "`" and the do-nothing built-in command ":":

```shell
% ls \
> -h `: this is a comment` \
> -a `: this is another comment` \
> -t `: more commentssss`
```

3 years ago, as I just had created Offpunk, I started to implement what would become ansicat : a way to render HTML (or any format) in your terminal

Besides a lot of technical learning, the biggest lesson was probably how bad people are at writing texts and abusing any format.

ploum.net/2022-03-24-ansi_html

See the results here:

offpunk.net/install.html

ploum.netRendering the Web with Pictures in Your Terminal : more than you would like to know about HTML, ANSI and the philosophy of communication.
Mer fra ploum

🐘 Mastodon Account Archives 🐘

TL;DR Sometimes mastodon account backup archive downloads fail to download via browser, but will do so via fetch with some flags in the terminal. YMMV.

the following are notes from recent efforts to get around browser errors while downloading an account archive link.

yes, surely most will not encounter this issue, and that's fine. there's no need to add a "works fine for me", so this does not apply to your situation, and that's fine too. however, if one does encounter browser errors (there were several unique ones and I don't feel like finding them in the logs).

moving on... some experimentation with discarding the majority of the URL's dynamic parameters, I have it working on the cli as follows:

» \fetch -4 -A -a -F -R -r --buffer-size=512384 --no-tlsv1 -v ${URL_PRE_QMARK}?X-Amz-Algorithm=AWS4-HMAC-SHA256

the primary download URL (everything before the query initiator "?" has been substituted as ${URL_PRE_QMARK}, and then I only included Amazon's algo params, the rest of the URL (especially including the "expire" tag) seems to be unnecessary.

IIRC the reasoning there is about the CDN's method for defaulting to a computationally inexpensive front-line cache management, where the expire aspects are embedded in the URL instead of internal (to the CDN clusters) metrics lookups for cache expiration.

shorter version: dropping all of the params except the hash algo will initiate a fresh zero-cached hit at the edge, though likely that has been cached on second/non-edge layer due to my incessent requests after giving up on the browser downloads.

increasing the buffer size and forcing ipv4 are helpful for some manner of firewall rules that are on my router side, which may or may not be of benefit to others.

- Archive directory aspect of URL: https://${SERVER}/${MASTO_DIR}/backups/dumps/${TRIPLE_LAYER_SUBDIRS}/original/
- Archive filename: archive-${FILE_DATE}-{SHA384_HASH}.zip

Command:

» \fetch -4 -A -a -F -R -r --buffer-size=512384 --no-tlsv1 -v ${URL_PRE_QMARK}?X-Amz-Algorithm=AWS4-HMAC-SHA256

Verbose output:

resolving server address: ${SERVER}:443
SSL options: 86004850
Peer verification enabled
Using OpenSSL default CA cert file and path
Verify hostname
TLSv1.3 connection established using TLS_AES_256_GCM_SHA384
Certificate subject: /CN=${SEVER}
Certificate issuer: /C=US/O=Let's Encrypt/CN=E5
requesting ${URL_PRE_QMARK}?X-Amz-Algorithm=AWS4-HMAC-SHA256
remote size / mtime: ${FILE_SIZE} / 1742465117
archive-${FILE_DATE}-{SHA384_HASH}.zip 96 MB 2518 kBps 40s

@stefano looks to be working now :)

🔥 Keep your commits consistent!
🔥 forgejo-commit-path-rules v0.2.3 ensures your commit messages align with your file changes.

🧩 Enforce commit message and file path rules in your repo!

🦀 Written in Rust
⭐ Repo: https://codeberg.org/kemitix/forgejo-commit-path-rules
🎬 A ForgeJo Action/CLI Tool

✨ What's New:

- Coloured highlights in logging (supports --no-colour)
- all matching strategy for paths (default is any)
- Built in templates: docs, feature, tests and fixes

🛠 Usage:

- Define rules in .forgejo/commit-path-rules.toml
- Run via CLI or ForgeJo Action

Install:
cargo install forgejo-commit-path-rules

CLI Usage:
forgejo-commit-path-rules --workspace . --no-colour

Forgejo Action:

 jobs:
  validate:
   steps:
    - uses: actions/checkout@v3
      with:
        fetch-depth: 0
    - name: Run forgejo-commit-path-rules
      uses: kemitix/commit-path-rules@v0.2.3
      with:
        args: --verbose