soc.octade.net is a Fediverse instance that uses the ActivityPub protocol. In other words, users at this host can communicate with people that use software like Mastodon, Pleroma, Friendica, etc. all around the world.
This server runs the snac software and there is no automatic sign-up process.
War, climate among high priority topics at Davos meeting
#comic #unix_surrealism #linux #art #mastoart #computers #bash #dillo #lgbt
Today, I discovered #bash and #ksh extglobs. Very powerful, almost as good as regex!
From BASH(1):
If the extglob shell option is enabled using the shopt builtin, the
shell recognizes several extended pattern matching operators. In the
following description, a pattern-list is a list of one or more patterns
separated by a |. Composite patterns may be formed using one or more
of the following sub-patterns:
?(pattern-list)
Matches zero or one occurrence of the given patterns.
*(pattern-list)
Matches zero or more occurrences of the given patterns.
+(pattern-list)
Matches one or more occurrences of the given patterns.
@(pattern-list)
Matches one of the given patterns.
!(pattern-list)
Matches anything except one of the given patterns.
This was invented for #AI. However, I'm finding it really nice for screen readers:
RTK rewrites output from chatty terminal commands that produce a lot of output, often in complex tables, in order to make the output 80 to 90 percent shorter. Just put rtk in front of the command you want to compress. So "rtk git status" instead of "git status". And you can be sure the compacted output is correct because it's just using regular expressions and deterministic rules under the hood to rewrite output from the tools it knows about. If it doesn't know about a particular command, it just passes the output on unchanged.
github.com/rtk-ai/rtk
Now I've got to figure out how to wire this up in #bash so it'll just happen without me typing rtk all the time.#a11y #screenreader #accessibility #commandline
How to install and enable an SSH server
https://negativepid.blog/how-to-install-and-enable-an-ssh-server/
#SSH #servers #linux #bash #shell #remoteAccess #tech #IT #ITadmin #computing #commandLine #prompt #negativepid
A quick-start guide to Unix commands
https://negativepid.blog/a-quick-start-guide-to-unix-commands/
#UNIX #linux #linuxCommands #cli #bash #admin #administrators #OS #tech #IT #science #STEM #computing #negativepid
Wrote a #shell function without using ls inside of $( ), so my inner @mirabilos won't harass me. XD
#slightly easier wireguard command
function wg {
local dir file profile profiledir= parm=${1:-} statustext
#Find profile dir
for dir in {,/usr/local}/etc/wireguard; do
if [[ -d $dir ]]; then
profiledir=$dir
break
fi
done
#Find config file
if [[ -n $profiledir ]]; then
for file in $profiledir/*.conf; do
if [[ -e $file ]]; then
profile=${file//*\/}
profile=${profile/.conf}
break
fi
done
fi
[[ -n $profile ]] || profile=proton
statustext="wireguard profile $profile"
case ${parm,,} in
up|on) doas wg-quick up $profile;;
down|off) doas wg-quick down $profile;;
status) echo -en "$statustext _______\r"
echo -en "$statustext "
ifconfig |grep -q "^$profile:" && echo enabled || echo disabled;;
*) warn "wg usage: wg up|down|status";;
esac
}
Hmm, seems ${foo,,} for lower case conversion is #bash-only. I wonder if I should use tr instead.
I'm not saying you should all go out and set up aliases to enable your various typos and slip-ups, but I honestly don't know why I didn't do this 25 years ago.
alias cd..='cd ..'
Recursion usually scares me a bit, but it worked out nicely here:
#convert "cx"-style Esperanto notation to native accents (ĉ)
function eaccent {
if [[ ${1:-} ]]; then
echo "$*" |eaccent
else
sed 's/cx/ĉ/g; s/gx/ĝ/g; s/hx/ĥ/g; s/jx/ĵ/g; s/sx/ŝ/g; s/ux/ŭ/g; s/C[xX]/Ĉ/g; s/G[xX]/Ĝ/g; s/H[xX]/Ĥ/g; s/J[xX]/Ĵ/g; s/S[xX]/Ŝ/g; s/U[xX]/Ŭ/g'
fi
}
#bash #unix #shell #scripts #scripting #UnixShell #ShellScripting #Esperanto
do you use file extensions for your scripts?
#scripts #bash #terminal #programming
| Yes: | 33 |
| No: | 17 |
Closed
Am I the only one that never, ever uses getopt/getops in shell scripts?
Just writing your own argument parser seems so much easier to do. :/
Seeing all these videos recently about the Epstein files having the Bash manual in them, I thought it would be a good time to make another new blog post about Bash and some useful built-in functionality that I have come to use and love.
$FUNCNAME
Read about it here; https://meatlotion.com/blog/bash_has_a_call_stack_and_its_glorious/
File this under #shell #functions I should have written years ago:
function grepc {
#Do a grep -c, but skipping files with no results
grep -c "$@" |grep -v ':0$'
}
P.S., the body of the parent #toot was created by a simple #shell #function:
function apod {
#Today's NASA Astronomy Picture of the Day info-fetcher
curl -sL 'https://apod.nasa.gov/apod/archivepix.html' \
|grep -m1 "[0-9][0-9]:" \
|sed 's/^/Date: /;
s|: *<a href="|\nURL: https://apod.nasa.gov/apod/|;
s/">/\nTitle: /; s/<.*$//'
echo
echo "#NASA #Astronomy #PictureOfTheDay"
}
#bash #ksh #mksh #shellScripting #unix #UnixShell #WebScraping #Scraping #HTML
Since people are going nuts online about how perfect February 2026 is... here you go:
~ $ cal feb 2026
February 2026
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
~ $ for x in {1900..2050}; do cal feb $x |grep -q "^ 1 " && echo $x; done
1903
1914
1920
1925
1931
1942
1948
1953
1959
1970
1976
1981
1987
1998
2004
2009
2015
2026
2032
2037
2043
January 29, 2026
After a while the days seem the same. I'll be glad to get out again. Maybe next week. Finished Orbital by Samantha Harvey. Next up, Storm Front. DeOxit my Pioneer HiFi amp. Work on Libre Indie Archive. I'm learning lisp! Running clisp in bash and reading Practical Common Lisp. Fun!
Practical Common Lisp
https://gigamonkeys.com/book/
#journal #discord #HairyLarryLand #books #bash #lisp #cabinfever
I had a thought this morning, and went digging for a simple way to make a pretty display on a linux console from bash.
Found bashsimplecurses, but...
I get q and x instead of lines. Do some googling and it's mostly people talking about putty?
Found if I stick `export NCURSES_NO_UTF8_ACS=1` in .bashrc then it works when I ssh in from Windows... but still gives me x's and q's from the linux console (actual control-alt-f1 console).
Suggestions?
Useful #shell (#ksh/#bash) #function du-jour:
function apod {
#Today's NASA Astronomy Picture of the Day info-fetcher
curl -sL 'https://apod.nasa.gov/apod/archivepix.html' \
|grep -m1 "[0-9][0-9]:" \
|sed 's/^/Date: /;
s|: *<a href="|\nURL: https://apod.nasa.gov/apod/|;
s/">/\nTitle: /; s/<.*$//'
}
~ $ apod
Date: 2026 January 05
URL: https://apod.nasa.gov/apod/ap260105.html
Title: The Red Rectangle Nebula from Hubble
~ $
HERE IS YOUR #bash history #recap / #rewind / #year_in_review !!!
grep -v "^[[:space:]]*#" ~/.bash_history |sed -E 's/^ *(sudo|doas) *//g' |awk '{print $1}' |sort |uniq -c |sort -n |tail -n $((LINES-2))
Example from this laptop:
54 updateall
57 nsxiv
58 pipx
63 pkg_info
73 tail
92 git
106 ssh
109 w3m
110 less
127 echo
138 type
194 searchall
214 grep
225 ststatus
275 duck
286 ll
292 vi
341 man
433 cd
453 ls
(Of course, it's not strictly a YEAR in review. Bash can timestamp the history, but most people don't have that turned on by default)
🥳 New Kitten Release
• Reduces minimum Bash version requirement for installing Kitten to Bash 3.2+ (was previously Bash 5+). This removes the requirement for people on macOS to upgrade the ancient version of Bash that Apple ships with their desktop operating system. (If you’re on Linux none of this was ever an issue for you.)¹
• Updates runtime to Node 24.12.0, the latest long-term support (LTS) version.
¹ While it’s easy enough to update your version of Bash on macOS using Homebrew, that only works (as we discovered on Friday https://mastodon.ar.al/@aral/115706233541301655) if you’re running one of the latest three versions of macOS and thus excludes people with perfectly functional older computers. (Don’t get me started on why Apple ships an ancient version of Bash as we’ll go down the rabbit hole of open as in “open for business” vs “free as in freedom” and corporate capture and how capitalism will happily be the end of us if we let it. Aren’t you glad you didn’t get me started?) ;)
Just finished writing another tool, now I can see NINE known compromised packages are still up for download on NPM! ⚠️
This tool crawls the list of known bad packages and downloads the latest bundle.
It then runs my other checks against the downloaded bundle and logs the results.
https://github.com/datapartyjs/walk-without-rhythm
#WalkWithoutRhythm #Sha1Hulud #NPM #GitHub #Microsoft #nodejs #javascript #cybersecurity #devlog #bash
I'm sleepy and am going to go to bed before working this out, but I'll just put it here:
Why doesn't this bash commandline play the file on every succesful packet?
`ping 9.9.9.9 | (if grep -F 'bytes from'; then aplay ding; fi)`
This also doesn't work:
`(while true; do echo 'bytes from'; sleep 5; done) | (if grep -F 'bytes from'; then aplay ding; fi)`
(the audio should last for 2 seconds)
@landley Using aliases in #bash is just my prefered method since it allows for adding/removing #CLI tools on the fly in userspace when there is no package manager and subsequent tools to make this more convenient.
Decimal to Roman with #bash and #awk #2F
roman() {
echo "$1" | awk '
BEGIN {
vals[1]=1000; syms[1]="M"
vals[2]=900; syms[2]="CM"
vals[3]=500; syms[3]="D"
vals[4]=400; syms[4]="CD"
vals[5]=100; syms[5]="C"
vals[6]=90; syms[6]="XC"
vals[7]=50; syms[7]="L"
vals[8]=40; syms[8]="XL"
vals[9]=10; syms[9]="X"
vals[10]=9; syms[10]="IX"
vals[11]=5; syms[11]="V"
vals[12]=4; syms[12]="IV"
vals[13]=1; syms[13]="I"
}
{
x=$1
for(i=1;i<=13;i++){
while(x>=vals[i]){
printf syms[i]; x-=vals[i]
}
}
printf "\n"
}'
}
The Minecraft Server Written in bash
Here is the page, just to get the link out of the way. It was written by sdomi back in 2023. They were also one of the people who presented the talk from a couple of days ago about turning Chromebooks into more-useable laptops.
Part of the page describing the wholly-questionable project.
People who know what both Minecraft and
https://setsideb.com/the-minecraft-server-written-in-bash/
#niche #bash #minecraft #niche #sdomi #StupidComputerTricks
#Nix #Systemd #Bash #ProgrammingHelp
Does anyone know how to make it so that instead of just grabbing the latest PNG file, systemd passes the file in question to the script? %f doesn't seem to work; $1 ends up giving me the name of the binary and $2 is undefined.
YO, LOOK AT THIS!!!!
rld@prometheus:~$ echo "3c4e 9ffd f962 3c00" |tr A-F a-f |tr -dc 0-9a-f |sed 's/0/ /g; s/1/ #/g; s/2/ # /g; s/3/ ##/g; s/4/ # /g; s/5/ # #/g; s/6/ ## /g; s/7/ ###/g; s/8/# /g; s/9/# #/g; s/a/# # /g; s/b/# ##/g; s/c/## /g; s/d/## #/g; s/e/### /g; s/f/####/g; s/ / /g; s/#/##/g; s/\(................\)/\1\n/g'; echo
########
## ######
## ##########
############ ##
########## ##
#### ##
########
rld@prometheus:~$ echo "3c7e 5a7f 1b3c 5a18" |tr A-F a-f |tr -dc 0-9a-f |sed 's/0/ /g; s/1/ #/g; s/2/ # /g; s/3/ ##/g; s/4/ # /g; s/5/ # #/g; s/6/ ## /g; s/7/ ###/g; s/8/# /g; s/9/# #/g; s/a/# # /g; s/b/# ##/g; s/c/## /g; s/d/## #/g; s/e/### /g; s/f/####/g; s/ / /g; s/#/##/g; s/\(................\)/\1\n/g'; echo
########
############
## #### ##
##############
#### ####
########
## #### ##
####
rld@prometheus:~$ echo "0102 0488 d0e0 f0f8" |tr A-F a-f |tr -dc 0-9a-f |sed 's/0/ /g; s/1/ #/g; s/2/ # /g; s/3/ ##/g; s/4/ # /g; s/5/ # #/g; s/6/ ## /g; s/7/ ###/g; s/8/# /g; s/9/# #/g; s/a/# # /g; s/b/# ##/g; s/c/## /g; s/d/## #/g; s/e/### /g; s/f/####/g; s/ / /g; s/#/##/g; s/\(................\)/\1\n/g'; echo
##
##
##
## ##
#### ##
######
########
##########
Case matters, folks. 🫠
#Linux #FOSS #Terminal #OpenSource #Bash #CommandLine #TechHumor #TechMeme #Humor #Meme #SysAdmin #System #Privacy #InfoSec #CyberSecurity #LinuxLife #LinuxGaming #Shell #DevLife #Dev #Development #CLI #LinuxCommunity #SecureByDesign #Ubuntu #TechNews #Wayland #DevOps #SelfHosting #ArchLinux #Debian #LinuxAdmin #LinuxTips #LinuxMint #Fedora #PopOS #GNULinux #CloudComputing #GNU #BSD #FreeBSD #OpenBSD
git add .
fatal: not a git repository (or any of the parent directories): .git
I want to make a handler that if this happens then it just
git init --initial-branch=main
So I DO love me some python, but I just want to say that #Bash is awesome.
I had no idea this was a thing:
echo "${variable/$inTheString/$replacesIt}"