2018-05-26 21:36:16 +00:00
|
|
|
#-----------------------------------------------------------------------------#
|
|
|
|
# Yggdrasil NG #
|
|
|
|
# compatibility : see documentation or man pages #
|
|
|
|
# author : Francois B. (Makotosan/Shakasan) #
|
|
|
|
# licence : GPLv3 #
|
|
|
|
# website : https://makotonoblog.be/ #
|
|
|
|
#-----------------------------------------------------------------------------#
|
|
|
|
|
2018-03-21 07:26:38 +00:00
|
|
|
#-----------------------------------------------------------------------------#
|
|
|
|
# tools and config functions #
|
|
|
|
#-----------------------------------------------------------------------------#
|
|
|
|
|
|
|
|
#
|
|
|
|
# /tmp in RAM by modifying /etc/fstab
|
2018-03-24 16:08:59 +00:00
|
|
|
#TODO: add possibily to choose amount of ram
|
2018-03-21 07:26:38 +00:00
|
|
|
function enableTmpRAM () {
|
|
|
|
runCmd "echo 'tmpfs /tmp tmpfs defaults,size=2g 0 0' | sudo tee -a /etc/fstab" \
|
2018-03-30 17:02:06 +00:00
|
|
|
"enabling /tmp in RAM by modifying /etc/fstab"
|
2018-03-21 07:26:38 +00:00
|
|
|
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
|
2018-06-04 11:44:23 +00:00
|
|
|
printf "[CMD] enabling CLI History TimeStamp "
|
2018-03-21 07:26:38 +00:00
|
|
|
echo "export HISTTIMEFORMAT='%F %T '" | tee -a /home/$myHomedir/.bashrc &>> $logFile
|
|
|
|
ret_code=$?
|
|
|
|
retCode $ret_code
|
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# display useful system/hardware informations
|
|
|
|
#
|
|
|
|
function toolInxi () {
|
2018-03-21 07:31:17 +00:00
|
|
|
checkAndInstallDep apt inxi inxi \
|
|
|
|
&& inxi -F
|
2018-03-21 07:26:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# check bandwith and latency of the internet connection
|
|
|
|
#
|
|
|
|
function toolSpeedtestCli () {
|
2018-03-21 07:31:17 +00:00
|
|
|
checkAndInstallDep pip speedtest-cli speedtest-cli \
|
|
|
|
&& speedtest-cli
|
2018-03-21 07:26:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# check for packet loss
|
|
|
|
#
|
|
|
|
function toolPacketLoss () {
|
|
|
|
ping -q -c 10 google.com
|
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# remove useless packages (depedencies)
|
|
|
|
#
|
|
|
|
function toolAutoremove () {
|
|
|
|
runCmd "sudo apt-get -y autoremove" \
|
2020-05-24 18:16:08 +00:00
|
|
|
"removing useless APT dependencies"
|
|
|
|
runCmd "sudo flatpak uninstall --unused -y" \
|
|
|
|
"removing useless FLATPAK dependencies"
|
2018-03-21 07:26:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# force soundcards detection
|
|
|
|
#
|
|
|
|
function toolSoundCardsDetection () {
|
|
|
|
runCmd "sudo alsa force-reload" \
|
2018-03-30 17:02:06 +00:00
|
|
|
"detecting ALSA sound cards"
|
2018-03-21 07:26:38 +00:00
|
|
|
}
|