Aliases

alias ping='ping -c4 -s.2'
Because yes

Other urls found in this thread:

wttr.in/$LOCATION'
wttr.in/$1
paste.teknik.io/Raw/Pi0HA
bitstamp.net/api/v2/ticker/btcusd/)
twitter.com/NSFWRedditImage

alias op="faggot"

So everytime you type ping, it does nothing because thats not a valid command? Nice alias twat

VPN-related aliases

alias gruyere-on='sudo systemctl start [email protected]'
alias gruyere-off='sudo systemctl stop twister && sudo systemctl stop [email protected]'
alias murica='sudo systemctl stop twister && sudo systemctl stop [email protected] && sudo systemctl start openvpn@US_Texas'
alias murica-reverse='sudo systemctl stop twister && sudo systemctl stop openvpn@US_Texas.service && sudo systemctl start [email protected]'
alias murica-on='sudo systemctl start openvpn@US_Texas.service'
alias murica-off='sudo systemctl stop twister && sudo systemctl stop openvpn@US_Texas.service'
alias gruyere-reboot='sudo systemctl stop twister && sudo systemctl stop [email protected] && sudo systemctl restart NetworkManager && sudo systemctl start [email protected]'

some of aliases that i use on dialy basis

#terminal
alias clean="clear"

alias update-grub="sudo grub2-mkconfig -o /boot/grub2/grub.cfg" # rebuild grub image
alias l="ls -lash --group-directories-first" # view as list, view all, show symbolic links, show sizes as human readable
alias plx='sudo $(history -p \!\!)' # run previous command as super user
alias aa="ping google.com" # test interent connection
alias mkdir="mkdir -p"
alias cp="cp -iv"
alias mv="mv -iv"

alias ayy="echo lmao"
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias ......="cd ../../../../.."

alias weather='curl wttr.in/$LOCATION'

is pretty cool, found it in another one of these threads. change the location to your city or zip code

This gives me the wrong place, and if I try putting in a zip code it gives me an error, presumably because it doesn't recognise 4 digit ones

alias hack='ping'

>alias clean="clear"
Why? It's the exact same number of letters, and you're just changing the end one?

>alias plx='sudo $(history -p \!\!)' # run previous command as super user
>using 'plx' for this alias instead of something more appropriate like 'fuck'

it's easier for me to type the 'n' at the end rather than 'r'

and i'm just being polite to my chinkpad :^)

alias medfreq='sudo cpupower frequency-set -d 800MHz -u 1300MHz'
alias hifreq='sudo cpupower frequency-set -d 800MHz -u 3.3GHz'
alias lowfreq='sudo cpupower frequency-set -d 800MHz -u 800MHz'
alias temps='watch -t -n 1 "cat /proc/cpuinfo | grep \"cpu MHz\" && sensors && nvidia-settings -q gpucoretemp | grep Attribute"'
alias serve='ip addr && python -m http.server'

>what is CTRL+L

im aware of this, but i got used to my alias.
you know what they say, old habits, they die hard

don't know what to tell you pham.

another of my favorites.
alias fuck='sudo !!'

would post more, but just realized it's mostly self-made shit to work with my various other machines, and wouldn't be of much use to the layman. oh well.

and i have a little script:

#!/usr/bin/bash

function weather() {
if [ -z $2 ]; then
curl --silent wttr.in/$1 | sed -n '1p; 8,17p'
elif [ $2 = "n" ]; then
curl --silent wttr.in/$1 | head -7
elif [ $2 = "t" ]; then
curl --silent wttr.in/$1 | sed -n '1p; 8,17p'
elif [ $2 = "tt" ]; then
curl --silent wttr.in/$1 | sed -n '1p; 18,27p'
elif [ $2 = "ttt" ]; then
curl --silent wttr.in/$1 | sed -n '1p; 28,37p'
else
echo "Could not recognize $2"
return -1
fi
}

Most="LosAngeles"

if [ -z "$1" ]; then
weather $Most "n"
else
if [ $1 = "n" ]; then
weather $Most $1
elif [ $1 = "t" ]; then
weather $Most $1
elif [ $1 = "tt" ]; then
weather $Most $1
elif [ $1 = "ttt" ]; then
weather $Most $1
elif [ $1 = "w" ]; then
weather "Washington" $2
elif [ $1 = "s" ]; then
weather "SanFrancisco" $2
elif [ $1 = "m" ]; then
weather "MountainView" $2
else
weather $1 $2
fi
fi


syntax:
– when you want to see weather in a specific city at a specific time:
script City When

– when you want to see weather in your home city, now:
script

– when you want to see weather in your home city, specific time:
script When

– if you want to see weather in specific city now:
script City


When indicators:
– "n" is "now"
– "t" is "today"
– "tt" is "tomorrow"
– "ttt" is "the day after tomorrow"

paste.teknik.io/Raw/Pi0HA

forgot to say, one can also specify some special cities inside the script, just use the abbreviations

and one another, for checking BTC/USD on bitstamp:

Curl=$(curl -s bitstamp.net/api/v2/ticker/btcusd/)

Last=$(echo $Curl | grep -Poh '"last": "\d*\.\d*"' | grep -Poh "\d*\.\d*" | sed -e 's/^[0]*//' -e 's/[0]*$//g')
Lowest=$(echo $Curl | grep -Poh '"low": "\d*\.\d*"' | grep -Poh "\d*\.\d*" | sed -e 's/^[0]*//' -e 's/[0]*$//g')
Highest=$(echo $Curl | grep -Poh '"high": "\d*\.\d*"' | grep -Poh "\d*\.\d*" | sed -e 's/^[0]*//' -e 's/[0]*$//g')

echo "BTC last: $Last"
echo "BTC last 24 hours lowest: $Lowest"
echo "BTC last 24 hours highest: $Highest"

My script apt-get:
#!/bin/bash
arg=${1}
result=""

if [ $arg = "install" ];then
result="-S"
elif [ $arg = "upgrade" ];then
result="-Syyu"
elif [ $arg = "remove" ];then
result="-R"
elif [ $arg = "search" ];then
result="-Ss"
elif [ $arg = "find" ];then
result="-Qs"
fi

pacman $(echo "$result" "${2}")

>plx='sudo $(history -p \!\!)
sudo !! senpai

>alias ..="cd .."
>alias ...="cd ../.."
...

What is cd ~ or cd /

>#!/usr/bin/bash
topkek

What is cd.
Retard.

>sudo !! senpai
plx is faster senpai

>What is cd ~ or cd /
Imagine that I have some deeply nested catalogs and cd ~ or cd / is not an option to navigate through them freely

i mean, why? `which bash` gave me that dir, i'm gonna stick to that, thank you very much

>alias ..="cd .."
>alias ...="cd ../.."
>alias ....="cd ../../.."
>alias .....="cd ../../../.."
>alias ......="cd ../../../../.."
why not just cd -, cd -2, cd -3 etc.?

At work we even have these aliased to 1, 2, 3, ...

it's kinda natural to me to use dots. But i have not given even a single thought about numbers, gonna try that user!

alias aptupdate='sudo apt-get update'
alias aptinstall='sudo apt-get install'
alias aptupgrade='sudo apt-get update && sudo apt-get upgrade'
alias aptdist='sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade'
alias aptremove='sudo apt-get autoremove'
alias aptpurge='sudo apt-get purge'


encrypt file with openssl (cypher used: aes-256-cbc)

function __sslaesenc {
if [ $# -eq 2 ]; then
openssl aes-256-cbc -in $1 -out $2
else
echo "poe la os argumentos certos"
echo "1. ficheiro input"
echo "2. ficheiro cifrado"
fi
}

function __sslaesdec {
if [ $# -eq 2 ]; then
openssl aes-256-cbc -d -in $1 -out $2
else
echo "poe la os argumentos certos"
echo "1. ficheiro cifrado"
echo "2. ficheiro output"
fi
}

also brotip

setopt auto_pushd
set this in your .zshrc

then try stuff like cd -

just so you know Switzerland gives all info it has on foreigners. It only has strong privacy laws for Swiss citizens

...

Also data retention laws make it illegal to make access logs anonymous or to destroy logs before 12 months, regardless of the service offered.

>cd ~

alias :e=vim

im not using zsh

...

alias pacmen="yaourt"
alias lock="i3lock -i /home/admin/.config/awesome/themes/zenburn-custom/background.png"
alias hibernate="i3lock -i /home/admin/.config/awesome/themes/zenburn-custom/background.png && systemctl hibernate"

alias upd='sudo aptitude update'
alias upg='sudo aptitude upgrade'
alias updg='sudo aptitude update ; sudo aptitude upgrade'
alias ins='sudo aptitude install $1'
alias rem='sudo aptitude remove $1'

why would you do that, why not just fucking use pacmaan like normal and not just pretend you're using some scrub distro?

your loss

>mispell one character
>upgrade kernel
>nothing work now

>tfw pacman never broke my install
I feel left out 2bh

...

alias pacmaan=pacman

>muh get

>C-r y u
I don't need aliases to update my system quickly, learn to use your shell editing commands properly.

alias eject='sudo zfs unmount'
alias doas='sudo'

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

>alias aa="ping google.com" # test interent connection
Why not saying RMS hello instead?
alias aa="ping stallman.com" # nudge rms

>cat /proc/cpuinfo | grep \"cpu MHz\"
Useless use of cat, try this:
grep \"cpu MHz\" /proc/cpuinfo

Just use cd without any argument.

- Use && instead of ;, so the second command only executes when the first didn't fail.

- Those $1s are useless, remove them.
Also, if you use them in functions, quote them like "$1".

- Don't use #!/usr/bin/bash. Bash is in /bin/. For portability, you should prefer #!/usr/bin/env bash, which will automatically search for the place where bash is installed.

- Always quote variables.
- Prefer printf over echo for portability.
- if/elif/elif/elif/elif doesn't look nice, use case:

case "$2" in
a) command
;;
b) command
;;
esac


>alias tempwatch="while :; do sensors; sleep 1 && clear; done;"
take a look at watch
alias tempwatch='watch sensors'
>pacman $(echo "$result" "${2}")
Thats horrible, try this:
pacman "$result" "$2"

This wouldn't do any harm, dumb winbabby.

>Useless use of cat
Bad habit. I wonder why doing this is so widespread?

>I wonder why doing this is so widespread?
UNIX mindset I guess?

>stallman.com
Jesus. Ofc stallman.ORG

>#!/usr/bin/env bash
that useful, thanks!
also
>- Always quote variables.
why? Can this really matter, or is this only a good practice?

try it, report back

Arguments are usually delimited by spaces, so when you use filenames or strings as variables, scripts will break when they contain spaces. Quoting prevents this.
See the difference of:
variable="1 2 3"; for i in $variable; do echo "$i"; done
and
variable="1 2 3"; for i in "$variable"; do echo "$i"; done

This is why we can't have nice threads on Sup Forums. Kill yourself kid.

okay, now i understand, that can be a game breaker. Thanks user!

did you run it?

ok, I'll delete it... faggots.

>Error: You cannot delete a post this old.
welp...

don't even try this.
if you want to know what it does, type
man rm
and
man bash