#bashrc — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #bashrc, aggregated by home.social.
-
Affect shell sessions globally in bash #commandline #bash #bashrc
-
Ускоряем навигацию в 5 раз: CD-меню для частых папок
Привет, Хабр! Сколько раз за день Вы вводите cd ~/projects/current-project/src/components/very-long-folder-name , чтобы просто перейти в нужную директорию? Такая навигация в терминале отнимает кучу времени и сил, теряется фокус. В данной статье хочу поделиться простым bash-скриптом, который покажет Вам пронумерованный список избранных папок и позволит переходить в них одной цифрой.
-
Ускоряем навигацию в 5 раз: CD-меню для частых папок
Привет, Хабр! Сколько раз за день Вы вводите cd ~/projects/current-project/src/components/very-long-folder-name , чтобы просто перейти в нужную директорию? Такая навигация в терминале отнимает кучу времени и сил, теряется фокус. В данной статье хочу поделиться простым bash-скриптом, который покажет Вам пронумерованный список избранных папок и позволит переходить в них одной цифрой.
-
Ускоряем навигацию в 5 раз: CD-меню для частых папок
Привет, Хабр! Сколько раз за день Вы вводите cd ~/projects/current-project/src/components/very-long-folder-name , чтобы просто перейти в нужную директорию? Такая навигация в терминале отнимает кучу времени и сил, теряется фокус. В данной статье хочу поделиться простым bash-скриптом, который покажет Вам пронумерованный список избранных папок и позволит переходить в них одной цифрой.
-
Ускоряем навигацию в 5 раз: CD-меню для частых папок
Привет, Хабр! Сколько раз за день Вы вводите cd ~/projects/current-project/src/components/very-long-folder-name , чтобы просто перейти в нужную директорию? Такая навигация в терминале отнимает кучу времени и сил, теряется фокус. В данной статье хочу поделиться простым bash-скриптом, который покажет Вам пронумерованный список избранных папок и позволит переходить в них одной цифрой.
-
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?
-
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?
-
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?
-
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?
-
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?
-
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?
-
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?
-
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?
-
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?
-
#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) -
@nickbearded you know you gotta love hashcat for all the protocols it works on. I got second r proxy online https://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 -
@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 -
@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
-
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 -
alias ghrel="gh release create --generate-notes"
$ git push origin main
$ ghrel v1.5.0Creating releases quickly without going to github.com
-
Į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
.shfailus manogitkataloge, patikrinti jų aprašymus, URL ir naudojimą.bashrcir.bash_aliasesfailuose, o rezultatus pateikti terminale ir išsaugoti Markdown formatu, kad galėčiau juos peržiūrėtiObsidianprogramoje.#!/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"doneKaip veikia
Pagrindinės funkcijos
- Git katalogo tikrinimas: Skriptas pradeda veikti nuo nurodymo pereiti į
gitkatalogą, kur saugomi visi.shfailai. - Markdown failo kūrimas: Skriptas sukuria (arba išvalo esamą) tuščią
mano_skriptai.mdfailąObsidiannotes kataloge. - Scenarijų nuskaitymas: Kiekvienam
.shfailui kataloge skriptas:- Nuskaito failo pavadinimą.
- Ištraukia aprašymą ir URL iš komentarų.
- Patikrina, ar failas naudojamas
.bashrcir.bash_aliasesfailuose.
- 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.
- Informacijos išsaugojimas: Visa informacija taip pat išsaugoma
mano_skriptai.mdfaile, tinkamai suformatuota, kad būtų patogi peržiūraiObsidianprogramoje.
Kaip Naudotis
- Nusikopijuokite skriptą: Nukopijuokite aukščiau pateiktą skriptą į savo tekstinį redaktorių ir išsaugokite jį, pvz., kaip
scan_scripts.sh. - Pakeiskite katalogų kelią: Įsitikinkite, kad
HOME/gitirHOME/Obsidian/noteskeliai atitinka jūsų sistemos struktūrą. - Suteikite vykdymo teisę: Naudokite komandą
chmod +x scan_scripts.sh, kad suteiktumėte skriptui vykdymo teisę. - 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
.shfailai: Skriptas tikrina tik.shfailus. 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
- Dinaminiai katalogai: Pridėti galimybę nurodyti katalogus kaip skripto parametrus, kad būtų lankstesnis naudojimas.
- Papildoma informacija: Išplėsti skriptą, kad būtų galima ištraukti daugiau informacijos iš komentarų, pvz., autorių, sukūrimo datą ir kt.
- Failų tipų palaikymas: Pridėti galimybę tikrinti ir kitų tipų scenarijus, ne tik
.shfailus. - Paieška subkataloguose: Pridėti rekursyvią paiešką subkataloguose, kad būtų tikrinami visi scenarijai visame
gitkataloge.
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
Obsidianprogramą. Naudodamiesi šiuo įrankiu, galiu efektyviau valdyti savo scenarijus ir palaikyti tvarką savo sistemoje.https://funkcijos.wordpress.com/2024/06/06/skriptu-dokumentavimas/
- Git katalogo tikrinimas: Skriptas pradeda veikti nuo nurodymo pereiti į
-
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:
https://github.com/sanjayankur31/100_dotfiles/commit/ae2a168ce18f9c849244e75a0fc94678f760dd0c
-
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:
https://github.com/sanjayankur31/100_dotfiles/commit/ae2a168ce18f9c849244e75a0fc94678f760dd0c
-
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:
https://github.com/sanjayankur31/100_dotfiles/commit/ae2a168ce18f9c849244e75a0fc94678f760dd0c
-
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:
https://github.com/sanjayankur31/100_dotfiles/commit/ae2a168ce18f9c849244e75a0fc94678f760dd0c
-
How To Restore .bashrc File To Default Settings In Ubuntu #Bashrc #BashProfile #Ubuntu #LinuxTroubleshooting #Linuxtips #Linuxhowto #Linuxadmin
https://ostechnix.com/restore-bashrc-file-default-settings-ubuntu/ -
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
-
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 -
Add this to your .bashrc
function lazygit() {
git add .
git commit -a -m "$1"
git push
}Thank me later 🤓
-
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.
-
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
-
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
-
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