Uninstall bloatware

sudo apt-get remove thunderbird -y
sudo apt-get remove libreoffice* -y
sudo apt-get remove hexchat -y
sudo apt-get remove pix -y
sudo apt-get remove transmission-* -y
sudo apt-get remove bluetooth -y
sudo apt-get remove blueman -y
sudo apt-get remove celluloid -y
sudo apt-get remove hypnotix -y
sudo apt-get remove rhythmbox -y
sudo apt-get remove webapp-manager -y
sudo apt-get remove drawing -y

🔨 FIX repos/errors

sudo apt autoremove
sudo apt --fix-broken install -y
sudo apt update
sudo apt-get --allow-releaseinfo-change update

SSH without password

Generate the key on the local system (Requires Win10)

ssh-keygen.exe
cat ~\.ssh\id_rsa.pub | clip # copy public key to clipboard

Add the clipboard contents to the authorized_keys file on the Linux box

sudo nano ~/.ssh/authorized_keys

Update/Upgrade repos

sudo apt update && sudo apt upgrade

Message Of The Day (MOTD)

cat /etc/motd

Use NeoFetch for a nice MOTD sudo apt-get install neofetch -y && sudo bash -c $'echo "neofetch" >> /etc/profile.d/mymotd.sh && chmod +x /etc/profile.d/mymotd.sh'

Add unstable repo

sudo apt edit-sources

deb https://deb.debian.org/debian/ unstable main contrib non-free
deb-src https://deb.debian.org/debian/ unstable main contrib non-free

SMB Server

  • Install samba:
sudo apt-get install samba -y
  • configure samba:
sudo nano /etc/samba/smb.conf
  • Append this config - adjust the Valid users line if required:
[sharedfolder]
comment = secured shared folder
path = /srv/samba/data
Valid users = pi
guest ok = no
writable = yes
privatable = no
browsable = yes
  • Create a login for user "pi"
sudo smbpasswd -a pi
  • Restart the service
sudo service smbd restart
  • If you get an error about guest access on Windows, use gpedit.msc to adjust this setting:
Computer configuration > administrative templates > network > Lanman Workstation: "Enable insecure guest logons" = Enabled

Bash script example

https://linuxhint.com/30_bash_script_examples/

for i in {1..5};
do
echo "$i" ;
done

install powershell

sudo apt-get install -y powershell 

Show available Shells

cat /etc/shells 

Change default shell to PowerShell

sudo chsh username -s /usr/bin/powershell 

Install java (to launch .jar files)

sudo apt-get install openjdk-9-jre 

Mark a file as executable (eg .jar files)

sudo chmod +x /home/mike/Downloads/minecraft.jar 

Check SELinux status

Sestatus 

Stop Firewall service

sudo service firewalld stop 

Set/change hostname

Reboot may be required to change the hostname

sudo hostnamectl set-hostname <hostname> 

Grep

Search for a string in raw text files:

grep -r -i YOURKEYWORDHERE

Sleep

Modern Linux Tool Alternatives

cat (bat)

sudo apt-get --allow-releaseinfo-change update

https://github.com/ibraheemdev/modern-unix