Last active 1742540822

Revision 04a9baf516141beefebe83802c9cd840efa71011

.zshrc Raw
1# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
2# Initialization code that may require console input (password prompts, [y/n]
3# confirmations, etc.) must go above this block; everything else may go below.
4if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
5 source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
6fi
7
8export ZSH="/root/.oh-my-zsh"
9PATH=/snap/bin:/usr/sbin:/sbin:/usr/local/sbin:$PATH
10export LC_ALL="en_US.UTF-8"
11ZSH_THEME="junkfood"
12plugins=(
13 git
14 zsh-syntax-highlighting
15 zsh-autosuggestions
16)
17source $ZSH/oh-my-zsh.sh
18alias sync="rsync -avz -e 'ssh -p1079'"
19alias udemydl="youtube-dl -u malin@cenusa.me -o '%(playlist)s/%(chapter_number)s - %(chapter)s/%(playlist_index)s. %(title)s.%(ext)s'"
20alias clmac="find ./ -name '._*' -o -name '.DS_Store' -o -name '.apdisk' -o -name '.lyndisk' | sed 's/.*/\"&\"/' | xargs rm -rfv"
21alias cpwp="cp -a /root/wordpress/* ."
22alias fixow="chown -R nobody:nogroup ./"
23alias wpht="cat /root/.htaccess >> ./.htaccess"
24alias fixwp="cpwp && wpht && fixow"
25alias goup="apt update && apt upgrade -y && apt autoremove && apt dist-upgrade -y"
26alias flt="mkdir $1{files,tmp,log}"
27alias wssl="wget --no-check-certificate"
28alias wrip="wget -r -nc -np"
29alias move="rsync -avz --remove-source-files --progress"
30alias wbulk="wget --content-disposition -c -N --tries=0 --read-timeout=20 -q --show-progress"
31alias mp3rip="youtube-dlc --restrict-filenames --extract-audio --audio-format mp3"
32alias cleancrap="find ./ -type f -regex '.*\.exe\|.*\.diz\|.*\.nfo\|.*\.txt\|.*\.url\|.*\.nzb\|.*\.torrent' -exec rm -rfv {} \;"
33alias license="/usr/local/cpanel/cpkeyclt"
34
35editz() {
36pdnsutil edit-zone $1
37 }
38
39createz() {
40 pdnsutil create-zone $1
41 }
42
43push() {
44 for i in {1..10}
45 do
46 pdnsutil increase-serial $1
47 pdns_control notify $1
48 done
49}
50
51sslcert() {
52 certbot certonly --webroot -w /home/www/$1/files -d $1 -d www.$1 -d cdn.$1
53}
54
55wban() {
56 fail2ban-client set wordpress banip $1
57}
58
59flickr() {
60 ruby flickr-photo-downloader.rb $1 -d /flickr/$2
61}
62
63weather() {
64 curl "wttr.in/${1:-vilafranca de bonany}?m"
65}
66
67resolve() {
68 dig +short $1 $2
69}
70
71ns12() {
72 echo -n 'NS1: '; dig +short $1 @ns1.palmasolutions.net
73 echo -n 'NS2: '; dig +short $1 @ns2.palmasolutions.net
74}
75
76ttfb() {
77 curl -s -w 'Testing Website Response Time for :%{url_effective}\n\nLookup Time:\t\t%{time_namelookup} seconds\nConnect Time:\t\t%{time_connect} seconds\nAppCon Time:\t\t%{time_appconnect} seconds\nRedirect Time:\t\t%{time_redirect} seconds\nPre-transfer Time:\t%{time_pretransfer} seconds\nStart-transfer Time:\t%{time_starttransfer} seconds\n\nTotal Time:\t\t%{time_total}\n' -o /dev/null https://$1
78}
79
80lcheck() {
81 latency=`ttfb $1 | grep Total | cut -f3-`
82 if (( $(bc -l <<< "$latency >= 1") ));
83 then
84 echo -n $1; echo -n ' > lag > '; echo $latency
85 else
86 echo -n $1; echo -n ' > no lag > '; echo $latency
87 fi
88}
89
90pwg() {
91 printf "%s" "$(tr -cd '[:graph:]' < /dev/urandom | tr -d '\-#&\+,\.\/\:\`\"'\' | head -c"${1:-32}")";
92};
93
94getpings() {
95 for i in $(cat /root/sites);
96 do lcheck $i;
97 done
98}
99
100alias dfd='df -h | grep -e "/dev/sd" -e "Filesystem" --color=never'
101
102login() {
103 ssh root@$i -p 1079
104}
105
106wlfw() {
107 ufw allow from $1 to any port $2 proto $3 comment "$4"
108}
109
110inst() {
111 apt install $1 -y
112}
113
114ripw() {
115 wget -r -np -nc --tries=0 --reject iso,exe,html,htm,nfo,nzb,torrent --read-timeout=20 --no-check-certificate -q --show-progress $1
116}
117
118# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
119[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
120