#Shellscript

2026-03-04

Mi skribis unu simpla #ShellScript por fari elŝuti de ĉiu senpaga #RaspberryPi revuoj de oficiala retejo.

Kiuj posedas intereso en uzi ĝi, povas recevi ĝi en: github.com/A-Infor/Shell-Scrip

Raspberry Pi revuoj kovriloj.RaspberryPi revuoj elŝutaĵo.Shell Script
Jonathan Kamens 86 47jik@federate.social
2026-02-21

Here's a little puzzle for you. Can you figure out the purpose of this one-off shell script I just wrote?
If you post an answer put it behind a CW so you don't spoil it for others!
#programming #scripting #shellScript #shellScripting #Linux

#!/bin/bash

files=$(ls bc*.ppm)
numfiles=$(ls $files | wc -l)
numpages=$((numfiles*2))
frontat=1
backat=$numpages

for file in $files; do
    filewidth=$(pamfile -size $file | awk '{print $1}')
    pagewidth=$((filewidth/2))
    pamcut -right $pagewidth $file >| left.ppm
    pamcut -left $((pagewidth+1)) $file >| right.ppm
    if ((frontat % 2 == 0)); then
        mv left.ppm split$(printf %02d $frontat).ppm
        mv right.ppm split$(printf %02d $backat).ppm
    else
        mv right.ppm split$(printf %02d $frontat).ppm
        mv left.ppm split$(printf %02d $backat).ppm
    fi
    ((++frontat))
    ((--backat))
done
2026-01-31

And today's multi-hour confusing time suck was:

`curl -H "Authorization: ${TOKEN}"`

(Note conspicuous lack of the word `Bearer`)

To add #insult to #injury, this old #Perl guy had to dig into some #PHP in order to figure out where his stupid #shellscript went wrong.

On the other hand, I did gather enough #research to propose a #solution to #decommission a piece of #commercial software in favor of a mix of #cloud services and #selfhosted #opensource.

2026-01-27

CLI siêu nhẹ dùng Ollama chuyển ngôn ngữ tự nhiên thành lệnh shell, mặc định qwen2.5-coder, dễ chuyển mô hình bằng `--model`/`ASK_MODEL` và `OLLAMA_HOST`. Thích hợp cho dev muốn nhanh chóng biến mô tả thành câu lệnh. #Ollama #CLI #Shell #AI #Programming #LậpTrình #CôngCụ #AIVietnam #ShellScript

reddit.com/r/ollama/comments/1

2026-01-26

Hi! I'm Koffietje! (Not very original, might change that later.)
Obviously, I'm a big fan of coffee! Generally black, over-steeped in a French press. But lately I've been messing around with the Moka pot.

I'm also big on Linux. My daily driver is Fedora, which seems to work incredibly well on my computers. I'm also curious about ARM & RISC-V, and have dipped my toes into BSD. Always trying to learn more, and currently I'm working on my Bash skills, trying to get into network administration, managing VMs, and figuring out self-hosting.

When I'm not tinkering with my machines (which is rare, since I may or may not have way too many...) I like to play video games. Currently I'm running through Vampire Survivors, but I generally really enjoy rogue-li{k,t}es. Numbers! And they go up! What fun!

I've also recently gotten the "Retro Bug", learning about (and yearning for) 80s/90s/00s PCs and retro games I missed out on. Hopefully I can restore an iMac G3 one day. (And I'll throw OpenBSD on that sucker!)

When I've got the time, I like to read. Pretty much purely non-fiction, usually something computer-related. Mostly on an e-reader (thanks, Calibre!) but I do very much enjoy physical books. Any recommendations? Let me know!

Beyond that, I'm vegetarian (moving towards and very close to being vegan), take care of way too many houseplants, and I can be both OCD-ish and overly verbose. But, I'm very friendly! So if you want to talk to me, please do so! Can't have too many friends, right?

Lastly, here is the command in case you want to create something similar:
echo -e '\n\n' && echo -e "Hi, I'm Koffietje! Linux & BSD guy, big computer nerd, lover of non-fiction books, and enjoyer of the occasional (retro) game." '\n' "I'm friendly, so feel free to reach out about anything!" '\n' "And lastly, I hope you have a great day!"| cowsay
(Cowsay and Cool Retro Term required!)

Some hashtags: #Linux #BSD #Coffee #Fedora #ARM #RISC-V #Bash #Gaming #Roguelike #Roguelite #Calibre #Vegetarian #houseplants #OCD #Friendly #ShellScript

An image of the terminal command line (Cool Retro Term) showing the following text:
Hi, I'm Koffietje! Linux & BSD guy, big
computer nerd, lover of non-fiction
books, and enjoyer of the occasional
(retro) game.

I'm friendly, so feel free to reach out
about anything!

And lastly, I hope you have a great
day!

It's encased in an ASCII text box, spoken from an ASCII Art cow (cowsay).

The terminal has a vintage/retro effect, and the main color is amber over a brown background.
Rosa Luxemburgo :Ryyca:RosaLuxemburgo@ursal.zone
2026-01-24

Muita discussão interessante rolando no fidigerson e eu... há três dias tentando recuperar um arquivo. :angery:
Provavelmente a parte de recuperar é a mais simples. O difícil é encontrar o diacho do arquivo numa montanha de arquivinhos... Fiz logo um script shell pq a quantidade tá brutal.

#testdisk #photorec #recuperaçãodearquivos #shellscript #shell #bash

N-gated Hacker Newsngate
2026-01-15

🚀🕰️ Ah, the of square brackets in shell scripting—the forgotten relics of our youth! 🤓📚 Luca Ferrari takes us on a time-traveling adventure to rediscover the ancient art of 'test,' proving once again that some people will do anything to relive their university glory days. 🎓💾
fluca1978.github.io/2025/12/10

David Cantrell 🏏DrHyde@fosstodon.org
2026-01-02

Re earlier toot ... as soon as I'd finished dealing with #dependabot's PRs, I wanted to use the script to view other peoples' PRs against my code (there are only two that I've not dealt with because I'm a good boy, although one has been festering for 7 years because I'm a bad boy), and then to see all my PRs against other peoples' code that are still open. And so the script got just a teensy bit bigger.

github.com/DrHyde/shellscripts

#ShellScript

𝕿𝖍𝖊 𝕮𝖆𝖕𝖙𝖆𝖎𝖓!roymathur
2025-12-20

:

clear && echo "" && date | tr -d "\n" && uptime && echo ""

Output:

Sat Dec 20 12:18:53 GMT Standard Time 2025 12:18:53 up 5 days, 16:03, load average: 0.00, 0.00, 0.00

NB This is a script running on . Enjoy .

2025-12-02

MisskeyのAPIの叩き方(curl, Ruby) #ShellScript - Qiita https://mnmm.top/hvr

2025-11-22

(22 Nov) Aeryth – AppImage to Package Converter Aeryth is a shell script designed to convert .AppImage files into distribution packages ❲.deb for Debian and .pkg.tar.zst for Arch Linux❳. https://www.linuxlinks.com/aeryth-appimage-package-converter/ #appimage #cli #shell-script

Aeryth options
2025-11-14

@DecaTec@mastodon.social

Hi. Ich bin zufällig über
#NextCloudBackupRestore (https://codeberg.org/DecaTec/Nextcloud-Backup-Restore) gestolpert und habe das gleich mal getestet (Bislang nur manuell und noch nicht per #Cronjob).

Super. Vielen Dank dafür.
👍

Ich hätte allerdings noch 2 Feature Requests für das
#Skript:

1. Rechteanpassung im Ziel:

#
# Check if backup dir already exists
#
if [ ! -d "${backupDir}" ]
then
mkdir -p "${backupDir}"
#chown -R "${user}" "${backupDir}"
#chmod 700 -R "${backupDir}"
else
errorecho "ERROR: The backup directory ${backupDir} already exists!"
exit 1
fi
Hier musste ich die chown und chmod Befehle auskommentieren, da das auf dem sftp-Share eine Fehlermeldung über fehlende Rechte erzeugt und dann das Skript abbricht. Ohne die Rechteanpassung läuft's durch.

2.
Nicht den gesamten
#Webserver für die ganze Laufzeit des #Backup stoppen, sondern nur den #vhost von #Nextcloud deaktivieren.

Hintergrund:
Ich (und wahrscheinlich auch andere) sichere auf ein eingebundenen
#sftp #Share zu einem anderen Server in einem anderen Rechenzentrum. Auch wenn die Anbindung zwischen diesen deutlich dicker ist als ein Heiminternetanschluss, dauert das bei meiner NC fast eine Stunde.

Da auf dem
#VPS (wie wahrscheinlich bei vielen) noch mehr #Webanwendungen laufen, ist alles nicht erreichbar, wenn der Webserver komplett gestoppt wird.

Ich kann das nur hart ins Backupskript coden. für mehr reichen meine Skriptfähigkeiten nicht:
Statt
#
# Stop web server
#
echo "$(date +"%H:%M:%S"): Stopping web server..."
systemctl stop "${webserverServiceName}"
echo "Done"
echo
sieht das bei mir nun so aus:
echo "$(date +"%H:%M:%S"): Disabling Nextcloud vhost ..."
a2dissite nextcloud.conf
echo "Done"
echo
echo "$(date +"%H:%M:%S"): Reloading webserver ..."
systemctl restart "${webserverServiceName}"
echo "Done"
echo
und dementspechend am Ende des Skripts statt
#
# Start web server
#
echo "$(date +"%H:%M:%S"): Starting web server..."
systemctl start "${webserverServiceName}"
echo "Done"
echo
dann
echo "$(date +"%H:%M:%S"): Enabling Nextcloud vhost ..."
a2ensite nextcloud.conf
echo "Done"
echo
echo "$(date +"%H:%M:%S"): Restarting web server..."
systemctl restart "${webserverServiceName}"
echo "Done"
echo
Aber das mit einer Variable für den vhost abzubilden und diese in die beim setup.sh in NextcloudBackupRestore.conf zu schreiben, wäre natürlich besser und damit wieder universal nutzbar.

Bin gespannt auf deine / eure Rückmeldung.

#Nextcloud #Backup #Skript #Script #Shellskript #Shellscript

2025-11-08
Copiei aqui o :shell: script que rodo na Ayom, com a principal diferença sendo o uso de :docker: contêiner, mas também é possível adaptar pra usar outro programa de compressão. Qual teria custo/benefício mais interessante que pigz é a pulga atrás da orelha... :nazare:

:sh: backup_mastodon-db.sh :gplv3+:

Quem quiser permanecer com gzip sem paralelismo ainda pode tentar reduzir o esforço, como está no script, para 1, pra ver se melhora o tempo sem perder tanta razão de compressão. Acho que li mais fontes sobre isso, mas uma delas é Peter Eisentraut — Check your pg_dump compression levels.

#PostgreSQL #shellScript #blambers #SoftwareLivre #GPLv3 #fediAdminBR #gzip #pigz
2023-07-22

Social Media, Shell Scripts, & Some ImageMagick!

spectra.video/w/6ADxCxAB13TXvv

Michael Boelenmboelen@mastodon.nl
2025-10-28

"Bestandsnamen onder Linux moet je altijd eenvoudig houden."

"hold my beer"

Kan nu snel de status van alle video's zien en ze doorschuiven naar de volgende fase als het klaar is 😎

#linux #shellscript

Uitvoer van een programma onder Linux met daarin emoji's in bestandsnamen om de status aan te geven
2025-10-09

Today was #rage and #pullrequests.

1. Yes, #hardcoded #opaque identifiers are a little tiny bit faster in this task that runs for a couple of minutes on an irregular, on-demand basis. But maybe you should look up those monstrosities starting from their #humanfriendly equivalents which are much more descriptive.

2. Fine, you wrote some #shellscript with #LLM. It's not very #DRY and it interfaces poorly with the #pipeline syntax. This will require #commits to a branch, not just a #review.

Client Info

Server: https://mastodon.social
Version: 2025.07
Repository: https://github.com/cyevgeniy/lmst