remember to detach the old disk and enlarge the system partition on new disk
in kde partiton manager, you can resize both the encrypted partition and the root partition as well as the swap partition (install tools prompted by name)
copy all current user environment variables to crontab.
to run notify-send you have to set DBUS_SESSION_BUS_ADDRESS
to run other gui programs you set DISPLAY and XAUTHORITY
wall works for tmux and ssh sessions but not gnome-terminal.
in kde everything works fine. install konsole instead.
script for monitoring disk usage:
1 2 3 4 5 6 7 8 9 10 11
#!/bin/bash used_percentage=$(df / | awk 'NR==2 {sub(/%/, "", $5); print $5}') alarm_message="Root filesystem has less than 10% free space." # Compare the percentage with the number 90 if [ "$used_percentage" -lt 90 ]; then echo"Disk is ok." else wall $alarm_message notify-send $alarm_message fi
#!/bin/bash # this freaking works. # Script to reset all local xHCI (USB) controllers # Based on: http://billauer.co.il/blog/2013/02/usb-reset-ehci-uhci-linux/ if [[ ${EUID} != 0 ]]; then echo This must be run as root! exit 1 fi for xhci in /sys/bus/pci/drivers/ahci; do if ! cd${xhci}; then echo"Weird error. Failed to change directory to ${xhci}." exit 1 fi echo"Resetting devices from ${xhci}..." for i in ????:??:??.?; do echo -n "${i}" > unbind echo -n "${i}" > bind done done
#!/bin/bash # this freaking works. # Script to reset all local xHCI (USB) controllers # Based on: http://billauer.co.il/blog/2013/02/usb-reset-ehci-uhci-linux/ if [[ ${EUID} != 0 ]]; then echo This must be run as root! exit 1 fi for xhci in /sys/bus/pci/drivers/?hci_hcd; do if ! cd${xhci}; then echo"Weird error. Failed to change directory to ${xhci}." exit 1 fi echo"Resetting devices from ${xhci}..." for i in ????:??:??.?; do echo -n "${i}" > unbind echo -n "${i}" > bind done done
everytime the fucking machine restarts, it fails devastatingly.
the word: Giving the fans some time to reach full speed...
the script:
1 2 3 4 5 6 7
#!/usr/bin/expect spawn pwmconfig #expect "Giving the fans some time to reach full speed..." expect "If you do not want to do this hit control-C now!!!" send "\03" expect eof
hope this shit works?
1 2 3
echo 255 | sudo tee /sys/class/hwmon/hwmon6/pwm3 echo 255 | sudo tee /sys/class/hwmon/hwmon6/pwm1
i have install something other than that. like i8kctl, some thermal controllers by intel (thermald)? but still gpu fan not spinning till now.
[Unit] Description=rclone webdav served on pyjom, after the disk is mounted [Service] User=root ExecStart=/usr/bin/python3 mount_help_and_serve_pyjom.py WorkingDirectory=/root/Desktop/works/restore_sessions [Install] WantedBy=multi-user.target
tempthrottle.service
1 2 3 4 5 6 7 8 9
[Unit] Description=temperature control, cpu temperature under 60 celsius [Service] User=root ExecStart=/usr/bin/python3 tempthrottle_daemon.py WorkingDirectory=/root/Desktop/works/restore_sessions [Install] WantedBy=multi-user.target
[Unit] Description=syncdog (server), to sync things to the cloud (github) Wants=sshd.service Wants=network.target [Service] User=root ExecStart=/usr/bin/python3 syncdog_test.py WorkingDirectory=/root/Desktop/works/sync_git_repos [Install] WantedBy=multi-user.target