diff --git a/Miscellaneous/boot-script.sh b/Miscellaneous/.boot-script.sh similarity index 89% rename from Miscellaneous/boot-script.sh rename to Miscellaneous/.boot-script.sh index 050b48a..c58c310 100644 --- a/Miscellaneous/boot-script.sh +++ b/Miscellaneous/.boot-script.sh @@ -1,9 +1,4 @@ #!/bin/sh - -function boot_script { - touch /etc/rc.local && chmod +x /etc/rc.local - cat <<'EOF' > /etc/rc.local -#!/bin/sh ## Network #NIC Config interface=$(/sbin/ip -o -4 route show to default | awk '{print $5}') @@ -52,6 +47,4 @@ else done fi clear -exit 0 -EOF -} +exit 0 \ No newline at end of file diff --git a/Torrent Clients/qBittorrent/qBittorrent/qBittorrent 4.5.0 - libtorrent-v1.2.18/qbittorrent-nox b/Torrent Clients/qBittorrent/qBittorrent/Other/qBittorrent 4.5.0 - libtorrent-v1.2.18/qbittorrent-nox similarity index 100% rename from Torrent Clients/qBittorrent/qBittorrent/qBittorrent 4.5.0 - libtorrent-v1.2.18/qbittorrent-nox rename to Torrent Clients/qBittorrent/qBittorrent/Other/qBittorrent 4.5.0 - libtorrent-v1.2.18/qbittorrent-nox diff --git a/Torrent Clients/qBittorrent/qBittorrent/qBittorrent 4.5.0 - libtorrent-v2.0.8/qbittorrent-nox b/Torrent Clients/qBittorrent/qBittorrent/Other/qBittorrent 4.5.0 - libtorrent-v2.0.8/qbittorrent-nox similarity index 100% rename from Torrent Clients/qBittorrent/qBittorrent/qBittorrent 4.5.0 - libtorrent-v2.0.8/qbittorrent-nox rename to Torrent Clients/qBittorrent/qBittorrent/Other/qBittorrent 4.5.0 - libtorrent-v2.0.8/qbittorrent-nox diff --git a/Torrent Clients/qBittorrent/qBittorrent/qBittorrent 4.1.9 - libtorrent-1_1_14/qbittorrent-nox b/Torrent Clients/qBittorrent/qBittorrent/qBittorrent 4.1.9 - libtorrent-1_1_14/qbittorrent-nox new file mode 100644 index 0000000..ae2466a Binary files /dev/null and b/Torrent Clients/qBittorrent/qBittorrent/qBittorrent 4.1.9 - libtorrent-1_1_14/qbittorrent-nox differ diff --git a/Torrent Clients/qBittorrent/qBittorrent/qBittorrent 4.3.9 - libtorrent-v1.2.18/qbittorrent-nox b/Torrent Clients/qBittorrent/qBittorrent/qBittorrent 4.3.9 - libtorrent-v1.2.18/qbittorrent-nox index cf8cc64..98424fa 100644 Binary files a/Torrent Clients/qBittorrent/qBittorrent/qBittorrent 4.3.9 - libtorrent-v1.2.18/qbittorrent-nox and b/Torrent Clients/qBittorrent/qBittorrent/qBittorrent 4.3.9 - libtorrent-v1.2.18/qbittorrent-nox differ diff --git a/Torrent Clients/qBittorrent/qBittorrent/qBittorrent 4.4.5 - libtorrent-v1.2.18/qbittorrent-nox b/Torrent Clients/qBittorrent/qBittorrent/qBittorrent 4.4.5 - libtorrent-v1.2.18/qbittorrent-nox index 4537712..eb8810d 100644 Binary files a/Torrent Clients/qBittorrent/qBittorrent/qBittorrent 4.4.5 - libtorrent-v1.2.18/qbittorrent-nox and b/Torrent Clients/qBittorrent/qBittorrent/qBittorrent 4.4.5 - libtorrent-v1.2.18/qbittorrent-nox differ diff --git a/Torrent Clients/qBittorrent/qBittorrent/qBittorrent 4.4.5 - libtorrent-v2.0.8/qbittorrent-nox b/Torrent Clients/qBittorrent/qBittorrent/qBittorrent 4.4.5 - libtorrent-v2.0.8/qbittorrent-nox index f0a57c3..57ce4e8 100644 Binary files a/Torrent Clients/qBittorrent/qBittorrent/qBittorrent 4.4.5 - libtorrent-v2.0.8/qbittorrent-nox and b/Torrent Clients/qBittorrent/qBittorrent/qBittorrent 4.4.5 - libtorrent-v2.0.8/qbittorrent-nox differ diff --git a/Torrent Clients/qBittorrent/qBittorrent/qBittorrent 4.5.1 - libtorrent-v1.2.18/qbittorrent-nox b/Torrent Clients/qBittorrent/qBittorrent/qBittorrent 4.5.1 - libtorrent-v1.2.18/qbittorrent-nox new file mode 100644 index 0000000..ebe8642 Binary files /dev/null and b/Torrent Clients/qBittorrent/qBittorrent/qBittorrent 4.5.1 - libtorrent-v1.2.18/qbittorrent-nox differ diff --git a/Torrent Clients/qBittorrent/qBittorrent/qBittorrent 4.5.1 - libtorrent-v2.0.8/qbittorrent-nox b/Torrent Clients/qBittorrent/qBittorrent/qBittorrent 4.5.1 - libtorrent-v2.0.8/qbittorrent-nox new file mode 100644 index 0000000..c8c5666 Binary files /dev/null and b/Torrent Clients/qBittorrent/qBittorrent/qBittorrent 4.5.1 - libtorrent-v2.0.8/qbittorrent-nox differ diff --git a/Torrent Clients/qBittorrent/qBittorrent_install.sh b/Torrent Clients/qBittorrent/qBittorrent_install.sh index f6fa242..5d5eeb8 100644 --- a/Torrent Clients/qBittorrent/qBittorrent_install.sh +++ b/Torrent Clients/qBittorrent/qBittorrent_install.sh @@ -1,9 +1,13 @@ function qBittorrent_download { + ## Allow users to determine which version of qBittorrent to be installed need_input; echo "Please enter your choice (qBittorrent Version - libtorrent Version):"; normal_3 - options=("qBittorrent 4.1.9.1 - libtorrent-1_1_14" "qBittorrent 4.3.9 - libtorrent-v1.2.18" "qBittorrent 4.4.5 - libtorrent-v1.2.18" "qBittorrent 4.4.5 - libtorrent-v2.0.8" "qBittorrent 4.5.0 - libtorrent-v1.2.18" "qBittorrent 4.5.0 - libtorrent-v2.0.8") + options=("qBittorrent 4.1.9 - libtorrent-1_1_14" "qBittorrent 4.1.9.1 - libtorrent-1_1_14" "qBittorrent 4.3.9 - libtorrent-v1.2.18" "qBittorrent 4.4.5 - libtorrent-v1.2.18" "qBittorrent 4.4.5 - libtorrent-v2.0.8" "qBittorrent 4.5.1 - libtorrent-v1.2.18" "qBittorrent 4.5.1 - libtorrent-v2.0.8") select opt in "${options[@]}" do case $opt in + "qBittorrent 4.1.9. - libtorrent-1_1_14") + qBver=4.1.9 && libver=libtorrent-1_1_14; break + ;; "qBittorrent 4.1.9.1 - libtorrent-1_1_14") qBver=4.1.9.1 && libver=libtorrent-1_1_14; break ;; @@ -16,11 +20,11 @@ function qBittorrent_download { "qBittorrent 4.4.5 - libtorrent-v2.0.8") qBver=4.4.5 && libver=libtorrent-v2.0.8; break ;; - "qBittorrent 4.5.0 - libtorrent-v1.2.18") - qBver=4.5.0 && libver=libtorrent-v1.2.18; break + "qBittorrent 4.5.1 - libtorrent-v1.2.18") + qBver=4.5.1 && libver=libtorrent-v1.2.18; break ;; - "qBittorrent 4.5.0 - libtorrent-v2.0.8") - qBver=4.5.0 && libver=libtorrent-v2.0.8; break + "qBittorrent 4.5.1 - libtorrent-v2.0.8") + qBver=4.5.1 && libver=libtorrent-v2.0.8; break ;; *) warn_1; echo "Please choose a valid version"; normal_3;; esac @@ -62,10 +66,31 @@ EOF } function qBittorrent_config { + ## Determine if it is a SSD or a HDD and tune certain parameters + disktype=$(cat /sys/block/sda/queue/rotational) + if [ "${disktype}" == 0 ]; then + aio=12 + low_buffer=5120 + buffer=20480 + buffer_factor=250 + else + aio=4 + low_buffer=3072 + buffer=10240 + buffer_factor=150 + fi + ## systemctl stop qbittorrent-nox@$username + ## if [[ "${qBver}" =~ "4.1." ]]; then md5password=$(echo -n $password | md5sum | awk '{print $1}') cat << EOF >/home/$username/.config/qBittorrent/qBittorrent.conf +[BitTorrent] +Session\AsyncIOThreadsCount=$aio +Session\SendBufferLowWatermark=$low_buffer +Session\SendBufferWatermark=$buffer +Session\SendBufferWatermarkFactor=$buffer_factor + [LegalNotice] Accepted=true @@ -85,6 +110,12 @@ EOF wget https://raw.githubusercontent.com/jerry048/Seedbox-Components/main/Torrent%20Clients/qBittorrent/qb_password_gen && chmod +x $HOME/qb_password_gen PBKDF2password=$($HOME/qb_password_gen $password) cat << EOF >/home/$username/.config/qBittorrent/qBittorrent.conf +[BitTorrent] +Session\AsyncIOThreadsCount=$aio +Session\SendBufferLowWatermark=$low_buffer +Session\SendBufferWatermark=$buffer +Session\SendBufferWatermarkFactor=$buffer_factor + [LegalNotice] Accepted=true @@ -108,10 +139,14 @@ EOF MemoryWorkingSetLimit=$Cache_qB [BitTorrent] +Session\AsyncIOThreadsCount=$aio Session\DefaultSavePath=/home/$username/qbittorrent/Downloads/ Session\DiskCacheSize=$Cache_qB Session\Port=45000 Session\QueueingSystemEnabled=false +Session\SendBufferLowWatermark=$low_buffer +Session\SendBufferWatermark=$buffer +Session\SendBufferWatermarkFactor=$buffer_factor [LegalNotice] Accepted=true diff --git a/seedbox_installation.sh b/seedbox_installation.sh index efcb76c..32bca6c 100644 --- a/seedbox_installation.sh +++ b/seedbox_installation.sh @@ -5,7 +5,7 @@ function Update { normal_1; echo "Updating installed packages and install prerequisite" normal_2 apt-get -qqy update && apt-get -qqy upgrade - apt-get -qqy install sudo sysstat htop curl psmisc python3-pyqt5 + apt-get -qqy install sudo sysstat htop curl psmisc cd $HOME tput sgr0; clear } diff --git a/tweaking.sh b/tweaking.sh index 7743de1..1379d24 100644 --- a/tweaking.sh +++ b/tweaking.sh @@ -107,39 +107,34 @@ function kernel_Tweaking { # Grabing the informations of the server to be used in determining certain Tweaking parameters memsize=$(grep MemTotal /proc/meminfo | awk '{print $2}') if (($memsize > 16000000)); then - rmem_default=16777216 - rmem_max=67108864 - wmem_default=16777216 - wmem_max=67108864 tcp_mem='262144 1572864 2097152' - tcp_rmem='4194304 16777216 67108864' - tcp_wmem='4194304 16777216 67108864' elif (($memsize > 8000000)); then + tcp_mem='262144 524288 1048576' + elif (($memsize > 4000000)); then + tcp_mem='32768 65536 65536' + else + tcp_mem='32768 32768 32768' + + fi + + interface=$(/sbin/ip -o -4 route show to default | awk '{print $5}') + nic_speed=$(ethtool $interface | grep Speed | awk '{print $2}' | tr -d -c 0-9) + if (($nic_speed = 10000)); then + rmem_default=33554432 + rmem_max=67108864 + wmem_default=67108864 + wmem_max=134217728 + tcp_rmem='4194304 33554432 67108864' + tcp_wmem='4194304 67108864 134217728' + else rmem_default=16777216 rmem_max=33554432 wmem_default=16777216 wmem_max=33554432 - tcp_mem='262144 524288 1048576' tcp_rmem='4194304 16777216 33554432' - tcp_wme='4194304 16777216 33554432' - elif (($memsize > 4000000)); then - rmem_default=8388608 - rmem_max=16777216 - wmem_default=8388608 - wmem_max=16777216 - tcp_mem='32768 65536 65536' - tcp_rmem='4194304 8388608 16777216' - tcp_wmem='4194304 8388608 16777216' - else - rmem_default=8388608 - rmem_max=8388608 - wmem_default=8388608 - wmem_max=8388608 - tcp_mem='32768 32768 32768' - tcp_rmem='4194304 8388608 8388608' - tcp_wmem='4194304 8388608 8388608' - fi + tcp_wmem='4194304 16777216 33554432' + fi cat << EOF >/etc/sysctl.conf ###/proc/sys/kernel/ Variables: @@ -386,8 +381,8 @@ net.ipv4.tcp_mem = $tcp_mem # case this value is ignored. net.ipv4.tcp_rmem = $tcp_rmem -# Disable receive buffer auto-tuning -net.ipv4.tcp_moderate_rcvbuf = 0 +# Enable receive buffer auto-tuning +net.ipv4.tcp_moderate_rcvbuf = 1 # Distribution of socket receive buffer space between TCP window size(this is the size of the receive window advertised to the other end), and application buffer/ #The overhead (application buffer) is counted as bytes/2^tcp_adv_win_scale i.e. Setting this 2 would mean we use 1/4 of socket buffer space as overhead @@ -482,8 +477,8 @@ net.ipv4.tcp_window_scaling = 1 net.ipv4.tcp_workaround_signed_windows = 1 -# The maximum amount of unsent bytes in TCP socket write queue -net.ipv4.tcp_notsent_lowat = 983040 +# The maximum amount of unsent bytes in TCP socket write queue, this is on top of the congestion window +net.ipv4.tcp_notsent_lowat = 131072 # Controls the amount of data in the Qdisc queue or device queue net.ipv4.tcp_limit_output_bytes = 3276800