Skip to content

Instantly share code, notes, and snippets.

@10maurycy10
Last active November 19, 2021 01:14
Show Gist options
  • Save 10maurycy10/285bbef69704b925cc6999d9a296e0d5 to your computer and use it in GitHub Desktop.
Save 10maurycy10/285bbef69704b925cc6999d9a296e0d5 to your computer and use it in GitHub Desktop.
Things to do on a new system

Things to do on a new system

Note, these assume debian or a debian based system, i.n. ubuntu.

I you have a diffrent system, you will have to replace all apt commands with your distro's package manager.

You may also have to do extra configuration.

Install & configure sudo

  • Get a root shell (if not loged in as root)

su

  • install sudo

apt install sudo

Replace [username] with the username of a trusted normal user.

usermod -Ga sudo [username]

If you dont have a DE, install a window manager (not actual necessary but useful)

sudo apt install i3

or

sudo apt install sway

Install UFW (unless you want to mess arround with ip tables)

sudo apt install ufw

  • Run it.

ufw enable

Install bumblebee (on optimus systems, i.e. laptops with dual gpus)

Bumblebee is slower than other options, but it is the most convienant and works almost out of the box. (for me)

  • On Nouveau

sudo apt install bumblebee primus

  • On Nvidia drivers

sudo apt install bumblebee-nvidia primus-nvidia primus-vk-nvidia

  • Configure bumblebee

sudoedit /etc/bumblebee/bumblebee.conf

  • Change default bridge to primus

  • Change these settings in [bumblebeed]

KeepUnusedXServer=false
ServerGroup=bumblebee
TurnCardOffAtExit=true
  • Restart bumblebeed

sudo systemctl restart bumblebeed.service

  • note: using vblank_mode=0 primusrun insted of primusrun can result in lower input lag.

Install tlp and powertop

sudo apt install tlp powertop

generate power top report

sudo powertop -r

  • examine the tuning tab in powertop.html

  • make shell script to preform tuning

  • Note: if you installed bumblebee skip PM for gps.

sudoedit /root/tune

sudo chmod a+x /root/tune

  • create a systemd service to run script

note, if you don't use systemd, you will have to do this differently,

sudoedit /lib/systemd/system/setup-pm.service

  • you can use this template
Description=Tweak device params to impove power
After=network.target
After=systemd-user-sessions.service

[Service]
User=root
Type=simple
ExecStart="/root/tune"

[Install]
WantedBy=multi-user.target
  • enable the service

sudo systemctl enable setup-pm

sudo systemctl start setup-pm

if using a realtek wifi addapter

  • Installing the drivers is highly recommended

https://github.com/aircrack-ng/rtl8188eus

Note on Bumblebee

if you experance poor preformace, try echo ON | sudo tee /proc/acpi/bbswitch and sudo systemctl restart bumblebeed.service

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment