I've been toying with the idea of posting something like this for awhile and with the old forums treasure trove of info gone, now it might be a good time for it.
So here is a list of basic changes I make on a fresh Linux install, as well as commands I find useful.
Linux survival guide
Budgie:
When you have more than 2 monitors connected the option to mirror a display goes away.
So you'll need to do something like this. (Yes this has been reported):
xrandr --output DP-1 --mode 1920x1080 --output HDMI-1 --mode 1920x1080 --same-as DP-1
Note you'll need to run xrandr, identify which monitor is which to ensure you mirror the correct one.
This is not persistent, it will need to be run after every boot, so you may want to add this command to autostart.
Want thumbnails for videos within Nautilus (Files)?
sudo eopkg it ffmpegthumbnailer
Plasma (KDE):
You can not span a single wallpaper across your monitors, as every monitor is its own workspace.
Solution use imagemagick to split your wallpaper into slices so you can set a different slice per monitor background.
sudo eopkg it imagemagick
I've 3x 1920x1080 monitors so I downloaded a 5760x1080 image. Now I'm going to slice it into 1920x1080 parts.
convert -crop 1920x1080 road.jpg +repage road%d.jpg
Now I have 4 files road.jpg (original) as well as road0.jpg, road1.jpg, road2.jpg
Nvidia
Screen tearing / graphical glitches with NVIDIA GPU's
Note you'll probably want the to enable hardware acceleration in firefox too, discussed in the Firefox section.
Solution: 1
You can enable "Force Full Composition Pipeline" on in nvidia-settings
Watch this video to make sure you save it properly: -
Solution: 2
EDIT: This option has resulted in at least one users system booting to a blank screen, not exactly sure why https://dev.getsol.us/T9543#181324 https://discuss.getsol.us/d/5973-aggregated-510-issues/222. Exercise caution and as always, have a backup of your important files.
NVIDIA PRIME (Laptop) folks may not see this option, do this instead:
echo "nvidia-drm.modeset=1" | sudo tee /etc/kernel/cmdline.d/50-nvidia-drm.conf
sudo clr-boot-manager update
Firefox:
In the URL bar type about:config and press enter, then agree to the accept the risk warning.
Search for and double click these values to toggle (enable / disable) where appropriate.
Enable hardware acceleration in Firefox
layers.acceleration.force-enabled
Enable autoscroll
Use middle mouse button to click and scroll with mouse movement.
general.autoScroll
Disable Firefox Pocket
extensions.pocket.enabled
In KDE is a dark theme causing forms on websites using firefox to be dark?:
Create a new string pref in about:config (right click menu) named widget.content.gtk-theme-override and set the value to a installed light theme (e.g. Breeze), then restart Firefox.
Misc:
Start steam on boot minimized
Enabling start steam on boot from within steam itself will make steam open on screen instead of hiding in traydock. To do this, disable the auto boot from within steam and go to budgie settings > autostart and add a command.
steam -silent %U
Setup zsh with oh-my-zsh:
Use zsh and set agnoster theme for example
Install zsh & git:
sudo eopkg it zsh git
Create symlink for /etc/shells:
sudo ln -s /usr/share/defaults/etc/shells /etc/shells
Install Oh-My-ZSH:
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
follow the prompts on screen
Change theme
nano .zshrc
change line beginning ZSH_THEME to look like this ZSH_THEME="agnoster" and save
Reload config.
source ~/.zshrc
SSH Keys:
Create key, on client system:
ssh-keygen -t rsa
Follow prompts and don't set a passphrase.
Copy key to server:
Replace username and ipaddress with the information relevant to your remote system. Login with the password you normally would.
ssh-copy-id username@ipaddress
Now you're done ssh username@ipaddress to test, you shouldn't need to enter a password anymore.
Make logining in to your systems even easier by adding the following alias to the end of your .bashrc (or .zshrc if you use zsh). Replace "myserver" with any unique name you want.
alias myserver='ssh username@ipaddress'
Now you just type myserver and you automatically shell into the server you listed.
Clean up journal logs:
Keep only the last 48 hours worth.
sudo journalctl --vacuum-time=2d
Delete eopkg cached packages:
sudo eopkg dc
Wake On Lan:
Get connection name:
nmcli
Check current status:
nmcli c show "Wired connection 1" | grep 802-3-ethernet.wake-on-lan
Enable Wake on Lan
nmcli c modify "Wired connection 1" 802-3-ethernet.wake-on-lan magic
Very basic firewall rules using UFW default rules are deny all incoming and allow all outgoing:
Install UFW
sudo eopkg it UFW
Enable UFW
Note if you are connected to the machine remotely, enabling now will disconnect you.
sudo ufw enable
Allow ssh IN to this machine from a specific local IP address. Limit helps prevent multiple connection attempts from happening too quickly (IP listed in command is just an example).
sudo ufw limit from 192.168.0.5 to any port 22
Or trust your local network (Your local network may be different adjust accordingly):
sudo ufw allow in to 192.168.0.0/24
Delete files matching pattern, recursively from the directory its run from:
find . -iname 'thumbs.db' -exec rm -rfv {} +
Merge external subtitles into mkv container:
sudo eopkg it mkvtoolnix
mkvmerge -o video.mkv -S subtitles.srt
Batch changing of title metadata in a .mkv or .mp4 file to match its filename:
https://github.com/TheHarveyBirdman/rmeta
Sometimes you might have a disk with a bad partition table that refuses to be formatted. Replace XXX with the device id of the drive you wish to wipe. Make sure you know what you're doing or this could end very badly!
dd if=/dev/zero of=/dev/XXX count=1 bs=4096
Backup home folder using rsync
rsync -avh /home/username/ /mnt/backuphdd/backup/
You can add other flags to the command for features such as:
Delete files / folders no longer present in source from /mnt/backuphdd/backup
--delete
To exclude certain files within directory from being in the backup. .rsyncexclude is a simple text file you create where you list files / folders you don't want backed up, 1 per line.
--exclude-from='/home/username/.rsyncexclude'
To test without making any changes append this to any command.
--dry-run
Let the community know any other commands you find useful.