1
0
Fork 0

Mettre à jour 'mybashrc'

This commit is contained in:
virtubox 2018-09-27 15:55:06 +00:00
parent a2f1df9d2e
commit 7337837d92
1 changed files with 4 additions and 58 deletions

View File

@ -1,26 +1,10 @@
# FUNCTIONS
mynginxconf() {
nano /etc/nginx/sites-available/$1
}
transfer_vtbox_net() {
curl --progress-bar --upload-file $1 https://transfer.vtbox.net/$(basename $1) | tee /dev/null
}
git_commit() {
git add .
git commit -m "$1"
}
git_push() {
git fetch
git push
}
compress_pigz() {
tar -I pigz -cvf $1.tar.gz $1
}
@ -46,31 +30,18 @@ MAINTENANCE_APT() {
echo -e "${CGREEN}#############################################${CEND}"
echo -e ' APT UPDATE '
echo -e "${CGREEN}#############################################${CEND}"
## Updates package lists
sudo apt update
echo -e "${CGREEN}#############################################${CEND}"
echo -e ' APT FULL-UPGRADE '
echo -e "${CGREEN}#############################################${CEND}"
## Updates packages and libraries
sudo apt full-upgrade -y
echo -e "${CGREEN}#############################################${CEND}"
echo -e ' APT-GET AUTOREMOVE '
echo -e "${CGREEN}#############################################${CEND}"
## Removes unneeded packages
sudo apt-get -y --purge autoremove
echo -e "${CGREEN}#############################################${CEND}"
echo -e ' DEBORPHAN '
echo -e "${CGREEN}#############################################${CEND}"
## Removes unused config files
if [ ! -x /usr/bin/deborphan ]; then
apt install deborphan -y
fi
sudo deborphan -n --find-config | xargs sudo apt-get -y --purge autoremove
echo -e "${CGREEN}#############################################${CEND}"
echo -e ' APT AUTOCLEAN '
echo -e "${CGREEN}#############################################${CEND}"
## Removes package files that can no longer be downloaded and everything except
# the lock file in /var/cache/apt/archives, including directories.
sudo apt-get -y autoclean
sudo apt-get -y clean
## clean packages in deinstall state
@ -97,37 +68,12 @@ MAINTENANCE_APT() {
}
wp_scan_website() {
docker run -it --rm wpscanteam/wpscan -u https://$1
}
PHPMYADMIN_UPDATE_FUNCTION() {
PHPMYADMIN_VERSION="4.8.3"
cd /var/www/22222/htdocs/db/ || exit 1
wget -qO phpmyadmin.zip https://files.phpmyadmin.net/phpMyAdmin/$PHPMYADMIN_VERSION/phpMyAdmin-$PHPMYADMIN_VERSION-all-languages.zip
unzip phpmyadmin.zip && rm phpmyadmin.zip
mv pma/config.inc.php .
cp -rf phpMyAdmin-$PHPMYADMIN_VERSION-all-languages/* pma/
mv config.inc.php pma/
sudo chown -R www-data:www-data pma
}
alias transfer=transfer_vtbox_net
alias cheat='cht.sh'
alias pull='git pull'
alias commit=git_commit
alias push=git_push
alias nginxconf=mynginxconf
alias wp='wp --allow-root'
alias gzip=compress_pigz
@ -151,9 +97,9 @@ alias la='ls -A'
alias l='ls -CF'
alias lh="stat -c '%A %a %n'"
alias maintenance=MAINTENANCE_APT
alias wpscan=wp_scan_website
alias update-phpmyadmin=PHPMYADMIN_UPDATE_FUNCTION
alias ee-maintenance=MAINTENANCE_APT