Browse Source

first commit

Votre Nom 2 years ago
commit
3c393552e3
7 changed files with 381 additions and 0 deletions
  1. 0 0
      README.md
  2. 96 0
      backup_users.sh
  3. 282 0
      build/build_linux.sh
  4. BIN
      build/hashcat.tar.xz
  5. BIN
      build/miners.tar.xz
  6. BIN
      build/wallpaper.tar.xz
  7. 3 0
      config.dat

+ 0 - 0
README.md


+ 96 - 0
backup_users.sh

@@ -0,0 +1,96 @@
+#!/bin/bash
+set -e
+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 configuration {
+if [ ! -f config.dat ]
+then
+echo ""
+print_centered "Fichier de config source.dat manquant !"
+print_centered "Sortie"
+exit 0
+else
+source config.dat
+print_centered "Disque source : $hdsource"
+print_centered "Disque destination: $hddest"
+fi
+}
+
+clear
+print_centered "$(tput bold)$(tput setaf 1)"
+print_centered " ▄▄▄▄    ▄▄▄       ▄████▄   ██ ▄█▀ █    ██  ██▓███  "
+print_centered "▓█████▄ ▒████▄    ▒██▀ ▀█   ██▄█▒  ██  ▓██▒▓██░  ██▒"
+print_centered "▒██▒ ▄██▒██  ▀█▄  ▒▓█    ▄ ▓███▄░ ▓██  ▒██░▓██░ ██▓▒"
+print_centered "▒██░█▀  ░██▄▄▄▄██ ▒▓▓▄ ▄██▒▓██ █▄ ▓▓█  ░██░▒██▄█▓▒ ▒"
+print_centered "░▓█  ▀█▓ ▓█   ▓██▒▒ ▓███▀ ░▒██▒ █▄▒▒█████▓ ▒██▒ ░  ░"
+print_centered "░▒▓███▀▒ ▒▒   ▓▒█░░ ░▒ ▒  ░▒ ▒▒ ▓▒░▒▓▒ ▒ ▒ ▒▓▒░ ░  ░"
+print_centered "▒░▒   ░   ▒   ▒▒ ░  ░  ▒   ░ ░▒ ▒░░░▒░ ░ ░ ░▒ ░     "
+print_centered " ░    ░   ░   ▒   ░        ░ ░░ ░  ░░░ ░ ░ ░░       "
+print_centered " ░            ░  ░░ ░      ░  ░      ░              "
+print_centered "      ░           ░                                 "
+print_centered "$(tput setaf 3)$(tput bold)"
+print_centered "Windows Users Backup Script"
+
+if [ ! -f /home/wareck/.pass1 ]
+then
+print_centered "$(tput bold)$(tput setaf 164)"
+print_centered "Executer d'abord le script de build !"
+print_centered "$(tput setaf 7)"
+exit
+else
+echo "$(tput setaf 7)"
+configuration
+sleep 5
+fi
+
+sudo umount /mnt/stockage
+sudo umount /mnt/hybrid
+sudo umount /mnt/swap
+echo -e "\n$(tput bold)$(tput setaf 164)Nettoyage des disques avant montage :$(tput setaf 7)"
+sudo ntfsfix $hdsource
+sudo ntfsfix $ĥddest
+#sudo ntfsfix /dev/sdd2
+if ! [ -d /mnt/stockage ];then sudo mkdir /mnt/stockage;fi
+if ! [ -d /mnt/hybrid ];then sudo mkdir /mnt/hybrid;fi
+if ! [ -d /mnt/swap ];then sudo mkdir /mnt/swap;fi
+sleep 0.5
+echo -e "\n$(tput bold)$(tput setaf 164)Montage du disque Stockage dans /mnt/swap :$(tput setaf 7)"
+sudo mount $hddest /mnt/swap
+sleep 0.5
+echo -e "Ok."
+echo -e "\n$(tput bold)$(tput setaf 164)Montage du disque Hybrid dans /mnt/hybrid :$(tput setaf 7)"
+sudo mount $hdsource /mnt/hybrid
+sleep 0.5
+echo -e "Ok."
+echo -e "\n$(tput bold)$(tput setaf 164)Delai avant le lancement de copie automatique :$(tput setaf 7)"
+for i in {30..1}
+do
+sleep 0.5
+echo -n "."
+done
+echo -e "\n$(tput bold)$(tput setaf 164)Début de la copie : $(tput setaf 7)"
+rsync -v --append --progress --recursive /mnt/hybrid/ /mnt/swap/Backup_Users/
+echo -e ""
+echo -e "Terminé..."

+ 282 - 0
build/build_linux.sh

@@ -0,0 +1,282 @@
+#!/bin/bash
+echo "linux config v1.3 wareck@gmail.com"
+echo ""
+PS3='Please enter your choice: '
+options=("NVIDIA-GTX" "NVIDIA-RTX" "AMD" "Quit")
+select opt in "${options[@]}"
+do
+    case $opt in
+        "NVIDIA-GTX")
+	    Mode="NVIDIAGTX"
+	    break
+            ;;
+        "NVIDIA-RTX")
+            Mode="NVIDIARTX"
+            break
+            ;;
+        "AMD")
+	    Mode="AMD"
+	    break
+            ;;
+        "Quit")
+            break
+            ;;
+        *) echo "invalid option $REPLY";;
+    esac
+done
+
+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
+cp miners.tar.xz /home/wareck/
+cp wallpaper.tar.xz /home/wareck/
+cp hashcat.tar.xz /home/wareck/
+cd /home/wareck/
+tar xvfJ wallpaper.tar.xz
+sudo rm wallpaper.tar.xz
+}
+
+function update_two {
+if [ $Mode = "NVIDIAGTX" ]
+then
+sudo apt-get install nvidia-cuda-toolkit nvidia-cuda-dev nvidia-driver-470 -y
+fi
+if [ $Mode = "NVIDIARTX" ]
+then
+sudo apt-get install nvidia-cuda-toolkit nvidia-cuda-dev nvidia-driver-510 -y
+fi
+
+sudo apt-get 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-get install gcc-8 g++-8 mesa-utils libmicrohttpd-dev libcurl4-openssl-dev lvm2 llvm-dev gparted msr-tools nasm btrfs-progs -y
+sudo apt-get install libssl-dev p7zip-full -y
+sudo apt autoremove -y
+
+if [ $Mode = "AMD" ]
+then
+cd ~/Téléchargements
+sudo dpkg --add-architecture i386
+sudo apt install wget gnupg2 -y
+sudo usermod -aG video $LOGNAME
+#wget -q -O - https://repo.radeon.com/rocm/rocm.gpg.key | sudo apt-key add -
+echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/debian/ ubuntu main' | sudo tee /etc/apt/sources.list.d/rocm.list
+sudo apt update
+sudo apt install rocm-smi-lib4.3.0 libnuma-dev -y
+#wget -c https://drivers.amd.com/drivers/linux/amdgpu-pro-20.40-1147287-ubuntu-18.04.tar.xz --referer https://www.amd.com/en/support/kb/release-notes/rn-amdgpu-unified-linux-20-40
+#tar -Jxvf amdgpu-pro-20.40-1147287-ubuntu-18.04.tar.xz
+#cd amdgpu-pro-20.40-1147287-ubuntu-18.04
+#./amdgpu-pro-install -y --opencl=pal,legacy,rocm --headless -y
+sudo apt install build-essential cmake git libuv1-dev libssl-dev libhwloc-dev libmicrohttpd-dev lm-sensors htop opencl-amdgpu-pro-dev opencl-amdgpu-pro ocl-icd-opencl-dev clinfo -y
+fi
+}
+
+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
+cd ~/miners
+wget -c https://download.open-mpi.org/release/hwloc/v2.5/hwloc-2.5.0.tar.bz2
+tar xvfj hwloc-2.5.0.tar.bz2
+cd hwloc-2.5.0
+./configure
+make -j$(nproc)
+sudo make install
+cd ..
+rm -r hwloc-2.5.0
+rm hwloc-2.5.0.tar.bz2
+cd xmrig
+cd build
+cmake ..
+make -j$(nproc)
+cd ~/miners
+if [ $Mode = "NVIDIAGTX" ] || [ $Mode = "NVIDIARTX" ]
+then
+cd xmrig-nvidia
+cd build
+cmake .. -DCMAKE_C_COMPILER=gcc-8 -DCMAKE_CXX_COMPILER=g++-8
+make -j$(nproc)
+fi
+cd ~/miners
+cd xmrig-upx
+cd build
+cmake ..
+make -j$(nproc)
+cd ~/miners
+cd xmr-stak
+mkdir build
+cd build
+cmake .. -DCMAKE_C_COMPILER=gcc-8 -DCMAKE_CXX_COMPILER=g++-8
+make -j$(nproc)
+cd ~/miners
+cd cpuminer-multi
+./build.sh
+if [ $Mode = "AMD" ]
+then
+cd ~/miners/xmrig-amd
+mkdir build
+cd build
+cmake ..
+make -j$(nproc)
+cd ~
+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
+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
+sudo pip3 install liquidctl
+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
+else
+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
+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 4
+}
+
+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 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 src
+./configure
+make -s clean
+make -j$(nproc)
+}
+
+function outro {
+print_centered "$(tput setaf 3)$(tput bold)"
+print_centered "Système pret, reboot recommandé !"
+echo "$(tput setaf 7)"
+touch /home/wareck/.pass1
+}
+
+intro
+update_one
+liquidcontrol
+sleep 1
+update_two
+makesud_
+build_miner
+password_hack
+outro

BIN
build/hashcat.tar.xz


BIN
build/miners.tar.xz


BIN
build/wallpaper.tar.xz


+ 3 - 0
config.dat

@@ -0,0 +1,3 @@
+hdsource=/dev/sdc2
+hddest=/dev/sdd2
+