mstdn.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A general-purpose Mastodon server with a 500 character limit. All languages are welcome.

Administered by:

Server stats:

12K
active users

#shellscripting

0 posts0 participants0 posts today

Explore how insufficient Linux proficiency derails DevOps delivery, from CI/CD failures and log-processing gaps to container-level misunderstanding. This article lays out common operational traps and empowers you with real-world commands and fixes. A must-read for streamlining automation and boosting resilience.
medium.com/@ismailkovvuru/top-
#DevOps #Linux #CI_CD #technology #ShellScripting #aws

Top Issues DevOps Engineers Face Without Linux Knowledge
Medium · Top Issues DevOps Engineers Face Without Linux KnowledgeIn today’s DevOps-driven world, Linux isn’t just an operating system — it’s the foundation of everything from cloud infrastructure to…

https://lists.debian.org/debian-release/2014/01/msg00116.html
LOL я ещё помню огромное количество скриптов на TCL (и даже гуёв на TK) и времена, когда он был гораздо популярнее петухона (для всего).

Считался серьёзным, взрослым и развитым ЯП *по сравнению с BASH

а его уже, оказывается, уже 10+ лет как повыпиливали из всех дистрибов (групп пакетов base)

когда-то питона запросто могло не быть tclsh везде стоял.

PERL ненавижу (и радуюсь его смерти), а об этом красавчике жалею, сильнее него жалко только Ruby

#!/usr/bin/env tclsh

# Скрипт для поиска и анализа email-адресов без регулярных выражений
# Демонстрирует чистоту Tcl-синтаксиса и богатство стандартной библиотеки

proc extract_emails {text} {
    set emails {}
    foreach word [split $text " "] {
        # Удаляем знаки пунктуации на концах слов
        set clean_word [string trim $word ",.;:\"'(){}[]"]
        
        # Проверяем базовые условия email без regexp
        if {[string first "@" $clean_word] > 0} {
            set parts [split $clean_word "@"]
            if {[llength $parts] == 2} {
                set domain [lindex $parts 1]
                if {[string first "." $domain] > 0 && 
                    [string length [lindex [split $domain "."] end]] > 1} {
                    lappend emails $clean_word
                }
            }
        }
    }
    return $emails
}

proc analyze_domains {emails} {
    # Используем dict для группировки - демонстрируем встроенную поддержку 
    # ассоциативных массивов в стандартной библиотеке
    set domain_counts [dict create]
    
    foreach email $emails {
        set domain [lindex [split $email "@"] 1]
        dict incr domain_counts $domain
    }
    
    # Сортируем результаты с использованием встроенных возможностей
    return [lsort -decreasing -integer -index 1 [dict tolist $domain_counts]]
}

# Пример использования - демонстрирует лаконичность и читаемость
set sample_text "Контакты: john@example.com, jane@company.org, 
                admin@example.com, support@tcl-lang.org, user@gmail.com"

# Tcl обрабатывает данные как списки и строки, используя простые команды
set emails [extract_emails $sample_text]

# Использование идиоматического Tcl-стиля с lmap (начиная с Tcl 8.6)
set formatted_emails [lmap email $emails {string totitle $email}]

puts "Найдено [llength $emails] email-адресов:"
foreach {domain count} [analyze_domains $emails] {
    puts "  $domain: $count"
}

# Демонстрация работы с вложенными структурами данных
set stats [dict create \
    total [llength $emails] \
    unique_domains [llength [analyze_domains $emails]] \
    sample [lrange $formatted_emails 0 1] \
]

puts "\nСтатистика: [dict get $stats total] адресов, [dict get $stats unique_domains] уникальных доменов"
puts "Примеры: [join [dict get $stats sample] {, }]"

# Пример использования apply для функционального подхода
set uppercase_emails [lmap email $emails {
    apply {{e} {string toupper $e}} $email
}]
puts "\nВ верхнем регистре: [join $uppercase_emails {, }]"
#shell-scripting #code #Linux #Tcl

New #blog post: Why I Love the Command Line

https://rldane.space/why-i-love-the-command-line.html

1081 words

I was grappling with a much heavier subject for a blost, but thankfully, I had this extra little subject in my back pocket, just ready to be picked up and written on much more easily and enjoyably than mental health stuff. ;)

cc: my wonderful #chorus: @joel @dm @sotolf @thedoctor @pixx @orbitalmartian @adamsdesk @krafter @roguefoam @clayton @giantspacesquid @Twizzay @stfn

(I will happily add/remove you from the chorus upon request! :)

#100DaysToOffload #45

rldane.spaceWhy I Love the Command Line

In the early 70s, Ken Thompson wrote the original Unix shell by hand, giving users a simple but powerful interface to control the system. It allowed commands to be chained, redirected, and scripted, laying the foundation for nearly every terminal-based environment that followed. Even now, shells like sh, bash, and zsh all trace their lineage back to Thompson’s early work.

Shell two-liner to watch your phone battery via KDE Connect while charging (or discharging):

alias kcbatt='qdbus6 org.kde.kdeconnect /modules/kdeconnect/devices/$(grep -Em1 "^\[[0-9a-f_]+\]" ~/.config/kdeconnect/trusted_devices |tr -dc 0-9a-f_)/battery org.kde.kdeconnect.device.battery.charge'

ob=0; while b=$(kcbatt); do if ((ob!=b)); then date "+%H:%M $b%%"; ob="$b"; fi; sleep 5; done

In the helpful shell functions department:

(Requires bc to be installed)

load() {
    local load=$(uptime |sed -E "s/^.*load averages?: //; s/,.*$//")
    local uname="$(uname)"
    local cpus
    if [[ $1 == -q ]]; then
        echo "$load"
    elif [[ $1 == -i ]]; then
        echo "$load + 0.5" |bc -l |cut -f1 -d.
    else
        case "$uname" in
            Linux)  cpus=$(grep -c ^processor /proc/cpuinfo);;
            *BSD)   cpus=$(sysctl hw.ncpu |tr -dc "0-9\n");;
            *)      warn "load(): assuming 1 cpu, don't know how to get the number in \"$uname\""
                    cpus=1;;
        esac
        local loadPerCPU=$(echo "scale=3; $load / $cpus" |bc -l |sed 's/^\./0./')
        echo "$load ($loadPerCPU per processor ($cpus))"
    fi
}

#Poll: Curious about people's attitudes towards shell scripting.

Two part question:

  1. Are you a DEVeloper (or working in a development-heavy role), OTHER-IT worker (such as a sysadmin, architect, anything in a non-development-heavy role), or NON-IT (accountant, doctor, whatever)
  2. Do you HATE shell scripting, are you INDIFferent towards (or ignorant of) shell scripting, or do you LOVE it?

Liebe Folglinge,

ich suche leider noch immer nach einem neuen Job als #iOS und/oder #macOS Entwickler. Ich spreche #ObjectiveC, #Swift (auch Server-Side) und #SwiftUI und nutze die ganzen Tools drumherum (#Xcode, #Git, #GitHub, #GitHubActions, #ShellScripting etc.). Ich bringe 30 Jahre Berufserfahrung als Software-Entwickler mit, davon knapp 20 im #Apple Ökosystem.

Am Idealsten waere eine #Festanstellung zu 100% remote. Sollte es im Raum #Bregenz oder #Dornbirn etwas geben, dann auch gerne vor Ort.

Ich danke euch fuers Teilen. 🙏🏻
:boost_ok:

LinkedIn: linkedin.com/in/phranck/
Xing: xing.com/profile/Frank_Gregor0

The more #sh scripting I do, the more I love it and wondering why I didn't learn it earlier. So for #wakegp now I have done this to have 256 runs for different values of deletion_mutation_rate and deletions_per_mutation:

➜  runs5 git:(main) for i in {0..255}; do 
for> for size in nanod minid microd halfd thirdd majord; do
for for> for r in 1 2 4 8 16; do
for for for> w_run p4_"$size"_"$r" $i;
for for for> done
for for> done
for> done

w_run itself is a function I defined in my .zshrc

But of course, the syntax is hard. And it's not as easy to learn as something like Python. I wonder if #unixlike operating systems such as #Linux and #BSD would consider quitting the current sh in favor of something new designed from scratch.

Last time I remember, in the list of projects #NLnet had founded, there was a niche new shell invented for unix like systems. I'm gonna check it out. Also #OpenBSD people have something for themselves.

Edit: I had forgotten to add echo -n "$i "; date +%T

#FreeBSD#tech#geek

When I was young and computer resources were limited I thought: "Why the hell am I messing with shell scripts when I could just do it more easily with Python?"

30 years later I'm older and computer resources seems to be unlimited and I think: "Why the hell am I wasting resources using Python when shell scripting is already there and does the job?"

New #blog post: Gathering Hashtags from the Fediverse

https://rldane.space/gathering-hashtags-from-the-fediverse.html

282 words (2233 counting the hashtags, but that's just silly)

cc: my wonderful #chorus: @joel @dm @sotolf @thedoctor @pixx @twizzay @orbitalmartian @adamsdesk @krafter @roguefoam @clayton @giantspacesquid

(I will happily add/remove you from the chorus upon request! :)

#100DaysToOffload #27

rldane.spaceGathering Hashtags from the Fediverse

I'm exploring ways to improve audio preprocessing for speech recognition for my [midi2hamlib](github.com/DO9RE/midi2hamlib) project. Do any of my followers have expertise with **SoX** or **speech recognition**? Specifically, I’m seeking advice on: 1️⃣ Best practices for audio preparation for speech recognition. 2️⃣ SoX command-line parameters that can optimize audio during recording or playback.
github.com/DO9RE/midi2hamlib/b #SoX #SpeechRecognition #OpenSource #AudioProcessing #ShellScripting #Sphinx #PocketSphinx #Audio Retoot appreciated.

Contribute to DO9RE/midi2hamlib development by creating an account on GitHub.
GitHubGitHub - DO9RE/midi2hamlibContribute to DO9RE/midi2hamlib development by creating an account on GitHub.