Linux Basic Guides
Setup sudo
-
Switch to root
Terminal window su - -
Install sudo
Terminal window apt install sudo -
Add 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 -f -
Add 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 0 -
Reboot
Setup Samba
-
Install samba
Terminal window apt install samba -
Open
/etc/samba/smb.confTerminal window sudo nano /etc/samba/smb.conf -
Add 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 restart -
Access the Share at
//<your ip>/shareName
Create a systemd service
-
Create a systemd service
Terminal window nano /etc/systemd/system/<serviceName>.service -
Edit the service with your desired settings
<serviceName>.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-reload -
Enable 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/grub -
Edit 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-grub -
Reboot
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>