toot.wales is one of the many independent Mastodon servers you can use to participate in the fediverse.
We are the Open Social network for Wales and the Welsh, at home and abroad! Y rhwydwaith cymdeithasol annibynnol i Gymru, wedi'i bweru gan Mastodon!

Administered by:

Server stats:

666
active users

#bash

18 posts16 participants1 post today

Vim users:

Do you use vi mode in your shell (bash, zsh, fish, etc.), the default bash mode, or something else?

#vim#vi#bash

#ripgrep replacement in #bash with #GNU #grep.

forgejo.mueller.network/Zenton

ripgrepgeneric: da, wo es kein ripgrep gibt ☝️

zum beispiel auf alten, zu migrierenden, servern. auf denen es wohl noch alte configs zu durchforsten, aber keine attraktive möglichkeit ripgrep nachzuinstallieren, gibt.

da sucht man, in welcher datei das suchwort drinsteht und wenn ja, an welcher stelle.

dieser zweizeiler mit variablenübernahme wird durch das script komftebel™ vertreten.

Summary card of repository Zentonic/ripgrepgeneric
forgejo.mueller.network: Beyond coding. We Forge.ripgrepgenericrgn [PATH] [EXPRESSION] -> ripgrep Ersatz mit GNU grep

Hi everyone! I recently released 3 blog posts!
All of them are writeups on CTFs where I make some scripts and tools in bash and golang!

I'll leave you the link of the blog posts and if you have any suggestions or interact with me, don't hesitate to comment or DM me!

I hope you all can enjoy reading them!

blog.jackrendor.dev/posts/tryh

blog.jackrendor.dev/posts/tryh

blog.jackrendor.dev/posts/tryh

Jack Rendor's blog - Penetration Tester and Security Researcher · Tryhackme Security FootageWriteup on Security Footage, a room from TryHackMe where I explore the possible ways to extract files from a pcap file.

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
}
Continued thread

(more Linux news in original post)

NVIDIA 580 Linux driver will be the last to support Maxwell, Pascal and Volta GPUs, X11 versions older than v1.17 will also be deprecated:
phoronix.com/news/NVIDIA-580-L

Bash 5.3 released with a new form of command substitution that executes the command within the current shell execution context, GLOBSORT variable can be used to determine how the shell will sort results of pathname completion, etc.:
phoronix.com/news/GNU-Bash-5.3

DXVK 2.7 released with Direct3D 8 / 9 / 10 / 11 based games and applications running atop the Vulkan API, other changes:
phoronix.com/news/DXVK-2.7-Rel

Alpine Linux developer Ariadne Conill announced Wayback, a new X11 compatibility layer on Wayland, utilizing a rootful XWayland server:
phoronix.com/news/Wayback-X11-

TUXEDO Stellaris 16 Gen7 laptop available with AMD Ryzen 9 9955HX and AMD Ryzen 9 9955HX3D processors:
9to5linux.com/tuxedo-stellaris

Linux reaches 5% desktop marketshare in the US:
ostechnix.com/linux-reaches-5-

(FOSS news in comments)

www.phoronix.comNVIDIA Confirms 580 Linux Driver Is The Last For Maxwell / Pascal / Volta

#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?

Seit 25 Jahren arbeite ich mit Linux und ja – Windows ist nicht das OS, das ich freiwillig nutzen möchte. Aber dieses ewige OS-Bashing erinnert eher an einen Streit auf dem Pausenhof als an einen erwachsenen Diskurs. Wer Spaß an seinem System hat, soll es nutzen. Linux ist solide, manchmal sogar elegant – aber kein Heilsversprechen. Und das muss es auch nicht sein.

Die Welt dreht sich weiter – ob mit #Bash oder #PowerShell spielt längst nicht mehr die Hauptrolle.

How would you solve the following use case when #bash #scripting ?

Given a text file and need to insert a line somewhere specific.
Extra challenging: Assume some lines are identical.

This might be worth sharing with @b0rk 's audience.

I'll share a solution I just used at work in the first comment; worth adding to ones #cheatsheet!