mamot.fr is one of the many independent Mastodon servers you can use to participate in the fediverse.
Mamot.fr est un serveur Mastodon francophone, géré par La Quadrature du Net.

Server stats:

3.2K
active users

#scripting

17 posts17 participants2 posts today

💡 Idea for a debugging script 💡

This might already exist for FreeBSD, and if so.. let me know!

- 1) keeps record of OS core/default settings: loader.conf, rc.conf, sysctl.conf, devfs.rules, login.conf etc
- 2) keeps record of file checksum on those OS core files (similar to the app, tripwire)
- 3) mode which shows divergence on current state vs known-default state in configs (1) and checksums (2)
-4) mode which tracks the files and their change-sets over time, similar to a zfs snapshot but at a single file-level

Here's a demo of the mp3 glitching script I wrote about here: reillyspitzfaden.com/posts/202

I added a batch script so I can take in a bunch of folders of .wav files, use ffmpeg to convert them to mp3 (and try out different bitrates), glitch them, re-encode those as .wav (easier to work with), and then clean up all the intermediate mp3s.

In less than 18 hours, including a solid 12 hours (at least) of downtime, I have gone from concept to 90% functional prototype of a creative rPi project, thanks to aus.social allowing quick and easy downloads, jq, an obscure CUPS driver project, and an intimate knowledge of scripting.

Feeling very accomplished.

Today I found that bash uses dynamic scoping, not lexical scoping. So if you have a

function inner() {
echo "$x"
}

it will go up the call stack to find the first x defined as

local x

in any caller and print it. Pity (add more swearwords here)🙁 . There is a reason why emacs lisp is being converted to lexical scoping despite having decades of dynamic binding history.

#bash #dynamicscoping #lexicalscoping #programming #scripting

stackoverflow.com/a/48166252/2

Stack OverflowUnderstanding lexical scoping - is Wikipedia correct?I've been trying to grok lexical scoping (I'm far from convinced by the use of the word lexical but that's another discussion) and I've looked at Wikipedia's entry. According to the fairly simple ...
Continued thread

I also have a script (github.com/reillypascal/person) that takes a flag for the interaction type and a URL, extracts the title from the URL, and creates a new interaction post (e.g., like, RSVP, etc.). Makes things much more convenient than having to copy all that down by hand!

GitHubpersonalsite-ssg/interaction at main · reillypascal/personalsite-ssgMy personal site, formatted for a static site generator (Eleventy) - reillypascal/personalsite-ssg

I added some more cool things to my grimoire! reillyspitzfaden.com/code/#gri

I have interactions on Mastodon/Bluesky coming in as webmentions, and that's nice, but other sources get lost in the shuffle, so I have a script here (github.com/reillypascal/person) that filters out all the ones where "wm-source" contains "brid.gy/," which is super helpful.

reillyspitzfaden.comReilly Spitzfaden, Composer | Code

Measuring times in bash.

- time: put in front of your command and it spits out some timing millisecond resolution, but you cannot capture the number to use it elsewhere
- starttime=$(date +%s%N) and same for endtime: this is expensive in the millisecond range, because the external command, date is run
- printf "%(%s)T" has only seconds resolution

Now I found "$EPOCHREALTIME". But set LC_NUMERIC=en first or lose.

gnu.org/software/bash/manual/h

www.gnu.orgBash Variables (Bash Reference Manual)Bash Variables (Bash Reference Manual)