meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linux:prepare:prepare [2018/01/26 12:47] – [parallel packers] niziaklinux:prepare:prepare [2025/01/06 10:53] (current) niziak
Line 1: Line 1:
-====== Linux/Prepare ======+====== LinuxPrepare ======
  
 ===== Basic ===== ===== Basic =====
  
-==== add i386 architecture ====+==== .bashrc ====
  
 +Adapt old ''.bashrc'' to latest distro ''/etc/skel/.bashrc'' 
 +
 +==== default EDITOR ====
 <code bash> <code bash>
-dpkg --add-architecture i386 +sudo update-alternatives --list editor 
-apt-get update +sudo update-alternatives --config editor
-apt-get install gpm tcpdump bmon tinc ppp pptpd mc links2 gparted hdparm smartmontools smart-notifier valgrind openssh-server +
-apt-get install wireshark mtr+
 </code> </code>
 +
 +==== set umask ====
 +
 +In file: ''~/.profile''
 +  * ''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
 +
 +**NOTE!:** Problem appears with non default user umask and ''sudo'' command usage.
 +After sudo umask is still set to the user umask, which is correct. 
 +But can lead to some unpredicted behavior i.e. installing system-wide packages - new file will be created with incorrect umasks (user umask).
 +
 +To prevent this:
 +<file | /etc/sudoers>
 +Defaults        umask_override
 +Defaults        umask=0022
 +</file>
 +
  
 ==== NTP: allow time corrections bigger than 1h ==== ==== NTP: allow time corrections bigger than 1h ====
-  - Edit /etc/default/ntp and add "-s" argument. +  - Disable systemd time service: ''systemctl disable --now systemd-timesyncd'' 
-  - Ordered List ItemInstall ntpdate and ntp +  - Install ''ntpdate'' and ''ntp'' 
-  - Ordered List ItemSwitch RTC to UTC time:+  - Edit ''/etc/default/ntp'' and add ''-g'' argument.  
 +  - Switch RTC to UTC time:
 <code bash> <code bash>
 timedatectl set-local-rtc 0 timedatectl set-local-rtc 0
-ntpd -qg+ntpd -gxn
 hwclock --systohc hwclock --systohc
 </code> </code>
Line 61: Line 82:
  
  
- +Remember to set [[sw:libreoffice#paper_format]]
- +
-==== set cfq/deadline scheduler ==== +
- +
-<file | /etc/udev/rules.d/60-schedulers.rules> +
-set cfq scheduler for rotating disks +
-ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="cfq" +
- +
-# set deadline scheduler for non-rotating disks +
-ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="deadline"   +
-</file>+
  
 ==== Disable console beep ==== ==== Disable console beep ====
Line 137: Line 148:
 </code> </code>
  
-==== Logitech wireless mouse/trackball ==== 
-To handle old (not Unifying Receiver) Logitech product: 
-<code bash>sudo apt-get install lomoco</code> 
-<code bash>sudo lomoco -i</code> 
-<code> 
-003.005: 046d:c508 Receiver for Cordless Optical TrackMan (C-BA4-MSE) Caps: CSR SMS  
- Receiver type: C508 
- Mouse type: Cordless Optical TrackMan 
- Connect button on mouse pressed: no 
- Active RF Channel: 1 
- Battery status: 7 (full) 
- Cordless security ID: 0x8e16 
- Receiver talking: yes 
- Lock Request (CONNECT button pressed): no 
- Mouse Powerup (First time out of the box auto-locking): no 
- Receiver Unlocked (Mouse disconnected): no 
- Wait Lock (Searching for mouse): no 
- Device physical shape type: 0 
- SmartScroll (SMS): reporting not supported 
- USB Mouse Polling Interval:  10ms 
-</code> 
  
-<code bash>sudo lomoco --pid=C508 -i | grep -w "Battery status:"</code>+==== mandb ====
  
-For logitech devices there are additional packets+Disable mandb updates after apt
-[[https://wiki.archlinux.org/index.php/Logitech_Marble_Mouse]]+<code bash>echo "set man-db/auto-update false" | debconf-communicate; dpkg-reconfigure man-db</code>
  
-=== Change trackball pointer speed === +==== smartmontools ====
-Using CTM: +
-<code bash> +
-xinput set-prop "Logitech USB Receiver" "libinput Accel Speed" 1 +
-xinput set-prop "Logitech USB Receiver" "Coordinate Transformation Matrix"+
-2.000000, 0.000000, 0.000000, \ +
-0.000000, 2.000000, 0.000000, \ +
-0.000000, 0.000000, 1.000000 +
-</code>+
  
 +<code bash>apt install smartmontools</code>
 +<file sh /etc/smartd.conf>
 +DEVICESCAN -n standby,336,q -S on -H -l error \
 + -l xerror \
 + -l selftest \
 + -l offlinests \
 + -l scterc,0,0 \
 + -e lookahead,on \
 + -s (L/../../6/01|S/../.././02) \
 + -f -p -C 197+ -U 198+ -W 10,45,50....
 +</file>
 +
 +NOTE: It ignores disk in standby to do not spin up HDDs, but it ignores 336 checks (x 1800s interval = 7 days), then it will spin up disc. To put disc sleep again it is good to use ''hd-idle'' daemon.
 +
 +==== hd-idle ====
 +
 +<code bash>apt install hd-idle</code>
 +
 +<file sh /etc/default/hd-idle>
 +HD_IDLE_OPTS="-a /dev/disk/by-id/ata-ST2000DM008-2UB102 -i 600 -l /var/log/hd-idle.log"
 +</file>
 +systemctl restart hd-idle