meta data for this page
Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
linux:prepare:prepare [2016/01/19 07:18] niziak |
linux:prepare:prepare [2023/07/30 08:53] (current) niziak |
||
---|---|---|---|
Line 3: | Line 3: | ||
===== Basic ===== | ===== Basic ===== | ||
- | === Usefull software === | + | ==== default EDITOR ==== |
- | <code bash>sudo apt-get install wireshark cups</code> | + | <code bash> |
- | <code bash>sudo usermod -G lp,lpadmin,dialout,sudo,audio,video,netdev,vboxusers,wireshark,kismet,i2c user_login</code> | + | sudo update-alternatives --list editor |
+ | sudo update-alternatives --config editor | ||
+ | </code> | ||
+ | ==== set umask ==== | ||
- | === parallel packers === | + | In file: ''~/.profile'' |
- | <code bash>sudo apt-get install pigz pbzip2 pxz lbzip2</code> | + | * ''umask 002'' (default), RW for user, RW for group and R for others - create dirs as 775 and files as 664 |
+ | * ''umask 022'' (default for root), 755 and 644 | ||
+ | * ''umask 077'' only RW for user, not other access | ||
+ | * ''umask 007'' RW for user, RW for group | ||
- | To force using parallel packers system-wide: | + | **NOTE!:** Problem appears with non default user umask and ''sudo'' command usage. |
- | <code bash> | + | After sudo umask is still set to the user umask, which is correct. |
- | ln -s /usr/bin/lbzip2 /usr/local/bin/bzip2 | + | But can lead to some unpredicted behavior i.e. installing system-wide packages - new file will be created with incorrect umasks (user umask). |
- | ln -s /usr/bin/lbzip2 /usr/local/bin/bunzip2 | + | |
- | ln -s /usr/bin/lbzip2 /usr/local/bin/bzcat | + | To prevent this: |
- | ln -s /usr/bin/pigz /usr/local/bin/gzip | + | <file | /etc/sudoers> |
- | ln -s /usr/bin/pigz /usr/local/bin/gunzip | + | Defaults umask_override |
- | ln -s /usr/bin/pigz /usr/local/bin/zcat | + | Defaults umask=0022 |
- | ln -s /usr/bin/pixz /usr/local/bin/xz | + | |
- | </code> | + | |
- | or use bash aliases: | + | |
- | <file | .bashrc> | + | |
- | alias gzip='pigz' | + | |
- | alias gunziip='unpigz' | + | |
- | alias bzip2='pbzip2' | + | |
- | alias bunzip2='pbunzip2' | + | |
- | alias xz='pxz' | + | |
</file> | </file> | ||
- | === add i386 architecture === | + | |
+ | ==== add i386 architecture ==== | ||
<code bash> | <code bash> | ||
Line 39: | Line 37: | ||
</code> | </code> | ||
- | === etckeeper === | + | ==== NTP: allow time corrections bigger than 1h ==== |
+ | - Disable systemd time service: ''systemctl disable --now systemd-timesyncd'' | ||
+ | - Install ''ntpdate'' and ''ntp'' | ||
+ | - Edit ''/etc/default/ntp'' and add ''-g'' argument. | ||
+ | - Switch RTC to UTC time: | ||
<code bash> | <code bash> | ||
- | apt-get install git | + | timedatectl set-local-rtc 0 |
- | git config --global user.name "my name" | + | ntpd -gxn |
- | git config --global user.email myemail@address.pl | + | hwclock --systohc |
- | apt-get install git-cola etckeeper kdiff3 | + | |
</code> | </code> | ||
- | === Disable PC speaker === | + | |
+ | |||
+ | |||
+ | ==== Disable PC speaker ==== | ||
<code bash> | <code bash> | ||
echo "blacklist pcspkr" > /etc/modprobe.d/nobeep.conf | echo "blacklist pcspkr" > /etc/modprobe.d/nobeep.conf | ||
</code> | </code> | ||
- | === resolv.conf === | + | ==== resolv.conf ==== |
<code bash>apt-get install resolvconf</code> | <code bash>apt-get install resolvconf</code> | ||
Line 61: | Line 65: | ||
<code bash>sudo resolvconf -u</code> | <code bash>sudo resolvconf -u</code> | ||
- | == Polish & locales == | + | === Polish & locales === |
<code bash> | <code bash> | ||
+ | dpkg-reconfigure keyboard-configuration | ||
apt-get install console-data | apt-get install console-data | ||
dpkg-reconfigure console-data | dpkg-reconfigure console-data | ||
Line 81: | Line 86: | ||
</code> | </code> | ||
- | = X11 = | ||
- | Based on XFCE | ||
- | == misc == | + | Remember to set [[sw:libreoffice#paper_format]] |
- | <code bash>apt-get install browser-plugin-vlc</code> | + | |
+ | ==== set cfq/deadline scheduler ==== | ||
+ | <file | /etc/udev/rules.d/60-schedulers.rules> | ||
+ | ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="cfq" | ||
+ | ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="deadline" | ||
+ | </file> | ||
- | == Power management == | + | <code bash>cat /sys/block/sd*/queue/scheduler</code> |
- | sudo apt-get install acpi-support | + | |
- | Turn off monitors command and lock: | + | === single queue schedulers === |
- | xset dpms force off | + | There are 2 queues, one for read & one for write operations. |
- | xscreensaver-command --lock | + | * **none** is just a First In First Out standard queue of I/O operations. |
+ | * **cfq** (Completely Fair Scheduling) is similar to the Round Robin algorithm and basically allots a fixed execution time for each I/O operation (they are implemented as a circular queue) | ||
+ | * **deadline** is like a priority queue with an aging concept. Basically it adds a deadline for each I/O operation & implements a priority queue | ||
- | === Control minitor brightness === | + | === block multi-queue schedulers === |
- | <code bash> | + | Supported in kernel >=4.12. It is disabled by default. |
- | xrandr --output HDMI2 --brightness 0.5 | + | To use multi-queue schedulers compile kernel with **CONFIG_SCSI_MQ_DEFAULT=y** or pass parameter **scsi_mod.use_blk_mq=1** in boot loader. |
- | xrandr --output VGA1 --brightness 0.5 | + | |
- | </code> | + | |
- | ==== Using Brighntess Controller ==== | + | [[https://www.thomas-krenn.com/en/wiki/Linux_Multi-Queue_Block_IO_Queueing_Mechanism_(blk-mq)|Linux Multi-Queue Block IO Queueing Mechanism]] |
- | <code bash>sudo apt-get install python-wxgtk3.0 python-pyside</code> | + | |
- | Download and install latest version from [[http://lordamit.github.io/Brightness]]. | + | <file | /etc/udev/rules.d/60-schedulers.rules> |
- | Do not use Ubuntu's deb because it contain old version. | + | ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="bfq" |
- | + | ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="mq-deadline" | |
- | + | </file> | |
- | ==== Using Indicator Brightness ==== | + | |
- | apt-get install libappindicator1 libdbusmenu-gtk4 libindicator7 python-appindicator python-gobject | + | |
- | apt-get install notify-osd | + | |
- | + | ||
- | wget http://launchpadlibrarian.net/196377180/notify-osd-icons_0.8%2B15.04.20150202-0ubuntu1_all.deb | + | |
- | dpkg -i dpkg -i notify-osd-icons_0.8+15.04.20150202-0ubuntu1_all.deb | + | |
- | + | ||
- | wget http://ppa.launchpad.net/indicator-brightness/ppa/ubuntu/pool/main/i/indicator-brightness/indicator-brightness_0.4~bzr11~ubuntu15.04.1_all.deb | + | |
- | dpkg -i indicator-brightness_0.4~bzr11~ubuntu15.04.1_all.deb | + | |
- | + | ||
- | + | ||
- | sudo apt-get install software-properties-common python-software-properties | + | |
- | sudo add-apt-repository ppa:indicator-brightness/ppa | + | |
- | sudo apt-get update | + | |
- | sudo apt-get install indicator-brightness | + | |
- | + | ||
- | + | ||
- | + | ||
- | === Open PDFs in okular === | + | |
- | Force system to ask how to open file: | + | |
- | <code bash>mimeopen -d file.pdf</code> | + | |
- | or | + | |
<code bash> | <code bash> | ||
- | xdg-mime query filetype document.pdf | + | sudo udevadm control --reload |
- | xdg-mime query default application/pdf | + | sudo udevadm trigger |
- | xdg-mime default okularApplication_pdf.desktop application/pdf | + | cat /sys/block/sd*/queue/scheduler |
- | # or kde4-okularApplication_pdf.desktop | + | |
- | </code> | + | |
- | see | + | |
- | <code bash> | + | |
- | cat /usr/share/applications/mimeinfo.cache and defaults.list | + | |
- | cat ~/.local/share/applications/mimeapps.list | + | |
</code> | </code> | ||
- | sudo update-mime-database /usr/share/mime | + | ==== Disable console beep ==== |
- | + | ||
- | === Multimonitor === | + | |
- | use xrandr to list available outputs. Example output: | + | |
- | + | ||
- | <code> | + | |
- | Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 8192 x 8192 | + | |
- | VGA1 connected 1366x768+0+0 (normal left inverted right x axis y axis) 410mm x 230mm | + | |
- | 1366x768 59.79*+ | + | |
- | ... | + | |
- | HDMI1 disconnected (normal left inverted right x axis y axis) | + | |
- | HDMI2 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 477mm x 268mm | + | |
- | 1920x1080 60.00*+ | + | |
- | ... | + | |
- | DP1 disconnected (normal left inverted right x axis y axis) | + | |
- | HDMI3 disconnected (normal left inverted right x axis y axis) | + | |
- | </code> | + | |
- | To set layout of monitor: | + | To disable console annoying beep: |
+ | * System wide by removing PC Speaker module: | ||
<code bash> | <code bash> | ||
- | xrandr --output VGA1 --right-of HDMI2 | + | rmmod pcspkr |
+ | sudo echo "blacklist pcspkr" > /etc/modprobe.d/pcspkr-blacklist.conf | ||
</code> | </code> | ||
- | You need to create startup script with above command, and configure XFCE to run it at start (read more below). | ||
- | There is also graphical UI available: | ||
- | <code bash>apt-get install arandr</code> | ||
- | To make settings permanent, use **Layout** --> **Save as** | ||
- | This will create executable script in **~/.screenlayout/your_name.sh** | ||
- | Then add above executable script to autostart of XFCE: | ||
- | **Application Menu** --> **Settings** --> **Session and Startup** | ||
- | === remote VNC access === | + | ===== Usefull software ===== |
- | Start VNC after first user login (from autostart): | + | <code bash>sudo apt-get install wireshark cups</code> |
+ | <code bash>sudo usermod -G lp,lpadmin,dialout,sudo,audio,video,netdev,vboxusers,wireshark,kismet,i2c user_login</code> | ||
- | <code bash> | ||
- | $ sudo apt-get install x11vnc | ||
- | $ mkdir -p ~/.config/autostart | ||
- | $ cd ~/.config/autostart | ||
- | $ cat > X11VNC.desktop | ||
- | </code> | ||
- | And paste following content: | + | ==== parallel packers ==== |
+ | <code bash>sudo apt-get install pigz pbzip2 pxz lbzip2</code> | ||
- | <code ini> | + | To force using parallel packers system-wide: |
- | [Desktop Entry] | + | <code bash> |
- | Encoding=UTF-8 | + | ln -s /usr/bin/lbzip2 /usr/local/bin/bzip2 |
- | Type=Application | + | ln -s /usr/bin/lbzip2 /usr/local/bin/bunzip2 |
- | Name=X11VNC | + | ln -s /usr/bin/lbzip2 /usr/local/bin/bzcat |
- | Comment= | + | ln -s /usr/bin/pigz /usr/local/bin/gzip |
- | Exec=x11vnc -forever -usepw -httpport 5900 | + | ln -s /usr/bin/pigz /usr/local/bin/gunzip |
- | StartupNotify=false | + | ln -s /usr/bin/pigz /usr/local/bin/zcat |
- | Terminal=false | + | ln -s /usr/bin/pixz /usr/local/bin/xz |
- | Hidden=false | + | |
</code> | </code> | ||
+ | or use bash aliases: | ||
+ | <file | .bashrc> | ||
+ | alias gzip='pigz' | ||
+ | alias gunziip='unpigz' | ||
+ | alias bzip2='pbzip2' | ||
+ | alias bunzip2='pbunzip2' | ||
+ | alias xz='pxz' | ||
+ | </file> | ||
- | Finish pasting with CTRL+D | + | some benchmarks (i7-3770K), BTRFS FS +NoCOW attrib |
+ | ^ command ^ user time ^ size ^ comments ^ | ||
+ | |pbzip2 -1 | 4m12 | 694M | | | ||
+ | |pbzip2 -5 | 4m59 | 683M | | | ||
+ | |pbzip2 -9 | 6m25 | 679M | default | | ||
+ | |pigz -0 | 0m32 | 3,5G | no compression | | ||
+ | |pigz -1 | 0m52 | 727M | | | ||
+ | |pigz -2 | 0m48 | 723M | | | ||
+ | |pigz -6 | 1m18 | 698M | default | | ||
+ | |pxz -0 | 3m30 | 660M | | | ||
+ | |pxz -3 | 5m00 | 636M | | | ||
+ | |pxz -6 | 11m19 | 571M | default | | ||
- | Password file (~/.vnc/passwd) you can create using //vncpasswd// command. | ||
- | ==== vnc4server ==== | ||
- | in file ~/.vnc/xstartup | ||
- | |||
- | add before executing x-session: | ||
- | |||
- | <code bash ~/.vnc/xstartup> | ||
- | if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then | ||
- | eval `dbus-launch --sh-syntax –exit-with-session` | ||
- | echo "D-BUS per-session daemon address is: \ | ||
- | $DBUS_SESSION_BUS_ADDRESS" | ||
- | fi | ||
- | </code> | ||
- | |||
- | === Sound === | ||
- | <code> | ||
- | apt-get install pavucontrol pavumeter | ||
- | </code> | ||
- | |||
- | === Trackball/mouse === | ||
- | <code bash>apt-get install xinput</code> | ||
- | For touchscreen, please install also xinput-calibrator | ||
+ | ==== etckeeper ==== | ||
<code bash> | <code bash> | ||
- | xinput list # to see device list and ids | + | apt-get install git |
- | xinput list-props 10 # list props for device id=10 | + | git config --global user.name "my name" |
+ | git config --global user.email myemail@address.pl | ||
+ | apt-get install git-cola etckeeper kdiff3 | ||
</code> | </code> | ||
- | For logitech devices there are additional packets: | ||
- | <code bash> | ||
- | sudo apt-get install lomoco solaar | ||
- | </code> | ||
- | [[https://wiki.archlinux.org/index.php/Logitech_Marble_Mouse]] | ||
+ | ==== mandb ==== | ||
+ | Disable mandb updates after apt: | ||
+ | <code bash>echo "set man-db/auto-update false" | debconf-communicate; dpkg-reconfigure man-db</code> |