Compare commits
73 Commits
ec2f9d52c1
...
master
Author | SHA1 | Date | |
---|---|---|---|
202c5cdf3d | |||
934ab849a3 | |||
e50532d608 | |||
fdc8ca56b7 | |||
69472df977 | |||
718c25bf3c | |||
6acbc825b6 | |||
e5ddc9f1e3 | |||
9e41abfe41 | |||
3a81f9668b | |||
3172cd0f66 | |||
73da3c67ca | |||
5af6241f6d | |||
25f7af29e7 | |||
7a549537c2 | |||
5f37da00c9 | |||
6e89d81187 | |||
6879cab723 | |||
8f5159adf5 | |||
e0e87399d0 | |||
43bbd98ef6 | |||
517de66369 | |||
cf462e2d79 | |||
99cf15801a | |||
7f95245e8a | |||
4802a7b1e6 | |||
721208c975 | |||
28038dfe06 | |||
48160eccb6 | |||
|
4dda5fafc9 | ||
|
5e6f30590d | ||
|
dc93490939 | ||
|
9d0c7c876f | ||
|
ce4dc744ae | ||
|
6801217980 | ||
|
f577dd7177 | ||
|
75061e740c | ||
|
d3e208661a | ||
|
32e41b30ef | ||
|
5d749419be | ||
|
e433f6c05c | ||
|
8edbcfacdf | ||
|
25c5fa4a6f | ||
|
f93c33d8df | ||
|
34fa438724 | ||
|
f609d33974 | ||
|
b5319e4612 | ||
|
fac8e343c0 | ||
|
8e5b8e8a95 | ||
|
7576381f11 | ||
|
8763521710 | ||
|
be3e02dff5 | ||
|
618483fedb | ||
|
68d26461b3 | ||
|
d92aa46552 | ||
|
acf6427dcc | ||
|
6b6570af75 | ||
|
0b157e4289 | ||
|
6c4f927459 | ||
|
13f22fef94 | ||
|
f121bfa66b | ||
|
02ffc6792f | ||
|
0a2806daf5 | ||
|
d8605dcc9e | ||
|
05c9b0a7a0 | ||
|
3d68e66445 | ||
|
f5a7483840 | ||
|
ff50060a61 | ||
|
d98a7a2b6c | ||
|
af992a38c5 | ||
3cbfb7c0ad | |||
2e65790426 | |||
1e7341007a |
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
.scripts/
|
||||
.scripts/
|
11
custom-cmds-in-ubuntu/bin_examples/README.md
Normal file
11
custom-cmds-in-ubuntu/bin_examples/README.md
Normal file
@@ -0,0 +1,11 @@
|
||||
## Add Script name at the end
|
||||
|
||||
```
|
||||
bash -c "$(wget -qLO - https://git.sthope.dev/sthope/sthope-examples/raw/branch/master/custom-cmds-in-ubuntu/bin_examples/)"
|
||||
```
|
||||
|
||||
### Get PC Details
|
||||
|
||||
```
|
||||
bash -c "$(wget -qLO - https://git.sthope.dev/sthope/sthope-examples/raw/branch/master/custom-cmds-in-ubuntu/bin_examples/get_pc_details.sh)"
|
||||
```
|
22
custom-cmds-in-ubuntu/bin_examples/autouser
Normal file
22
custom-cmds-in-ubuntu/bin_examples/autouser
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
# ___ _ _ _ __
|
||||
# / __|| |_ | |_ ___ | '_ \ ___
|
||||
# \__ \| _|| \ / _ \| .__// -_)
|
||||
# |___/ \__||_||_|\___/|_| \___|
|
||||
|
||||
## nano ~/.bashrc
|
||||
## and add this to the end of the file: export PATH=$PATH:~/bin
|
||||
## sudo chmod +x ~/bin/*;su -l $USER
|
||||
|
||||
### USAGE:
|
||||
|
||||
U=$1
|
||||
P=$2
|
||||
R=$4
|
||||
|
||||
if [ "$3" = "sudo" ]
|
||||
then
|
||||
echo $4 | sudo -S adduser $U --gecos "69,69,69,69" --disabled-password;echo "$U:$P" | sudo chpasswd;usermod -aG sudo $U
|
||||
else
|
||||
adduser $U --gecos "69,69,69,69" --disabled-password;echo "$U:$P" | chpasswd;usermod -aG sudo $U
|
||||
fi
|
13
custom-cmds-in-ubuntu/bin_examples/check_max_ram.sh
Normal file
13
custom-cmds-in-ubuntu/bin_examples/check_max_ram.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
# ___ _ _ _ __
|
||||
# / __|| |_ | |_ ___ | '_ \ ___
|
||||
# \__ \| _|| \ / _ \| .__// -_)
|
||||
# |___/ \__||_||_|\___/|_| \___|
|
||||
|
||||
clear;dpkg -s dmidecode &> /dev/null
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
sudo dmidecode -t 16
|
||||
else
|
||||
sudo apt-get -qq update;sudo apt-get -qq install -y dmidecode
|
||||
fi
|
@@ -8,7 +8,7 @@
|
||||
## 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
|
||||
# bash -c "$(wget -qLO - https://git.sthope.dev/sthope/sthope-examples/src/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
|
||||
|
43
custom-cmds-in-ubuntu/bin_examples/get_pc_details.sh
Normal file
43
custom-cmds-in-ubuntu/bin_examples/get_pc_details.sh
Normal file
@@ -0,0 +1,43 @@
|
||||
#!/bin/bash
|
||||
# ___ _ _ _ __
|
||||
# / __|| |_ | |_ ___ | '_ \ ___
|
||||
# \__ \| _|| \ / _ \| .__// -_)
|
||||
# |___/ \__||_||_|\___/|_| \___|
|
||||
|
||||
## USAGE:
|
||||
# clear;bash -c "$(wget -qLO - https://git.sthope.dev/sthope/sthope-examples/raw/branch/master/custom-cmds-in-ubuntu/bin_examples/get_pc_details.sh)"
|
||||
|
||||
DF=details_$HOSTNAME.log
|
||||
|
||||
dpkg -s dmidecode &> /dev/null
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "[$HOSTNAME bios]" >> $DF
|
||||
sudo dmidecode --type bios >> $DF
|
||||
|
||||
echo "[$HOSTNAME system]" >> $DF
|
||||
sudo dmidecode --type system >> $DF
|
||||
|
||||
echo "[$HOSTNAME baseboard]" >> $DF
|
||||
sudo dmidecode --type baseboard >> $DF
|
||||
|
||||
echo "[$HOSTNAME chassis]" >> $DF
|
||||
sudo dmidecode --type chassis >> $DF
|
||||
|
||||
echo "[$HOSTNAME processor]" >> $DF
|
||||
sudo dmidecode --type processor >> $DF
|
||||
|
||||
echo "[$HOSTNAME memory]" >> $DF
|
||||
sudo dmidecode --type memory >> $DF
|
||||
|
||||
echo "[$HOSTNAME cache]" >> $DF
|
||||
sudo dmidecode --type cache >> $DF
|
||||
|
||||
echo "[$HOSTNAME connector]" >> $DF
|
||||
sudo dmidecode --type connector >> $DF
|
||||
|
||||
echo "[$HOSTNAME slot]" >> $DF
|
||||
sudo dmidecode --type slot >> $DF
|
||||
else
|
||||
sudo apt-get -qq update;sudo apt-get -qq install -y dmidecode
|
||||
fi
|
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
# ___ _ _ _ __
|
||||
# / __|| |_ | |_ ___ | '_ \ ___
|
||||
# \__ \| _|| \ / _ \| .__// -_)
|
||||
# |___/ \__||_||_|\___/|_| \___|
|
||||
|
||||
|
||||
BRANCH_NAME="master"
|
||||
|
||||
if [ -n "$1" ]; then
|
||||
BRANCH_NAME=$1
|
||||
fi
|
||||
|
||||
git checkout --orphan latest_branch
|
||||
|
||||
git add -A
|
||||
|
||||
git commit -am "Initial Commit"
|
||||
|
||||
git branch -D $BRANCH_NAME
|
||||
|
||||
git branch -m $BRANCH_NAME
|
||||
|
||||
git push -f origin $BRANCH_NAME
|
@@ -0,0 +1,8 @@
|
||||
mkdir -p /etc/systemd/system/docker.service.d/
|
||||
|
||||
cat << EOF > /etc/systemd/system/docker.service.d/startup_options.conf
|
||||
# /etc/systemd/system/docker.service.d/override.conf
|
||||
[Service]
|
||||
ExecStart=
|
||||
ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2376
|
||||
EOF
|
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
###################################
|
||||
############ by Sthope ############
|
||||
###################################
|
||||
|
||||
### Installing Docker on Ubuntu Server with Docker-Compose (by LinuxServer)
|
||||
|
||||
sudo apt-get remove docker docker-engine docker.io containerd runc
|
||||
|
||||
sudo apt-get install -y apt-transport-https ca-certificates curl gnupg lsb-release
|
||||
|
||||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
|
||||
|
||||
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||
|
||||
|
||||
sudo apt-get update
|
||||
|
||||
sudo apt-get upgrade -y
|
||||
|
||||
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
|
||||
|
||||
sudo groupadd docker
|
||||
|
||||
sudo usermod -aG docker $USER
|
||||
|
||||
sudo curl -L --fail https://raw.githubusercontent.com/linuxserver/docker-docker-compose/master/run.sh -o /usr/local/bin/docker-compose
|
||||
|
||||
sudo chmod +x /usr/local/bin/docker-compose
|
||||
|
||||
sudo reboot
|
16
custom-cmds-in-ubuntu/bin_examples/installing_python3.sh
Normal file
16
custom-cmds-in-ubuntu/bin_examples/installing_python3.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/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-examples/src/branch/master/custom-cmds-in-ubuntu/bin_examples/installing_python3.sh)"
|
||||
#
|
||||
sudo apt-get update
|
||||
sudo apt-get upgrade -y
|
||||
|
||||
sudo apt-get install -y python3-pip
|
16
custom-cmds-in-ubuntu/bin_examples/portainercli-config.sh
Normal file
16
custom-cmds-in-ubuntu/bin_examples/portainercli-config.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/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-examples/src/branch/master/custom-cmds-in-ubuntu/bin_examples/proxmox_addnewuser)" Username Password
|
||||
#
|
||||
|
||||
portainer-cli configure http://127.0.0.1:9000/
|
||||
portainer-cli login $1 $2
|
||||
portainer-cli -d request status
|
@@ -8,7 +8,7 @@
|
||||
## 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
|
||||
# bash -c "$(wget -qLO - https://git.sthope.dev/sthope/sthope-examples/src/branch/master/custom-cmds-in-ubuntu/bin_examples/proxmox_addnewuser)" Username Password
|
||||
#
|
||||
|
||||
apt-get update
|
||||
|
98
custom-cmds-in-ubuntu/bin_examples/system_info.sh
Normal file
98
custom-cmds-in-ubuntu/bin_examples/system_info.sh
Normal file
@@ -0,0 +1,98 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Log file for errors, warnings, and output
|
||||
log_file="system_info.log"
|
||||
|
||||
# Redirect both stdout and stderr to the log file
|
||||
exec > >(tee -a "$log_file") 2>&1
|
||||
|
||||
if ! command -v dmidecode &> /dev/null; then
|
||||
echo "dmidecode is not installed. Please install it." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Color escape codes
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
# Define a divider line
|
||||
divider="----------------------------------------------------------------------------------------------------------------------------------------------------------------------------"
|
||||
|
||||
# Function to print section header
|
||||
print_section_header() {
|
||||
echo "$divider"
|
||||
echo -e "${YELLOW}$1${NC}"
|
||||
echo "$divider"
|
||||
}
|
||||
|
||||
# Function to convert bytes to human-readable sizes
|
||||
human_readable_size() {
|
||||
num=$1
|
||||
unit=("B" "KB" "MB" "GB" "TB")
|
||||
index=0
|
||||
|
||||
while [ $num -ge 1024 ] && [ $index -lt 4 ]; do
|
||||
num=$((num / 1024))
|
||||
index=$((index + 1))
|
||||
done
|
||||
|
||||
echo "$num ${unit[$index]}"
|
||||
}
|
||||
|
||||
# Get system information
|
||||
hostname=$(hostname)
|
||||
kernel=$(uname -r)
|
||||
cpu=$(cat /proc/cpuinfo | grep "model name" | head -n 1 | cut -d ':' -f 2 | xargs)
|
||||
memory=$(free -b | grep "Mem:" | awk '{print $2}')
|
||||
disk=$(df -h / | awk 'NR==2{print $2}')
|
||||
uptime=$(uptime -p)
|
||||
ip_address=$(ip route get 1.1.1.1 | grep -oP 'src \K\S+')
|
||||
motherboard_brand=$(sudo dmidecode -s baseboard-manufacturer)
|
||||
motherboard=$(sudo dmidecode -s baseboard-product-name)
|
||||
gpu=$(lspci | grep -i vga | cut -d ":" -f3)
|
||||
audio=$(lspci | grep -i audio | cut -d ":" -f3)
|
||||
|
||||
# Create a timestamp for the filename
|
||||
# d=$(date +"%Y-%m-%d")
|
||||
# t=$(date +"%H-%M-%S")
|
||||
# filename="${hostname}_${d}_${t}.log"
|
||||
filename="${hostname}.log"
|
||||
|
||||
# Get the number of CPU cores
|
||||
cpu_cores=$(nproc)
|
||||
|
||||
# Write information to the file
|
||||
echo "System Information" > "$filename"
|
||||
print_section_header "System Information"
|
||||
echo "Hostname: $hostname" >> "$filename"
|
||||
echo "IP Address: $ip_address" >> "$filename"
|
||||
echo "Uptime: $uptime" >> "$filename"
|
||||
echo "Kernel Version: $kernel" >> "$filename"
|
||||
echo "CPU: $cpu ($cpu_cores cores)" >> "$filename" # Display CPU cores here
|
||||
echo "Memory: $(human_readable_size $memory)" >> "$filename"
|
||||
echo "Disk Space: $disk" >> "$filename"
|
||||
echo "Motherboard: $motherboard_brand $motherboard" >> "$filename"
|
||||
echo "GPU:$gpu" >> "$filename"
|
||||
echo "Audio:$audio" >> "$filename"
|
||||
echo "$divider" >> "$filename"
|
||||
|
||||
# System Health Check
|
||||
print_section_header "System Health Check"
|
||||
cpu_usage=$(top -n 1 -b | grep "%Cpu" | awk '{print $2}')
|
||||
memory_usage=$(free -m | awk 'NR==2{print $3}')
|
||||
disk_usage=$(df -h / | awk 'NR==2{print $5}')
|
||||
echo "CPU Usage: $cpu_usage%" >> "$filename"
|
||||
echo "Memory Usage: $memory_usage MB" >> "$filename"
|
||||
echo "Disk Usage: $disk_usage" >> "$filename"
|
||||
echo "$divider" >> "$filename"
|
||||
|
||||
# Installed Packages
|
||||
print_section_header "Installed Packages"
|
||||
installed_packages=$(dpkg -l) # or rpm -qa for Red Hat-based systems
|
||||
echo "Package Name | Version" >> "$filename"
|
||||
echo "$installed_packages" | awk 'NR>5{print}' >> "$filename" # Skip header lines
|
||||
echo "$divider" >> "$filename"
|
||||
|
||||
echo -e "${GREEN}System information saved to $filename${NC}"
|
@@ -1,2 +1,12 @@
|
||||
# docker_portainer_stacks
|
||||
# Docker Portainer Stacks
|
||||
|
||||
|
||||
### Creating macvlan Network in Docker
|
||||
|
||||
```
|
||||
docker network create -d macvlan \
|
||||
--subnet=192.168.1.0/24 \
|
||||
--gateway=192.168.1.1 \
|
||||
-o parent=eth0 \
|
||||
network
|
||||
```
|
@@ -2,11 +2,11 @@
|
||||
|
||||
Run on the terminal
|
||||
```
|
||||
bash -c "$(wget -qLO - https://git.sthope.dev/sthope/docker_portainer_stacks/raw/branch/master/docker-compose/docker-compose.sh)"
|
||||
bash -c "$(wget -qLO - https://git.sthope.dev/sthope/sthope-examples/src/branch/master/docker_portainer_stacks/raw/branch/master/docker-compose/docker-compose.sh)"
|
||||
```
|
||||
& (sudo user)
|
||||
```
|
||||
bash -c "$(wget -qLO - https://git.sthope.dev/sthope/docker_portainer_stacks/raw/branch/master/docker-compose/config.sh)"
|
||||
bash -c "$(wget -qLO - https://git.sthope.dev/sthope/sthope-examples/src/branch/master/docker_portainer_stacks/raw/branch/master/docker-compose/config.sh)"
|
||||
```
|
||||
|
||||
|
||||
|
17
docker_portainer_stacks/jenkins.yml
Normal file
17
docker_portainer_stacks/jenkins.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
version: "3.8"
|
||||
services:
|
||||
jenkins:
|
||||
image: jenkins/jenkins:latest
|
||||
container_name: jenkins
|
||||
hostname: jenkins
|
||||
network_mode: bridge
|
||||
ports:
|
||||
- 50000
|
||||
- 8080
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- jenkins_data:/var/jenkins_home
|
||||
|
||||
volumes:
|
||||
jenkins_data:
|
@@ -3,24 +3,24 @@
|
||||
|
||||
Download config env's
|
||||
```
|
||||
wget -q https://git.sthope.dev/sthope/docker_portainer_stacks/raw/branch/master/librenms/msmtpd.env; wget -q https://git.sthope.dev/sthope/docker_portainer_stacks/raw/branch/master/librenms/librenms.env
|
||||
wget -q https://git.sthope.dev/sthope/sthope-examples/src/branch/master/docker_portainer_stacks/raw/branch/master/librenms/msmtpd.env; wget -q https://git.sthope.dev/sthope/sthope-examples/src/branch/master/docker_portainer_stacks/raw/branch/master/librenms/librenms.env
|
||||
```
|
||||
|
||||
Download configs.env (edit with your configs)
|
||||
```
|
||||
wget -q https://git.sthope.dev/sthope/docker_portainer_stacks/raw/branch/master/librenms/.env
|
||||
wget -q https://git.sthope.dev/sthope/sthope-examples/src/branch/master/docker_portainer_stacks/raw/branch/master/librenms/.env
|
||||
```
|
||||
|
||||
Docker-Compose file
|
||||
```
|
||||
wget -q https://git.sthope.dev/sthope/docker_portainer_stacks/raw/branch/master/librenms/docker-compose.yml
|
||||
wget -q https://git.sthope.dev/sthope/sthope-examples/src/branch/master/docker_portainer_stacks/raw/branch/master/librenms/docker-compose.yml
|
||||
```
|
||||
|
||||
|
||||
All files
|
||||
```
|
||||
wget -q https://git.sthope.dev/sthope/docker_portainer_stacks/raw/branch/master/librenms/msmtpd.env; \
|
||||
wget -q https://git.sthope.dev/sthope/docker_portainer_stacks/raw/branch/master/librenms/librenms.env; \
|
||||
wget -q https://git.sthope.dev/sthope/docker_portainer_stacks/raw/branch/master/librenms/.env; \
|
||||
wget -q https://git.sthope.dev/sthope/docker_portainer_stacks/raw/branch/master/librenms/docker-compose.yml
|
||||
wget -q https://git.sthope.dev/sthope/sthope-examples/src/branch/master/docker_portainer_stacks/raw/branch/master/librenms/msmtpd.env; \
|
||||
wget -q https://git.sthope.dev/sthope/sthope-examples/src/branch/master/docker_portainer_stacks/raw/branch/master/librenms/librenms.env; \
|
||||
wget -q https://git.sthope.dev/sthope/sthope-examples/src/branch/master/docker_portainer_stacks/raw/branch/master/librenms/.env; \
|
||||
wget -q https://git.sthope.dev/sthope/sthope-examples/src/branch/master/docker_portainer_stacks/raw/branch/master/librenms/docker-compose.yml
|
||||
```
|
23
docker_portainer_stacks/mqtt-explorer.yml
Normal file
23
docker_portainer_stacks/mqtt-explorer.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
---
|
||||
version: "3.8"
|
||||
|
||||
volumes:
|
||||
mqttexplorer:
|
||||
|
||||
services:
|
||||
mqtt-explorer:
|
||||
image: smeagolworms4/mqtt-explorer:latest
|
||||
container_name: mqtt-explorer
|
||||
environment:
|
||||
- PUID=1000
|
||||
- PGID=1000
|
||||
- TZ=Europe/Amsterdam
|
||||
- HTTP_PORT=4000
|
||||
- CONFIG_PATH=/mqtt-explorer/config
|
||||
volumes:
|
||||
- mqttexplorer:/mqtt-explorer/config
|
||||
ports:
|
||||
- 4000:4000
|
||||
restart: unless-stopped
|
||||
labels:
|
||||
- com.centurylinklabs.watchtower.enable=true
|
13
docker_portainer_stacks/mysteriumnetwork/myst_server.yml
Normal file
13
docker_portainer_stacks/mysteriumnetwork/myst_server.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
version: "3.8"
|
||||
services:
|
||||
mysterium_vpn:
|
||||
image: mysteriumnetwork/myst:latest
|
||||
container_name: mysterium_vpn
|
||||
network_mode: host
|
||||
commands: service --agreed-terms-and-conditions
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
restart: unless-stopped
|
||||
labels:
|
||||
- com.centurylinklabs.watchtower.enable=true
|
21
docker_portainer_stacks/octoprint.yml
Normal file
21
docker_portainer_stacks/octoprint.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
version: '3.8'
|
||||
|
||||
volumes:
|
||||
octoprint:
|
||||
|
||||
services:
|
||||
octoprint:
|
||||
image: octoprint/octoprint:latest
|
||||
container_name: octoprint
|
||||
network_mode: bridge
|
||||
restart: unless-stopped
|
||||
user: 1000:1000
|
||||
volumes:
|
||||
- octoprint:/octoprint
|
||||
# devices:
|
||||
# - /dev/ttyUSB0:/dev/ttyUSB0
|
||||
ports:
|
||||
- 80:80
|
||||
labels:
|
||||
- com.centurylinklabs.watchtower.enable=true
|
@@ -0,0 +1,38 @@
|
||||
---
|
||||
version: "3.8"
|
||||
|
||||
networks:
|
||||
nginx:
|
||||
external: true
|
||||
name: nginx
|
||||
|
||||
services:
|
||||
omada_controller:
|
||||
image: mbentley/omada-controller:latest
|
||||
container_name: omada_controller
|
||||
networks:
|
||||
- nginx
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- MANAGE_HTTP_PORT=8088
|
||||
- MANAGE_HTTPS_PORT=8043
|
||||
- PORTAL_HTTP_PORT=8088
|
||||
- PORTAL_HTTPS_PORT=8843
|
||||
- SHOW_SERVER_LOGS=true
|
||||
- SHOW_MONGODB_LOGS=false
|
||||
- TZ=Europe/Lisbon
|
||||
volumes:
|
||||
- /docker/omada/data:/opt/tplink/EAPController/data
|
||||
- /docker/omada/work:/opt/tplink/EAPController/work
|
||||
- /docker/omada/logs:/opt/tplink/EAPController/logs
|
||||
ports:
|
||||
- 8088:8088
|
||||
- 8043:8043
|
||||
- 8843:8843
|
||||
- 29810:29810/udp
|
||||
- 29811:29811
|
||||
- 29812:29812
|
||||
- 29813:29813
|
||||
- 29814:29814
|
||||
labels:
|
||||
- com.centurylinklabs.watchtower.enable=true
|
@@ -0,0 +1,35 @@
|
||||
---
|
||||
version: "3.8"
|
||||
services:
|
||||
omada_controller:
|
||||
image: mbentley/omada-controller:5.0
|
||||
container_name: omada_controller
|
||||
network_mode: host
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- TZ=Europe/Lisbon
|
||||
- MANAGE_HTTP_PORT=8088
|
||||
- MANAGE_HTTPS_PORT=8043
|
||||
- PORTAL_HTTP_PORT=8088
|
||||
- PORTAL_HTTPS_PORT=8843
|
||||
- SHOW_SERVER_LOGS=true
|
||||
- SHOW_MONGODB_LOGS=false
|
||||
# - SSL_CERT_NAME="tls.crt"
|
||||
# - SSL_KEY_NAME="tls.key"
|
||||
volumes:
|
||||
- omada-data:/opt/tplink/EAPController/data
|
||||
- omada-work:/opt/tplink/EAPController/work
|
||||
- omada-logs:/opt/tplink/EAPController/logs
|
||||
ports:
|
||||
- 8088:8088
|
||||
- 8043:8043
|
||||
labels:
|
||||
- com.centurylinklabs.watchtower.enable=true
|
||||
|
||||
volumes:
|
||||
omada-data:
|
||||
external: false
|
||||
omada-work:
|
||||
external: false
|
||||
omada-logs:
|
||||
external: false
|
21
docker_portainer_stacks/ombi.yml
Normal file
21
docker_portainer_stacks/ombi.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
version: "3.8"
|
||||
services:
|
||||
ombi:
|
||||
image: ghcr.io/linuxserver/ombi:latest
|
||||
container_name: ombi
|
||||
network_mode: HTPC
|
||||
environment:
|
||||
- PUID=1000
|
||||
- PGID=1000
|
||||
- TZ=Europe/Amsterdam
|
||||
volumes:
|
||||
- ombi_data:/config
|
||||
ports:
|
||||
- 3579:3579
|
||||
restart: unless-stopped
|
||||
labels:
|
||||
- com.centurylinklabs.watchtower.enable=true
|
||||
|
||||
volumes:
|
||||
ombi_data:
|
27
docker_portainer_stacks/openssh-server.yml
Normal file
27
docker_portainer_stacks/openssh-server.yml
Normal file
@@ -0,0 +1,27 @@
|
||||
---
|
||||
version: "3.8"
|
||||
services:
|
||||
openssh-server:
|
||||
image: ghcr.io/linuxserver/openssh-server
|
||||
container_name: openssh-server
|
||||
hostname: openssh-server #optional
|
||||
environment:
|
||||
- PUID=1000
|
||||
- PGID=1000
|
||||
- TZ=Europe/Amsterdam
|
||||
- PUBLIC_KEY=yourpublickey #optional
|
||||
- PUBLIC_KEY_FILE=/path/to/file #optional
|
||||
- PUBLIC_KEY_DIR=/path/to/directory/containing/_only_/pubkeys #optional
|
||||
- SUDO_ACCESS=false #optional
|
||||
- PASSWORD_ACCESS=false #optional
|
||||
- USER_PASSWORD=password #optional
|
||||
- USER_PASSWORD_FILE=/path/to/file #optional
|
||||
- USER_NAME=linuxserver.io #optional
|
||||
volumes:
|
||||
- openssh-server-config:/config
|
||||
ports:
|
||||
- 2222:2222
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
openssh-server-config:
|
@@ -3,18 +3,18 @@
|
||||
Docker-compose stack with Portainer, VSCode, WatchTower
|
||||
Install with 1 line cmd (running as sudo/root)
|
||||
```
|
||||
clear;bash -c "$(wget -qLO - https://git.sthope.dev/sthope/docker_portainer_stacks/raw/branch/master/portainer/script/install_nosudo)"
|
||||
clear;bash -c "$(wget -qLO - https://git.sthope.dev/sthope/sthope-examples/src/branch/master/docker_portainer_stacks/raw/branch/master/portainer/script/install_nosudo)"
|
||||
```
|
||||
|
||||
download docker-compose.yml with:
|
||||
```
|
||||
wget https://git.sthope.dev/sthope/docker_portainer_stacks/raw/branch/master/portainer/docker-compose.yml
|
||||
wget https://git.sthope.dev/sthope/sthope-examples/src/branch/master/docker_portainer_stacks/raw/branch/master/portainer/docker-compose.yml
|
||||
```
|
||||
|
||||
# Portainer Agent
|
||||
|
||||
```
|
||||
bash -c "$(wget -qLO - https://git.sthope.dev/sthope/docker_portainer_stacks/raw/branch/master/portainer/install-portainer-agent)" EDGE_ID EDGE_KEY
|
||||
bash -c "$(wget -qLO - https://git.sthope.dev/sthope/sthope-examples/src/branch/master/docker_portainer_stacks/raw/branch/master/portainer/install-portainer-agent)" EDGE_ID EDGE_KEY
|
||||
```
|
||||
Replace `EDGE_ID` and `EDGE_KEY` with ones given by Portainer
|
||||
|
||||
|
@@ -1,11 +1,12 @@
|
||||
#!/bin/bash
|
||||
###################################
|
||||
############ by Sthope ############
|
||||
###################################
|
||||
# ___ _ _ _ __
|
||||
# / __|| |_ | |_ ___ | '_ \ ___
|
||||
# \__ \| _|| \ / _ \| .__// -_)
|
||||
# |___/ \__||_||_|\___/|_| \___|
|
||||
|
||||
|
||||
#### USAGE
|
||||
# bash -c "$(wget -qLO - https://git.sthope.dev/sthope/sthope-examples/raw/branch/master/docker_portainer_stacks/portainer/install-portainer-agent)" EDGE_ID EDGE_KEY
|
||||
#
|
||||
# bash -c "$(wget -qLO - https://git.sthope.dev/sthope/sthope-examples/src/branch/master/docker_portainer_stacks/raw/branch/master/portainer/install-portainer-agent)" EDGE_ID EDGE_KEY
|
||||
|
||||
sudo docker run -d \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
@@ -18,5 +19,6 @@ sudo docker run -d \
|
||||
-e EDGE_KEY=${2} \
|
||||
-e CAP_HOST_MANAGEMENT=1 \
|
||||
--label=hide_container=true \
|
||||
--label=com.centurylinklabs.watchtower.enable=true \
|
||||
--name portainer_edge_agent \
|
||||
portainer/agent
|
||||
portainer/agent
|
@@ -0,0 +1,72 @@
|
||||
#!/bin/bash
|
||||
# ___ _ _ _ __
|
||||
# / __|| |_ | |_ ___ | '_ \ ___
|
||||
# \__ \| _|| \ / _ \| .__// -_)
|
||||
# |___/ \__||_||_|\___/|_| \___|
|
||||
|
||||
|
||||
#### USAGE
|
||||
# bash -c "$(wget -qLO - https://git.sthope.dev/sthope/sthope-examples/src/branch/master/docker_portainer_stacks/raw/branch/master/portainer/install-portainer-agent)" EDGE_ID EDGE_KEY
|
||||
|
||||
EDGE_ID=1
|
||||
EDGE_KEY=2
|
||||
NETWORK=3
|
||||
TAG=4
|
||||
DOCKER_FILE="./test123.log"
|
||||
SAVE_IN='echo -e '
|
||||
SAVE_OUT=''
|
||||
|
||||
|
||||
# cat > ./test_file.log <<EOF
|
||||
# docker run -d \
|
||||
# -v /var/run/docker.sock:/var/run/docker.sock \
|
||||
# -v /var/lib/docker/volumes:/var/lib/docker/volumes \
|
||||
# -v /:/host \
|
||||
# -v portainer_agent_data:/data \
|
||||
# --restart always \
|
||||
# --network= ${NETWORK}
|
||||
# -e EDGE=1 \
|
||||
# -e EDGE_ID=${EDGE_ID} \
|
||||
# -e EDGE_KEY=${EDGE_KEY} \
|
||||
# -e EDGE_INSECURE_POLL=1 \
|
||||
# --name portainer_edge_agent \
|
||||
# portainer/agent:${TAG}
|
||||
# EOF
|
||||
|
||||
|
||||
# if [ -f ${DOCKER_FILE} ];
|
||||
# thenSAVE_IN
|
||||
# echo "File already exist"
|
||||
# else
|
||||
# cat >> ${DOCKER_FILE} <<EOF
|
||||
# docker run -d \
|
||||
# -v /var/run/docker.sock:/var/run/docker.sock \
|
||||
# -v /var/lib/docker/volumes:/var/lib/docker/volumes \
|
||||
# -v /:/host \
|
||||
# -v portainer_agent_data:/data \
|
||||
# --restart always \
|
||||
# --network= ${NETWORK}
|
||||
# -e EDGE=1 \
|
||||
# -e EDGE_ID=${EDGE_ID} \
|
||||
# -e EDGE_KEY=${EDGE_KEY} \
|
||||
# -e EDGE_INSECURE_POLL=1 \
|
||||
# --name portainer_edge_agent \
|
||||
# portainer/agent:${TAG}
|
||||
# EOF
|
||||
# fi
|
||||
|
||||
# clear;cat <<EOF
|
||||
# docker run -d \
|
||||
# -v /var/run/docker.sock:/var/run/docker.sock \
|
||||
# -v /var/lib/docker/volumes:/var/lib/docker/volumes \
|
||||
# -v /:/host \
|
||||
# -v portainer_agent_data:/data \
|
||||
# --restart always \
|
||||
# --network= ${NETWORK}
|
||||
# -e EDGE=1 \
|
||||
# -e EDGE_ID=${EDGE_ID} \
|
||||
# -e EDGE_KEY=${EDGE_KEY} \
|
||||
# -e EDGE_INSECURE_POLL=1 \
|
||||
# --name portainer_edge_agent \
|
||||
# portainer/agent:${TAG}
|
||||
# EOF
|
@@ -8,17 +8,17 @@
|
||||
## sudo chmod +x ~/bin/*;su -l $USER
|
||||
|
||||
#### USAGE
|
||||
# bash -c "$(wget -qLO - https://git.sthope.dev/sthope/docker_portainer_stacks/raw/branch/master/portainer/script/install_nosudo)"
|
||||
# bash -c "$(wget -qLO - https://git.sthope.dev/sthope/sthope-examples/src/branch/master/docker_portainer_stacks/raw/branch/master/portainer/script/install_nosudo)"
|
||||
#
|
||||
|
||||
apt-get update
|
||||
apt-get upgrade -y
|
||||
|
||||
bash -c "$(wget -qLO - https://git.sthope.dev/sthope/docker_portainer_stacks/raw/branch/master/docker-compose/config.sh)"
|
||||
bash -c "$(wget -qLO - https://git.sthope.dev/sthope/sthope-examples/src/branch/master/docker_portainer_stacks/raw/branch/master/docker-compose/config.sh)"
|
||||
|
||||
mkdir -p /docker/portainer
|
||||
mkdir -p /docker/vscode
|
||||
|
||||
wget https://git.sthope.dev/sthope/docker_portainer_stacks/raw/branch/master/portainer/docker-compose.yml -P /docker/
|
||||
wget https://git.sthope.dev/sthope/sthope-examples/src/branch/master/docker_portainer_stacks/raw/branch/master/portainer/docker-compose.yml -P /docker/
|
||||
|
||||
cd /test/;docker-compose up -d
|
17
docker_portainer_stacks/registry.yml
Normal file
17
docker_portainer_stacks/registry.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
version: "3.8"
|
||||
services:
|
||||
docker-hub:
|
||||
image: registry:${tag:-2}
|
||||
container_name: docker-hub
|
||||
environment:
|
||||
- PUID=${PUID:-1000}
|
||||
- PGID=${PGID:-1000}
|
||||
- TZ=${TZ:-Europe/Amsterdam}
|
||||
volumes:
|
||||
- ${volume_docker_hub:-/docker/registry}:/var/lib/registry
|
||||
ports:
|
||||
- ${port_http:-5000}:5000
|
||||
restart: ${restart:-always}
|
||||
labels:
|
||||
- com.centurylinklabs.watchtower.enable=${WATCHTOWER_AUTO_UPDATE:-true}
|
18
docker_portainer_stacks/stash.yml
Normal file
18
docker_portainer_stacks/stash.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
version: "3.8"
|
||||
services:
|
||||
stash:
|
||||
container_name: stash
|
||||
image: cr.hotio.dev/hotio/stash
|
||||
restart: unless-stopped
|
||||
network_mode: bridge
|
||||
ports:
|
||||
- "9999:9999"
|
||||
environment:
|
||||
- PUID=1000
|
||||
- PGID=1000
|
||||
- UMASK=002
|
||||
- TZ=Europe/Amsterdam
|
||||
volumes:
|
||||
- /stash:/config
|
||||
labels:
|
||||
- com.centurylinklabs.watchtower.enable=true
|
21
docker_portainer_stacks/syslog-ng.yml
Normal file
21
docker_portainer_stacks/syslog-ng.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
version: "3.8"
|
||||
services:
|
||||
syslog-ng:
|
||||
image: ghcr.io/linuxserver/syslog-ng:latest
|
||||
container_name: syslog-ng
|
||||
network_mode: bridge
|
||||
environment:
|
||||
- PUID=1000
|
||||
- PGID=1000
|
||||
- TZ=Europe/Amsterdam
|
||||
volumes:
|
||||
- /path/to/config:/config
|
||||
- /path/to/log:/var/log
|
||||
ports:
|
||||
- 514:5514/udp
|
||||
- 601:6601/tcp
|
||||
- 6514:6514/tcp
|
||||
restart: unless-stopped
|
||||
labels:
|
||||
- com.centurylinklabs.watchtower.enable=true
|
20
docker_portainer_stacks/tvheadend.yml
Normal file
20
docker_portainer_stacks/tvheadend.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
version: "3.8"
|
||||
services:
|
||||
tvheadend:
|
||||
image: lscr.io/linuxserver/tvheadend:latest
|
||||
container_name: tvheadend
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- PUID=1000
|
||||
- PGID=1000
|
||||
- TZ=Europe/Amsterdam
|
||||
# - RUN_OPTS=<run options here> #optional
|
||||
volumes:
|
||||
- /tvheadend/config:/config
|
||||
- /tvheadend/recordings:/recordings
|
||||
ports:
|
||||
- 9981:9981
|
||||
- 9982:9982
|
||||
# devices:
|
||||
# - /dev/dri:/dev/dri
|
20
docker_portainer_stacks/whisparr.yaml
Normal file
20
docker_portainer_stacks/whisparr.yaml
Normal file
@@ -0,0 +1,20 @@
|
||||
version: "3.8"
|
||||
services:
|
||||
whisparr:
|
||||
container_name: whisparr
|
||||
image: cr.hotio.dev/hotio/whisparr:nightly
|
||||
network_mode: bridge
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "6969:6969"
|
||||
environment:
|
||||
- PUID=1000
|
||||
- PGID=1000
|
||||
- UMASK=002
|
||||
- TZ=Europe/Amsterdam
|
||||
volumes:
|
||||
- /HTPC/htpc/whisparr:/config
|
||||
- /HTPC/downloads:/downloads
|
||||
- /HTPC/media/xxx:/xxx
|
||||
labels:
|
||||
- com.centurylinklabs.watchtower.enable=true
|
@@ -1 +1,55 @@
|
||||
# .drone.yml
|
||||
# .drone.yml
|
||||
|
||||
## Docker Pipeline
|
||||
|
||||
### Example Docker Configuration
|
||||
This guide covers configuring continuous integration pipelines for projects that have a Docker dependency. If you’re new to Drone please read our Tutorial and build configuration guides first.
|
||||
|
||||
### Basic Example
|
||||
In the below example we demonstrate a pipeline that connects to the host machine Docker daemon by mounting a volume. For security reasons, only trusted repositories can mount volumes. Furthermore, mounting the host machine Docker socket is highly insecure, and should only be used in trusted environments.
|
||||
```yaml
|
||||
---
|
||||
kind: pipeline
|
||||
name: default
|
||||
|
||||
steps:
|
||||
- name: test
|
||||
image: docker:dind
|
||||
volumes:
|
||||
- name: dockersock
|
||||
path: /var/run/docker.sock
|
||||
commands:
|
||||
- docker ps -a
|
||||
|
||||
volumes:
|
||||
- name: dockersock
|
||||
host:
|
||||
path: /var/run/docker.sock
|
||||
...
|
||||
```
|
||||
|
||||
# SSH
|
||||
|
||||
```yaml
|
||||
---
|
||||
kind: pipeline
|
||||
name: ssh deploy
|
||||
|
||||
steps:
|
||||
- name: ssh commands
|
||||
image: appleboy/drone-ssh
|
||||
settings:
|
||||
host:
|
||||
from_secret: host
|
||||
username:
|
||||
from_secret: username
|
||||
password:
|
||||
from_secret: password
|
||||
port: 22
|
||||
script:
|
||||
- docker run --rm sthopeless/randompwd
|
||||
- docker image rm sthopeless/randompwd:latest
|
||||
- mkdir ~/test
|
||||
- rm -r ~/test
|
||||
- echo "This is a test."
|
||||
```
|
22
yq/README.md
Normal file
22
yq/README.md
Normal file
@@ -0,0 +1,22 @@
|
||||
## 1Line command:
|
||||
```
|
||||
bash -c "$(wget -qLO - https://git.sthope.dev/sthope/sthope-examples/raw/branch/master/yq/ha_faking_secrets_with_docker.sh)"
|
||||
```
|
||||
---
|
||||
|
||||
## Install YQ latest version:
|
||||
```
|
||||
bash -c "$(wget -qLO - https://git.sthope.dev/sthope/sthope-examples/raw/branch/master/yq/install_yq_latest_version.sh)"
|
||||
```
|
||||
---
|
||||
|
||||
## enter your HA folder and do:
|
||||
```
|
||||
bash -c "$(wget -qLO - https://git.sthope.dev/sthope/sthope-examples/raw/branch/master/yq/ha_faking_secrets.sh.sh.sh)"
|
||||
```
|
||||
---
|
||||
|
||||
## to also Git Push use:
|
||||
```
|
||||
bash -c "$(wget -qLO - https://git.sthope.dev/sthope/sthope-examples/raw/branch/master/yq/ha_faking_secrets_with_gitpush.sh.sh)"
|
||||
```
|
23
yq/ha_faking_secrets.sh
Normal file
23
yq/ha_faking_secrets.sh
Normal file
@@ -0,0 +1,23 @@
|
||||
###################################
|
||||
############ 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
|
||||
#
|
||||
#
|
||||
|
||||
### fake passwords
|
||||
yq eval '.[] = "fake_password"' secrets.yaml > fake_pwds.yaml
|
||||
|
||||
### fake ips
|
||||
yq eval '(.[] | select(. == "*.*.*.*")) |= "127.0.0.1"' secrets.yaml > fake_ips.yaml
|
||||
|
||||
### merging all into one
|
||||
yq eval-all 'select(fi == 0) * select(filename == "fake_ips.yaml")' fake_pwds.yaml fake_ips.yaml > fake_secrets.yaml
|
||||
|
||||
### clean up..
|
||||
rm fake_pwds.yaml fake_ips.yaml
|
33
yq/ha_faking_secrets_with_docker.sh
Normal file
33
yq/ha_faking_secrets_with_docker.sh
Normal file
@@ -0,0 +1,33 @@
|
||||
###################################
|
||||
############ 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
|
||||
#
|
||||
#
|
||||
|
||||
yq() {
|
||||
docker run --rm -i -v "${PWD}":/workdir mikefarah/yq "$@"
|
||||
}
|
||||
|
||||
yq eval '... comments=""' secrets.yaml > no_comments.yaml
|
||||
|
||||
yq eval 'del( .[] | select(. != "*gmail*") )' no_comments.yaml > e.yaml
|
||||
yq eval 'del( .[] | select(. != "*http*") )' no_comments.yaml > http.yaml
|
||||
yq eval 'del( .[] | select(. != "*rtsp*") )' no_comments.yaml >> http.yaml
|
||||
yq eval 'del( .[] | select(. != "192*") )' no_comments.yaml > ips.yaml
|
||||
yq eval '.[] = "fake_password"' no_comments.yaml > fake_pwds.yaml; rm no_comments.yaml
|
||||
|
||||
|
||||
yq eval '.[] = "please@dont.try"' e.yaml > emails.yaml; rm e.yaml
|
||||
yq eval '.[] = "http://not_that_easy.com"' http.yaml > urls.yaml; rm http.yaml
|
||||
yq eval '.[] = "127.0.0.1"' ips.yaml > ip.yaml; rm ips.yaml
|
||||
|
||||
|
||||
yq eval-all 'select(fileIndex == 0) * select(fileIndex == 1)' emails.yaml urls.yaml > 1.yaml; rm emails.yaml urls.yaml
|
||||
yq eval-all 'select(fileIndex == 0) * select(fileIndex == 1)' 1.yaml ip.yaml > 2.yaml;rm 1.yaml ip.yaml
|
||||
yq eval-all 'select(fileIndex == 0) * select(fileIndex == 1)' fake_pwds.yaml 2.yaml > fake_secrets.yaml;rm fake_pwds.yaml 2.yaml
|
39
yq/ha_faking_secrets_with_gitpush.sh
Normal file
39
yq/ha_faking_secrets_with_gitpush.sh
Normal file
@@ -0,0 +1,39 @@
|
||||
#!/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
|
||||
# cd into Home Assistant folder and run: ha_faking_secrets
|
||||
# Add secrets.yaml to your .gitignore file
|
||||
|
||||
### fake passwords
|
||||
yq eval '.[] = "fake_password"' secrets.yaml > fake_pwds.yaml
|
||||
|
||||
### fake ips
|
||||
yq eval '(.[] | select(. == "*.*.*.*")) |= "127.0.0.1"' secrets.yaml > fake_ips.yaml
|
||||
|
||||
### merging all into one
|
||||
yq eval-all 'select(fi == 0) * select(filename == "fake_ips.yaml")' fake_pwds.yaml fake_ips.yaml > fake_secrets.yaml
|
||||
|
||||
### clean up..
|
||||
rm fake_pwds.yaml fake_ips.yaml
|
||||
|
||||
### Git Push
|
||||
git add .
|
||||
|
||||
echo 'Commit msg:'
|
||||
read commitMessage
|
||||
|
||||
git commit -m "$commitMessage"
|
||||
|
||||
echo 'Branch name:'
|
||||
read branch
|
||||
|
||||
git push origin $branch
|
||||
|
||||
read
|
18
yq/install_yq_latest_version.sh
Normal file
18
yq/install_yq_latest_version.sh
Normal file
@@ -0,0 +1,18 @@
|
||||
###################################
|
||||
############ 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
|
||||
#
|
||||
#
|
||||
|
||||
VERSION=$(curl -s "https://api.github.com/repos/mikefarah/yq/releases/latest" | awk -F '"' '/tag_name/{print $4}')
|
||||
BINARY=yq_linux_amd64
|
||||
|
||||
### Download
|
||||
wget -q https://github.com/mikefarah/yq/releases/download/${VERSION}/${BINARY}.tar.gz -O - |\
|
||||
tar xz && mv ${BINARY} /usr/bin/yq
|
Reference in New Issue
Block a user