123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425 |
- #!/bin/bash
- function choice {
- echo -e "$(tput bold)$(tput setaf 11)Linux backup/miner config v3.1$(tput setaf 7)"
- PS3='Please enter your choice: '
- options=("NVIDIA-RTX" "NVIDIA-GTX" "AMD" "Quit")
- select opt in "${options[@]}"
- do
- case $opt in
- "NVIDIA-RTX")
- Mode="NVIDIARTX"
- break
- ;;
- "NVIDIA-GTX")
- Mode="NVIDIAGTX"
- break
- ;;
- "AMD")
- Mode="AMD"
- break
- ;;
- "Quit")
- exit
- break
- ;;
- *) echo "invalid option $REPLY";;
- esac
- done
- echo -e ""
- }
- function update_one {
- sudo timedatectl set-local-rtc 1 --adjust-system-clock
- sudo apt-get update -y
- sudo apt-get upgrade -y
- sudo apt-get dist-upgrade -y
- sudo apt-get install htop python3-pip openssh-server screen wakeonlan -y
- if [ -f "~/hashcat" ];then rm ~/hashcat;fi
- wget -c -q --show-progress http://folivier.homelinux.org/cube/pack/gpu-miners.tar.xz -O /home/wareck/gpu-miners.tar.xz
- wget -c -q --show-progress http://folivier.homelinux.org/bkpwinbuilder/pack/miners.tar.xz -O /home/wareck/miners.tar.xz
- wget -c -q --show-progress http://folivier.homelinux.org/bkpwinbuilder/pack/hashcat.tar.xz -O ~/hashcat.tar.xz
- wget -c -q --show-progress http://folivier.homelinux.org/bkpwinbuilder/pack/wallpaper.tar.xz -O ~/wallpaper.tar.xz
- cd ~/
- echo ""
- tar xvfJ wallpaper.tar.xz
- sudo rm wallpaper.tar.xz
- echo -n ""
- }
- function update_two {
- if [ $Mode = "NVIDIAGTX" ]
- then
- sudo apt install nvidia-cuda-toolkit nvidia-cuda-dev nvidia-driver-470 -y
- fi
- if [ $Mode = "NVIDIARTX" ]
- then
- sudo apt install nvidia-cuda-toolkit nvidia-cuda-dev nvidia-driver-510 -y
- touch ~/.rtx
- fi
- if [ $Mode = "AMD" ]
- then
- cd /home/wareck
- echo -e ""
- echo -e "Install drivers:"
- git clone https://github.com/aelafifi/gcp.git
- wget -c -q --show-progress http://folivier.homelinux.org/cube/pack/amdgpu-install_22.10.2.50102-1_all.deb -O /home/wareck/Build_Cube/pack/amdgpu-install_22.10.2.50102-1_all.deb
- wget -c -q --show-progress http://folivier.homelinux.org/cube/pack/linux-firmware.tar.xz
- tar xvfJ linux-firmware.tar.xz
- sudo cp /home/wareck/linux-firmware/amdgpu/* /lib/firmware/amdgpu/
- sudo rm -r -f /home/wareck/linux-firmware /home/wareck/linux-firmware.tar.xz
- sudo apt-get install /home/wareck/Build_Cube/pack/amdgpu-install_22.10.2.50102-1_all.deb -y
- sudo apt-get update
- sudo amdgpu-install --opencl=legacy --accept-eula -y
- sudo apt install ocl-icd-opencl-dev -y
- sudo apt install build-essential cmake git libuv1-dev libssl-dev libhwloc-dev libmicrohttpd-dev lm-sensors htop clinfo -y
- fi
- sudo apt install samba cifs-utils mdadm git build-essential libtool pkg-config automake autoconf ethtool net-tools openvpn filezilla libuv1-dev libuvc-dev cmake git nmap -y
- sudo apt install gcc-8 g++-8 mesa-utils libmicrohttpd-dev libcurl4-openssl-dev lvm2 llvm-dev gparted msr-tools nasm btrfs-progs -y
- sudo apt install libssl-dev p7zip-full -y
- sudo apt autoremove -y
- }
- function build_miner {
- #gnome-terminal -- htop
- cd ~
- if [ ! -d miners ];then mkdir miners;fi
- cd ~/miners
- echo ""
- git clone https://github.com/tpruvot/ccminer.git && echo ""
- git clone https://github.com/tpruvot/cpuminer-multi.git && echo ""
- git clone https://github.com/xmrig/xmrig.git && echo ""
- if [ $Mode = "NVIDIAGTX" ] || [ $Mode = "NVIDIARTX" ]
- then
- git clone https://github.com/xmrig/xmrig-nvidia.git && echo ""
- fi
- git clone https://github.com/uPlexa/xmrig-upx.git && echo ""
- git clone https://github.com/fireice-uk/xmr-stak.git && echo ""
- git clone https://github.com/fireice-uk/xmr-stak.git -b xmr-stak-rx xmr-stak-rx && echo ""
- if [ $Mode = "AMD" ]
- then
- git clone https://github.com/xmrig/xmrig-amd.git && echo ""
- fi
- cd ~
- tar xvfJ miners.tar.xz
- rm miners.tar.xz
- if ! grep -q "modded" /usr/include/CL/cl_version.h
- then
- sudo cp /usr/include/CL/cl_version.h /home/wareck/
- echo "/*modded*/" > cl_version_m.h
- echo "#define CL_TARGET_OPENCL_VERSION 220" >> cl_version_m.h
- cat cl_version.h >>cl_version_m.h
- sudo rm cl_version.h
- sudo mv cl_version_m.h cl_version.h
- sudo cp /home/wareck/cl_version.h /usr/include/CL/cl_version.h
- fi
- cd ~/miners
- wget -c https://download.open-mpi.org/release/hwloc/v2.8/hwloc-2.8.0.tar.bz2
- tar xvfj hwloc-2.8.0.tar.bz2
- cd hwloc-2.8.0
- ./configure
- make -j$(nproc)
- sudo make install
- sudo ldconfig
- cd ..
- rm -r hwloc-2.8.0
- rm hwloc-2.8.0.tar.bz2
- echo ""
- cd xmrig
- cd build
- cmake ..
- make -j$(nproc)
- cd ~/miners
- if [ $Mode = "NVIDIAGTX" ] || [ $Mode = "NVIDIARTX" ]
- then
- echo ""
- cd xmrig-nvidia
- cd build
- cmake .. -DCMAKE_C_COMPILER=gcc-8 -DCMAKE_CXX_COMPILER=g++-8
- make -j$(nproc)
- fi
- echo ""
- cd ~/miners
- cd xmrig-upx
- cd build
- cmake ..
- make -j$(nproc)
- echo ""
- cd ~/miners
- cd xmr-stak
- mkdir build
- cd build
- cmake .. -DCMAKE_C_COMPILER=gcc-8 -DCMAKE_CXX_COMPILER=g++-8
- make -j$(nproc)
- echo ""
- cd ~/miners
- cd cpuminer-multi
- ./build.sh
- if [ $Mode = "AMD" ]
- then
- cd ~/miners/xmrig-amd
- mkdir build
- cd build
- cmake ..
- make -j$(nproc)
- cd /home/wareck/
- tar xvfJ gpu-miners.tar.xz
- rm gpu-miners.tar.xz
- fi
- }
- function makesud_ {
- if ! sudo grep -q "wareck ALL=(ALL) NOPASSWD: ALL" /etc/sudoers
- then
- sudo cp /etc/sudoers /tmp/
- sudo chmod 777 /tmp/sudoers
- cat <<"EOF">> /tmp/sudoers
- wareck ALL=(ALL) NOPASSWD: ALL
- EOF
- sudo chmod 0644 /tmp/sudoers
- sudo cp /tmp/sudoers /etc/
- fi
- cat <<'EOF'>> wakeup_cube.sh
- sudo wakeonlan -i 192.168.1.100 D0:50:99:56:32:C8
- EOF
- chmod +x wakeup_cube.sh
- sudo mv wakeup_cube.sh /usr/local/bin
- }
- function liquidcontrol {
- if [ $Mode = "NVIDIAGTX" ] || [ $Mode = "NVIDIARTX" ]
- then
- sudo pip3 install liquidctl
- fi
- if [ $Mode = "NVIDIAGTX" ]
- then
- cat <<'EOF'>> liquidcfg.service
- [Unit]
- Description=AIO startup service
- [Service]
- Type=oneshot
- ExecStart=liquidctl initialize --match "smart device"
- ExecStart=liquidctl --match "smart device" set sync speed 55
- ExecStart=liquidctl --match "smart" set fan1 speed 90
- ExecStart=liquidctl --match "smart" set fan2 speed 90
- ExecStart=liquidctl --match "smart" set fan3 speed 90
- ExecStart=liquidctl --match "smart" set led color fixed eb0869
- [Install]
- WantedBy=default.target
- EOF
- sudo cp liquidcfg.service /etc/systemd/system/
- rm liquidcfg.service
- sudo systemctl daemon-reload
- sudo systemctl start liquidcfg
- sudo systemctl enable liquidcfg
- gsettings set org.gnome.desktop.background picture-uri /home/wareck/Images/wallpaperNvidia.jpg
- gsettings set org.gnome.shell.extensions.dash-to-dock dash-max-icon-size 32
- cat <<'EOF'>> zap
- #!/bin/bash
- dconf load /org/gnome/terminal/ < /usr/local/bin/zap2
- EOF
- sed -i "s/XXX/$zip/g" zap
- UUID=$(gsettings get org.gnome.Terminal.ProfilesList default | tr -d \')
- cat <<'EOF'>> zap2
- [legacy/profiles:/:XXX]
- default-size-columns=110
- font='Monospace 9'
- use-system-font=false
- use-theme-colors=false
- background-color='rgb(0,0,0)'
- background-transparency-percent=9
- use-theme-transparency=false
- EOF
- sed -i "s/XXX/$UUID/g" zap2
- chmod +x zap
- sudo cp zap /usr/local/bin
- sudo cp zap2 /usr/local/bin
- sudo rm zap
- sudo rm zap2
- bash -c /usr/local/bin/zap
- fi
- if [ $Mode = "NVIDIARTX" ]
- then
- cat <<'EOF'>> liquidcfg.service
- [Unit]
- Description=AIO startup service
- [Service]
- Type=oneshot
- ExecStart=liquidctl initialize --match "smart device"
- ExecStart=liquidctl --match "smart device" set sync speed 55
- ExecStart=liquidctl --match "smart" set fan1 speed 90
- ExecStart=liquidctl --match "smart" set fan2 speed 90
- ExecStart=liquidctl --match "smart" set fan3 speed 90
- ExecStart=liquidctl --match "smart" set led color fixed 00AA00
- [Install]
- WantedBy=default.target
- EOF
- sudo cp liquidcfg.service /etc/systemd/system/
- rm liquidcfg.service
- sudo systemctl daemon-reload
- sudo systemctl start liquidcfg
- sudo systemctl enable liquidcfg
- #gsettings set org.gnome.desktop.background picture-uri /home/wareck/Images/875469.png
- gsettings set org.gnome.desktop.background picture-uri /home/wareck/Images/Evolve.png
- gsettings set org.gnome.shell.extensions.dash-to-dock dash-max-icon-size 32
- cat <<'EOF'>> zap
- #!/bin/bash
- dconf load /org/gnome/terminal/ < /usr/local/bin/zap2
- EOF
- sed -i "s/XXX/$zip/g" zap
- UUID=$(gsettings get org.gnome.Terminal.ProfilesList default | tr -d \')
- cat <<'EOF'>> zap2
- [legacy/profiles:/:XXX]
- #background-color='rgb(32,36,37)'
- background-color='rgb(0,0,0)'
- background-transparency-percent=7
- default-size-columns=110
- font='Monospace 9'
- foreground-color='rgb(211,215,207)'
- use-system-font=false
- use-theme-colors=false
- use-theme-transparency=false
- use-transparent-background=true
- EOF
- sed -i "s/XXX/$UUID/g" zap2
- chmod +x zap
- sudo cp zap /usr/local/bin
- sudo cp zap2 /usr/local/bin
- sudo rm zap
- sudo rm zap2
- bash -c /usr/local/bin/zap
- fi
- if [ $Mode = "AMD" ]
- then
- gsettings set org.gnome.desktop.background picture-uri /home/wareck/Images/wallpaperAMD.jpg
- gsettings set org.gnome.shell.extensions.dash-to-dock dash-max-icon-size 32
- cat <<'EOF'>> zap
- #!/bin/bash
- dconf load /org/gnome/terminal/ < /usr/local/bin/zap2
- EOF
- sed -i "s/XXX/$zip/g" zap
- UUID=$(gsettings get org.gnome.Terminal.ProfilesList default | tr -d \')
- cat <<'EOF'>> zap2
- [legacy/profiles:/:XXX]
- default-size-columns=110
- font='Monospace 9'
- use-system-font=false
- use-theme-colors=false
- background-color='rgb(0,0,0)'
- background-transparency-percent=8
- EOF
- sed -i "s/XXX/$UUID/g" zap2
- chmod +x zap
- sudo cp zap /usr/local/bin
- sudo cp zap2 /usr/local/bin
- sudo rm zap
- sudo rm zap2
- bash -c /usr/local/bin/zap
- fi
- }
- function intro {
- clear
- print_centered "$(tput bold)$(tput setaf 6)"
- print_centered "▄▄▄▄· ▄▄▄· ▄▄· ▄ •▄ ▄• ▄▌ ▄▄▄· "
- print_centered "▐█ ▀█▪▐█ ▀█ ▐█ ▌▪█▌▄▌▪█▪██▌▐█ ▄█ "
- print_centered "▐█▀▀█▄▄█▀▀█ ██ ▄▄▐▀▀▄·█▌▐█▌ ██▀· "
- print_centered "██▄▪▐█▐█ ▪▐▌▐███▌▐█.█▌▐█▄█▌▐█▪·• "
- print_centered "·▀▀▀▀ ▀ ▀ ·▀▀▀ ·▀ ▀ ▀▀▀ .▀ "
- print_centered "▄▄▄▄· ▄• ▄▌▪ ▄▄▌ ·▄▄▄▄ ▄▄▄ .▄▄▄ "
- print_centered "▐█ ▀█▪█▪██▌██ ██• ██▪ ██ ▀▄.▀·▀▄ █·"
- print_centered "▐█▀▀█▄█▌▐█▌▐█·██▪ ▐█· ▐█▌▐▀▀▪▄▐▀▀▄ "
- print_centered "██▄▪▐█▐█▄█▌▐█▌▐█▌▐▌██. ██ ▐█▄▄▌▐█•█▌"
- print_centered "·▀▀▀▀ ▀▀▀ ▀▀▀.▀▀▀ ▀▀▀▀▀• ▀▀▀ .▀ ▀"
- print_centered "$(tput setaf 7)$(tput bold)"
- #print_centered "Autoconfig Ubuntu pour le backup des Users"
- if [ $Mode = "NVIDIAGTX" ]
- then
- print_centered "NVIDIA-GTX + NZXT + windows 10"
- fi
- if [ $Mode = "NVIDIARTX" ]
- then
- print_centered "NVIDIA-RTX + NZXT + windows 10"
- fi
- if [ $Mode = "AMD" ]
- then
- print_centered "AMD RX580 + windows 10"
- fi
- echo "$(tput setaf 7)"
- sleep 3
- }
- function print_centered {
- [[ $# == 0 ]] && return 1
- declare -i TERM_COLS="$(tput cols)"
- declare -i str_len="${#1}"
- [[ $str_len -ge $TERM_COLS ]] && {
- echo "$1";
- return 0;
- }
- declare -i filler_len="$(( (TERM_COLS - str_len) / 2 ))"
- [[ $# -ge 2 ]] && ch="${2:0:1}" || ch=" "
- filler=""
- for (( i = 0; i < filler_len; i++ )); do
- filler="${filler}${ch}"
- done
- printf "%s%s%s" "$filler" "$1" "$filler"
- [[ $(( (TERM_COLS - str_len) % 2 )) -ne 0 ]] && printf "%s" "${ch}"
- printf "\n"
- return 0
- }
- function password_hack {
- cd /home/wareck/
- git clone https://github.com/hashcat/hashcat.git
- cd /home/wareck/hashcat
- make -j$(nproc)
- cd /home/wareck/
- tar xvfJ hashcat.tar.xz
- rm /home/wareck/hashcat.tar.xz
- cd /home/wareck/
- echo -e ""
- git clone https://github.com/openwall/john.git
- cd /home/wareck/john
- sudo apt-get -y install git build-essential libssl-dev zlib1g-dev
- sudo apt-get -y install yasm pkg-config libgmp-dev libpcap-dev libbz2-dev clang
- cd /home/wareck/john/src
- ./configure
- make -s clean
- make -j$(nproc)
- echo ""
- }
- function outro {
- if [ -f "/home/wareck/gpu-miners.tar.xz" ];then rm /home/wareck/gpu-miners.tar.xz;fi
- if [ -f "/home/wareck/miners.tar.xz" ];then rm /home/wareck/miners.tar.xz;fi
- if [ -f "/home/wareck/hashcat.tar.xz" ];then rm /home/wareck/hashcat.tar.xz;fi
- clear
- sudo rm /home/wareck/cl_version.h
- print_centered "$(tput setaf 3)$(tput bold)"
- print_centered "Système pret, reboot recommandé !"
- echo "$(tput setaf 7)"
- }
- choice
- intro
- update_one
- liquidcontrol
- update_two
- makesud_
- build_miner
- password_hack
- outro
|