-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathzFunk
51 lines (40 loc) · 827 Bytes
/
zFunk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
## Z-Shell Functions
## Similar to the ZAlias file this is sourced in zshrcand holds my personal functions
# shellcheck disable=all
function hex-encode() {
echo "$@" | xxd -p
}
function hex-decode() {
echo "$@" | xxd -p -r
}
function rot13() {
echo "$@" | tr 'A-Za-z' 'N-ZA-Mn-za-m'
}
function mip() {
printf '%s\n' 'Internal: ' $(ip --br a | grep eth0 | awk '{print $3}' | awk -F/ '{print $1}')
printf '%s'\n'External: '\n'%b$(curl -s ifconfig.me)'
}
function cht() {
curl cht.sh/$@
}
function upg() {
sudo apt update
sudo apt full-upgrade -y
}
function cln() {
sudo apt autoremove -y
sudo apt autoclean
}
function se() {
sed -e "s/$1/$2/g"
}
function si() {
sed -i "s/$2/$3/g" $1
}
function ai() {
sudo apt-get install -y "$@"
}
# apt search
function sa() {
apt search "$@"
}