| Server IP : 127.0.0.1 / Your IP : 216.73.217.122 Web Server : Apache System : Linux Stag-Enterprise-Production-20-04 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 06:59:36 UTC 2025 x86_64 User : ubuntu ( 1000) PHP Version : 7.4.3-4ubuntu2.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/ubuntu/ |
Upload File : |
#!/bin/bash
## aliases go here, this file is included from ~/.bashrc
#list 10 most recent files in cwd or dir specified
lth() { ls -Alht --color=always "$@" |head; }
# make less interpret color codes
alias less='less -r'
#make ccze output ansi colors to stdout & disable lookups for MASSIVE performance boost
alias ccze='ccze -A -o nolookups '
ccat() { ccze < "$1";}
# tail recent file in current dir
alias tail-recent='tail -n 999 -F "$( ls -1 -t "$(pwd)/"* |head -n1 )" |ccze -A'
alias tail-cloudfront='tail -F /var/log/apache2/*.log |grep --line-buffered -i cloudfront |ccze'
# watch all logs (except splunk logs; made for machine readable, not human)
alias tail-logs=' tail -F $(find /var/log/ -name "*log" |grep -v "apache2/splunk__" ) |ccze -A'
# Special Specialty Adddition
# follow all the logs for a given env
tail-logs-env(){
env_str="$1"
tail -F /mnt/Sites/specialty.autotrader.com/default/build/log/atx_app_np.log|grep --line-buffered '"env":"'"$env_str"'"' &
tail -F \
/var/log/nodejs/*"$env_str"*.log \
/var/log/apache2/*"$env_str"*.log \
/var/log/nginx/*"$env_str"*.log \
/mnt/Sites/specialty.autotrader.com/"$env_str"/build/cakephp/*.com/tmp/logs/*.log \
/mnt/Sites/specialty.autotrader.com/"$env_str"/build/log/*.log \
/mnt/Sites/cdn/"$env_str"/build/logs/*.log \
|ccze
}
# Block an IP (drops all incoming packets using iptables)
# EX: block-ip IP_ADDRESS_SPAMMING_THE_SITE
block-ip(){
bad_ip="$1"
sudo iptables -I INPUT -s "$bad_ip" -j DROP
}
alias BlockIp='block-ip'
#make grepping over php & js easier
alias grep-php='grep -rn --include="*.php" --include="*.ctp" --include="*.phtml" --exclude="*.log" --exclude-dir=node_modules --exclude-dir=wflogs --exclude="*.min.*"'
alias grep-js='grep -rn --include="*.php" --include="*.ctp" --include="*.phtml" --exclude="*.log" --include="*.js" --include="*.jsx" --exclude-dir=node_modules --exclude-dir=dist --exclude-dir=dist_server --exclude="*.min.*" --exclude="*.bundle.js*"'
alias grep-css='grep -rn --include="*.css" --include="*.scss" --exclude="*.log" --exclude-dir=node_modules --exclude="*.min.*" --exclude="*.compiled.*"'
alias replace-php-short-open-tags="perl -pi -e '"'s/(<\?(?!php))/<\?php /g'"'"
####
#### Laravel
####
# php artisan with less typing
alias artisan='php artisan'
# autocomplete for artisan
_artisan()
{
COMP_WORDBREAKS=${COMP_WORDBREAKS//:}
COMMANDS=`php artisan --raw --no-ansi list | sed "s/[[:space:]].*//g"`
COMPREPLY=(`compgen -W "$COMMANDS" -- "${COMP_WORDS[COMP_CWORD]}"`)
return 0
}
complete -F _artisan art
complete -F _artisan artisan
alias nom='npm'
#tired of seeing snaps in df output
# if you want more mountpoints, spell them out here
alias df='df -h / /mnt/Sites '
if [ ! -d "/mnt/Sites" ]; then
# handle servers without app volume mounted at /mnt/Sites
alias df='df -h / '
fi
#output ssl cert info like valid from & to
alias show-ssl-cert='nmap -p 443 --script ssl-cert '
# list only sshfs mounts
alias show-sshfs-mounts='mount |grep "fuse.sshfs" |sort |column -t'