Index of /public/downloads/linuxconfig/Debian8-jessie

[ICO]NameLast modifiedSizeDescription

[PARENTDIR]Parent Directory  -  
[DIR]usr/2017-01-25 07:10 -  
[DIR]etc/2017-01-25 07:10 -  
[TXT]README.html2017-01-25 07:10 40K 

Debian 8 Wheezy configuration examples

1. Hardware independent Debian 8 configuration

1.1. Terminal uxterm

xterm -class UXTerm -title uxterm -u8

1.2. Trim SSD disk batched_discard

Installation
  1. Don’t forget ot add discard in /etc/crypttab. It should look like this:

    sda5_crypt UUID=97ec9.... none luks,discard
  2. Update init-ramdisk

    # update-initramfs -uk all
  3. Copy this file in /etc/cron.daily/ or /etc/cron.weekly/

/etc/cron.weekly/batched_discard
LOG=/var/log/batched_discard.log
echo "*** $(date -R) ***" >> $LOG

# To find which FS support trim, we check that DISC-MAX (discard max bytes)
# is great than zero. Check discard_max_bytes documentation at
# https://www.kernel.org/doc/Documentation/block/queue-sysfs.txt
# http://ward.vandewege.net/blog/2014/12/debian-jessie-trim-on-lvm-on-luks-on-ssd/

for fs in $(lsblk -o MOUNTPOINT,DISC-MAX,FSTYPE | grep -E '^/.* [1-9]+.* ' | awk '{print $1}'); do
        fstrim -v "$fs" >> $LOG
done

1.5. Midnight Commander mc

Table 1. Additional Midnight Commander functions:

F2 T

Move one selected ítem into the recycle bin.

F2 Shift+T

Move all selected item into the recycle bin.

F2 L

Create shortest relative symbolic link from one selected item into the other pane.

F2 Shift+L

Create shortest relative symbolic links from all selected items into the other pane.

1.7. Set $PATH for interactive, non-interactive and login-shells

The best place to set $PATH is /etc/environment. In this example I added /opt/wine/bin at the beginning.

/etc/environment
PATH="/opt/wine/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

It is sourced by the PAM service and forwarded then to all shells. Unfortunately /etc/profile overrides the $PATH later for login shells so we have to source it again.

/etc/profile.d/environment.sh
#!/bin/dash
set -a
. /etc/environment

This solution was tested with bash and dash interactive, non-interactive and login-shells.

2. Hardware specific Debian 8 configuration

2.1. Levono T420s

2.1.1. Temperature monitoring and fan control

The hwmon thermal device path number changed randomly after boot between hwmon1 and hwmon2:

/sys/devices/platform/coretemp.0/hwmon/hwmon1/temp1_input

or

/sys/devices/platform/coretemp.0/hwmon/hwmon2/temp1_input

I discovered a race condition when the coretemp kernel modules is loaded. Installing coretemp after thinkpad_acpi fixed the problem:

Excerpt from my /etc/modprobe.d/thinkpad_acpi.conf
install coretemp /sbin/modprobe -q --ignore-install thinkpad_acpi; /sbin/modprobe -q --ignore-install coretemp; /bin/true;

Now hwmon is a persistent path:

/sys/devices/platform/coretemp.0/hwmon/hwmon2/temp1_input