Lenh cấu hình và kiểm tra linux ubuntu-14.04.6

A no-nonsense kernel tweak script for Linux and Android systems, backed by evidence. - GitHub - tytydraco/KTweak at latency

github.com



File sysctl.conf đã chỉnh sửa
//www.mediafire.com/file/j32igia3g02x8k6/sysctl.conf/file

Cpufreq:
//www.mediafire.com/file/v65csn6d9gptit2/cpufreq.start/file

$ sudo nano /etc/sysctl.conf

# content of this file will override /etc/sysctl.d/*

vm.swappiness = 100
vm.vfs_cache_pressure = 200
vm.dirty_background_ratio = 5
vm.dirty_ratio = 15
#vm.dirty_background_bytes = 11758094
#vm.dirty_bytes = 23516188
vm.dirty_writeback_centisecs = 400
vm.dirty_expire_centisecs = 200
vm.lowmem_reserve_ratio = 32 32
vm.min_free_kbytes = 3072
vm.user_reserve_kbytes = 6144
vm.admin_reserve_kbytes = 3072
vm.panic_on_oom = 0
vm.overcommit_memory = 1
vm.overcommit_ratio = 50
vm.drop_caches = 3
vm.laptop_mode = 0
vm.mmap_min_addr = 4096
vm.oom_kill_allocating_task = 0
vm.extfrag_threshold = 500
vm.oom_dump_tasks = 1
vm.page-cluster = 1
vm.stat_interval = 1
vm.compact_unevictable_allowed = 0
vm.highmem_is_dirtyable = 0

kernel.panic = 10
kernel.panic_on_oops = 1
kernel.tainted = 0
kernel.ctrl-alt-del = 1
kernel.threads-max = 15507
kernel.random.write_wakeup_threshold = 128
kernel.usermodehelper.bset = 4294967295 4294967295
kernel.usermodehelper.inheritable = 4294967295 4294967295
kernel.printk = 4 4 1 7
kernel.kptr_restrict = 2
kernel.randomize_va_space = 2
kernel.perf_event_paranoid = 3
kernel.keys.root_maxkeys = 200
kernel.keys.root_maxbytes = 20000
kernel.perf_event_paranoid = 1
kernel.perf_cpu_time_max_percent = 3
kernel.shmmax = 268435456
kernel.shmall = 2097152
kernel.msgmni = 2048
kernel.msgmax = 64000
kernel.sem = 500 512000 64 2048
kernel.auto_msgmni = 1
kernel.sched_child_runs_first = 0
kernel.hung_task_timeout_secs = 0

fs.file-max = 99222
fs.epoll.max_user_watches = 138922

net.core.somaxconn = 128
net.core.wmem_max = 131072
net.core.rmem_max = 131072
net.core.wmem_default = 112640
net.core.rmem_default = 112640
net.core.warnings = 1

net.ipv4.tcp_ecn = 1
net.ipv4.tcp_fastopen = 3
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_wmem = 1536 21845 131072
net.ipv4.tcp_rmem = 1536 21845 131072

$ sudo sysctl -p

$ sudo nano /etc/local.d/cpufreq.start

# Set the governor to ondemand for all processors
for cpu in /sys/devices/system/cpu/cpufreq/policy*; do
echo ondemand > ${cpu}/scaling_governor
done

# Reduce the boost ignore_nice_load to 0
echo 0 > /sys/devices/system/cpu/cpufreq/ondemand/ignore_nice_load

# Reduce the boost io_is_busy to 0
echo 0 > /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy

# Reduce the boost powersave_bias to 0 /sys/devices/system/cpu/cpufreq/ondemand/powersave_bias

# Reduce the boost sampling_down_factor to 2
echo 2 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor

# Reduce the boost sampling_rate to 20000
echo 20000 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate

# Reduce the boost threshold to 95%
echo 95 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold

$ sudo chmod +x /etc/local.d/cpufreq.start
$ sudo rc-update add local default
$ sudo lbu commit

***Tooltips:

Install 2D GPU accelerate driver:

$ sudo apk add xf86-video-opentegra libvdpau-tegra

Change opentegra.conf to 00-opentegra.conf in /usr/share/X11/xorg.conf.d
Let's opentegra driver loaded before fbdev driver

//wiki.alpinelinux.org/wiki/Desktop-notes

Xfce - Alpine Linux

wiki.alpinelinux.org


Setting up Alsa audio

  1. apk add alsa-utils
  2. rc-update add alsa
  3. rc-service alsa start
  4. Set the default sound device
    1. List sound devices: cat /proc/asound/card*/id
    2. Depending on your setup select the proper device
      1. create a /etc/asound.conf with following content where PCH is sound card name.
pcm.!default {
type plug
slave.pcm {
@func getenv
vars [ ALSAPCM ]
default "hw:ALC5642"
}
}

Vào terminal:

$ alsamixer -c 0

Enable các thông số thiết lập [phím M hoặc phím mũi tên lên/xuống]: "Speaker R" "Speaker L"
"DAC MIXR INF1" "DAC MIXL INF1" "SPOL MIX DAC R1" "SPOL MIX DAC L1" "Stereo DAC
MIXR DAC R1" "Stereo DAC MIXL DAC L1"

Cài timezone
$ sudo apk add tzdata
$ ls /usr/share/zoneinfo
Suppose you want to use Asia/Ho_Chi_Minh. First copy the proper zone to local

$ sudo cp /usr/share/zoneinfo/Asia/Ho_Chi_Minh /etc/local

$ sudo echo "Asia/Ho_Chi_Minh" > /etc/timezone

User-agent:
$ gsettings set org.gnome.Epiphany.web:/org.gnome.epiphany/web/ user-agent 'Mozilla/5.0 [Android 11; Mobile; rv:91.0] Gecko/91.0 Firefox/91.0'

Ẩn con trỏ chuột trong xfce4
$ sudo nano /etc/lightdm/lightdm.conf

Bỏ dấu '#' trong [:Seat]

xserver-command=X -nocursor

Cài ibus và bộ gõ Vietnamese

$ sudo apk add ibus

Chọn thêm input language là Vietnamese. Đồng thời tạo settings → session and startup

Name: IBus
Description: input keyboard methods
Command: /usr/bin/ibus-daemon -d
start: on logon

Fix error: [1] not authorized to control networking

//wiki.gentoo.org/wiki/NetworkManager#Fixing_nm-applet_insufficient_privileges

NetworkManager - Gentoo Wiki

wiki.gentoo.org



Fixing nm-applet insufficient privileges

If nm-applet fails to create new networks with the error "Insufficient Privileges," then it could be a policy kit issue. Create the following file:


FILE: /etc/polkit-1/rules.d/50-org.freedesktop.NetworkManager.rules

polkit.addRule[function[action, subject] {
if [action.id.indexOf["org.freedesktop.NetworkManager."] == 0 && subject.isInGroup["plugdev"]] { return polkit.Result.YES;
}
}];

This lets all users in the plugdev group control network manager.

Control CPU frequency match with thermal, using shell scripts

//github.com/Sepero/temp-throttle/tree/4e6fa06ea036129c4a815fc5d4494556578624e

Low_temp=max_temp - 5

$ sh temp_throttle.sh 59

//www.mediafire.com/file/7vh0qxu1r28aeia/

Create startup temperature for cpu throttle at login

$ visudo

ALL ALL=[root] NOPASSWD: /path/to/temp_throttle.sh

$ sudo chown root /path/to/temp_throttle.sh

$ sudo chmod 755 /path/to/themp_throttle.sh

Settings → Sessions and applications startup

Command: sudo /path/to/temp_throttle.sh 58

Activate sensor auto rotate screen:

//gitlab.com/gullradriel/asus-grouper-nexus-7-sensor-daemon

gullradriel / Asus Grouper Nexus 7 sensor daemon · GitLab

Asus Grouper Nexus 7 sensor daemon is a tool which use iio-sensor-proxy, perl, xinput and xrandr to provide mobile like functionalities to the device while under alpine linux...

gitlab.com



$ sudo apk iio-sensor-proxy perl xinput xrandr xset

$ sudo rc-service -v iio-sensor-proxy start

$ sudo rc-update add iio-sensor-proxy default

$ sudo monitor-sensor

Check all program allow running permission and run

$ sudo /usr/init.d/asus_grouper_sensors start

$ sudo rc-update add asus_grouper_sensors default

***Connecting keyboard and mouse bluetooth, NFC checking:

$ sudo apk bluez bluez-utils bluez-mgmt bluez-btmon bluez-hid2hci bluez-alsa neard

$ sudo rc-service -v bluetooth start

$ sudo bluetoothctl power on

$ sudo bluetoothctl

#: scan on

#: help

NFC:

$ sudo rc-service -v neard start

$ sudo nfctool -d nfc0 -1 -p

***Config firefox 90, install Ublock origin and h264ify addons

$ sudo apk add zram-init

//gitlab.com/postmarketOS/mobile-config-firefox/blob/master/src/mobile-config-prefs.js

src/mobile-config-prefs.js · master · postmarketOS / mobile-config-firefox · GitLab

Mobile and privacy friendly configuration for Firefox [distro-independent]

gitlab.com



Cài dual boot Android và Ubuntu dùng MultiROM
//tinhte.vn/thread/multirom-cai-ubuntu-14-04-6-lts-len-nexus-7-2012-grouper-dualboot-android.3134764/

MultiROM - Cài Ubuntu 14.04.6 LTS lên Nexus 7 2012 wifi/3G[grouper/tilapia] dualboot Android

Chạy Linux thuần thì xem bài này //tinhte.vn/thread/cai-postmarketos-len-nexus-7-2012-wifi-3g-dung-luong-8gb-16gb-32gb.3179205/ Bài bị xoá không rõ nguyên nhân //tinhte.vn/threads/cai-postmarketos-len-nexus-7-2012-16gb.

Chủ Đề