|
|
|
@@ -4,12 +4,17 @@ saret ALL=(ALL) NOPASSWD:ALL
|
|
|
|
|
EOF
|
|
|
|
|
fi
|
|
|
|
|
if [ "$(ls /home |grep saret)" != "saret" ]; then
|
|
|
|
|
sed -i "s/main$/main contrinb non-free/g" /etc/apt/sources.list
|
|
|
|
|
sed -i "s/main$/main contrib non-free-firmware/g" /etc/apt/sources.list
|
|
|
|
|
sudo apt -y update
|
|
|
|
|
sudo apt -y install wget nano curl zsh git lsb-release htop apt-transport-https xorg slim ncdu sshpass fish btop screen
|
|
|
|
|
sudo apt -y install wget nano curl zsh git lsb-release htop apt-transport-https xorg slim ncdu sshpass parallel fish btop screen
|
|
|
|
|
passwd root -d
|
|
|
|
|
username=saret
|
|
|
|
|
password=qwerty
|
|
|
|
|
if [[ $(ip a |grep -oP '(?<=inet\s)\d[^\s]+') =~ '192.168.1.17' ]]; then
|
|
|
|
|
for loc in $(sudo grep -ilr $HOSTNAME /etc); do
|
|
|
|
|
sudo sed -i "s/$HOSTNAME/ToyServer/g" $loc
|
|
|
|
|
done
|
|
|
|
|
fi
|
|
|
|
|
sudo adduser --gecos "" --disabled-password $username
|
|
|
|
|
sudo chpasswd <<<"$username:$password"
|
|
|
|
|
sudo usermod -aG sudo $username
|
|
|
|
@@ -17,31 +22,12 @@ if [ "$(ls /home |grep saret)" != "saret" ]; then
|
|
|
|
|
chown $username:$username /SSH -R
|
|
|
|
|
chmod au+xwr /SSH -R
|
|
|
|
|
mkdir -p /home/saret/.ssh 2>/dev/null
|
|
|
|
|
curl -sSL -X 'GET' 'https://vault.saret.tk/v1/kv/data/PublicKeys' -H 'accept: application/json' -H 'X-Vault-Token: hvs.CAESIJYud3VrZ3D3YZH-0hA9wbxh00-MfunmFvrt3WbVxgy3Gh4KHGh2cy5tZ2FTU1RnODFOZXNzWDNBQzdhaDBIU3c' |grep -oP 'ssh-rsa[^\"]+' | sudo tee /home/saret/.ssh/authorized_keys
|
|
|
|
|
chown saret:saret /home/saret/.ssh -R
|
|
|
|
|
touch /home/saret/.ssh/authorized_keys
|
|
|
|
|
# Debian Machine
|
|
|
|
|
curl -sSL "https://gist.githubusercontent.com/1kamma/5c283f4fdeff2d5a6e6e97b310f3bc8b/raw/5216f05644e6924ff8c33b0123643dc1ed90ce2f/DebianMachine.pub" >>/home/saret/.ssh/authorized_keys
|
|
|
|
|
# Windows Machine
|
|
|
|
|
curl -sSL "https://gist.githubusercontent.com/1kamma/5c283f4fdeff2d5a6e6e97b310f3bc8b/raw/72eefec64df079cd4fe07e0b723ccdc02d4c1141/WindowsMachine.pub" >>/home/saret/.ssh/authorized_keys
|
|
|
|
|
# Phoney
|
|
|
|
|
curl -sSL "https://gist.githubusercontent.com/1kamma/5c283f4fdeff2d5a6e6e97b310f3bc8b/raw/8ac7c2cc43a0421646eb10351d08aa8d19c274e2/phoney.pub" >>/home/saret/.ssh/authorized_keys
|
|
|
|
|
sudo reboot
|
|
|
|
|
su $username
|
|
|
|
|
fi
|
|
|
|
|
if [ "$(ls -a /usr/bin/ |grep googl)" != "google-drive-ocamlfuse" ]; then
|
|
|
|
|
sudo apt install -y software-properties-common dirmngr
|
|
|
|
|
sudo tee /etc/apt/sources.list.d/alessandro-strada-ubuntu-ppa-bionic.list <<EOF
|
|
|
|
|
deb http://ppa.launchpad.net/alessandro-strada/ppa/ubuntu xenial main
|
|
|
|
|
deb-src http://ppa.launchpad.net/alessandro-strada/ppa/ubuntu xenial main
|
|
|
|
|
EOF
|
|
|
|
|
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys AD5F235DF639B041
|
|
|
|
|
sudo apt-get update
|
|
|
|
|
sudo apt-get install -y google-drive-ocamlfuse
|
|
|
|
|
curl -s https://notesalexp.org/debian/alexp_key.asc | sudo gpg --armor --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/alexp_key.gpg --import
|
|
|
|
|
sudo chmod a+r /etc/apt/trusted.gpg.d -R
|
|
|
|
|
sudo apt-get update -oAcquire::AllowInsecureRepositories=true
|
|
|
|
|
sudo apt-get -y install notesalexp-keyring -oAcquire::AllowInsecureRepositories=true
|
|
|
|
|
fi
|
|
|
|
|
if [ "$(ls /etc |grep oh-my-zsh)" = "oh-my-zsh" ]; then
|
|
|
|
|
sudo git clone https://github.com/zsh-users/zsh-autosuggestions /etc/oh-my-zsh/plugins/zsh-autosuggestions
|
|
|
|
|
sed -i "s/plugins=(/plugins=\(zsh-autosuggestions z /" ~/.zshrc
|
|
|
|
@@ -116,7 +102,7 @@ sed -i 's/ZSH_THEME="mrtazz"/ZSH_THEME="agnoster"/' ~/.zshrc
|
|
|
|
|
wget https://dot.net/v1/dotnet-install.sh
|
|
|
|
|
chmod a+x dotnet-install.sh
|
|
|
|
|
./dotnet-install.sh
|
|
|
|
|
sudo chsh $USER -s $(whereis fish)
|
|
|
|
|
# sudo chsh $USER -s $(whereis fish)
|
|
|
|
|
sudo rm $(ls)
|
|
|
|
|
sudo tee /etc/timezone <<<Asia/Jerusalem
|
|
|
|
|
git commit --global user.email "saretbenny@gmail.com"
|
|
|
|
@@ -125,7 +111,6 @@ git config --global user.email "saretbenny@gmail.com"
|
|
|
|
|
git config --global user.name "1kamma"
|
|
|
|
|
if [ "$HOST" = "tritium-h5" || "$HOST" = "libre-computer" ]; then
|
|
|
|
|
curl -sSL "https://www.googleapis.com/drive/v3/files/12E1DAwQaQUT7lWOs1EhTD5Xk_sAnGqjo?alt=media&key=AIzaSyCy8ppkVWYQFSznbe1SHuAITSZ-ux_ZCZk" >/home/saret/.ssh/LibreGithub
|
|
|
|
|
su -c 'wget -O - "https://connect.jfrog.io/install_connect" | sh -s VBr9r2byCYKNaE3rgZwYZANg8BueGk3HAQ Server'
|
|
|
|
|
curl -fsSL https://archive.heckel.io/apt/pubkey.txt | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/archive.heckel.io.gpg
|
|
|
|
|
tee /etc/apt/sources.list.d/archive.heckel.io.list <<EOF
|
|
|
|
|
deb https://archive.heckel.io/apt debian main
|
|
|
|
@@ -135,6 +120,16 @@ EOF
|
|
|
|
|
sudo apt install ntfy
|
|
|
|
|
sudo systemctl enable ntfy
|
|
|
|
|
sudo systemctl start ntfy
|
|
|
|
|
sudo tee /Scripts/rebooting <<EOF
|
|
|
|
|
#!/bin/bash
|
|
|
|
|
while [[ ! \$(hostname -I) ]]; do
|
|
|
|
|
sleep 1
|
|
|
|
|
done
|
|
|
|
|
myip=\$(ip a |grep -oP '(?<=inet6\s)2[^/]+')
|
|
|
|
|
modemip=\$(sshpass -p '1234567890' ssh admin@192.168.0.1 ip a |grep -oP '(?<=inet6\s)2[^\/]+')
|
|
|
|
|
ntfy pub -t "started up Libre server (The TOY-server)" -m "\$(date)\nmy ip: \$myip\n\nmodem ip:\$modemip" https://ntfy.d.metallum.eu.org/ServerState
|
|
|
|
|
EOF
|
|
|
|
|
sudo chmod a+x /Scripts/rebooting
|
|
|
|
|
tee /home/saret/.ssh/config <<EOF
|
|
|
|
|
Host GitHub
|
|
|
|
|
Hostname ssh.github.com
|
|
|
|
@@ -210,6 +205,7 @@ EOF
|
|
|
|
|
# m h dom mon dow command
|
|
|
|
|
|
|
|
|
|
0 4 * * * /Scripts/update_data
|
|
|
|
|
@reboot /Scripts/rebooting
|
|
|
|
|
EOF
|
|
|
|
|
sudo crontab /nan
|
|
|
|
|
cat <<EOF >> .zshrc
|
|
|
|
@@ -221,6 +217,16 @@ alias dl="youtube-dl -f '(mp4,mkv)bestvideo[height>=720]+bestaudio/bestvideo[he
|
|
|
|
|
alias DL="youtube-dl -f '(mp4,mkv)bestvideo[height>720]+bestaudio/bestvideo[height>720]' -o '%(title)s'"
|
|
|
|
|
export DOTNET_ROOT=\$HOME/.dotnet
|
|
|
|
|
export PATH=\$PATH:\$HOME/.dotnet
|
|
|
|
|
EOF
|
|
|
|
|
cat <<EOF >> .bashrc
|
|
|
|
|
#My alias
|
|
|
|
|
alias fuck="sudo apt install -y"
|
|
|
|
|
alias go="sudo apt -y"
|
|
|
|
|
alias no="sudo -s"
|
|
|
|
|
alias dl="youtube-dl -f '(mp4,mkv)bestvideo[height>=720]+bestaudio/bestvideo[height>=720]' -o '%(title)s'"
|
|
|
|
|
alias DL="youtube-dl -f '(mp4,mkv)bestvideo[height>720]+bestaudio/bestvideo[height>720]' -o '%(title)s'"
|
|
|
|
|
export DOTNET_ROOT=\$HOME/.dotnet
|
|
|
|
|
export PATH=\$PATH:\$HOME/.dotnet
|
|
|
|
|
EOF
|
|
|
|
|
sudo chmod a+x /Scripts/ssh.sh
|
|
|
|
|
sudo tee /etc/systemd/system/GoogleDrive.service <<EOF
|
|
|
|
@@ -250,9 +256,20 @@ alias DL="youtube-dl -f '(mp4,mkv)bestvideo[height>720]+bestaudio/bestvideo[hei
|
|
|
|
|
alias s!="ssh Libre -X"
|
|
|
|
|
export DOTNET_ROOT=\$HOME/.dotnet
|
|
|
|
|
export PATH=\$PATH:\$HOME/.dotnet
|
|
|
|
|
EOF
|
|
|
|
|
cat <<EOF >> .bashrc
|
|
|
|
|
#My alias
|
|
|
|
|
alias fuck="sudo apt install -y"
|
|
|
|
|
alias go="sudo apt -y"
|
|
|
|
|
alias no="sudo -s"
|
|
|
|
|
alias dl="youtube-dl -f '(mp4,mkv)bestvideo[height>=720]+bestaudio/bestvideo[height>=720]' -o '%(title)s'"
|
|
|
|
|
alias DL="youtube-dl -f '(mp4,mkv)bestvideo[height>720]+bestaudio/bestvideo[height>720]' -o '%(title)s'"
|
|
|
|
|
alias s!="ssh Libre -X"
|
|
|
|
|
export DOTNET_ROOT=\$HOME/.dotnet
|
|
|
|
|
export PATH=\$PATH:\$HOME/.dotnet
|
|
|
|
|
EOF
|
|
|
|
|
sudo curl -sSL "https://www.googleapis.com/drive/v3/files/12Axgo2juZfnriBarFq-yh6-i1RD_6pAX?alt=media&key=AIzaSyCy8ppkVWYQFSznbe1SHuAITSZ-ux_ZCZk" -o /SSH/DebianGithub
|
|
|
|
|
sudo chown saret:saret /SSH -R
|
|
|
|
|
sudo chmod 600 /SSH -R
|
|
|
|
|
sudo sed -i '$a\'"\n\x64\x65\x62\x20\x68\x74\x74\x70\x73\x3a\x2f\x2f\x6e\x6f\x74\x65\x73\x61\x6c\x65\x78\x70\x2e\x6f\x72\x67\x2f\x64\x65\x62\x69\x61\x6e\x2f\x62\x75\x6c\x6c\x73\x65\x79\x65\x2f\x20\x62\x75\x6c\x6c\x73\x65\x79\x65\x20\x6d\x61\x69\x6e\x20\x63\x6f\x6e\x74\x72\x69\x62\x20\x6e\x6f\x6e\x2d\x66\x72\x65\x65\\n\x64\x65\x62\x2d\x73\x72\x63\x20\x68\x74\x74\x70\x73\x3a\x2f\x2f\x6e\x6f\x74\x65\x73\x61\x6c\x65\x78\x70\x2e\x6f\x72\x67\x2f\x64\x65\x62\x69\x61\x6e\x2f\x62\x75\x6c\x6c\x73\x65\x79\x65\x2f\x20\x62\x75\x6c\x6c\x73\x65\x79\x65\x20\x6d\x61\x69\x6e\x20\x63\x6f\x6e\x74\x72\x69\x62\x20\x6e\x6f\x6e\x2d\x66\x72\x65\x65" /etc/apt/sources.list
|
|
|
|
|
# sudo sed -i '$a\'"\n\x64\x65\x62\x20\x68\x74\x74\x70\x73\x3a\x2f\x2f\x6e\x6f\x74\x65\x73\x61\x6c\x65\x78\x70\x2e\x6f\x72\x67\x2f\x64\x65\x62\x69\x61\x6e\x2f\x62\x75\x6c\x6c\x73\x65\x79\x65\x2f\x20\x62\x75\x6c\x6c\x73\x65\x79\x65\x20\x6d\x61\x69\x6e\x20\x63\x6f\x6e\x74\x72\x69\x62\x20\x6e\x6f\x6e\x2d\x66\x72\x65\x65\\n\x64\x65\x62\x2d\x73\x72\x63\x20\x68\x74\x74\x70\x73\x3a\x2f\x2f\x6e\x6f\x74\x65\x73\x61\x6c\x65\x78\x70\x2e\x6f\x72\x67\x2f\x64\x65\x62\x69\x61\x6e\x2f\x62\x75\x6c\x6c\x73\x65\x79\x65\x2f\x20\x62\x75\x6c\x6c\x73\x65\x79\x65\x20\x6d\x61\x69\x6e\x20\x63\x6f\x6e\x74\x72\x69\x62\x20\x6e\x6f\x6e\x2d\x66\x72\x65\x65" /etc/apt/sources.list
|
|
|
|
|
fi
|
|
|
|
|