redacted.sh: share your logs, not your secrets

Quick post. Sometimes it is necessary to share logs on public issue trackers, forums... and wanting to protect secrets, tokens, IPs is normal.

I've cooked my own minimal bash script for this quest, which I've just added to my public shared snippets : https://gitea.zoemp.be/sansguidon/snippets/raw/branch/main/redacted.sh

#!/usr/bin/env bash

default_rules=(
  's/[0-9]\{1,3\}\(\.[0-9]\{1,3\}\)\{3\}/<REDACTED_IP>/g'
  's/\b[a-zA-Z0-9._-]\+\.[a-zA-Z]\{2,\}\b/<REDACTED_DOMAIN>/g'
  's/\b[A-Za-z0-9+\/=]\{20,\}\b/<REDACTED_TOKEN>/g'
  's/\(password=\)\S\+/\1<REDACTED_PASS>/g'
)

rules=()
while [[ $1 =~ ^s/ ]]; do
  rules+=("$1")
  shift
done
[[ ${#rules[@]} -eq 0 ]] && rules=("${default_rules[@]}")

sed_expr=()
for r in "${rules[@]}"; do
  sed_expr+=( -e "$r" )
done

# If files are passed, process them to stdout.
# If none, read from stdin to stdout.
if [[ $# -gt 0 ]]; then
  sed "${sed_expr[@]}" "$@"
else
  sed "${sed_expr[@]}"
fi

Feel free to reuse, copy, extend, contact me to give feedback! πŸ’š

πŸ’Œ The best way to get in touch is via my email morgan at zoemp dot be. You can also follow me on the Fediverse / Mastodon at @sansguidon@mamot.fr. I speak (a lot) French, English and a bit of Dutch.


Kudos, Hackers

A quick shout-out to everyone who built the web at its best. Using amazing tools, discovering inspiring sites and communities, connecting with peersβ€”no social networkβ€”rocks.

Despite zero promotion, I occasionally get valuable feedback on this blog and my Shaarli. That means a lot, especially during tough times.

We build on the work of brilliant creatives who laid the groundwork. We save time thanks to countless articles, podcasts, tools and platforms crafted by talented people.

For every idea I have, someone smarter and more passionate probably already built something betterβ€”I know that. Yet I keep building, hoping someone will one day build on my work. Maybe I’ll pave the way for others. So, although support is relevant, I prioritize building useful tools and sharing them with everyone.

And to conclude...


Zombiemerge

I do love code reviews but I'm convinced they're best done live β€” reviewed, merged, communicated immediately.

A few weeks ago I did submit changes through merge requests, and a few weeks later I had completely forgot about their implementation.

I context switched a few times since then....

Today the change was merged by the repository maintainers then a few colleagues were discussing one of its consequences. Only because I was in the same workspace, I did react on time.

My mistake was likely to not have communicated more proactively about the change, likely as I'm not the repository maintainer nor the release maintainer so I had no idea when the change would be merged.

Anyway, there are several such merge requests being queued. All recipes for future headaches.


Productivity monk

I have taken a few habits recently:

  • Inbox zero by bedtime. Unhandled mails go to TickTick.
  • Tasks default to next week. If they matter, they’ll wait.
  • One work task per day. If it drags, I commit or kill it.
  • Articles get bookmarked. Read laterβ€”or never. Doesn’t matter.
  • Tasks get automated. Or ignored.
  • Midnight is my hard stop. Usually...
  • Everything goes in TickTick.
  • No date = no task. No surprises.
  • Task and blog ideas are dumped into TickTick as notes, voice or text.
  • LLMs get a few hours. That’s it. And only for automation.
  • LinkedIn runs on auto-reply.
  • Same rules at home and work. One brain. Scripts everywhere.
  • I keep folders of tabsβ€”Wednesday, Friday, Daily. I open them when it’s time. Not before.
  • I use browser userscripts to bend websites to my will. UX included.
  • Family runs on self-service. Automation takes care of the rest.
  • And a few things don’t changeβ€”only improve: Backups and monitoring for everything. Unit tests for all my scripts. And pipelines. Obviously.

This isn’t a system. It’s survival. Simplicity is the only thing that scales, especially with kids and ADHD.


Things nerds commonly have, but I don’t

Inspiration: https://forkingmad.blog/things-people-commonly-have-but-i-dont/

In a conversation recently with a colleague I casually mentioned I didn't have something. He was shocked... "but how then do you..." was the response.

So here's my list of don't haves

  • Spotify account. I have CDs and I've bought a CD player from KLIM. I just find the CD to be a very nice looking and collectible object, pleasant to listen to. Also I feel it's mine, and I like the creative goodies and packaging that you don't have with a digital copy of an album.
  • A NAS. I don't need a NAS to backup pictures or stream videos through Plex. I have a VPS where I run a Cloudron which hosts most of my web apps, one is for sharing my family pictures. And I also use Syncthing, and Dropbox to keep my photos in sync and backed up in several places. And next to that I use Plex but I just don't host it on my infra, I pay a provider for their generous bandwidth and for the fact they take care of streaming my content through Plex. It's so fluid. I couldn't and wouldn't maintain this at home.
  • A gaming machine nor a gaming chair. Seriously I do not see the point, because I consider most games do not require super advanced graphics or material to be fun. In fact I love minimalistic games with pixellated art. I'm old and also feel nostalgic of specific games that are all forgotten now. Anyway I'm developing the best game ever, which is the only one I play. More about this soon, when I'll buy the domain for the website, after I decide on a name.
  • A mechanical keyboard. Seriously, what's the deal is with those noisy expensive impractical keyboards.
  • A 3D Printer. Seriously, this is so cool to possess one, I just don't have the space for this now. Maybe when I'll have my own space in our future home.
  • A VPN. Sure it sounds secure but it's just someone else glorified proxy, and it's vulnerable to authority requiring logs or to any part getting compromised. You have to blindly and naively trust the VPN and people behind it to not disclose your information when their company will be required to by the authority. If different contexts I use them, i.e at work, of course, wherever it's mandatory.


Mastodon