home.social

#bashrc — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #bashrc, aggregated by home.social.

  1. #bashrc #bash
    Weil ich doch immer wieder cat benutze wenn ich den Inhalt einer Datei anzeigen möchte.

    Diese Funktion miau für . bashrc schlägt google-Ki vor

    miau() {
    printf '%s' "$(<"$1")"
    }

    bin aber nicht ganz zufrieden wegen echo Attribut -n 🤔

    a=test.txt
    echo -n "In $a steht der Text "; miau $a

  2. Ускоряем навигацию в 5 раз: CD-меню для частых папок

    Привет, Хабр! Сколько раз за день Вы вводите cd ~/projects/current-project/src/components/very-long-folder-name , чтобы просто перейти в нужную директорию? Такая навигация в терминале отнимает кучу времени и сил, теряется фокус. В данной статье хочу поделиться простым bash-скриптом, который покажет Вам пронумерованный список избранных папок и позволит переходить в них одной цифрой.

    habr.com/ru/articles/958676/

    #Linux #bashrc #bash #bashскрипт #оптимизация #cd

  3. Ускоряем навигацию в 5 раз: CD-меню для частых папок

    Привет, Хабр! Сколько раз за день Вы вводите cd ~/projects/current-project/src/components/very-long-folder-name , чтобы просто перейти в нужную директорию? Такая навигация в терминале отнимает кучу времени и сил, теряется фокус. В данной статье хочу поделиться простым bash-скриптом, который покажет Вам пронумерованный список избранных папок и позволит переходить в них одной цифрой.

    habr.com/ru/articles/958676/

    #Linux #bashrc #bash #bashскрипт #оптимизация #cd

  4. Ускоряем навигацию в 5 раз: CD-меню для частых папок

    Привет, Хабр! Сколько раз за день Вы вводите cd ~/projects/current-project/src/components/very-long-folder-name , чтобы просто перейти в нужную директорию? Такая навигация в терминале отнимает кучу времени и сил, теряется фокус. В данной статье хочу поделиться простым bash-скриптом, который покажет Вам пронумерованный список избранных папок и позволит переходить в них одной цифрой.

    habr.com/ru/articles/958676/

    #Linux #bashrc #bash #bashскрипт #оптимизация #cd

  5. Ускоряем навигацию в 5 раз: CD-меню для частых папок

    Привет, Хабр! Сколько раз за день Вы вводите cd ~/projects/current-project/src/components/very-long-folder-name , чтобы просто перейти в нужную директорию? Такая навигация в терминале отнимает кучу времени и сил, теряется фокус. В данной статье хочу поделиться простым bash-скриптом, который покажет Вам пронумерованный список избранных папок и позволит переходить в них одной цифрой.

    habr.com/ru/articles/958676/

    #Linux #bashrc #bash #bashскрипт #оптимизация #cd

  6. I'm trying to create an #alias in the #bashrc for the command-line tool #pwgen. I want to exclude certain characters using the "-cnys -r" switch. Because this also affects characters that cause the command to abort (such as " and '), I only get an error message. I'm familiar with exclusion markers, but the usual suspects, "\" or "/," are also part of the excluded string. I can't find a suitable solution online. Surely someone here has the necessary knowledge, right?

    #Arch #Linux #ArchLinux #bash #cli #Console #Terminal

  7. I'm trying to create an #alias in the #bashrc for the command-line tool #pwgen. I want to exclude certain characters using the "-cnys -r" switch. Because this also affects characters that cause the command to abort (such as " and '), I only get an error message. I'm familiar with exclusion markers, but the usual suspects, "\" or "/," are also part of the excluded string. I can't find a suitable solution online. Surely someone here has the necessary knowledge, right?

    #Arch #Linux #ArchLinux #bash #cli #Console #Terminal

  8. I'm trying to create an #alias in the #bashrc for the command-line tool #pwgen. I want to exclude certain characters using the "-cnys -r" switch. Because this also affects characters that cause the command to abort (such as " and '), I only get an error message. I'm familiar with exclusion markers, but the usual suspects, "\" or "/," are also part of the excluded string. I can't find a suitable solution online. Surely someone here has the necessary knowledge, right?

    #Arch #Linux #ArchLinux #bash #cli #Console #Terminal

  9. I'm trying to create an #alias in the #bashrc for the command-line tool #pwgen. I want to exclude certain characters using the "-cnys -r" switch. Because this also affects characters that cause the command to abort (such as " and '), I only get an error message. I'm familiar with exclusion markers, but the usual suspects, "\" or "/," are also part of the excluded string. I can't find a suitable solution online. Surely someone here has the necessary knowledge, right?

    #Arch #Linux #ArchLinux #bash #cli #Console #Terminal

  10. I'm trying to create an #alias in the #bashrc for the command-line tool #pwgen. I want to exclude certain characters using the "-cnys -r" switch. Because this also affects characters that cause the command to abort (such as " and '), I only get an error message. I'm familiar with exclusion markers, but the usual suspects, "\" or "/," are also part of the excluded string. I can't find a suitable solution online. Surely someone here has the necessary knowledge, right?

    #Arch #Linux #ArchLinux #bash #cli #Console #Terminal

  11. Für das Kommandozeilen Werkzeug #pwgen versuche ich einen #alias in der #bashrc anzulegen. Mit dem Schalter "-cnys -r" sollen bestimmte Zeichen ausgeschlossen werden. Weil es auch Zeichen betrifft, die zum Abbruch des Befehls führen (wie z.B. " und '), bekomme ich nur eine Fehlermeldung angezeigt. Exclusion Marker sind mir ein Begriff, aber die üblichen Verdächtigen hierfür "\" oder "/", sind ja ebenfalls Teil der auszuschließenden Zeichenkette. Im Web finde ich keine passende Lösung. Hier hat doch bestimmt jemand das nötige Wissen, oder?

    #Arch #Linux #ArchLinux #bash #cli #Konsole #Terminal

  12. Für das Kommandozeilen Werkzeug #pwgen versuche ich einen #alias in der #bashrc anzulegen. Mit dem Schalter "-cnys -r" sollen bestimmte Zeichen ausgeschlossen werden. Weil es auch Zeichen betrifft, die zum Abbruch des Befehls führen (wie z.B. " und '), bekomme ich nur eine Fehlermeldung angezeigt. Exclusion Marker sind mir ein Begriff, aber die üblichen Verdächtigen hierfür "\" oder "/", sind ja ebenfalls Teil der auszuschließenden Zeichenkette. Im Web finde ich keine passende Lösung. Hier hat doch bestimmt jemand das nötige Wissen, oder?

    #Arch #Linux #ArchLinux #bash #cli #Konsole #Terminal

  13. Für das Kommandozeilen Werkzeug #pwgen versuche ich einen #alias in der #bashrc anzulegen. Mit dem Schalter "-cnys -r" sollen bestimmte Zeichen ausgeschlossen werden. Weil es auch Zeichen betrifft, die zum Abbruch des Befehls führen (wie z.B. " und '), bekomme ich nur eine Fehlermeldung angezeigt. Exclusion Marker sind mir ein Begriff, aber die üblichen Verdächtigen hierfür "\" oder "/", sind ja ebenfalls Teil der auszuschließenden Zeichenkette. Im Web finde ich keine passende Lösung. Hier hat doch bestimmt jemand das nötige Wissen, oder?

    #Arch #Linux #ArchLinux #bash #cli #Konsole #Terminal

  14. Für das Kommandozeilen Werkzeug #pwgen versuche ich einen #alias in der #bashrc anzulegen. Mit dem Schalter "-cnys -r" sollen bestimmte Zeichen ausgeschlossen werden. Weil es auch Zeichen betrifft, die zum Abbruch des Befehls führen (wie z.B. " und '), bekomme ich nur eine Fehlermeldung angezeigt. Exclusion Marker sind mir ein Begriff, aber die üblichen Verdächtigen hierfür "\" oder "/", sind ja ebenfalls Teil der auszuschließenden Zeichenkette. Im Web finde ich keine passende Lösung. Hier hat doch bestimmt jemand das nötige Wissen, oder?

    #Arch #Linux #ArchLinux #bash #cli #Konsole #Terminal

  15. #bash_scripting #bash #terminal #bashrc
    x
    Quick question, how do I enable persistent command history in an apple terminal shell? (up arrow remembers all previous commands even from previous sessions)

  16. @nickbearded you know you gotta love hashcat for all the protocols it works on. I got second r proxy online debianws.lexgopc.com/
    it has some stuff, i am spidering it with the other r proxy box (yacy.lexgopc.com) so all the info will be indexed and searchable. I have to make a couple static sites and then jump back to dynamic basic wp/drupal but also rag pipelines/pydantic, have been v busy with work and ongoing health issues, still getting there bit by bit. i am also going to try and pivot more to studying for cert - I am bad at time management but if i can pivot for a month or something and pass cert likely worth it. if i have wherewithal to get it done is another matter - hopefully. the dynamic portals have a future, I will get more balanced.
    i approve of testing on various platforms #devops #bashrc #bashcoreX #federated platforms #random oracles #blackbox zimbra

  17. @gary_alderson Absolutely, I agree 100%. Seeing things in action makes all the difference. I’m curious to hear what people notice or suggest once it’s out. Some hooks are subtle, others more obvious, and feedback, good or bad, always helps sharpen the vision.
    Action precedes understanding, indeed. 🔁💡
    #bashcore #bashrc #buildinpublic

  18. @nickbearded that is the most constructive and best option (maybe) - then people can see what all the neat hooks are plus you may get some feedback and suggestions - not all of them may be great but some may be - action precedes understanding #bashrc #recordmydesktop #totalrecall

  19. #bashrc

    i see i've got these lines, causing my issue.
    what s that which cmdAlias?

    ```
    # Cleanup orphaned packages
    alias cleanup='sudo pacman -Rns $(pacman -Qtdq)'

    # Get the error messages from journalctl
    alias jctl="journalctl -p 3 -xb"

    # Recent installed packages
    alias rip="expac --timefmt='%Y-%m-%d %T' '%l\t%n %v' | sort | tail -200 | nl"

    which msr >/dev/null || export PATH="$PATH:~"

    source ~/msr-cmd-alias.bashrc

    which use-this-alias >/dev/null || export PATH="$PATH:/home/jgaruda:/home/jgaruda/cmdAlias"
    ```
    #Garuda #GarudaLinux #Linux #PATH #ArchLinux

  20. I've been looking for this simple and clear explanation for a very long time!

    I visualization is worth so many words.

    #bash #shell #bashrc #linux #unix

  21. alias ghrel="gh release create --generate-notes"

    $ git push origin main
    $ ghrel v1.5.0

    Creating releases quickly without going to github.com

  22. Įvadas

    Norėdamas pagerinti savo darbo efektyvumą ir sutaupyti laiko, sukūriau automatizuotą bash scenarijų, kuris padeda valdyti, tikrinti ir dokumentuoti kitus scenarijus. Šis scenarijus skirtas automatizuotai nuskenuoti visus .sh failus mano git kataloge, patikrinti jų aprašymus, URL ir naudojimą .bashrc ir .bash_aliases failuose, o rezultatus pateikti terminale ir išsaugoti Markdown formatu, kad galėčiau juos peržiūrėti Obsidian programoje.

    #!/bin/bash# Description: Scenarijus, kuris rodo visus mano naudojamus scenarijus su aprašymais, web nuorodomis ir sąsaja su bashrc ir bash_aliases# URL: # Keičiame į git katalogącd "$HOME/git" || exit# Sukuriame tuščią failą mano_skriptai.md: > "$HOME/Obsidian/notes/mano_skriptai.md"# ANSI spalvų kodaiRED='\033[1;31m'GREEN='\033[1;32m'YELLOW='\033[1;33m'NC='\033[0m' # No Color# Ieškome .sh failųfor file in *.sh; do    # Ištraukiame scenarijaus pavadinimą    script_name=$(basename "$file")    # Ištraukiame aprašymą ir URL iš komentarų    description=$(grep -m 1 "^# Description:" "$file" | cut -d ':' -f 2- | sed 's/^[[:space:]]*//')    url=$(grep -m 1 "^# URL:" "$file" | cut -d ':' -f 2- | sed 's/^[[:space:]]*//')    # Patikrinama, ar scenarijus naudojamas .bashrc    if grep -q "$script_name" "$HOME/.bashrc"; then        bashrc_usage="Naudojamas"        bashrc_usage_color="$GREEN"    else        bashrc_usage="Nenaudojamas"        bashrc_usage_color="$RED"    fi    # Patikrinama, ar scenarijus naudojamas .bash_aliases    alias_usage=$(grep "^alias[[:space:]]\+[^=]*=.*$script_name" "$HOME/.bash_aliases" | sed "s/^alias[[:space:]]\+\([^=]*\)=.*/\1/")    if [ -z "$alias_usage" ]; then        alias_usage="Nenaudojamas"        alias_usage_color="$RED"    else        alias_usage_color="$GREEN"    fi    # Išvedame informaciją į terminalą    echo -e "scenarijaus pavadinimas: ${YELLOW}$script_name${NC}"    if [ -n "$description" ]; then        echo -e "# Description: ${GREEN}$description${NC}"    else        echo -e "# Description: ${RED}Aprašas nerastas${NC}"    fi    if [ -n "$url" ]; then        echo -e "# URL: ${GREEN}$url${NC}"    else        echo -e "# URL: ${RED}URL nerastas${NC}"    fi    echo -e "# .bashrc: ${bashrc_usage_color}$bashrc_usage${NC}"    if [ "$alias_usage" != "Nenaudojamas" ]; then        echo -e "# .bash_aliases: ${GREEN}$alias_usage${NC}"    else        echo -e "# .bash_aliases: ${RED}Nenaudojamas${NC}"    fi    echo "––––––––––––––––––"    # Išsaugome informaciją į failą    echo "scenarijaus pavadinimas: $script_name" >> "$HOME/Obsidian/notes/mano_skriptai.md"    if [ -n "$description" ]; then        echo "\# Description: $description" >> "$HOME/Obsidian/notes/mano_skriptai.md"    else        echo "\# Description: Aprašas nerastas" >> "$HOME/Obsidian/notes/mano_skriptai.md"    fi    if [ -n "$url" ]; then        echo "\# URL: $url" >> "$HOME/Obsidian/notes/mano_skriptai.md"    else        echo "\# URL: URL nerastas" >> "$HOME/Obsidian/notes/mano_skriptai.md"    fi    echo "\# .bashrc: $bashrc_usage" >> "$HOME/Obsidian/notes/mano_skriptai.md"    if [ "$alias_usage" != "Nenaudojamas" ]; then        echo "\# .bash_aliases: $alias_usage" >> "$HOME/Obsidian/notes/mano_skriptai.md"    else        echo "\# .bash_aliases: Nenaudojamas" >> "$HOME/Obsidian/notes/mano_skriptai.md"    fi    echo "––––––––––––––––––" >> "$HOME/Obsidian/notes/mano_skriptai.md"done

    Kaip veikia

    Pagrindinės funkcijos

    1. Git katalogo tikrinimas: Skriptas pradeda veikti nuo nurodymo pereiti į git katalogą, kur saugomi visi .sh failai.
    2. Markdown failo kūrimas: Skriptas sukuria (arba išvalo esamą) tuščią mano_skriptai.md failą Obsidian notes kataloge.
    3. Scenarijų nuskaitymas: Kiekvienam .sh failui kataloge skriptas:
      • Nuskaito failo pavadinimą.
      • Ištraukia aprašymą ir URL iš komentarų.
      • Patikrina, ar failas naudojamas .bashrc ir .bash_aliases failuose.
    4. Informacijos išvedimas: Visa surinkta informacija išvedama į terminalą spalvotai:
      • Geltona spalva: Scenarijaus pavadinimas.
      • Žalia spalva: Reikšmės, kurios rastos ar naudojamos.
      • Raudona spalva: Reikšmės, kurios nerastos ar nenaudojamos.
    5. Informacijos išsaugojimas: Visa informacija taip pat išsaugoma mano_skriptai.md faile, tinkamai suformatuota, kad būtų patogi peržiūrai Obsidian programoje.

    Kaip Naudotis

    1. Nusikopijuokite skriptą: Nukopijuokite aukščiau pateiktą skriptą į savo tekstinį redaktorių ir išsaugokite jį, pvz., kaip scan_scripts.sh.
    2. Pakeiskite katalogų kelią: Įsitikinkite, kad HOME/git ir HOME/Obsidian/notes keliai atitinka jūsų sistemos struktūrą.
    3. Suteikite vykdymo teisę: Naudokite komandą chmod +x scan_scripts.sh, kad suteiktumėte skriptui vykdymo teisę.
    4. Paleiskite Skriptą: Paleiskite skriptą naudodami komandą ./scan_scripts.sh.

    Privalumai

    • Automatizavimas: Scenarijus labai sutaupo laiką, automatizuodamas scenarijų tikrinimą ir dokumentavimą.
    • Aiški dokumentacija: Visa informacija išsaugoma aiškiai ir tvarkingai, kas yra labai naudinga, kai turiu daug skirtingų scenarijų.
    • Spalvotas išvedimas: Tai padeda greitai suprasti, kurie scenarijai yra naudojami ar turi aprašymus, ir kurie ne.
    • Suderinamumas su Obsidian: Informacija yra išsaugoma tokiu formatu, kad būtų patogu naudotis Obsidian programoje.

    Trūkumai

    • Statinis kelias: Skriptas yra priklausomas nuo specifinių katalogų, kuriuos reikia koreguoti rankiniu būdu.
    • Tik .sh failai: Skriptas tikrina tik .sh failus. Jei turiu kitų tipų scenarijų, juos reikės pritaikyti atskirai.
    • Ribota informacija: Skriptas ištraukia tik pirmą aprašymą ir URL iš failo komentarų. Jei failas turi daugiau informacijos, ji bus praleista.

    Ką galima papildyti ir pakeisti

    1. Dinaminiai katalogai: Pridėti galimybę nurodyti katalogus kaip skripto parametrus, kad būtų lankstesnis naudojimas.
    2. Papildoma informacija: Išplėsti skriptą, kad būtų galima ištraukti daugiau informacijos iš komentarų, pvz., autorių, sukūrimo datą ir kt.
    3. Failų tipų palaikymas: Pridėti galimybę tikrinti ir kitų tipų scenarijus, ne tik .sh failus.
    4. Paieška subkataloguose: Pridėti rekursyvią paiešką subkataloguose, kad būtų tikrinami visi scenarijai visame git kataloge.

    Išvada

    Šis shell skriptas yra paprastas, bet galingas įrankis scenarijų tikrinimui ir dokumentavimui. Jis padeda greitai rasti ir identifikuoti naudojamus scenarijus, pateikia informaciją patogiu formatu ir suteikia galimybę lengvai peržiūrėti informaciją naudojant Obsidian programą. Naudodamiesi šiuo įrankiu, galiu efektyviau valdyti savo scenarijus ir palaikyti tvarką savo sistemoje.

    https://funkcijos.wordpress.com/2024/06/06/skriptu-dokumentavimas/

    #bashrc #bashAliases #sh

  23. I use pushd/popd quite a bit to navigate directories. I've also been using quite a bit with and without . It's Alt + C mapping for the terminal is awesome. So I went ahead and created a new Alt + P mapping that does the same thing but uses instead of . Here's the tweak to my `~/.bashrc` if anyone else wants to do it too:

    github.com/sanjayankur31/100_d

  24. I use pushd/popd quite a bit to navigate directories. I've also been using #fzf quite a bit with and without #vim. It's Alt + C mapping for the terminal is awesome. So I went ahead and created a new Alt + P mapping that does the same thing but uses #pushd instead of #cd. Here's the tweak to my `~/.bashrc` if anyone else wants to do it too:

    github.com/sanjayankur31/100_d

    #bash #terminal #bashrc #terminal #cli

  25. I use pushd/popd quite a bit to navigate directories. I've also been using #fzf quite a bit with and without #vim. It's Alt + C mapping for the terminal is awesome. So I went ahead and created a new Alt + P mapping that does the same thing but uses #pushd instead of #cd. Here's the tweak to my `~/.bashrc` if anyone else wants to do it too:

    github.com/sanjayankur31/100_d

    #bash #terminal #bashrc #terminal #cli

  26. I use pushd/popd quite a bit to navigate directories. I've also been using #fzf quite a bit with and without #vim. It's Alt + C mapping for the terminal is awesome. So I went ahead and created a new Alt + P mapping that does the same thing but uses #pushd instead of #cd. Here's the tweak to my `~/.bashrc` if anyone else wants to do it too:

    github.com/sanjayankur31/100_d

    #bash #terminal #bashrc #terminal #cli

  27. 100 days of code BASH edition

    💻 Day 4 created my own system variable, made persistent within the .bashrc file.

    [export hoy="$((date +"%H") | awk '{if ($1 < 12) print "morning"; else if ($1 >= 12 && 1 < 17) print "afternoon"; else if ($1 >= 17 && $1 < 20) print "evening"; else print "night";}')"] (OpenAI GPT-3 script with few corrections) Displays the time of day in morning/afternoon/evening/and night format!

    #BASH #Linux #Kali #WSLg #100DasyOfCode #BashScript #Calendar #Time #bashrc

  28. My greatest gift to you is this, the culmination of years of collecting clever commands. I present to you, in its entirety (and updated in real time so that is true no matter when you read this), my .bash_aliases file:

    https://git.toad.city/brad/configs/src/branch/master/.bash_aliases

    and, for good measure, my much less exciting .bashrc file:

    https://git.toad.city/brad/configs/src/branch/master/.bashrc

    #linux #bash #bashrc #bashAliases #ubuntu #arch #debian
  29. Add this to your .bashrc

    function lazygit() {
    git add .
    git commit -a -m "$1"
    git push
    }

    Thank me later 🤓

    #bash #bashrc #git #lazygit #addcommitpush

  30. Tipp für eure #bashrc:

    alias dmesga="while true;do sudo dmesg -c;done"

    Macht eine autoaktualisierende Ausgabe von dmesg. Merkt euch aber, dass der Befehl überraschend viel CPU-Leistung zieht.

  31. 100 days of code BASH edition

    💻 Day 4 created my own system variable, made persistent within the .bashrc file.

    [export hoy="$((date +"%H") | awk '{if ($1 < 12) print "morning"; else if ($1 >= 12 && 1 < 17) print "afternoon"; else if ($1 >= 17 && $1 < 20) print "evening"; else print "night";}')"] (OpenAI GPT-3 script with few corrections) Displays the time of day in morning/afternoon/evening/and night format!

    #BASH #Linux #Kali #WSLg #100DasyOfCode #BashScript #Calendar #Time #bashrc

  32. 100 days of code BASH edition

    💻 Day 4 created my own system variable, made persistent within the .bashrc file.

    [export hoy="$((date +"%H") | awk '{if ($1 < 12) print "morning"; else if ($1 >= 12 && 1 < 17) print "afternoon"; else if ($1 >= 17 && $1 < 20) print "evening"; else print "night";}')"] (OpenAI GPT-3 script with few corrections) Displays the time of day in morning/afternoon/evening/and night format!

    #BASH #Linux #Kali #WSLg #100DasyOfCode #BashScript #Calendar #Time #bashrc

  33. 100 days of code BASH edition

    💻 Day 4 created my own system variable, made persistent within the .bashrc file.

    [export hoy="$((date +"%H") | awk '{if ($1 < 12) print "morning"; else if ($1 >= 12 && 1 < 17) print "afternoon"; else if ($1 >= 17 && $1 < 20) print "evening"; else print "night";}')"] (OpenAI GPT-3 script with few corrections) Displays the time of day in morning/afternoon/evening/and night format!

    #BASH #Linux #Kali #WSLg #100DasyOfCode #BashScript #Calendar #Time #bashrc