Do yourself a favor and login as root to save yourself some time and headaches:
$ sudo su -Install unattended-upgrades:
| :::::::::::::::::::::::::::::::::::::::::::: | |
| :: Automatically check & get admin rights V2 | |
| :::::::::::::::::::::::::::::::::::::::::::: | |
| @echo off | |
| CLS | |
| ECHO. | |
| ECHO ============================= | |
| ECHO Running Admin shell | |
| ECHO ============================= |
| console.log("canvas fingerprint: " + canvas_fingerprint()); | |
| function check_canvas(){ | |
| var elem = document.createElement('canvas'); | |
| return elem; | |
| } | |
| function canvas_fingerprint(){ |
| UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
| UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl'); | |
| UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl'); | |
| UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl'); |
| #!/bin/bash | |
| #install this in the /etc/profile.d/ to have it run on log in | |
| IP="$(who am i|awk '{ print $5}')" | |
| HOSTNAME=$(hostname) | |
| NOW=$(date +"%e %b %Y, %a %r") | |
| echo 'Someone from '$IP' logged into '$HOSTNAME' on '$NOW'.' | mail -s 'SSH Login Notification' <emailaddress@gmail.com> |
| roll back branch | |
| git checkout <branch> | |
| git reset --hard <commit> | |
| git push --force origin master | |
| create new from current | |
| git checkout -b <branch> | |
| always assume file is unchanged. |
| sudo -s | |
| apt update | |
| apt install unattended-upgrades | |
| nano /etc/apt/apt.conf.d/20auto-upgrades | |
| APT::Periodic::Update-Package-Lists "1"; | |
| APT::Periodic::Download-Upgradeable-Packages "1"; | |
| APT::Periodic::Unattended-Upgrade "3"; | |
| APT::Periodic::AutocleanInterval "7"; |
| sudo swapon --show | |
| free -h | |
| df -h | |
| sudo fallocate -l 1G /swapfile | |
| ls -lh /swapfile | |
| sudo chmod 600 /swapfile | |
| sudo mkswap /swapfile | |
| sudo swapon /swapfile |
| #add to /etc/apache2/apache2.conf | |
| #this will block .git access across all sites | |
| <Directory /var/www/> | |
| # Block access to .git directory | |
| RedirectMatch 404 /\.git | |
| </Directory> |