# /etc/bashrc alias which="type -path" # .bashrc HISTSIZE=40000 HISTFILESIZE=40000 HISTTIMEFORMAT="(%m/%d/%y) %T " export HISTTIMEFORMAT HISTSIZE # User specific aliases and functions alias rm='rm -i' alias cp='cp -i' alias mv='mv -i' #Setup history timestamps HISTTIMEFORMAT="(%m/%d/%y) %T " export HISTTIMEFORMAT export EDITOR="pico" export VISUAL="pico" PS1="\n\[\e[30;1m\]\[\016\]\[\017\](\[\e[34;1m\]\u@\h\[\e[30;1m\])-(\[\e[34;1m\]\@ \d\[\e[30;1m\])->\n\[\e[30;1m\]\[\016\]\[\017\](\[\[\e[32;1m\]\w\[\e[30;1m\])-(\[\e[32;1m\]\$(/bin/ls -1 | /usr/bin/wc -l | /bin/sed 's: ::g') files, \$(/bin/ls -lah | /bin/grep -m 1 total | /bin/sed 's/total //')b\[\e[30;1m\])--> \[\e[0m\]" whoami=`whoami` if [ -e "~/.dns" ]; then DNS=`cat ~/.dns` PS1="\u@$DNS [\w]# " else if [ -e "/var/cpanel/users/$whoami" ]; then eval `grep DNS= /var/cpanel/users/$whoami` if [ ! "$DNS" = "" ]; then echo -n "$DNS" > ~/.dns PS1="\u@$DNS [\w]# " fi fi fi if [ ! -e ~/public_html/cgi-bin ]; then mkdir -p ~/public_html/cgi-bin fi if [ ! -e ~/public_ftp ]; then mkdir -p ~/public_ftp fi mesg y alias wtf="watch -n 1 w -hs" alias wth="ps -uxa | more" # Now for the dos users alias dir="ls" alias copy="cp" alias del="rm" alias deltree="rm -r" alias move="mv" alias ff="whereis" alias attrib="chmod" alias edit="pico" alias chdir="cd" alias mem="top" alias search="grep" alias pico="pico -w -z" LS_OPTIONS='--color=tty -F -a -b -T 0'; export LS_OPTIONS; alias ls='/bin/ls $LS_OPTIONS'; alias dir='/bin/ls $LS_OPTIONS --format=vertical'; alias vdir='/bin/ls $LS_OPTIONS --format=long'; alias d=dir; alias v=vdir; eval `dircolors -b` export JAVA_HOME=/usr/local/jdk export PATH=$JAVA_HOME/bin:$PATH export CLASSPATH=.:$JAVA_HOME/lib/classes.zip export PATH="$PATH:/usr/local/bin:/usr/X11R6/bin" #cPanel Added local::lib -- BEGIN LOCALLIBUSER=$USER if [ -e "/usr/bin/whoami" ]; then LOCALLIBUSER=`/usr/bin/whoami` fi if [ "$LOCALLIBUSER" != "root" ]; then eval $(perl -Mlocal::lib) fi #cPanel Added local::lib -- END #cPanel Added User Commands -- BEGIN # Insert an entry into the PATH after all of the user's home directory paths. PATH="$(/usr/local/cpanel/3rdparty/bin/perl -e 'print join ":", map { ( ( !/^\Q$ENV{HOME}\E/ && !$seen++ ? @ARGV : () ), $_ ) } split /:/, $ENV{PATH};' /usr/local/cpanel/3rdparty/lib/path-bin)" export PATH #cPanel Added User Commands -- END #Gilbert S custom stuff: function mustBeRoot { if [[ $EUID -ne 0 ]]; then echo "This script must be run as root" 1>&2 return 1 2> /dev/null fi } function userEdit { $EDITOR /home*/$1/$2; } function domainEdit { $EDITOR /home*/$(/scripts/whoowns $1)/$2; } alias manual='curl -s https://djttyme.com/toolbox/manual.txt' alias fixperms='fixperms -v' alias handler='/usr/local/cpanel/bin/rebuild_phpconf --current' alias mailip='mustBeRoot && cat /etc/mailips' alias fixpath='PATH=$PATH:/opt/dedrads:/usr/local/cpanel/scripts:/usr/local/cpanel/bin:/opt/tier1adv/bin:/opt/sharedrads:/scripts' alias status='curl -Lw '%{http_code}' -s -o /dev/null -I' alias lfscan='mustBeRoot && bash < <(curl -s https://djttyme.com/toolbox/largefilescan)' alias wpdbb='bash < <(curl -s https://djttyme.com/toolbox/wpdbb)' alias wpdbr='bash < <(curl -s https://djttyme.com/toolbox/wpdbr)' alias padlockfix='bash < <(curl -s https://djttyme.com/toolbox/padlockfix)' #alias recluster='mustBeRoot && bash < <(curl -s https://djttyme.com/toolbox/recluster)' alias apachelog='tail -50 /usr/local/apache/logs/error_log' alias tailapachelog='tail -f /usr/local/apache/logs/error_log | grep 216.54.31.82' alias accesslog='cat /usr/local/cpanel/logs/access_log' alias eximlog='cat /var/log/exim_mainlog' alias ffmpeginstall='mustBeRoot && wget https://raw.githubusercontent.com/q3aql/ffmpeg-install/master/ffmpeg-install && chmod a+x ffmpeg-install && ./ffmpeg-install --install release' alias rebuildapache='mustBeRoot && /scripts/rebuildhttpdconf' alias rebuildnginx='mustBeRoot && ngxconf -Rrd --force' alias nlploop='for i in $(command ls /var/cpanel/users|xargs);do printf "[+] Scan of user ${i}:\n%s\n\n" "$(nlp ${i})";done' alias downgradechecker='bash < <(curl -s https://djttyme.com/toolbox/downgradechecker)' alias cpphpini='cp /usr/local/lib/php.ini ./' alias topsenders='bash < <(curl -s https://djttyme.com/toolbox/topsenders)' alias topscripts='bash < <(curl -s https://djttyme.com/toolbox/topscripts)' alias snetstat='mustBeRoot && bash < <(curl -s https://djttyme.com/toolbox/snetstat)' alias phpswitcherinstall='mustBeRoot && bash < <(curl -s https://djttyme.com/toolbox/phpswitcherinstall)' alias distiller='/usr/local/cpanel/bin/apache_conf_distiller --update' alias dnsadminrein='mustBeRoot && bash < <(curl -s https://djttyme.com/toolbox/dnsadminrein)' alias vpsshellscan='mustBeRoot && shellscan -u $(ls -p /var/cpanel/users | grep -v / | grep -v system| tr "\n" " ") -a off --mail docs@inmotionhosting.com' alias shellscaninstall='mustBeRoot && yum -y install imh-shellscan; /usr/bin/shellscan --update --freshclam -u $(\ls /var/cpanel/users | grep -v system) -n' alias csfinstall='mustBeRoot && bash < <(curl -s https://djttyme.com/toolbox/csfinstall)' alias softaculousinstall='mustBeRoot && bash < <(curl -s https://djttyme.com/toolbox/softaculousinstall)' alias serverinfo='bash < <(curl -s https://djttyme.com/toolbox/serverinfo)' alias killzombies='mustBeRoot && bash < <(curl -s https://djttyme.com/toolbox/killzombies)' #alias comododcv='bash < <(curl -s https://djttyme.com/toolbox/comododcv)' alias bounceall='mustBeRoot && bash < <(curl -s https://djttyme.com/toolbox/bounceall)' alias killphp='mustBeRoot && bash < <(curl -s https://djttyme.com/toolbox/killphp)' alias killeximque='exiqgrep -i | xargs exim -Mrm' alias cplicense='sleep 600 ; /usr/local/cpanel/cpkeyclt ' alias quickreview='mustBeRoot && bash < <(curl -s https://djttyme.com/toolbox/quickreview)' alias fullreview='mustBeRoot && bash < <(curl -s https://djttyme.com/toolbox/review.sh)' alias pushalldns='mustBeRoot && bash < <(curl -s https://djttyme.com/toolbox/pushalldns)' alias topprocess='/usr/local/cpanel/bin/dcpumonview' alias rebuildfpm='mustBeRoot && /scripts/php_fpm_config --rebuild' alias fixdbs='mysqlcheck -rA && mysqlcheck -oA' function extract() # Handy Extract Program { if [ -f $1 ] ; then case $1 in *.tar.bz2) tar xvjf $1 ;; *.tar.gz) tar xvzf $1 ;; *.bz2) bunzip2 $1 ;; *.rar) unrar x $1 ;; *.gz) gunzip $1 ;; *.tar) tar xvf $1 ;; *.tbz2) tar xvjf $1 ;; *.tgz) tar xvzf $1 ;; *.zip) unzip $1 ;; *.Z) uncompress $1 ;; *.7z) 7z x $1 ;; *) echo "'$1' cannot be extracted via >extract<" ;; esac else echo "'$1' is not a valid file!" fi } function mktar() { tar cvzf "$(date +%Y-%m-%d)-${1%%/}.tar.gz" "${1%%/}/"; } #move up N dirs upup(){ DEEP=$1; [ -z "${DEEP}" ] && { DEEP=1; }; for i in $(seq 1 ${DEEP}); do cd ../; done; } alias up='upup' #copy and go to dir cpg (){ if [ -d "$2" ];then cp $1 $2 && cd $2 else cp $1 $2 fi } #move and go to dir mvg (){ if [ -d "$2" ];then mv $1 $2 && cd $2 else mv $1 $2 fi } alias psg='/bin/ps aux | grep $1'