Linux Basic Guides
Setup sudo
Switch to root
Terminal window su -Install sudo
Terminal window apt install sudoAdd your user to the sudo group
Terminal window usermod -aG sudo <username>
Mount External USB Drive
Get your external USB drive information
UUIDTerminal window lsblk -fAdd your external drive to
/etc/fstabto mount it on bootTerminal window nano /etc/fstabThen add your drive like so:
UUID=<UUID> <mount path> auto uid=1000,gid=1000,nosuid,nodev,nofail 0 0Reboot
Setup Samba
Install samba
Terminal window apt install sambaOpen
/etc/samba/smb.confTerminal window sudo nano /etc/samba/smb.confAdd a Share Definition then save and exit
smb.conf [shareName]comment = hellopath = /media/samba/sharebrowseable = yeswritable = yesguest ok = yesread only = nousers = <user>, <user>Add a Samba user
Terminal window smbpasswd -a <username>Restart samba
Terminal window sudo service smbd restartAccess the Share at
//<your ip>/shareName
Create a systemd service
Create a systemd service
Terminal window nano /etc/systemd/system/<serviceName>.serviceEdit the service with your desired settings
<seriveName>.service [Unit]Description=<description>[Service]ExecStart=<path to executable>WorkingDirectory=<working directory path>Restart=alwaysRestartSec=50sUser=<username>After=<service name>Requires=<service name>Reload daemon
Terminal window sudo systemctl daemon-reloadEnable and start the service
Terminal window sudo systemctl enable <serviceName>sudo systemctl start <serviceName>Check service status
Terminal window sudo systemctl status <serviceName>Stop the service
Terminal window sudo systemctl stop <serviceName>List all services
Terminal window systemctl list-unit-files --type=service
Auto screen off
Open the GRUB configuration file
Terminal window sudo nano /etc/default/grubEdit the line that starts with
GRUB_CMDLINE_LINUX_DEFAULTand addconsoleblank=<seconds>grub GRUB_CMDLINE_LINUX_DEFAULT="quiet consoleblank=60"Update GRUB
Terminal window sudo update-grubReboot
Download and Install a Debian package
Download the package
Terminal window wget <url>Install the package
Terminal window sudo dpkg -i <filename>Remove the file you downloaded
Terminal window rm <filename>