Compare commits

...

73 Commits

Author SHA1 Message Date
202c5cdf3d Add custom-cmds-in-ubuntu/bin_examples/README.md 2023-08-08 20:04:42 +02:00
934ab849a3 Add custom-cmds-in-ubuntu/bin_examples/system_info.sh 2023-08-08 20:02:29 +02:00
e50532d608 Add custom-cmds-in-ubuntu/bin_examples/git_remove_commits_history 2023-07-30 19:50:36 +02:00
fdc8ca56b7 update 2022-08-14 11:05:09 +02:00
69472df977 update 2022-08-14 11:05:03 +02:00
718c25bf3c Add 'custom-cmds-in-ubuntu/bin_examples/autouser' 2022-04-17 16:21:39 +02:00
6acbc825b6 Update 'docker_portainer_stacks/stash.yml' 2022-04-17 10:14:57 +02:00
e5ddc9f1e3 Add 'docker_portainer_stacks/stash.yml' 2022-04-17 10:14:40 +02:00
9e41abfe41 Update 'docker_portainer_stacks/whisparr.yaml' 2022-04-17 10:14:19 +02:00
3a81f9668b Add 'docker_portainer_stacks/tvheadend.yml' 2022-04-17 10:06:10 +02:00
3172cd0f66 Add 'docker_portainer_stacks/whisparr.yaml' 2022-04-17 10:00:49 +02:00
73da3c67ca Delete 'docker_portainer_stacks/whisparr.yaml' 2022-04-17 09:59:56 +02:00
5af6241f6d Add 'docker_portainer_stacks/whisparr.yaml' 2022-04-17 09:53:57 +02:00
25f7af29e7 Update 'docker_portainer_stacks/mqtt-explorer.yml' 2022-02-05 09:23:23 +00:00
7a549537c2 Add 'docker_portainer_stacks/mqtt-explorer.yml' 2022-02-05 09:22:36 +00:00
5f37da00c9 Add 'docker_portainer_stacks/octoprint.yml' 2022-02-03 18:43:05 +00:00
6e89d81187 Update 'docker_portainer_stacks/omada_controller/omada_controller.yml' 2022-01-29 16:35:18 +00:00
6879cab723 Update 'docker_portainer_stacks/omada_controller/omada_controller.yml' 2022-01-29 16:31:13 +00:00
8f5159adf5 Update 'docker_portainer_stacks/omada_controller/omada_controller.yml' 2022-01-29 16:30:48 +00:00
e0e87399d0 Add 'docker_portainer_stacks/mysteriumnetwork/myst_server.yml' 2022-01-29 16:21:54 +00:00
43bbd98ef6 Add 'docker_portainer_stacks/omada_controller/omada_controller.yml' 2022-01-29 16:14:40 +00:00
517de66369 Update 'docker_portainer_stacks/omada_controller/omada_controller_test.yml' 2022-01-29 16:14:07 +00:00
cf462e2d79 Update 'docker_portainer_stacks/omada_controller/omada_controller.yml' 2022-01-29 15:31:12 +00:00
99cf15801a Update 'docker_portainer_stacks/omada_controller.yml' 2022-01-29 15:28:34 +00:00
7f95245e8a Update 'docker_portainer_stacks/omada_controller.yml' 2022-01-29 15:24:00 +00:00
4802a7b1e6 Add 'docker_portainer_stacks/omada_controller.yml' 2022-01-29 15:19:08 +00:00
721208c975 Update 'docker_portainer_stacks/portainer/install-portainer-agent' 2022-01-29 13:21:30 +00:00
28038dfe06 Add 'custom-cmds-in-ubuntu/bin_examples/get_pc_details.sh' 2021-11-13 18:29:59 +01:00
48160eccb6 Add 'custom-cmds-in-ubuntu/bin_examples/check_max_ram.sh' 2021-11-13 17:25:58 +01:00
sthope
4dda5fafc9 Add 'custom-cmds-in-ubuntu/bin_examples/installing_docker_ubuntuserver.sh' 2021-09-23 16:49:15 +02:00
sthope
5e6f30590d Update 'docker_portainer_stacks/syslog-ng.yml' 2021-09-19 13:16:16 +02:00
sthope
dc93490939 Add 'docker_portainer_stacks/syslog-ng.yml' 2021-09-19 13:14:14 +02:00
sthope
9d0c7c876f Update 'docker_portainer_stacks/registry.yml' 2021-09-15 19:06:38 +02:00
sthope
ce4dc744ae Add 'docker_portainer_stacks/registry.yml' 2021-09-15 19:04:37 +02:00
sthope
6801217980 Update 'docker_portainer_stacks/jenkins.yml' 2021-09-13 23:22:46 +02:00
sthope
f577dd7177 Add 'docker_portainer_stacks/jenkins.yml' 2021-09-13 23:20:12 +02:00
sthope
75061e740c Update 'docker_portainer_stacks/ombi.yml' 2021-09-08 18:57:04 +02:00
sthope
d3e208661a Add 'docker_portainer_stacks/ombi.yml' 2021-09-08 18:54:17 +02:00
sthope
32e41b30ef Update 'yq/ha_faking_secrets_with_docker.sh' 2021-09-06 22:10:02 +02:00
sthope
5d749419be Update 'yq/README.md' 2021-09-06 15:34:22 +02:00
sthope
e433f6c05c Update 'yq/README.md' 2021-09-06 15:33:28 +02:00
sthope
8edbcfacdf Add 'yq/ha_faking_secrets_with_docker.sh' 2021-09-06 15:32:20 +02:00
sthope
25c5fa4a6f Update 'README.md' 2021-09-06 15:02:08 +02:00
sthope
f93c33d8df Update 'yq/README.md' 2021-09-06 14:57:57 +02:00
sthope
34fa438724 Update 'README.md' 2021-09-06 14:55:54 +02:00
sthope
f609d33974 Update 'README.md' 2021-09-06 14:54:39 +02:00
sthope
b5319e4612 Update 'README.md' 2021-09-06 14:53:31 +02:00
sthope
fac8e343c0 Update 'README.md' 2021-09-06 14:51:57 +02:00
sthope
8e5b8e8a95 Update 'README.md' 2021-09-06 14:50:53 +02:00
sthope
7576381f11 Update 'yq/README.md' 2021-09-06 14:09:21 +02:00
sthope
8763521710 Update 'yq/install_yq_latest_version.sh' 2021-09-06 14:06:55 +02:00
sthope
be3e02dff5 Add 'yq/install_yq_latest_version.sh' 2021-09-06 14:06:48 +02:00
sthope
618483fedb Update 'yq/ha_faking_secrets.sh' 2021-09-06 13:48:45 +02:00
sthope
68d26461b3 Update 'yq/ha_faking_secrets_with_gitpush.sh' 2021-09-06 13:48:35 +02:00
sthope
d92aa46552 Update 'yq/README.md' 2021-09-06 13:47:59 +02:00
sthope
acf6427dcc Update 'yq/1.sh' 2021-09-06 13:46:50 +02:00
sthope
6b6570af75 Update 'yq/1.sh' 2021-09-06 13:46:12 +02:00
sthope
0b157e4289 Add 'yq/1.sh' 2021-09-06 13:44:41 +02:00
sthope
6c4f927459 Add 'yq/README.md' 2021-09-06 13:42:59 +02:00
sthope
13f22fef94 Add 'yq/ha_faking_secrets.sh' 2021-09-06 13:39:52 +02:00
sthope
f121bfa66b Add 'custom-cmds-in-ubuntu/bin_examples/portainercli-config.sh' 2021-09-05 15:56:20 +02:00
sthope
02ffc6792f Add 'custom-cmds-in-ubuntu/bin_examples/installing_python3.sh' 2021-09-05 15:49:15 +02:00
sthope
0a2806daf5 Update 'docker_portainer_stacks/README.md' 2021-09-05 00:54:02 +02:00
sthope
d8605dcc9e Update 'docker_portainer_stacks/README.md' 2021-09-05 00:53:37 +02:00
sthope
05c9b0a7a0 Add 'docker_portainer_stacks/openssh-server.yml' 2021-09-04 23:07:56 +02:00
sthope
3d68e66445 Update 'README.md' 2021-09-04 21:15:38 +02:00
sthope
f5a7483840 Update 'README.md' 2021-09-04 21:15:23 +02:00
sthope
ff50060a61 Update 'drone-ci/README.md' 2021-09-04 20:08:15 +02:00
sthope
d98a7a2b6c Update 'drone-ci/README.md' 2021-09-04 19:50:17 +02:00
sthope
af992a38c5 Update 'drone-ci/README.md' 2021-09-04 18:04:57 +02:00
3cbfb7c0ad initial commit 2021-09-04 02:34:32 +02:00
2e65790426 initial commit 2021-09-04 02:34:06 +02:00
1e7341007a initial commit 2021-09-04 02:33:44 +02:00
40 changed files with 874 additions and 26 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
.scripts/
.scripts/

View File

@@ -1 +1 @@
# Sthope.dev
# Sthope Scripts Examples

View 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)"
```

View 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

View 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

View File

@@ -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

View 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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View 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

View 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

View File

@@ -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

View 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}"

View File

@@ -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
```

View File

@@ -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)"
```

View 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:

View File

@@ -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
```

View 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

View 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

View 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

View File

@@ -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

View File

@@ -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

View 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:

View 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:

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View 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}

View 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

View 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

View 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

View 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

View File

@@ -1 +1,55 @@
# .drone.yml
## Docker Pipeline
### Example Docker Configuration
This guide covers configuring continuous integration pipelines for projects that have a Docker dependency. If youre 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
View 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
View 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

View 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

View 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

View 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