os linux
Ubuntu
→ Apt
→ List installed packages
dpkg -l
→ List installed files
dpkg -L <package-name>
→ Search a package
apt-cache search <pattern>
→ Manage package
aptitude
→ Search files
apt-file update
apt-file <filename>
→ Login
→ Prevent suspend when laptop closed
cat /etc/systemd/logind.conf
[Login]
HandleLidSwitch=ignore
→ Installer
→ Snap
It is well integrated with ubuntu. Sometimes flatpak is more up-to-date but snap has the advantage to provide a command in the path.
Also, snap does not access to /tmp
folder, which can be problematic.
→ Flatpak
Flatpak is as good as snap, with a different software coverage, but it does not provide a command in the path: instead flatpak run <tool>
.
Also the sofware are installed by package name flatpak install flathub org.gimp.GIMP
→ Dark Mode
→ Gtk natives
cat .gtkrc-2.0
gtk-application-prefer-dark-theme=true
gtk-key-theme-name = "Emacs"
gtk-icon-theme-name = "Yaru-dark"
18:46 $ cat .config/gtk-3.0/settings.ini
[Settings]
gtk-application-prefer-dark-theme=true
gtk-key-theme-name = emacs
gtk-icon-theme-name = "Yaru-dark"
gtk-can-change-accels = 1
→ Gtk flatpak
sudo apt install ubuntu-session yaru-theme-gnome-shell yaru-theme-gtk yaru-theme-icon yaru-theme-sound
ln -s /usr/share/themes ~/.themes
sudo flatpak override --filesystem=$HOME/.themes
sudo flatpak override --env=GTK_THEME=Yaru-dark
→ Limit resource to program
# 10000 / 200000 = 0.05 == 5% CPU usage cap.
echo 10000 > /sys/fs/cgroup/cpu/cpulimited/cpu.cfs_quota_us
echo 200000 > /sys/fs/cgroup/cpu/cpulimited/cpu.cfs_period_us
# bash script
sudo cgexec -g cpu:cpulimited ./your_program_or_script.sh
# existing program
cgclassify -g cpu:cpulimited <pidNum>
→ Ignore poweroff button press
- Open the file
/etc/systemd/logind.conf
:
sudo vim /etc/systemd/logind.conf
- Find the line that starts with
HandlePowerKey=
and change its value frompoweroff
toignore
. If the line is commented out, uncomment it and change its value.
HandlePowerKey=ignore
This page was last modified: