Just my Linux Bash notes…
Rename Ubuntu System
- nano /etc/hostname
- (Replace the current computer name with the desired new name. Save.)
- nano /etc/hosts
- (Change the system name on the 127.0.0.1 line. Save.)
- Restart
List All Subdirectories (based on cwd) and Disk Size
du -ks $(ls -d */) | sort -nr | cut -f2 | xargs -d ‘\n’ du -sh 2> /dev/null
Mount SMB Share at Boot
mkdir /mnt/Share
nano /etc/fstab
(Add to end…)
//192.168.0.4/Share /mnt/Share cifs username=User,password=Pass 0 0
Reload fstab without Reboot
mount -av
LAMP Setup
- apt-get install tasksel
- tasksel install lamp-server
- Update MySQL root user auth to make secure tool work
- mysql
- ALTER USER ‘root’@’localhost’ IDENTIFIED WITH mysql_native_password BY ‘password’;
- exit
- mysql_secure_installation (don’t edit the root user password)
- Undo MySQL root user auth change
- mysql -u root -p
- ALTER USER ‘root’@’localhost’ IDENTIFIED WITH auth_socket;
- exit
Tech Notes, Linux Bash