These are used on Mint XFCE 19.1, Ubuntu and Cygwin.
These are settings for bash, vim, etc.
To debug any ShellScript, just add set -x
after the shell bang: https://stackoverflow.com/questions/36273665/what-does-set-x-do
- My linux configurations (or Dotfiles)
- To install them
- Fix system crash
- To list all programs using a given port
- Install Sublime Text
- Enable hibernation
- ksuperkey
- Ksysguard & others
- chroot
- Optionally install KDE
- Hide user account from login screen
- Install wine & others
- Remove Default XFCE 4 Keybinds
- Create Default Keybinds
- Linux system information
- The table of contents used on this Markdown was generated by:
git clone https://github.com/evandroforks/markdown-toc
cd markdown-toc
npm -g install
cd ../this-repository-root
markdown-toc README.MD
-
First backup your settings, only then, clone this repository using this command:
git clone --recursive https://github.com/evandrocoan/MyLinuxSettings.git ~/Downloads/MyLinuxSettings
And move them to your main's user folder replacing your own settings:
rsync -r -t -v -s ~/Downloads/MyLinuxSettings/ ~/
-
Add yourself admin and sudo groups, for special privileges:
sudo usermod -a -G adm yourusername
(to view system logs, etc)sudo usermod -a -G sudo yourusername
- Use
journalctl -o short-precise -k -b -1 -p 4
to view system logs errors (-p 4). It also use colors, so it is better than directly opening/var/log/syslog
. - https://unix.stackexchange.com/questions/181067/how-to-read-dmesg-from-previous-session-dmesg-0
-
Enable core dump generation on
/var/crash/
by withsudo systemctl enable apport
ulimit -c
cat /proc/sys/kernel/core_pattern
- https://askubuntu.com/questions/966407/where-do-i-find-the-core-dump-in-ubuntu-16-04lts
-
Disable
Ctrl+Space
keybind to disable input!gsettings set org.freedesktop.ibus.general.hotkey triggers []
- https://askubuntu.com/questions/243639/ctrlspace-has-been-bound-to-invoke-some-input-method-and-does-not-work-in-ema
-
Enable the
.gitignore_global
file with:git config --global core.excludesfile ~/.gitignore_global
- https://stackoverflow.com/questions/7335420/global-git-ignore
-
Fix
~/.ssh/config
permissions:chmod 755 ~/.ssh
- Fix not accepting ssh connections with authorized_keys
- https://unix.stackexchange.com/questions/36540/why-am-i-still-getting-a-password-prompt-with-ssh-with-public-key-authentication
chmod 600 ~/.ssh/config
- https://serverfault.com/questions/253313/ssh-returns-bad-owner-or-permissions-on-ssh-config
-
Fix ssh cleaning up terminal output:
vim /etc/bash.bash_logout
if [ "$SHLVL" = 1 ]; then [ -x /usr/bin/clear ] && /usr/bin/clear fi
-
To detach any ssh anytime just press
Enter + ~~ + .
(press~
twice to input a single~
) -
To reset
terminator
terminal pressCtrl+Shift+G
(it will fixtmux
messing with input move after losing thessh
connection into atmux
session)git clone https://github.com/evandroforks/tmux-better-mouse-mode ~/scripts/tmux-better-mouse-mode/ git clone https://github.com/evandroforks/tmux-sensible ~/scripts/tmux-sensible/ git clone https://github.com/evandroforks/tmux-resurrect ~/scripts/tmux-resurrect/
-
To install tmux on Windows (msys2) use: Alexpux/MSYS2-pacman#50 (comment) - Manually Install Pacman Binaries
- To disable daylight saving on Msys2 or Debian:
ln -s /usr/share/zoneinfo/Etc/GMT-1 /etc/localtime -f
orTZ=Etc/GMT+3 date
- To disable daylight saving on Msys2 or Debian:
-
Configuring tigervnc (for RDP)
- https://serverspace.io/support/help/install-tigervnc-server-on-centos-8/
yum install tigervnc-server
sudo vim /etc/tigervnc/vncserver.users
,:2=yourusername
for access on port 5902, using Remmina VNC plugin (not RDP)sudo vim /etc/tigervnc/vncserver-config-defaults
,session=plasma
(see the.desktop
files on/usr/share/xsessions
for the session names)vncpasswd
after logging in asyourusername
, to set the VNC passwordsudo systemctl enable --now vncserver@:2
, to enable thesystemd
service for the useryourusername
on port2=5902
- https://tigervnc.org/
- https://wiki.archlinux.org/title/TigerVNC
- https://stackoverflow.com/questions/15816/changing-the-resolution-of-a-vnc-session-in-linux#:~:text=In%20TigerVNC%2C%20when%20you%20are,the%20one%20that%20you%20like.
- To add a custom resolution to the remotE machine running VNC server:
cvt 1680 1000
$ cvt 1680 1000 # 1680x1000 59.89 Hz (CVT) hsync: 62.17 kHz; pclk: 139.25 MHz Modeline "1680x1000_60.00" 139.25 1680 1784 1960 2240 1000 1003 1013 1038 -hsync +vsync
xrandr --newmode "1680x1000_60.00" 139.25 1680 1784 1960 2240 1000 1003 1013 1038 -hsync +vsync
xrandr --addmode VNC-0 "1680x1000_60.00"
(xrandr --addmode DP-1 "1680x1000_60.00"
)- https://www.tecmint.com/set-display-screen-resolution-in-ubuntu/
- Fix anydesk on Linux (by disabling Wayland and using Xorg),
sudo vim /etc/gdm/custom.conf
# GDM configuration storage [daemon] # Uncoment the line below to force the login screen to use Xorg WaylandEnable=false #AutomaticLoginEnable=true #AutomaticLogin=afonso
vim /etc/sddm.conf
vim /etc/sddm.conf.d/autologin.conf
- https://wiki.archlinux.org/title/SDDM
- https://askubuntu.com/questions/1131921/anydesk-remote-server-display-not-supported-e-g-wayland
- https://serverspace.io/support/help/install-tigervnc-server-on-centos-8/
-
After installing, reload the
XFCE
components, so the settings does not get overridden.This should reload the
XFCE
panel components:# https://www.makeuseof.com/tag/refresh-linux-desktop-without-rebooting/ xfce4-panel -r && xfwm4 --replace &
For other components, research how it could be done, or just install the settings by using another user account or desktop environment as KDE Plasma, Mate, Cinnamon, etc.
-
Set your Android WIFI as a metered connection:
iwgetid
to list WIFI/wireless connection SSIDnmcli -f connection.metered connection show YOUR_WIFI_SSID
nmcli connection modify YOUR_WIFI_SSID connection.metered yes
- https://askubuntu.com/questions/711949/set-wifi-as-metered-connection
-
sudo apt-get install anacron && sudo vim /etc/anacrontab
# the maximal random minutes delay added to the base delay of the jobs RANDOM_DELAY=45 # the jobs will be started during the following hours only START_HOURS_RANGE=3-22 # These replace cron's entries # period in days delay in minutes job-identifier command 1 5 cron.daily run-parts --report /etc/cron.daily 7 10 cron.weekly run-parts --report /etc/cron.weekly @monthly 15 cron.monthly run-parts --report /etc/cron.monthly 1 1 kill-twinkle killall -9 twinkle 1 1 kill-jami killall -9 jami-gnome 1 1 disable-lid-events /bin/bash /home/yourusername/scripts/wakeup-events.sh 1 1 fixmonitorcolors sleep 50 && /bin/bash /home/yourusername/.xprofile # https://bigint.wordpress.com/2016/08/10/xfce-panel-hiding-maximized-window-title/ # https://forum.xfce.org/viewtopic.php?id=10836 - change xfwm4-settings through command line # https://stackoverflow.com/questions/14612371/how-do-i-run-multiple-background-commands-in-bash-in-a-single-line 1 1 restart-xfwm4 sudo -u yourusername xfwm4 --replace & sleep 3 && xfconf-query -c xfwm4 -p /general/titleless_maximize -s false && sleep 2 && xfconf-query -c xfwm4 -p /general/titleless_maximize -s true
- https://www.thegeekdiary.com/centos-rhel-anacron-basics-what-is-anacron-and-how-to-configure-it/
- https://linux.die.net/man/5/anacrontab
- https://unix.stackexchange.com/questions/18151/how-to-follow-links-in-linux-man-pages
- https://askubuntu.com/questions/761658/manually-run-an-anacron-job
- https://www.certdepot.net/rhel7-how-get-started-anacron/
- https://serverfault.com/questions/52335/job-scheduling-using-crontab-what-will-happen-when-computer-is-shutdown-during
-
Configure ps aux monitoring:
sudo vim /etc/systemd/system/monitor-ps-aux.service
(with contents of ./scripts/monitor-ps-aux.sh)sudo systemctl daemon-reload
sudo systemctl enable monitor-ps-aux.service
sudo systemctl start monitor-ps-aux.service
sudo systemctl status monitor-ps-aux.service
-
Disable avahi-daemon missing up DHCP configuration:
sudo systemctl stop avahi-daemon.socket
sudo systemctl disable avahi-daemon.socket
sudo systemctl mask avahi-daemon.socket
sudo systemctl stop avahi-daemon.service
sudo systemctl disable avahi-daemon.service
sudo systemctl mask avahi-daemon.service
- https://ubuntuforums.org/showthread.php?t=2425530 How to stop avahi-daemon?
- https://askubuntu.com/questions/205937/how-can-i-disable-avahi-daemon
-
xfce4-stuff
cd ~/.scripts bash build_xfce4.sh
-
xfce4-panel / whiskermenu
# if: ls /usr/local/lib/xfce4/panel-plugins is a file # move it: mv /usr/local/lib/xfce4/panel-plugins{,old} xfce4-panel -q && PANEL_DEBUG=1 xfce4-panel # May be install it from source: https://github.com/gottcode/xfce4-whiskermenu-plugin/blob/master/INSTALL sudo rsync -ar /usr/lib/x86_64-linux-gnu/xfce4/panel/plugins/ /usr/local/lib/xfce4/panel-plugins/ sudo rsync -ar /usr/share/xfce4/panel/plugins/ /usr/local/share/xfce4/panel/plugins/
-
xf86-input-libinput
(Fix mouse scroll speed without using bugged has as imwheel!)git clone https://github.com/evandroforks/xf86-input-libinput cd xf86-input-libinput sudo apt-get install xserver-xorg-input-libinput # dpkg -l | grep xserver-xorg-input-libinput git checkout 0.29.0 sudo apt-get build-dep libinput autoreconf -vif ./configure --prefix=/usr make make install
- To these change take effect, restart your xorg session, i.e., logout and login again.
- https://gitlab.freedesktop.org/xorg/driver/xf86-input-libinput/-/merge_requests/12 - WIP: Add scroll distance scale setting
- https://gitlab.freedesktop.org/libinput/libinput/-/issues/185 - Support setting scroll speed
- https://askubuntu.com/questions/255890/how-can-i-adjust-the-mouse-scroll-speed/1278266#1278266
-
Select all lines:
ggVG
gg
moves to first line.V
starts visual mode.G
jumps to last line thereby selecting from first to last line- https://vi.stackexchange.com/questions/9028/what-is-the-command-for-select-all-in-vim-and-vsvim
-
In vim, how can I quickly switch between tabs?
g, t
Next tabg, T
Prior tabnnn, g, t
Numbered tab- https://superuser.com/questions/410982/in-vim-how-can-i-quickly-switch-between-tabs
-
Splitting a single file into multiple windows on Vim
Ctrl+w, v
Vertical SplitCtrl+w, n
Horizontal Split- https://superuser.com/questions/1139804/splitting-a-single-file-into-multiple-windows-on-vim
-
Is there a way to move a split page to a new tab in Vim?
-
How to copy selected lines to clipboard in vim
- Copy to the clipboard
" * y
- The unnamed register
" " y
- 10 numbered registers
" 0 y
to" 9 y
- The small delete register
" - y
- 26 named registers
" a y
to" z y
or" A y
to" Z y
- four read-only registers
" : y
," . y
," % y
and" # y
- the expression register
" = y
- The selection and drop registers
" * y
," + y
and" ~ y
- The black hole register
" _ y
- Last search pattern register
" / y
- http://vimdoc.sourceforge.net/htmldoc/change.html#registers
- https://stackoverflow.com/questions/9166328/how-to-copy-selected-lines-to-clipboard-in-vim
- Copy to the clipboard
Disable Google Chrome/Firefox hardware acceleration:
- https://www.lifewire.com/hardware-acceleration-in-chrome-4125122
- https://support.mozilla.org/en-US/kb/hardware-acceleration-and-windowblinds-crash
- https://superuser.com/questions/18609/changing-firefox-tab-cycle-order
- https://superuser.com/questions/1318336/how-to-disable-ctrlq-shortcut-in-firefox-on-linux
Add GRUB_CMDLINE_LINUX="i915.enable_rc6=0"
to /etc/default/grub
:
- https://unix.stackexchange.com/questions/401746/drm-i915-resetting-chip-after-gpu-hang
- https://askubuntu.com/questions/857123/how-to-tweak-intel-hd-graphics-on-ubuntu-16-04
- https://bugs.freedesktop.org/show_bug.cgi?id=104522
- https://bugs.freedesktop.org/show_bug.cgi?id=104520
- https://bbs.archlinux.org/viewtopic.php?id=232551
- https://forum.manjaro.org/t/i915-gpu-hang-solved/37200
- https://bugs.freedesktop.org/show_bug.cgi?id=108614
GRUB_CMDLINE_LINUX="i915.enable_rc6=0 i915.semaphores=0"
# after changing this, run
# sudo update-grub
- https://unix.stackexchange.com/questions/408582/how-to-disable-hardware-acceleration-in-linux
vim /etc/X11/xorg.conf.d/disable-gpu.conf
vim /etc/X11/xorg.conf.d/90-disable-gpu.conf
Section "Extensions" Option "GLX" "Disable" Option "DRI2" "Disable" Option "DRI3" "Disable" EndSection
/var/log/sysinfo
Oct 18 14:26:37 evandro-pc kernel: [309258.854944] [drm] GPU HANG: ecode 9:0:0x89b0929b, in twinkle [12478], reason: Hang on rcs0, action: reset Oct 18 14:26:37 evandro-pc kernel: [309258.854956] i915 0000:00:02.0: Resetting rcs0 after gpu hang Oct 18 14:26:38 evandro-pc kernel: [309260.071284] [drm:gen8_reset_engines [i915]] *ERROR* rcs0: reset request timeout Oct 18 14:26:38 evandro-pc kernel: [309260.071330] i915 0000:00:02.0: Resetting chip after gpu hang Oct 18 14:26:39 evandro-pc kernel: [309261.286980] [drm:gen8_reset_engines [i915]] *ERROR* rcs0: reset request timeout Oct 18 14:26:39 evandro-pc kernel: [309261.287024] [drm:i915_reset [i915]] *ERROR* Failed to reset chip: -5 Oct 18 14:26:40 evandro-pc xdg-desktop-por[22547]: xdg-desktop-portal-gtk: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0.
- Edit the standard skype start menu shortcut with
Menu Editor
to:/usr/bin/skypeforlinux %U --disable-gpu
- Edit the
snap
start menu shortcut withMenu Editor
to:env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/skype_skypeforlinux.desktop /snap/bin/skype --disable-gpu %U
- Edit the file
/var/lib/snapd/desktop/applications/skype_skypeforlinux.desktop
to:[Desktop Entry] X-SnapInstanceName=skype Name=Skype Comment=Skype Internet Telephony Exec=env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/skype_skypeforlinux.desktop /snap/bin/skype --disable-gpu %U Icon=/snap/skype/66/meta/gui/skypeforlinux.png ...
sudo netstat -tulpn | grep 5060
- https://www.sublimetext.com/3
- Install StudioChannel:
- https://github.com/evandrocoan/ITE#installation-go-to-top
https://raw.githubusercontent.com/evandrocoan/StudioChannel/master/channel.json
- https://forum.sublimetext.com/t/multiple-sublime-processes-with-different-environment/34575
Setup it to start maximized with:
It will take you computer from 10 to 30 minutes to come out from the hibernation. To speed things up, you need to install an SSD drive of 16 or 32 GB, depending on how much memory do you use. Remember, the SWAP partition must hold all you RAM memory, including the actual virtual memory already on the SWAP partition.
- Set swap file size to 20GG on the next step tutorial
- https://forums.linuxmint.com/viewtopic.php?f=42&t=284100 [GUIDE] How to hibernate to a swap file in Linux Mint 19.x
- https://forums.linuxmint.com/viewtopic.php?t=273202 How to enable hibernation with swap partion on Linux Mint 19
- https://askubuntu.com/questions/33697/how-do-i-add-swap-after-system-installation
- https://askubuntu.com/questions/343268/how-to-use-manual-partitioning-during-installation
- https://www.cyberciti.biz/faq/linux-check-swap-usage-command/
- https://askubuntu.com/questions/562153/can-swap-be-on-a-different-disk
- https://askubuntu.com/questions/180730/how-do-i-restore-a-swap-partition-i-accidentally-deleted
- https://www.cyberciti.biz/faq/linux-add-a-swap-file-howto/
-
findmnt -no UUID -T /swapfile30GB
-
sudo filefrag -v /swapfile30GB
(take the first1626112
)Filesystem type is: ef53 File size of /swapfile is 8589934592 (2097152 blocks of 4096 bytes) ext: logical_offset: physical_offset: length: expected: flags: 0: 0.. 6143: 1626112.. 4980735: 6144: 1: 6144.. 8191: 4982784.. 4984831: 2048: 4980736:
-
sudo vim /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="..... resume=UUID=8a45acb0-cc70-4a0d-a41c-f39e1676148f resume_offset=1626112"
-
sudo update-grub
-
sudo vim /etc/initramfs-tools/conf.d/resume
RESUME=UUID=8a45acb0-cc70-4a0d-a41c-f39e1676148f resume_offset=1626112
-
sudo update-initramfs -c -k all
-
sudo reboot
-
sudo systemctl hibernate
-
sudo systemctl status systemd-hibernate.service
-
https://www.linuxuprising.com/2021/08/how-to-enable-hibernation-on-ubuntu.html
-
sudo vim /etc/polkit-1/localauthority/50-local.d/com.ubuntu.desktop.pkla
[Enable hibernate in upower] Identity=unix-user:* Action=org.freedesktop.upower.hibernate ResultActive=yes [Enable hibernate in logind] Identity=unix-user:* Action=org.freedesktop.login1.hibernate;org.freedesktop.login1.handle-hibernate-key;org.freedesktop.login1;org.freedesktop.login1.hibernate-multiple-sessions;org.freedesktop.login1.hibernate-ignore-inhibit ResultActive=yes
-
vim ~/.local/share/applications/hibernate.desktop
[Desktop Entry] Type=Application Name=Hibernate desktop GenericName=Hibernate desktop Comment=Enter hibernation NoDisplay=false Icon=drive-multidisk Exec=systemctl hibernate Terminal=true Categories=System;Utility;Settings;
-
sudo vim /etc/systemd/sleep.conf
[Sleep] # suspend=hybrid-sleep SuspendMode=suspend SuspendState=disk # hibernate=hybrid-sleep HibernateMode=suspend HibernateState=disk
sudo systemctl hybrid-sleep
suspends the system both to RAM and disk, so a complete power loss does not result in lost data. This mode is also called suspend to both.sudo systemctl suspend-then-hibernate
initially suspends the system to RAM and if it is not interrupted within the delay specified by HibernateDelaySec in systemd-sleep.conf(5), then the system will be woken using an RTC alarm and hibernated.- https://wiki.archlinux.org/title/Power_management#Suspend_and_hibernate
By default almost any device can wake up your computer. To disable this:
-
sudo apt install acpitool
1, Create the filevim /etc/systemd/system/wakeup-events.service
[Unit] Description=Disable wakeup events on startup [Service] Type=oneshot ExecStart=/bin/bash /home/yourusername/scripts/wakeup-events.sh [Install] WantedBy=multi-user.target
-
And run
sudo systemctl enable wakeup-events
Created symlink /etc/systemd/system/multi-user.target.wants/wakeup-events.service → /etc/systemd/system/wakeup-events.service.
- https://forums.linuxmint.com/viewtopic.php?t=290225 - How to disable wakeup on lid open event? [SOLVED]
- https://unix.stackexchange.com/questions/52643/how-to-disable-auto-suspend-when-i-close-laptop-lid/52645
-
Use
sudo journalctl -u systemd-logind.service -f
to see login eventsdez 10 20:45:11 MOBDEV-016 systemd-logind[172521]: Lid closed. dez 10 20:45:16 MOBDEV-016 systemd-logind[172521]: Lid opened. dez 10 20:46:04 MOBDEV-016 systemd-logind[172521]: New session c1 of user root. dez 10 20:53:47 MOBDEV-016 systemd-logind[172521]: Power key pressed. dez 10 20:54:20 MOBDEV-016 systemd-logind[172521]: Operation 'sleep' finished. dez 10 21:02:15 MOBDEV-016 systemd-logind[172521]: Power key pressed.
-
Edit
vim /etc/UPower/UPower.conf
and setIgnoreLid=true
-
grep . /sys/bus/usb/devices/*/power/wakeup
echo disabled > /sys/bus/usb/devices/usb8/power/wakeup
If you got a black screen after suspend the computer or locking the session and unlocking, you got the following problem:
- https://ubuntuforums.org/showthread.php?t=2392824
- https://bbs.archlinux.org/viewtopic.php?id=249053
- the-cavalry/light-locker#126 - Painful "You'll be redirected to the unlock dialog in a few seconds" - Does it have to be there?
- https://askubuntu.com/questions/1133341/xubuntu-18-10-light-locker-wrong-behavior
Never use dm-tool lock
!
sudo vim /etc/systemd/logind.conf
sudo systemctl restart systemd-logind.service
- Configure systemd to handle suspend. (Do not use xfce4-power-manager)
# This file is part of systemd. # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. # # Entries in this file show the compile time defaults. # You can change settings by editing this file. # Defaults can be restored by simply deleting this file. # # See logind.conf(5) for details. [Login] HandlePowerKey=ignore HandleSuspendKey=ignore HandleHibernateKey=ignore HandleLidSwitch=ignore HandleLidSwitchExternalPower=ignore HandleLidSwitchDocked=ignore # --> # IdleAction=suspend # IdleActionSec=30min HandlePowerKey=suspend HandleSuspendKey=suspend HandleHibernateKey=ignore HandleLidSwitch=ignore HandleLidSwitchExternalPower=ignore HandleLidSwitchDocked=ignore
Add/usr/bin/light-locker
to run on system start up (Settings -> Sessions and Start up -> Application Auto Start -> (login)
)xfconf-query -c xfce4-session -p /general/LockCommand
xfconf-query -c xfce4-session -p /general/LockCommand -s "light-locker-command --lock"
xfconf-query -c xfce4-session -p /general/LockCommand -s ""
sudo apt-get install xfce4-screensaver xscreensaver
sudo vim /usr/bin/xflock4
... # "dm-tool switch-to-greeter" \ # "light-locker-command --lock" \ # Remove 'xfce4-screensaver-command' because it does not turn screen off as xscreensaver-command -lock! # "xfce4-screensaver-command --lock" \ # turn the screen off continually because xfce4-screensaver-command does not turn it off again # xfce4-screensaver-command --lock && { while true; do xset dpms force off; sleep 50; done; } for lock_cmd in \ "$LOCK_CMD" \ "xscreensaver-command -lock" \ "gnome-screensaver-command --lock" \ "mate-screensaver-command --lock" \ "" do ...
sudo -u gdm dbus-launch gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'nothing'
- https://askubuntu.com/questions/1101043/prevent-sleep-suspend-when-not-logged-in-to-a-specific-account
xrandr --listmonitors
(to see monitors names)xrandr --output eDP-1 -off
(turneDP-1
off)xrandr --output eDP-1 --auto
(turneDP-1
on)- https://askubuntu.com/questions/62858/turn-off-monitor-using-command-line
- https://askubuntu.com/questions/512192/turn-monitor-back-on-after-xrandr
Instead of expanding a SWAP partition, just create a swap file instead!
- sudo swapon --show
NAME TYPE SIZE USED PRIO /dev/sda2 partition 1.9G 0B -2
sudo fallocate -l 1G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo nano /etc/fstab
- And paste the following line:
/swapfile swap swap defaults 0 0
sudo swapon --show
NAME TYPE SIZE USED PRIO /swapfile file 1024M 507.4M -1
sudo free -h
- https://linuxize.com/post/how-to-add-swap-space-on-ubuntu-18-04/
sudo apt install peek
git clone https://gitlab.com/screenkey/screenkey
cd screenkey
sudo ./setup.py install
screenkey; peek
- Clone and install https://github.com/hanschen/ksuperkey with
make
andsudo make install
- Remove the
Super+L
toxfce4-popup-whiskermenu
onAll Settings -> Keyboard -> Applications Shortcuts
and add it toSuper_L|m
- Then, run the command
ksuperkey -e 'Super_L=Super_L|m'
on system startup.
Enable super user account login with su
:
sudo passwd root
# https://askubuntu.com/questions/20450/disable-root-account-in-ubuntu
sudo passwd -l root
-
sudo vim /etc/apt/apt.conf.d/99update-notifier
-
Add
#
in front ofDPkg::Post-Invoke {"if ...
-
https://askubuntu.com/questions/218755/how-to-disable-the-update-manager-popup
-
For Ubuntu, disable the annoying daily update check:
systemctl disable --now apt-daily{,-upgrade}.{timer,service}
- https://askubuntu.com/questions/1059971/disable-updates-from-command-line-in-ubuntu-16-04
tail -F /var/log/pcp/pmproxy/pmproxy.log
sudo /usr/lib/pcp/bin/pmproxy stop
sudo apt-get install systemd
sudo systemctl disable pmcd.service
sudo systemctl disable pmlogger.service
sudo mv /usr/lib/pcp/bin/pmproxy{,old}
sudo killall -9 pmproxy
- systemd/systemd#15928 - warn on KillMode=none, inform about left-over processes on stop and warn about sysv services
- https://linux.die.net/man/1/pmproxy
- https://man7.org/linux/man-pages/man1/pmproxy.1.html
- https://man7.org/linux/man-pages/man1/pcpintro.1.html
pulseaudio -k && sudo alsa force-reload && sleep 2 && pulseaudio -k && sudo alsa force-reload
sudo killall pulseaudio && sudo alsa force-reload && sleep 2 && sudo killall pulseaudio && sudo alsa force-reload
- https://askubuntu.com/questions/15223/how-can-i-restart-pulseaudio-without-having-to-logout
Add ppa repositories:
sudo add-apt-repository ppa:sporkwitch/autokey &&
sudo add-apt-repository ppa:hluk/copyq &&
sudo apt update
Install stuff:
sudo apt install build-essential autokey-gtk copyq mtp-tools gmtp imwheel openssh-server;
sudo apt-get install nethogs python3 python-pip python3-pip;
sudo apt-get install audacity thunderbird ksysguard wmctrl;
sudo apt-get install xdotool grsync unison-gtk indicator-multiload;
sudo apt-get install vim vim-gtk3 ncdu nemo glogg qps nemo-fileroller;
sudo apt-get install libc6-dbg gsmartcontrol iotop fatrace;
sudo apt-get install gnome-disk-utility speedcrunch okular;
sudo apt-get install terminator thunar-archive-plugin gparted p7zip-full;
sudo apt-get install xfce4-power-manager xfce4-systemload-plugin xfce4-screenshooter;
sudo apt-get install xfce4-terminal menulibre pinta catfish moreutils;
pip install setuptools;
pip3 install setuptools;
pip install wheel;
pip3 install wheel python-language-server;
- Never ever use GIMP! It its full of crap. Use pinta instead!
sudo apt-get install gnome-disks
(https://askubuntu.com/questions/500549/how-to-run-gnome-disk-utility#)- https://www.poweriso.com/download-poweriso-for-linux.htm
- https://remmina.org/how-to-install-remmina/
flameshot
flameshot-org/flameshot#11 (comment)terminator
(to set terminator as default terminal onnemo
file manager)gsettings set org.cinnamon.desktop.default-applications.terminal exec 'xfce4-terminal'
- linuxmint/nemo#2091
- https://unix.stackexchange.com/questions/86875/determining-specific-file-responsible-for-high-i-o
- Open
Preferred Applications
and set mailto asthunderbird
- Open
Preferred Applications
and set File Manger asnemo
- Open
KSysGuard
&System Monitor
and Install KSysGuard System Monitor Tabs:- Hard Disk Totals - https://store.kde.org/p/1198291
- System Load and Temps - https://store.kde.org/p/1198291
- Open
Unisson
&Grsync
- Add
System Load Monitor
widget to the main panel - Create keybind
,
(numpad comma),autokey-run -p insert_dot
- https://github.com/autokey/autokey
- Run
autokey-gtk --verbose &
for debugging it
- https://unix.stackexchange.com/questions/192048/mount-mtp-android-device-in-linux-mint-17-1
- https://unix.stackexchange.com/questions/389952/how-to-get-the-samsung-galaxy-s5-to-work-with-mtp-on-debian-9
Runimwheel -b "4 5"
on system start upCreate~/.imwheelrc
with:https://wiki.archlinux.org/index.php/IMWheel- Use
imwheel -d --debug --kill
to list windows
- Use
Usesudo killall -9 imwheel; sleep 2; imwheel -b "4 5"
to restart the service- ~https://askubuntu.com/questions/285689/increase-mouse-wheel-scroll-speed
- ~https://mintguide.org/other/643-setup-the-mouse-scroll-wheel-speed.html#sel=13:4,13:14
Disable smooth scrolling on Google Chrome:chrome://flags/#smooth-scrolling
- https://www.ghacks.net/2016/03/16/turn-off-smooth-scrolling-google-chrome/
sudo apt-get install debootstrap schroot
- Create an isolated environment with
chroot
(it will inherit your $HOME environment variable, etc)mkdir /myfiles/ubuntu_xenial_1604 debootstrap --arch=amd64 xenial /myfiles/ubuntu_xenial_1604 http://archive.ubuntu.com/ubuntu/ cp /usr/share/i18n/SUPPORTED /etc/locale.gen locale-gen dpkg-reconfigure locales apt-get install linux-headers-$(uname -r) gcc dialog unzip psmisc
mkdir -p /myfiles/ubuntu_xenial_1604/home/$USER/
- Add main machine resources to chroot nested machine
mkdir -p /myfiles/ubuntu_xenial_1604/proc/
mkdir -p /myfiles/ubuntu_xenial_1604/sys/
mkdir -p /myfiles/ubuntu_xenial_1604/dev/pts
sudo mount -t proc proc /myfiles/ubuntu_xenial_1604/proc/
sudo mount -t sysfs sys /myfiles/ubuntu_xenial_1604/sys/
sudo mount -o bind /dev /myfiles/ubuntu_xenial_1604/dev/
sudo mount -t devpts pts dev/pts/
- https://wiki.archlinux.org/index.php/Chroot
- https://unix.stackexchange.com/questions/98405/which-of-proc-sys-etc-should-be-bind-mounted
- Or edit
/etc/fstab
:# <device> <dir> <type> <options> <dump> <pass> /myfiles/ubuntu_xenial_1604/proc/ /proc auto -t,proc 0 1 /myfiles/ubuntu_xenial_1604/sys/ /sys auto -t,sysfs 0 1 /myfiles/ubuntu_xenial_1604/dev/pts /dev auto -t,devpts 0 1 /myfiles/ubuntu_xenial_1604/dev/ /dev auto -o,bind 0 1
sudo mount --bind /usr/local/something /myfiles/ubuntu_xenial_1604/mnt/something
- Optionally, mount something inside the new Linux
sudo umount /myfiles/ubuntu_xenial_1604/mnt/something
- Generate a new list of sources and add them to the file /etc/apt/sources.list
#------------------------------------------------------------------------------# # OFFICIAL UBUNTU REPOS # #------------------------------------------------------------------------------# ###### Ubuntu Main Repos deb http://55.archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse deb-src http://55.archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse ###### Ubuntu Update Repos deb http://55.archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse deb http://55.archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse deb http://55.archive.ubuntu.com/ubuntu/ xenial-proposed main restricted universe multiverse deb http://55.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse deb-src http://55.archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse deb-src http://55.archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse deb-src http://55.archive.ubuntu.com/ubuntu/ xenial-proposed main restricted universe multiverse deb-src http://55.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse ###### Ubuntu Partner Repo deb http://archive.canonical.com/ubuntu xenial partner deb-src http://archive.canonical.com/ubuntu xenial partner
- https://help.ubuntu.com/community/BasicChroot
- https://help.ubuntu.com/community/DebootstrapChroot
- 1 GB to install
sudo apt-get install kde-standard kwin-addons
- 28 MB to install
sudo apt install budgie-desktop-environment
- 128 MB to install
- http://ubuntuhandbook.org/index.php/2018/11/install-cinnamon-desktop-4-0-ubuntu-18-04/
sudo apt-get install cinnamon-desktop-environment
- Install applets:
- Cinnamenu
- Show desktop ++
- Collapsible Systray
- System Monitor
Open /var/lib/AccountsService/users/XXX and add:
[User]
SystemAccount=true
- https://www.teamviewer.com/pt-br/download/linux/
- https://community.teamviewer.com/English/discussion/95696/teamviewer-15-stopped-working-on-debian-buster
- https://superuser.com/questions/1563951/systemd-does-not-assign-a-seat-to-my-session-when-using-nis-authentication
- Use
systemctl edit --full systemd-logind
to disable the network restrictions in systemd-logind, by removing theIPAddressDeny=
andRestrictAddressFamilies=
options. (And probablySystemCallFilter=
as well).- Reboot your computer after
systemctl edit --full systemd-logind
- Reboot your computer after
sudo su
history
grep 'enp1s0' /var/log/syslog
/etc/init.d/network restart
systemctl status networking.service
systemctl restart NetworkManager
ip addr flush dev wlo1
ip addr flush dev enp1s0
ifdown enp1s0
ifdown wlo1
ifup enp1s0
ifup wlo1
ip a s
# assegure vim /etc/network/interfaces com o seguinte e execute ifdown/ifup em seguida
# Verifique se a conexão está ok com `ping 8.8.8.8` ou `ping 1.1.1.1`
auto lo
iface lo inet loopback
#auto enp1s0
allow-hotplug enp1s0
iface enp1s0 inet dhcp
auto wlo1
allow-hotplug wlo1
iface wlo1 inet dhcp
- https://routerctrl.com/ubuntu-wi-fi-connected-but-no-internet-access/
- https://askubuntu.com/questions/293827/error-rtnetlink-answers-file-exists
- https://raspberrypi.stackexchange.com/questions/13895/solving-rtnetlink-answers-file-exists-when-running-ifup
- https://unix.stackexchange.com/questions/100588/using-ip-addr-instead-of-ifconfig-reports-rtnetlink-answers-file-exists-on-de
If commands like docker run -it debian:11 apt update
cannot connect to internet:
sudo su
ip link delete docker0
service docker restart
- docker/for-linux#312 - Accidently deleted docker0 bridge. How do i get docker running again?
- https://forums.docker.com/t/network-bridge-docker0-cant-connect-to-local-network/78175
- https://stackoverflow.com/questions/58641541/why-docker0-bridge-is-showing-down-in-a-kubernetes-cluster-with-flannel
sudo snap install remmina
- Disable snap auto updates:
- https://askubuntu.com/questions/930593/how-to-disable-autorefresh-in-snap
sudo snap set system refresh.hold="$(date --date='today+300000 days' --iso-8601=seconds)"
sudo snap set system refresh.metered=hold
sudo systemctl disable snapd.service
sudo vim /etc/hosts
(add127.0.0.1 api.snapcraft.io
)
- https://askubuntu.com/questions/1227585/remmina-not-receiving-audio
Run the script ~/scripts/create-remmina-desktops.sh
to create .desktop
icons from saved Remmina connections and
edit ~/.config/menus/xfce-applications.menu
with the results.
sudo chmod ugo+rwx "$HOME/snap/remmina/" -R
- Software Manager -> Twinkle -> Install
- https://www.virtualbox.org/wiki/Linux_Downloads
- http://wiki.octave.org/Octave_for_Debian_systems
- https://wiki.winehq.org/Ubuntu
- https://www.cockos.com/licecap/
- https://github.com/balena-io/etcher
- https://askubuntu.com/questions/785657/i-cant-install-gnome-schedule-on-ubuntu-16-04
- https://askubuntu.com/questions/779946/how-do-i-install-lastfm-scrobblernewbie-at-ubuntu-stuff
- http://www.aimp2.us/aimp3-download.php (install inside wine)
- https://www.last.fm/about/trackmymusic?platform=windows (install inside wine)
- https://askubuntu.com/questions/138908/how-to-execute-a-script-just-by-double-clicking-like-exe-files-in-windows
- Wireshark
- https://www.syntevo.com/smartgit/download/ Sometimes ignored directories are containing tracked files in which case changes to these files might not show up automatically. If this is the case for you, you may disable this optimization by setting system property 'fileMonitor.excludeIgnoredDirectories=false'.
-
https://www.ostechnix.com/how-to-adjust-monitor-brightness-from-command-line-in-linux/
$ xrandr -q HDMI-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 510mm x 290mm DP-1 connected 1920x1080+1920+0 (normal left inverted right x axis y axis) 510mm x 290mm $ xrandr --output DP-1 --brightness 0.7 $ xrandr --output DP-1 --gamma 0.9:0.9:0.9
-
https://github.com/calandoa/movescreen
./movescreen.py right ./movescreen.py left
-
To see all current monitor settings
$ xrandr --verbose
-
How do I save my new resolution setting with xrandr?
- Create the
$HOME/.xprofile
and set it as executablechmod +x "$HOME/.xprofile"
:
#!/bin/bash xrandr --output DP-1 --brightness 1.0 xrandr --output DP-1 --gamma 0.85:0.85:0.85
- Create the
My old settings:
xrandr --output eDP-1 --brightness 0.6
xrandr --output eDP-1 --gamma 0.85:0.85:0.85
xrandr --output eDP-1 --brightness 0.9
xrandr --output eDP-1 --gamma 0.65:0.65:0.65
setterm -linewrap off
- https://unix.stackexchange.com/questions/20493/how-to-disable-line-wrap-in-a-terminal/345492
- All Settings -> Window Manger -> Keyboard ->
- Raise Window,
Alt+Shift+PgUp
- Lower Window,
Alt+Shift+PgDown
- Raise Window,
Ctrl+Alt+J
, subl -nCtrl+Alt+O
, gnome-calculatorCtrl+Alt+H
, gnome-system-monitorCtrl+Print
, flameshot gui- .local/bin/play_stop_music.sh
Pause
, play_stop_music.sh spaceAlt+Super+Up
, play_stop_music.sh UpAlt+Super+Down
, play_stop_music.sh DownAlt+Super+Left
, play_stop_music.sh F1Alt+Super+Right
, play_stop_music.sh F2
Alt+Super+0
, wmctrl -x -a aimp.exe.WineAlt+Super+1
, wmctrl -x -a minilyrics.exe.Wine- To list active windows use
wmctrl -lx
- To list active windows use
/home/evandro/.local/share/applications/lastfm.desktop
[Desktop Entry]
Version=1.1
Type=Application
Name=Last.fm
Comment=Listen to Last.fm radio
Icon=lastfm
Exec=wine "/home/evandro/.wine/dosdevices/c:/Program Files (x86)/Last.fm/Last.fm Scrobbler.exe"
Actions=
Categories=Audio;AudioVideo;Qt;
StartupNotify=true
/home/evandro/.local/share/applications/menulibre-aimp3.desktop
[Desktop Entry]
Version=1.1
Type=Application
Name=AIMP3
Comment=Music Player running on Wine
Icon=applications-other
Exec=wine "/home/evandro/Programs/AIMP3/AIMP.exe"
Actions=
Categories=AudioVideo;
/home/evandro/.local/share/applications/menulibre-minilyrics-wine.desktop
[Desktop Entry]
Version=1.1
Type=Application
Name=Minilyrics Wine
Comment=A small descriptive blurb about this application.
Icon=applications-other
Exec=wine "/home/evandro/.wine/dosdevices/c:/Program Files (x86)/MiniLyrics/MiniLyrics.exe"
Actions=
Categories=AudioVideo;
-
lshw -class disk
*-disk:0 description: ATA Disk product: WDC WD20EFRX-68E vendor: Western Digital physical id: 0 bus info: scsi@0:0.0.0 logical name: /dev/sda version: 82.0 serial: WD-WCC4M0NJKLUP size: 1863GiB (2TB) capabilities: gpt-1.00 partitioned partitioned:gpt configuration: ansiversion=5 guid=3fc710f6-7e35-4a0a-9142-73a813966c3b
-
sudo smartctl --all /dev/nvme0n1
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-47-generic] (local build) Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org === START OF INFORMATION SECTION === Model Number: CL1-3D256-Q11 NVMe SSSTC 256GB Serial Number: TW0TN2CC9DH0003I05HD Firmware Version: 22301115 PCI Vendor ID: 0x1e95 PCI Vendor Subsystem ID: 0x126f IEEE OUI Identifier: 0x38f601 Total NVM Capacity: 256.060.514.304 [256 GB] Unallocated NVM Capacity: 0 Controller ID: 1 Number of Namespaces: 1 Namespace 1 Size/Capacity: 256.060.514.304 [256 GB] Namespace 1 Formatted LBA Size: 512 Namespace 1 IEEE EUI-64: 002303 56303ac67b Local Time is: Thu Feb 18 09:46:11 2021 -03 Firmware Updates (0x14): 2 Slots, no Reset required Optional Admin Commands (0x0017): Security Format Frmw_DL Self_Test Optional NVM Commands (0x001f): Comp Wr_Unc DS_Mngmt Wr_Zero Sav/Sel_Feat Maximum Data Transfer Size: 32 Pages Warning Comp. Temp. Threshold: 83 Celsius Critical Comp. Temp. Threshold: 85 Celsius Supported Power States St Op Max Active Idle RL RT WL WT Ent_Lat Ex_Lat 0 + 3.50W - - 0 0 0 0 0 0 1 + 2.10W - - 1 1 1 1 0 0 2 + 1.65W - - 2 2 2 2 0 0 3 - 0.0500W - - 3 3 3 3 5000 5000 4 - 0.0050W - - 4 4 4 4 5000 20000 Supported LBA Sizes (NSID 0x1) Id Fmt Data Metadt Rel_Perf 0 + 512 0 0 === START OF SMART DATA SECTION === SMART overall-health self-assessment test result: PASSED SMART/Health Information (NVMe Log 0x02) Critical Warning: 0x00 Temperature: 33 Celsius Available Spare: 100% Available Spare Threshold: 50% Percentage Used: 5% Data Units Read: 9.964.234 [5,10 TB] Data Units Written: 8.399.441 [4,30 TB] Host Read Commands: 376.884.149 Host Write Commands: 364.516.648 Controller Busy Time: 12.058 Power Cycles: 312 Power On Hours: 1.492 Unsafe Shutdowns: 62 Media and Data Integrity Errors: 0 Error Information Log Entries: 0 Warning Comp. Temperature Time: 0 Critical Comp. Temperature Time: 0 Temperature Sensor 1: 33 Celsius Error Information (NVMe Log 0x01, max 64 entries) No Errors Logged
-
sudo apt-get install inxi dmidecode lshw
$ sudo lshw -short -C memory H/W path Device Class Description ==================================================== /0/0 memory 64KiB BIOS /0/3d memory 8GiB System Memory /0/3d/0 memory 8GiB DIMM DDR4 Synchronous 2400 MHz (0,4 ns) /0/3d/1 memory [empty] /0/3d/2 memory [empty] /0/3d/3 memory [empty] /0/43 memory 256KiB L1 cache /0/44 memory 1MiB L2 cache /0/45 memory 6MiB L3 cache /0/100/1f.2 memory Memory controller
-
sudo dmidecode --type 17
# dmidecode 3.1 Getting SMBIOS data from sysfs. SMBIOS 3.0.0 present. Handle 0x003E, DMI type 17, 40 bytes Memory Device Array Handle: 0x003D Error Information Handle: Not Provided Total Width: 64 bits Data Width: 64 bits Size: 8192 MB Form Factor: DIMM Set: None Locator: ChannelA-DIMM0 Bank Locator: BANK 0 Type: DDR4 Type Detail: Synchronous Speed: 2400 MT/s Manufacturer: 859B Serial Number: E1A93CFC Asset Tag: 9876543210 Part Number: BLS8G4D240FSB.16FBD2 Rank: 2 Configured Clock Speed: 2400 MT/s Minimum Voltage: 1.2 V Maximum Voltage: 1.2 V Configured Voltage: 1.2 V
-
sudo inxi -Fxz
System: Host: evandro-pc Kernel: 4.15.0-45-generic x86_64 bits: 64 compiler: gcc v: 7.3.0 Desktop: Xfce 4.12.3 Distro: Linux Mint 19.1 Tessa base: Ubuntu 18.04 bionic Machine: Type: Desktop System: Gigabyte product: H110M-S2PH v: N/A serial: <filter> Mobo: Gigabyte model: H110M-S2PH-CF v: x.x serial: <filter> UEFI: American Megatrends v: F21 date: 06/09/2017 CPU: Topology: Quad Core model: Intel Core i5-7400 bits: 64 type: MCP arch: Kaby Lake rev: 9 L2 cache: 6144 KiB flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 24000 Speed: 800 MHz min/max: 800/3500 MHz Core speeds (MHz): 1: 800 2: 800 3: 800 4: 800 Graphics: Device-1: Intel HD Graphics 630 vendor: Gigabyte driver: i915 v: kernel bus ID: 00:02.0 Display: x11 server: X.Org 1.19.6 driver: modesetting unloaded: fbdev,vesa resolution: 1920x1080~60Hz OpenGL: renderer: Mesa DRI Intel HD Graphics 630 (Kaby Lake GT2) v: 4.5 Mesa 18.2.2 direct render: Yes Audio: Device-1: Intel 100 Series/C230 Series Family HD Audio vendor: Gigabyte Sunrise Point-H driver: snd_hda_intel v: kernel bus ID: 00:1f.3 Sound Server: ALSA v: k4.15.0-45-generic Network: Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Gigabyte driver: r8169 v: 2.3LK-NAPI port: e000 bus ID: 01:00.0 IF: enp1s0 state: up speed: 1000 Mbps duplex: full mac: <filter> Drives: Local Storage: total: 931.51 GiB used: 47.82 GiB (5.1%) ID-1: /dev/sda vendor: Western Digital model: WD10EZEX-00WN4A0 size: 931.51 GiB Partition: ID-1: / size: 907.63 GiB used: 47.81 GiB (5.3%) fs: ext4 dev: /dev/dm-0 Sensors: System Temperatures: cpu: 29.8 C mobo: 27.8 C Fan Speeds (RPM): N/A Info: Processes: 236 Uptime: 1h 13m Memory: 7.68 GiB used: 4.39 GiB (57.2%) Init: systemd runlevel: 5 Compilers: gcc: 7.3.0 Shell: bash v: 4.4.19 inxi: 3.0.27