initial commit

This commit is contained in:
2021-09-02 18:01:03 +02:00
commit 229f86d94b
43 changed files with 1063 additions and 0 deletions

View File

@ -0,0 +1,15 @@
#!/bin/bash
###################################
############ by Sthope ############
###################################
## nano ~/.bashrc
## and add this to the end of the file: export PATH=$PATH:~/bin
## sudo chmod +x ~/bin/*;su -l $USER
#### USAGE
# bash -c "$(wget -qLO - https://git.sthope.dev/sthope/sthope_website_examples/raw/branch/master/custom-cmds-in-ubuntu/bin_examples/createnewuserns)" go Username Password
# Type "createnewuserns USERNAME PASSWORD" it will create new user without asking all the questions
adduser ${0} --gecos "${0},69,69,69" --disabled-password
echo "${0}:${1}" | chpasswd

View File

@ -0,0 +1,15 @@
#!/bin/bash
###################################
############ by Sthope ############
###################################
## nano ~/.bashrc
## and add this to the end of the file: export PATH=$PATH:~/bin
## sudo chmod +x ~/bin/*;su -l $USER
#### USAGE
# Type "dockerrm Container_Name" to Stop and Remove running Docker Container
# example: dockerrm Container_Name
docker stop $1
docker rm $1

View File

@ -0,0 +1,26 @@
#!/bin/bash
###################################
############ by Sthope ############
###################################
## nano ~/.bashrc
## and add this to the end of the file: export PATH=$PATH:~/bin
## sudo chmod +x ~/bin/*;su -l $USER
#### USAGE
# Type plsupgrade to update and upgrade or type plsupgrade get APP_NAME to install some app (max 9)
# example: plsupgrade get kodi vlc openssh-server
sudo apt-get update
sudo apt-get upgrade -y
case $1 in
'get') if [ "$1" = get ]; then
sudo apt-get install -y $2 $3 $4 $5 $6 $7 $8 $9
else
echo done
fi;;
*) exit 1;; #It is good practice to throw a code, hence allowing $? check
esac

View File

@ -0,0 +1,22 @@
#!/bin/bash
###################################
############ by Sthope ############
###################################
## nano ~/.bashrc
## and add this to the end of the file: export PATH=$PATH:~/bin
## sudo chmod +x ~/bin/*;su -l $USER
#### USAGE
# bash -c "$(wget -qLO - https://git.sthope.dev/sthope/sthope_website_examples/raw/branch/master/custom-cmds-in-ubuntu/bin_examples/proxmox_addnewuser)" Username Password
#
apt-get update
apt-get upgrade -y
apt-get install -y sudo
adduser ${0} --gecos "${0},69,69,69" --disabled-password
echo "${0}:${1}" | chpasswd
usermod -aG sudo ${0}
usermod -aG docker ${0}

View File

@ -0,0 +1,19 @@
#!/usr/bin/expect -f
###################################
############ by Sthope ############
###################################
## sudo apt-get install -y expect
## nano ~/.bashrc
## and add this to the end of the file: export PATH=$PATH:~/bin
## sudo chmod +x ~/bin/*;su -l $USER
#### USAGE
# Replace "Proxmox_Username", "Proxmox_IP", "Proxmox_Password" with your details
# Than enter on the terminal proxmoxupgradeyes and it will ssh into Proxmox and update, upgrade -y and autoremove -y
spawn ssh -o -o StrictHostKeyChecking=no -t Proxmox_Username@Proxmox_IP "apt-get update; apt-get upgrade -y;apt-get autoremove -y"
expect "assword:"
send "Proxmox_Password\r"
interact

View File

@ -0,0 +1,15 @@
#!/bin/bash
###################################
############ by Sthope ############
###################################
## nano ~/.bashrc
## and add this to the end of the file: export PATH=$PATH:~/bin
## sudo chmod +x ~/bin/*;su -l $USER
#### USAGE
# Type randomportgenerator and it will generate 10 random ports from range 50000 and 65535
for i in {1..10}; do echo $((50000 + RANDOM % 65535)); done

View File

@ -0,0 +1,15 @@
#!/bin/bash
###################################
############ by Sthope ############
###################################
## nano ~/.bashrc
## and add this to the end of the file: export PATH=$PATH:~/bin
## sudo chmod +x ~/bin/*;su -l $USER
#### USAGE
# Type randompwdgenerator and it will generate 10 random passwords with 18 chars
for i in {1..10}; do (tr -cd '[:alnum:]' < /dev/urandom | fold -w$'18' | head -n 1); done

View File

@ -0,0 +1,24 @@
#!/usr/bin/expect -f
###################################
############ by Sthope ############
###################################
## sudo apt-get install -y expect
## nano ~/.bashrc
## and add this to the end of the file: export PATH=$PATH:~/bin
## sudo chmod +x ~/bin/*;su -l $USER
### USAGE
# Type "sshnopwd USERNAME@IP PASSWORD"
# it will loggin without asking for password nor ask to confirm the new fingerprint (if applicable)
set timeout 5
set h [lindex $argv 0]
set p [lindex $argv 1]
spawn ssh -o StrictHostKeyChecking=no -t "$h"
expect "*assword:"
send "$p\r";
interact

View File

@ -0,0 +1,15 @@
#!/bin/bash
###################################
############ by Sthope ############
###################################
## nano ~/.bashrc
## and add this to the end of the file: export PATH=$PATH:~/bin
## sudo chmod +x ~/bin/*;su -l $USER
#### USAGE
# Type "y2upgrade" ans it will use first sudo apt-get update then sudo apt-get upgrade -y
# and it will update and upgrade system
sudo apt-get update
sudo apt-get upgrade -y