-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtools_functions.sh
executable file
·74 lines (66 loc) · 2.17 KB
/
tools_functions.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#-----------------------------------------------------------------------------#
# Yggdrasil NG #
# compatibility : see documentation or man pages #
# author : Francois B. (Makotosan/Shakasan) #
# licence : GPLv3 #
# website : https://makotonoblog.be/ #
#-----------------------------------------------------------------------------#
#-----------------------------------------------------------------------------#
# tools and config functions #
#-----------------------------------------------------------------------------#
#
# /tmp in RAM by modifying /etc/fstab
#TODO: add possibily to choose amount of ram
function enableTmpRAM () {
runCmd "echo 'tmpfs /tmp tmpfs defaults,size=2g 0 0' | sudo tee -a /etc/fstab" \
"enabling /tmp in RAM by modifying /etc/fstab"
if (whiptail --title "/tmp in RAM - Reboot" --yesno "Reboot required, proceed now ?" 10 60) then
sudo reboot
fi
}
#
# cli history cmd timestamp enable
#
function enableHistoryTS () {
typeset ret_code
printf "[CMD] enabling CLI History TimeStamp "
echo "export HISTTIMEFORMAT='%F %T '" | tee -a /home/$myHomedir/.bashrc &>> $logFile
ret_code=$?
retCode $ret_code
}
#
# display useful system/hardware informations
#
function toolInxi () {
checkAndInstallDep apt inxi inxi \
&& inxi -F
}
#
# check bandwith and latency of the internet connection
#
function toolSpeedtestCli () {
checkAndInstallDep pip speedtest-cli speedtest-cli \
&& speedtest-cli
}
#
# check for packet loss
#
function toolPacketLoss () {
ping -q -c 10 google.com
}
#
# remove useless packages (depedencies)
#
function toolAutoremove () {
runCmd "sudo apt-get -y autoremove" \
"removing useless APT dependencies"
runCmd "sudo flatpak uninstall --unused -y" \
"removing useless FLATPAK dependencies"
}
#
# force soundcards detection
#
function toolSoundCardsDetection () {
runCmd "sudo alsa force-reload" \
"detecting ALSA sound cards"
}