commit
1e25e36ce6
195 files changed
+152301
No files matched your search
@@ -0,0 +1,3 @@
|
||||
|
||||
.DS_Store
|
||||
docker/guton/env
|
||||
Generated
+8
@@ -0,0 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<settings>
|
||||
<option name="USE_PROJECT_PROFILE" value="false" />
|
||||
<version value="1.0" />
|
||||
</settings>
|
||||
</component>
|
||||
Generated
+4
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9" project-jdk-type="Python SDK" />
|
||||
</project>
|
||||
Generated
+8
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/public-setupfiles.iml" filepath="$PROJECT_DIR$/.idea/public-setupfiles.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
Generated
+12
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="PYTHON_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="jdk" jdkName="Python 3.9" jdkType="Python SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
<component name="PyDocumentationSettings">
|
||||
<option name="format" value="PLAIN" />
|
||||
<option name="myDocStringFormat" value="Plain" />
|
||||
</component>
|
||||
</module>
|
||||
Generated
+6
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
|
||||
|
||||
]
|
||||
}
|
||||
Vendored
+16
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"type": "markdownlint",
|
||||
"problemMatcher": [
|
||||
"$markdownlint"
|
||||
],
|
||||
"label": "markdownlint: Lint all Markdown files in the workspace with markdownlint",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
# Docker_backup
|
||||
|
||||
## Overview
|
||||
This directory contains the Docker backup scripts for this repository.
|
||||
|
||||
## Files
|
||||
- `docker-backup.sh` backs up Docker data to the NAS share.
|
||||
- `setup_docker-backup.sh` installs the backup script and cron job on a new system.
|
||||
- `correct_docker-backup.sh` repairs older installs and rewrites the cron job.
|
||||
- `update_docker-backup.sh` replaces previously installed backup scripts on a system and refreshes the cron job.
|
||||
|
||||
## Usage
|
||||
- Review the scripts before running them.
|
||||
- Run the install or correction scripts as `root`.
|
||||
- Run `update_docker-backup.sh` as `root` on existing systems to replace older installed copies.
|
||||
- Adjust paths if the target system uses different Docker or NAS mount locations.
|
||||
|
||||
## Notes
|
||||
- Backups are written to `/mnt/naspublic/docker-backup/{hostname}/{month}/{date}/`.
|
||||
- The backup set includes `/root/docker`, `/opt/docker`, `/var/lib/docker/volumes`, and `/home/traver/docker`.
|
||||
- The backup job runs every 3 hours.
|
||||
- Backups older than 14 days are removed automatically.
|
||||
@@ -0,0 +1,69 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
DEST_DIR="/root/docker"
|
||||
DEST_SCRIPT="${DEST_DIR}/docker-backup.sh"
|
||||
CRON_JOB_FILE="/etc/cron.d/docker-backup"
|
||||
LOG_FILE="/var/log/docker_backup.log"
|
||||
CRON_MATCH='docker-backup\.sh|docker_backup\.log|docker-backup-log'
|
||||
FILES_TO_INSTALL=(
|
||||
"docker-backup.sh"
|
||||
"setup_docker-backup.sh"
|
||||
"correct_docker-backup.sh"
|
||||
"update_docker-backup.sh"
|
||||
)
|
||||
|
||||
if [[ "${EUID}" -ne 0 ]]; then
|
||||
echo "Run this script as root."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
remove_legacy_cron_jobs() {
|
||||
local cron_file
|
||||
while IFS= read -r cron_file; do
|
||||
rm -f "$cron_file"
|
||||
echo "Removed legacy cron file ${cron_file}"
|
||||
done < <(grep -El "${CRON_MATCH}" /etc/cron.d/* 2>/dev/null || true)
|
||||
|
||||
if [[ -f /etc/crontab ]] && grep -Eq "${CRON_MATCH}" /etc/crontab; then
|
||||
grep -Ev "${CRON_MATCH}" /etc/crontab >/tmp/docker-backup-etc-crontab.cleaned || true
|
||||
install -m 644 /tmp/docker-backup-etc-crontab.cleaned /etc/crontab
|
||||
rm -f /tmp/docker-backup-etc-crontab.cleaned
|
||||
echo "Removed legacy Docker backup entries from /etc/crontab"
|
||||
fi
|
||||
|
||||
if crontab -l -u root >/tmp/docker-backup-root-crontab 2>/dev/null; then
|
||||
grep -Ev "${CRON_MATCH}" /tmp/docker-backup-root-crontab >/tmp/docker-backup-root-crontab.cleaned || true
|
||||
crontab -u root /tmp/docker-backup-root-crontab.cleaned
|
||||
rm -f /tmp/docker-backup-root-crontab /tmp/docker-backup-root-crontab.cleaned
|
||||
echo "Removed legacy Docker backup entries from root crontab"
|
||||
fi
|
||||
}
|
||||
|
||||
remove_legacy_cron_jobs
|
||||
|
||||
mkdir -p "${DEST_DIR}"
|
||||
|
||||
install_scripts() {
|
||||
local file
|
||||
for file in "${FILES_TO_INSTALL[@]}"; do
|
||||
install -m 755 "${SCRIPT_DIR}/${file}" "${DEST_DIR}/${file}"
|
||||
echo "Installed ${DEST_DIR}/${file}"
|
||||
done
|
||||
}
|
||||
|
||||
install_scripts
|
||||
|
||||
cat > "${CRON_JOB_FILE}" <<EOF
|
||||
SHELL=/bin/bash
|
||||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||
|
||||
# Run every 3 hours
|
||||
0 */3 * * * root ${DEST_SCRIPT} >> ${LOG_FILE} 2>&1
|
||||
EOF
|
||||
|
||||
chmod 644 "${CRON_JOB_FILE}"
|
||||
echo "Installed ${CRON_JOB_FILE}"
|
||||
echo "Docker backup scripts were updated and will run every 3 hours."
|
||||
@@ -0,0 +1,162 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# =========================
|
||||
# Docker Backup Script
|
||||
# =========================
|
||||
|
||||
# Backup destination
|
||||
NAS_ROOT="/mnt/naspublic"
|
||||
HOSTNAME="$(hostname -s)"
|
||||
BACKUP_BASE="${NAS_ROOT}/docker-backup/${HOSTNAME}"
|
||||
|
||||
# What to back up
|
||||
SOURCE_PATHS=(
|
||||
"/root/docker"
|
||||
"/opt/docker"
|
||||
"/var/lib/docker/volumes"
|
||||
"/home/traver/docker"
|
||||
)
|
||||
|
||||
# Retention in days
|
||||
RETENTION_DAYS=14
|
||||
|
||||
# Log file
|
||||
LOG_FILE="/var/log/docker_backup.log"
|
||||
|
||||
# Stop containers during backup? true/false
|
||||
STOP_CONTAINERS="false"
|
||||
|
||||
# Docker compose search roots for optional stop/start
|
||||
COMPOSE_DIRS=(
|
||||
"/root/docker"
|
||||
"/opt/docker"
|
||||
"/home/traver/docker"
|
||||
)
|
||||
|
||||
# Date/time foldering
|
||||
MONTH_STAMP="$(date '+%Y-%m')"
|
||||
DATE_STAMP="$(date '+%Y-%m-%d')"
|
||||
TIME_STAMP="$(date '+%H-%M-%S')"
|
||||
BACKUP_DIR="${BACKUP_BASE}/${MONTH_STAMP}/${DATE_STAMP}"
|
||||
|
||||
log() {
|
||||
echo "[$(date '+%F %T')] $*" | tee -a "$LOG_FILE"
|
||||
}
|
||||
|
||||
archive_name_for_path() {
|
||||
local path="$1"
|
||||
echo "${path#/}" | tr '/' '_'
|
||||
}
|
||||
|
||||
require_backup_target() {
|
||||
if command -v mountpoint >/dev/null 2>&1; then
|
||||
mountpoint -q "$NAS_ROOT" || {
|
||||
log "Error: ${NAS_ROOT} is not mounted. Aborting backup."
|
||||
exit 1
|
||||
}
|
||||
return
|
||||
fi
|
||||
|
||||
if command -v findmnt >/dev/null 2>&1; then
|
||||
findmnt -rn "$NAS_ROOT" >/dev/null 2>&1 || {
|
||||
log "Error: ${NAS_ROOT} is not mounted. Aborting backup."
|
||||
exit 1
|
||||
}
|
||||
return
|
||||
fi
|
||||
|
||||
if [[ ! -d "$NAS_ROOT" ]]; then
|
||||
log "Error: ${NAS_ROOT} is not mounted. Aborting backup."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
start_containers() {
|
||||
log "Starting Docker Compose stacks..."
|
||||
for dir in "${COMPOSE_DIRS[@]}"; do
|
||||
if [[ -d "$dir" ]]; then
|
||||
while IFS= read -r -d '' compose_file; do
|
||||
compose_path="$(dirname "$compose_file")"
|
||||
log "Starting stack in $compose_path"
|
||||
docker compose -f "$compose_file" up -d >>"$LOG_FILE" 2>&1 || log "Warning: failed to start stack in $compose_path"
|
||||
done < <(find "$dir" -type f \( -name "docker-compose.yml" -o -name "compose.yml" -o -name "docker-compose.yaml" -o -name "compose.yaml" \) -print0)
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
stop_containers() {
|
||||
log "Stopping Docker Compose stacks..."
|
||||
for dir in "${COMPOSE_DIRS[@]}"; do
|
||||
if [[ -d "$dir" ]]; then
|
||||
while IFS= read -r -d '' compose_file; do
|
||||
compose_path="$(dirname "$compose_file")"
|
||||
log "Stopping stack in $compose_path"
|
||||
docker compose -f "$compose_file" down >>"$LOG_FILE" 2>&1 || log "Warning: failed to stop stack in $compose_path"
|
||||
done < <(find "$dir" -type f \( -name "docker-compose.yml" -o -name "compose.yml" -o -name "docker-compose.yaml" -o -name "compose.yaml" \) -print0)
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
cleanup_old_backups() {
|
||||
log "Removing backups older than ${RETENTION_DAYS} days from ${BACKUP_BASE}"
|
||||
find "$BACKUP_BASE" -mindepth 2 -maxdepth 2 -type d -mtime +"$RETENTION_DAYS" -exec rm -rf {} + >>"$LOG_FILE" 2>&1 || true
|
||||
find "$BACKUP_BASE" -mindepth 1 -maxdepth 1 -type d -empty -delete >>"$LOG_FILE" 2>&1 || true
|
||||
}
|
||||
|
||||
create_archive() {
|
||||
local path="$1"
|
||||
local archive_name
|
||||
local archive_path
|
||||
local parent_dir
|
||||
local base_name
|
||||
|
||||
if [[ ! -e "$path" ]]; then
|
||||
log "Warning: source path missing: $path"
|
||||
return 0
|
||||
fi
|
||||
|
||||
archive_name="$(archive_name_for_path "$path")"
|
||||
archive_path="${BACKUP_DIR}/${TIME_STAMP}_${archive_name}.tar.gz"
|
||||
parent_dir="$(dirname "$path")"
|
||||
base_name="$(basename "$path")"
|
||||
|
||||
log "Creating archive ${archive_path} from ${path}"
|
||||
if command -v pigz >/dev/null 2>&1; then
|
||||
tar --xattrs --acls --numeric-owner -cpf - -C "$parent_dir" "$base_name" 2>>"$LOG_FILE" | pigz 2>>"$LOG_FILE" > "$archive_path"
|
||||
else
|
||||
tar --xattrs --acls --numeric-owner -czpf "$archive_path" -C "$parent_dir" "$base_name" >>"$LOG_FILE" 2>&1
|
||||
fi
|
||||
}
|
||||
|
||||
main() {
|
||||
log "========================================"
|
||||
log "Starting Docker backup"
|
||||
|
||||
require_backup_target
|
||||
mkdir -p "$BACKUP_BASE"
|
||||
mkdir -p "$BACKUP_DIR"
|
||||
|
||||
if [[ "$STOP_CONTAINERS" == "true" ]]; then
|
||||
stop_containers
|
||||
fi
|
||||
|
||||
log "Creating separate compressed backups in $BACKUP_DIR"
|
||||
for path in "${SOURCE_PATHS[@]}"; do
|
||||
create_archive "$path"
|
||||
done
|
||||
|
||||
log "Backup sizes:"
|
||||
du -sh "$BACKUP_DIR" >>"$LOG_FILE" 2>&1 || true
|
||||
|
||||
if [[ "$STOP_CONTAINERS" == "true" ]]; then
|
||||
start_containers
|
||||
fi
|
||||
|
||||
cleanup_old_backups
|
||||
|
||||
log "Docker backup completed successfully"
|
||||
log "========================================"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -0,0 +1,87 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
DEST_DIR="/root/docker"
|
||||
DEST_SCRIPT="${DEST_DIR}/docker-backup.sh"
|
||||
CRON_JOB_FILE="/etc/cron.d/docker-backup"
|
||||
LOG_FILE="/var/log/docker_backup.log"
|
||||
CRON_MATCH='docker-backup\.sh|docker_backup\.log|docker-backup-log'
|
||||
FILES_TO_INSTALL=(
|
||||
"docker-backup.sh"
|
||||
"setup_docker-backup.sh"
|
||||
"correct_docker-backup.sh"
|
||||
"update_docker-backup.sh"
|
||||
)
|
||||
|
||||
if [[ "${EUID}" -ne 0 ]]; then
|
||||
echo "Run this script as root."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
detect_mode() {
|
||||
# Treat as update only when concrete install artifacts are present.
|
||||
if [[ -f "${DEST_SCRIPT}" || -f "${CRON_JOB_FILE}" ]]; then
|
||||
echo "update"
|
||||
else
|
||||
echo "first-time"
|
||||
fi
|
||||
}
|
||||
|
||||
MODE="$(detect_mode)"
|
||||
|
||||
remove_legacy_cron_jobs() {
|
||||
local cron_file
|
||||
while IFS= read -r cron_file; do
|
||||
rm -f "$cron_file"
|
||||
echo "Removed legacy cron file ${cron_file}"
|
||||
done < <(grep -El "${CRON_MATCH}" /etc/cron.d/* 2>/dev/null || true)
|
||||
|
||||
if [[ -f /etc/crontab ]] && grep -Eq "${CRON_MATCH}" /etc/crontab; then
|
||||
grep -Ev "${CRON_MATCH}" /etc/crontab >/tmp/docker-backup-etc-crontab.cleaned || true
|
||||
install -m 644 /tmp/docker-backup-etc-crontab.cleaned /etc/crontab
|
||||
rm -f /tmp/docker-backup-etc-crontab.cleaned
|
||||
echo "Removed legacy Docker backup entries from /etc/crontab"
|
||||
fi
|
||||
|
||||
if crontab -l -u root >/tmp/docker-backup-root-crontab 2>/dev/null; then
|
||||
grep -Ev "${CRON_MATCH}" /tmp/docker-backup-root-crontab >/tmp/docker-backup-root-crontab.cleaned || true
|
||||
crontab -u root /tmp/docker-backup-root-crontab.cleaned
|
||||
rm -f /tmp/docker-backup-root-crontab /tmp/docker-backup-root-crontab.cleaned
|
||||
echo "Removed legacy Docker backup entries from root crontab"
|
||||
fi
|
||||
}
|
||||
|
||||
remove_legacy_cron_jobs
|
||||
|
||||
mkdir -p "${DEST_DIR}"
|
||||
|
||||
install_scripts() {
|
||||
local file
|
||||
for file in "${FILES_TO_INSTALL[@]}"; do
|
||||
install -m 755 "${SCRIPT_DIR}/${file}" "${DEST_DIR}/${file}"
|
||||
echo "Installed ${DEST_DIR}/${file}"
|
||||
done
|
||||
}
|
||||
|
||||
install_scripts
|
||||
|
||||
if [[ "${MODE}" == "first-time" ]]; then
|
||||
echo "No existing Docker backup install detected. Installing Docker backup scripts and cron configuration."
|
||||
else
|
||||
echo "Existing Docker backup install detected. Reinstalling Docker backup scripts and refreshing cron configuration."
|
||||
fi
|
||||
|
||||
cat > "${CRON_JOB_FILE}" <<EOF
|
||||
SHELL=/bin/bash
|
||||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||
|
||||
# Run every 3 hours
|
||||
0 */3 * * * root ${DEST_SCRIPT} >> ${LOG_FILE} 2>&1
|
||||
EOF
|
||||
|
||||
chmod 644 "${CRON_JOB_FILE}"
|
||||
echo "Installed ${CRON_JOB_FILE}"
|
||||
echo "Installed helper scripts: ${DEST_DIR}/correct_docker-backup.sh and ${DEST_DIR}/update_docker-backup.sh"
|
||||
echo "Complete: setup/update finished with current Docker backup configuration."
|
||||
@@ -0,0 +1,71 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
DEST_DIR="/root/docker"
|
||||
DEST_SCRIPT="${DEST_DIR}/docker-backup.sh"
|
||||
CRON_JOB_FILE="/etc/cron.d/docker-backup"
|
||||
LOG_FILE="/var/log/docker_backup.log"
|
||||
CRON_MATCH='docker-backup\.sh|docker_backup\.log|docker-backup-log'
|
||||
FILES_TO_INSTALL=(
|
||||
"docker-backup.sh"
|
||||
"setup_docker-backup.sh"
|
||||
"correct_docker-backup.sh"
|
||||
"update_docker-backup.sh"
|
||||
)
|
||||
|
||||
if [[ "${EUID}" -ne 0 ]]; then
|
||||
echo "Run this script as root."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
remove_legacy_cron_jobs() {
|
||||
local cron_file
|
||||
while IFS= read -r cron_file; do
|
||||
rm -f "$cron_file"
|
||||
echo "Removed legacy cron file ${cron_file}"
|
||||
done < <(grep -El "${CRON_MATCH}" /etc/cron.d/* 2>/dev/null || true)
|
||||
|
||||
if [[ -f /etc/crontab ]] && grep -Eq "${CRON_MATCH}" /etc/crontab; then
|
||||
grep -Ev "${CRON_MATCH}" /etc/crontab >/tmp/docker-backup-etc-crontab.cleaned || true
|
||||
install -m 644 /tmp/docker-backup-etc-crontab.cleaned /etc/crontab
|
||||
rm -f /tmp/docker-backup-etc-crontab.cleaned
|
||||
echo "Removed legacy Docker backup entries from /etc/crontab"
|
||||
fi
|
||||
|
||||
if crontab -l -u root >/tmp/docker-backup-root-crontab 2>/dev/null; then
|
||||
grep -Ev "${CRON_MATCH}" /tmp/docker-backup-root-crontab >/tmp/docker-backup-root-crontab.cleaned || true
|
||||
crontab -u root /tmp/docker-backup-root-crontab.cleaned
|
||||
rm -f /tmp/docker-backup-root-crontab /tmp/docker-backup-root-crontab.cleaned
|
||||
echo "Removed legacy Docker backup entries from root crontab"
|
||||
fi
|
||||
}
|
||||
|
||||
install_scripts() {
|
||||
local file
|
||||
mkdir -p "${DEST_DIR}"
|
||||
|
||||
for file in "${FILES_TO_INSTALL[@]}"; do
|
||||
install -m 755 "${SCRIPT_DIR}/${file}" "${DEST_DIR}/${file}"
|
||||
echo "Installed ${DEST_DIR}/${file}"
|
||||
done
|
||||
}
|
||||
|
||||
install_cron_job() {
|
||||
cat > "${CRON_JOB_FILE}" <<EOF
|
||||
SHELL=/bin/bash
|
||||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||
|
||||
# Run every 3 hours
|
||||
0 */3 * * * root ${DEST_SCRIPT} >> ${LOG_FILE} 2>&1
|
||||
EOF
|
||||
|
||||
chmod 644 "${CRON_JOB_FILE}"
|
||||
echo "Installed ${CRON_JOB_FILE}"
|
||||
}
|
||||
|
||||
remove_legacy_cron_jobs
|
||||
install_scripts
|
||||
install_cron_job
|
||||
echo "Docker backup scripts were updated and the 3-hour cron job was refreshed."
|
||||
@@ -0,0 +1,43 @@
|
||||
<<<<<<< HEAD
|
||||
# Email_domains_block_allow
|
||||
|
||||
## Purpose
|
||||
This directory contains files related to **Email domains block allow**.
|
||||
|
||||
## Contents
|
||||
- `email_domain_allow_block_list.md`
|
||||
- `blocked_domains.md`
|
||||
|
||||
## Usage
|
||||
- Review each script or configuration file before running
|
||||
- Some scripts may require **root or sudo**
|
||||
- Paths and variables may need adjustment for your environment
|
||||
|
||||
## Notes
|
||||
- This folder is part of the **public-setupfiles** repository
|
||||
- Files are provided as-is for reference or automation
|
||||
|
||||
## Safety
|
||||
Always back up data before running scripts that modify system state.
|
||||
=======
|
||||
# Email_domains_block_allow
|
||||
|
||||
## Overview
|
||||
This directory is part of the **public-setupfiles** repository.
|
||||
It contains scripts, configuration files, or resources related to **Email_domains_block_allow**.
|
||||
|
||||
## Usage
|
||||
- Review scripts before execution
|
||||
- Some files may require **root or sudo privileges**
|
||||
- Paths, variables, or credentials may need customization
|
||||
|
||||
## Logging & Output
|
||||
Scripts may generate logs or output files in the same directory or system locations.
|
||||
|
||||
## Safety Notes
|
||||
- Always back up important data before running scripts
|
||||
- Test in a non-production environment when possible
|
||||
- Use at your own risk
|
||||
|
||||
---
|
||||
>>>>>>> main
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,31 @@
|
||||
sudo apt install -y nmap \
|
||||
wordlist \
|
||||
ettercap-common \
|
||||
ettercap-graphical \
|
||||
arp-scan \
|
||||
wfuzz \
|
||||
wireshark \
|
||||
airgeddon \
|
||||
aircrack-ng \
|
||||
airgraph-ng \
|
||||
traceroute \
|
||||
wifite wpscan \
|
||||
whois \
|
||||
wifiphisher \
|
||||
kismet \
|
||||
netdiscover \
|
||||
bettercap \
|
||||
burpsuite \
|
||||
tcpdump \
|
||||
fern-wifi-cracker \
|
||||
bettercap-ui \
|
||||
wifi-honey \
|
||||
gparted \
|
||||
gvm \
|
||||
openvas \
|
||||
git
|
||||
|
||||
git clone https://github.com/LionSec/katoolin.git && cp katoolin/katoolin.py /usr/bin/katoolin
|
||||
chmod +x /usr/bin/katoolin
|
||||
# sudo katoolin
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
<<<<<<< HEAD
|
||||
# Kali_tools_install
|
||||
|
||||
## Purpose
|
||||
This directory contains files related to **Kali tools install**.
|
||||
|
||||
## Contents
|
||||
- `Kalitoolsinstall.sh`
|
||||
- `setup_debian_kali_tools.sh`
|
||||
|
||||
## Usage
|
||||
- Review each script or configuration file before running
|
||||
- Some scripts may require **root or sudo**
|
||||
- Paths and variables may need adjustment for your environment
|
||||
|
||||
## Notes
|
||||
- This folder is part of the **public-setupfiles** repository
|
||||
- Files are provided as-is for reference or automation
|
||||
|
||||
## Safety
|
||||
Always back up data before running scripts that modify system state.
|
||||
=======
|
||||
# Kali_tools_install
|
||||
|
||||
## Overview
|
||||
This directory is part of the **public-setupfiles** repository.
|
||||
It contains scripts, configuration files, or resources related to **Kali_tools_install**.
|
||||
|
||||
## Usage
|
||||
- Review scripts before execution
|
||||
- Some files may require **root or sudo privileges**
|
||||
- Paths, variables, or credentials may need customization
|
||||
|
||||
## Logging & Output
|
||||
Scripts may generate logs or output files in the same directory or system locations.
|
||||
|
||||
## Safety Notes
|
||||
- Always back up important data before running scripts
|
||||
- Test in a non-production environment when possible
|
||||
- Use at your own risk
|
||||
|
||||
---
|
||||
>>>>>>> main
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Ensure the script is run as root
|
||||
if [ "$(id -u)" -ne 0 ]; then
|
||||
echo "Please run this script as root."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Backup the current sources.list
|
||||
cp /etc/apt/sources.list /etc/apt/sources.list.bak
|
||||
echo "Backup of sources.list created at /etc/apt/sources.list.bak"
|
||||
|
||||
# Add Kali rolling repository
|
||||
echo "deb http://http.kali.org/kali kali-rolling main contrib non-free" | tee -a /etc/apt/sources.list
|
||||
echo "Kali repository added."
|
||||
|
||||
# Import Kali's GPG key
|
||||
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys ED444FF07D8D0BF6
|
||||
echo "Kali GPG key imported."
|
||||
|
||||
# Update package lists
|
||||
apt update
|
||||
|
||||
# Prompt user to select a Kali metapackage to install
|
||||
echo "Select a Kali metapackage to install:"
|
||||
echo "1) kali-linux-top10"
|
||||
echo "2) kali-linux-default"
|
||||
echo "3) kali-linux-all"
|
||||
echo "4) kali-linux-wireless"
|
||||
echo "5) kali-linux-web"
|
||||
read -p "Enter the number corresponding to your choice: " choice
|
||||
|
||||
case $choice in
|
||||
1)
|
||||
apt install -y kali-linux-top10
|
||||
;;
|
||||
2)
|
||||
apt install -y kali-linux-default
|
||||
;;
|
||||
3)
|
||||
apt install -y kali-linux-all
|
||||
;;
|
||||
4)
|
||||
apt install -y kali-linux-wireless
|
||||
;;
|
||||
5)
|
||||
apt install -y kali-linux-web
|
||||
;;
|
||||
*)
|
||||
echo "Invalid choice. Exiting."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "Installation of the selected Kali metapackage is complete."
|
||||
|
||||
# Reminder to remove Kali repositories after installation
|
||||
echo "It's recommended to remove the Kali repository from /etc/apt/sources.list after installation to prevent potential system issues."
|
||||
@@ -0,0 +1,49 @@
|
||||
# Security Policy
|
||||
|
||||
## 📌 Supported Versions
|
||||
This repository is provided **as-is** without official support. However, contributions and reports of issues are welcome.
|
||||
|
||||
| Version | Status | Notes |
|
||||
|---------|------------|-------|
|
||||
| Latest | Actively Maintained | Open for contributions |
|
||||
| Older | No Support | Use at your own risk |
|
||||
|
||||
---
|
||||
|
||||
## 🔍 Reporting Security Issues
|
||||
If you find a **security vulnerability**, please **DO NOT** open a public issue. Instead, follow these steps:
|
||||
|
||||
1. **Contact Me Privately**:
|
||||
- Email: **[your-email@example.com]** (replace with actual contact if needed)
|
||||
- Direct message on **GitHub**
|
||||
|
||||
2. **Include in Your Report**:
|
||||
- A **detailed description** of the issue.
|
||||
- Steps to **reproduce** it.
|
||||
- Any **possible fixes** you suggest.
|
||||
|
||||
3. **Response Time**:
|
||||
- Issues will be reviewed **within 7 days**.
|
||||
- If confirmed, a fix will be worked on and released as soon as possible.
|
||||
|
||||
---
|
||||
|
||||
## 🔐 Security Best Practices
|
||||
Although this repository contains setup scripts, users are responsible for ensuring **secure usage**. Follow these guidelines:
|
||||
|
||||
✅ **Keep your system up to date**
|
||||
✅ **Use strong passwords & enable MFA where possible**
|
||||
✅ **Review scripts before running them**
|
||||
✅ **Use Docker safely with minimal privileges**
|
||||
✅ **Do not expose sensitive configurations**
|
||||
|
||||
---
|
||||
|
||||
## ❗ Disclaimer
|
||||
This repository is licensed under **CC-BY-NC 4.0** and is provided **without warranty**. Use at your own risk. The repository owner is **not responsible for any damage** resulting from its use.
|
||||
|
||||
---
|
||||
|
||||
## 🔗 References
|
||||
- [Creative Commons Attribution-NonCommercial 4.0](https://creativecommons.org/licenses/by-nc/4.0/)
|
||||
- [GitHub Security Best Practices](https://docs.github.com/en/code-security)
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
# Security Policy
|
||||
|
||||
## 📌 Supported Versions
|
||||
This repository is provided **as-is** without official support. However, contributions and reports of issues are welcome.
|
||||
|
||||
| Version | Status | Notes |
|
||||
|---------|------------|-------|
|
||||
| Latest | Actively Maintained | Open for contributions |
|
||||
| Older | No Support | Use at your own risk |
|
||||
|
||||
---
|
||||
|
||||
## 🔍 Reporting Security Issues
|
||||
If you find a **security vulnerability**, please **DO NOT** open a public issue. Instead, follow these steps:
|
||||
|
||||
1. **Contact Me Privately**:
|
||||
- Email: **[your-email@example.com]** (replace with actual contact if needed)
|
||||
- Direct message on **GitHub**
|
||||
|
||||
2. **Include in Your Report**:
|
||||
- A **detailed description** of the issue.
|
||||
- Steps to **reproduce** it.
|
||||
- Any **possible fixes** you suggest.
|
||||
|
||||
3. **Response Time**:
|
||||
- Issues will be reviewed **within 7 days**.
|
||||
- If confirmed, a fix will be worked on and released as soon as possible.
|
||||
|
||||
---
|
||||
|
||||
## 🔐 Security Best Practices
|
||||
Although this repository contains setup scripts, users are responsible for ensuring **secure usage**. Follow these guidelines:
|
||||
|
||||
✅ **Keep your system up to date**
|
||||
✅ **Use strong passwords & enable MFA where possible**
|
||||
✅ **Review scripts before running them**
|
||||
✅ **Use Docker safely with minimal privileges**
|
||||
✅ **Do not expose sensitive configurations**
|
||||
|
||||
---
|
||||
|
||||
## ❗ Disclaimer
|
||||
This repository is licensed under **CC-BY-NC 4.0** and is provided **without warranty**. Use at your own risk. The repository owner is **not responsible for any damage** resulting from its use.
|
||||
|
||||
---
|
||||
|
||||
## 🔗 References
|
||||
- [Creative Commons Attribution-NonCommercial 4.0](https://creativecommons.org/licenses/by-nc/4.0/)
|
||||
- [GitHub Security Best Practices](https://docs.github.com/en/code-security)
|
||||
@@ -0,0 +1,8 @@
|
||||
net use w: \\nas\public
|
||||
net use s: \\nas\downloadedmedia
|
||||
net use r: \\nas\downloads
|
||||
net use t: \\nas\public2
|
||||
|
||||
|
||||
|
||||
robocopy C:\Users\trave\Downloads\VMs \\nas\public2\vm\abcwhyme /z /s /r:2 /w:2 /copy:dt /compress /purge
|
||||
@@ -0,0 +1,4 @@
|
||||
robocopy C:\Users\trave\Videos\ "\\nas\public\Traver's Personal\produced_videos" /z /s /r:2 /copy:dt /w:2 /purge
|
||||
robocopy "\\nas\public\Traver's Personal\produced_videos" C:\Users\trave\Videos\ /z /s /r:2 /copy:dt /w:2
|
||||
|
||||
robocopy C:\Users\trave\Videos\ "\\NAS\mymedia\Videos" /z /s /r:2 /copy:dt /w:2
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
robocopy \\NAS\downloadedmedia\MyVideos H:\MyVideos /z /s /r:2 /copy:dt /w:2
|
||||
@@ -0,0 +1,6 @@
|
||||
robocopy C:\Docker_data\minecraft \\NAS\public\Minecraft\docker-backup /z /s /r:2 /copy:dt /w:2 /purge
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
net use w: \\nas\public
|
||||
net use s: \\nas\downloadedmedia
|
||||
net use r: \\nas\downloads
|
||||
net use t: \\NAS\public-share2
|
||||
|
||||
robocopy C:\Users\trave\Downloads \\NAS\Public\downloads /z /s /r:2 /w:3 /XD "C:\Users\trave\Downloads\VMs" /xf *.jpg *.iso *.png *.jpeg *.docx *.pdf /COPY:DAT
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
# onedrive personal to Network NAS copy all.
|
||||
robocopy C:\Users\Traver\OneDrive\Education \\NAS\public\education /z /s /r:2 /w:2 /copy:dt
|
||||
robocopy C:\Users\Trave\OneDrive\Education \\NAS\public\education /z /s /r:2 /w:2 /copy:dt
|
||||
robocopy C:\Users\Traver\OneDrive\Education "G:\My Drive\Education" /z /s /r:2 /w:2 /copy:dt
|
||||
robocopy C:\Users\Trave\OneDrive\Education "G:\My Drive\Education" /z /s /r:2 /w:2 /copy:dt
|
||||
## robocopy "G:\My Drive\Education" C:\Users\Trave\OneDrive\Education /z /s /r:2 /w:2 /copy:dt
|
||||
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
robocopy "C:\Users\trave\OneDrive\IT Work" \\nas\public\ITWork /z /s /r:2 /w:2 /copy:dt /purge
|
||||
robocopy \\nas\public\ITWork "C:\Users\trave\OneDrive\IT Work" /z /s /r:2 /w:2 /copy:dt
|
||||
@@ -0,0 +1,15 @@
|
||||
net use z: /delete
|
||||
net use y: /delete
|
||||
net use x: /delete
|
||||
net use w: /delete
|
||||
net use v: /delete
|
||||
net use u: /delete
|
||||
net use v: /delete
|
||||
net use t: /delete
|
||||
net use r: /delete
|
||||
net use s: /delete
|
||||
|
||||
net use w: \\nas\public
|
||||
net use r: \\nas\downloads
|
||||
net use t: \\NAS\public2
|
||||
net use s: \\nas\media
|
||||
@@ -0,0 +1 @@
|
||||
robocopy C:\Users\trave\Downloads\vms \\nas\public-share2\vm\murder23 /z /s /r:2 /w:2 /purge
|
||||
@@ -0,0 +1,5 @@
|
||||
net use w: \\nas\public
|
||||
net use s: \\nas\downloadedmedia
|
||||
net use r: \\nas\downloads
|
||||
|
||||
robocopy \\nas\public f:\public /z /s /r:2 /w:2 /copy:dt /purge /compress
|
||||
@@ -0,0 +1,32 @@
|
||||
net use w: \\nas\public
|
||||
net use x: \\nas\devry
|
||||
net use y: \\nas\docker
|
||||
net use z: \\nas\downloads
|
||||
net use u: \\nas\AudioBooks
|
||||
net use t: \\nas\Personal
|
||||
net use s: \\nas\downloadedmedia
|
||||
net use r: \\nas\vm
|
||||
|
||||
robocopy C:\Users\trave\OneDrive\Ark "d:\nas1public\Ark" /z /s /r:2 /w:3 /copy:dts /purge
|
||||
robocopy C:\Users\trave\OneDrive\Documents d:\nas1public\documents /z /s /r:2 /w:2 /copy:dts
|
||||
robocopy "C:\Users\trave\OneDrive\Family Health Docs" d:\nas1public\FamilyHealthDocs /z /s /r:2 /w:3 /copy:dts
|
||||
robocopy C:\Users\trave\OneDrive\Devry D:\nas1devry /z /s /r:2 /w:2 /copy:dts /purge
|
||||
robocopy C:\Users\trave\OneDrive\Desktop d:\nas1public\desktop /z /s /r:2 /w:2 /copy:dts /purge
|
||||
robocopy C:\Users\trave\Downloads d:\nas1public\Downloads /z /s /r:2 /w:3 /copy:dts /XD "C:\Users\trave\Downloads\VMs"
|
||||
robocopy "C:\Users\trave\OneDrive\IT Work" d:\nas1public\ITWork /z /s /r:2 /w:2 /copy:dts /purge
|
||||
robocopy C:\Users\trave\Downloads\VMs d:\vms /z /s /r:2 /w:3 /copy:dts
|
||||
|
||||
robocopy C:\Users\trave\Downloads\VMs \\nas\vm /z /s /r:2 /w:2 /copy:dts
|
||||
robocopy C:\Users\trave\OneDrive\Ark \\NAS\public\Ark /z /s /r:2 /w:3 /copy:dts /purge
|
||||
robocopy C:\Users\trave\OneDrive\Documents \\NAS\public\documents /z /s /r:2 /copy:dts /w:2
|
||||
robocopy "C:\Users\trave\OneDrive\Family Health Docs" \\NAS\public\FamilyHealthDocs /z /copy:dts /s /r:2 /w:3 /purge
|
||||
robocopy C:\Users\trave\OneDrive\Devry \\NAS\devry /z /s /r:2 /w:2 /copy:dts /purge
|
||||
robocopy C:\Users\trave\OneDrive\Desktop \\NAS\public\desktop /z /s /r:2 /w:2 /copy:dts /purge
|
||||
robocopy "C:\Users\trave\OneDrive\IT Work" \\nas\public\ITWork /z /s /r:2 /copy:dts /w:2 /purge
|
||||
robocopy C:\Users\trave\OneDrive\Documents\Docker \\NAS\docker /z /s /r:2 /w:3 /copy:dts /purge
|
||||
|
||||
robocopy C:\Users\trave\Videos\ \\nas\personal\videos /z /s /r:2 /copy:dts /w:2 /purge
|
||||
|
||||
robocopy C:\Users\trave\Downloads \\NAS\public\downloads /z /s /r:2 /w:3 /copy:dts /XD "C:\Users\trave\Downloads\VMs"
|
||||
robocopy \\NAS\public d:\nas1public /z /s /r:2 /w:3 /copy:dts /purge
|
||||
robocopy \\nas\vm d:\vms /z /s /r:2 /w:3 /copy:dts /purge
|
||||
@@ -0,0 +1,19 @@
|
||||
net use w: \\nas\public
|
||||
net use s: \\nas\downloadedmedia
|
||||
net use z: \\nas\quarantine
|
||||
net use x: \\nas\samantha-personal
|
||||
net use u: \\nas\traver-personal
|
||||
net use t: \\nas\VM-proxmox
|
||||
net use r: \\nas\downloads
|
||||
net use v: \\nas\vm-shared
|
||||
|
||||
robocopy C:\Users\trave\Downloads \\NAS\public\downloads /z /s /r:2 /w:3 /copy:dt /XD "C:\Users\trave\Downloads\VMs" /xf *.jpg /xf *.iso
|
||||
|
||||
robocopy "C:\Users\trave\OneDrive\IT Work" \\nas\public\ITWork /z /s /r:2 /w:2 /copy:dt /purge
|
||||
#robocopy C:\Users\trave\OneDrive\education \\NAS\public\education /z /s /r:2 /w:2 /copy:dt /purge
|
||||
#robocopy "C:\Users\trave\Pictures" "W:\Traver's Personal\Photos" /z /s /r:2 /w:3 /copy:dt
|
||||
robocopy "C:\Users\trave\Videos" "W:\Traver's Personal\videos" /z /s /r:2 /w:3 /copy:dt
|
||||
|
||||
|
||||
robocopy C:\Users\trave\Downloads\VMs \\nas\public\vm\abcwhyme /z /s /r:2 /w:2 /copy:dt /purge
|
||||
robocopy e:\vms \\nas\public\vm\murder23 /z /s /r:2 /w:2 /copy:dt /purge
|
||||
@@ -0,0 +1,4 @@
|
||||
robocopy C:\Users\trave\Downloads\*.jpeg "\\NAS\public\Traver's Personal\Downloaded pictures" /z /s /r:2 /w:3 /copy:dt /XD "C:\Users\trave\Downloads\VMs"
|
||||
robocopy C:\Users\trave\Downloads\*.gif "\\NAS\public\Traver's Personal\Downloaded pictures\*.gif" /z /s /r:2 /w:3 /copy:dt /XD "C:\Users\trave\Downloads\VMs"
|
||||
robocopy C:\Users\trave\Downloads\*.jpg "\\NAS\public\Traver's Personal\Downloaded pictures\*.jpg" /z /s /r:2 /w:3 /copy:dt /XD "C:\Users\trave\Downloads\VMs"
|
||||
robocopy C:\Users\trave\Downloads\*.png "\\NAS\public\Traver's Personal\Downloaded pictures\*.png" /z /s /r:2 /w:3 /copy:dt /XD "C:\Users\trave\Downloads\VMs"
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
robocopy C:\Users\trave\OneDrive\Devry \\rasp2\share\nas1devry /z /s /r:2 /w:2 /copy:dt /purge
|
||||
|
||||
robocopy C:\Users\trave\OneDrive\Devry D:\nas1devry /z /s /r:2 /w:2 /copy:dt /purge
|
||||
@@ -0,0 +1,7 @@
|
||||
|
||||
robocopy C:\Users\trave\OneDrive\Devry \\nas1\devry /z /s /r:2 /w:2 /copy:dt /purge
|
||||
robocopy C:\Users\trave\OneDrive\Ark \\nas1\public\Ark /z /s /r:2 /w:3 /purge /copy:dt /purge
|
||||
robocopy C:\Users\trave\OneDrive\Documents \\nas1\public\documents /z /s /r:2 /w:2 /copy:dt /purge
|
||||
robocopy "C:\Users\trave\OneDrive\Family Health Docs" \\nas1\public\FamilyHealthDocs /z /s /r:2 /w:3 /copy:dt /purge
|
||||
robocopy C:\Users\trave\OneDrive\Desktop \\nas1\public\desktop /z /s /r:2 /w:2 /copy:dt /purge
|
||||
robocopy C:\Users\trave\Downloads \\nas1\public\downloads /z /s /r:2 /w:3 /copy:dt
|
||||
@@ -0,0 +1,5 @@
|
||||
robocopy C:\Users\trave\Downloads \\RASP2\share\nas1public\downloads /z /s /r:2 /w:3 /copy:dt
|
||||
robocopy C:\Users\trave\OneDrive\Devry \\RASP2\share\nas1devry /z /s /r:2 /w:2 /copy:dt /purge
|
||||
robocopy C:\Users\trave\OneDrive\Ark \\RASP2\share\nas1public\Ark /z /s /r:2 /w:3 /purge /copy:dt /purge
|
||||
robocopy C:\Users\trave\OneDrive\Documents \\RASP2\share\nas1public\documents /z /s /r:2 /w:2 /copy:dt /purge
|
||||
robocopy "C:\Users\trave\OneDrive\Family Health Docs" \\RASP2\share\nas1public\FamilyHealthDocs /z /s /r:2 /w:3 /copy:dt /purge
|
||||
@@ -0,0 +1,16 @@
|
||||
net use z: /delete
|
||||
net use y: /delete
|
||||
net use x: /delete
|
||||
net use w: /delete
|
||||
net use v: /delete
|
||||
net use u: /delete
|
||||
net use v: /delete
|
||||
net use t: /delete
|
||||
|
||||
|
||||
net use y: \\nas1\public
|
||||
net use x: \\nas1\devry
|
||||
net use z: \\nas1\docker
|
||||
net use w: \\rasp2\share
|
||||
|
||||
robocopy "C:\Users\trave\OneDrive\IT Work" \\nas1\public\it-work /z /s /r:2 /w:3 /copy:dt
|
||||
@@ -0,0 +1 @@
|
||||
robocopy "C:\Users\trave\OneDrive\IT Work" \\RASP2\share\nas1public\it-work /s /z /r:2 /w:3 /copy:dt
|
||||
@@ -0,0 +1,13 @@
|
||||
net use z: /delete
|
||||
net use y: /delete
|
||||
net use x: /delete
|
||||
net use w: /delete
|
||||
net use v: /delete
|
||||
net use u: /delete
|
||||
net use v: /delete
|
||||
net use t: /delete
|
||||
net use r: /delete
|
||||
|
||||
|
||||
net use w: \\nas\public
|
||||
net use s: \\nas\downloadedmedia
|
||||
@@ -0,0 +1,14 @@
|
||||
net use z: /delete
|
||||
net use y: /delete
|
||||
net use x: /delete
|
||||
net use w: /delete
|
||||
net use v: /delete
|
||||
net use u: /delete
|
||||
net use v: /delete
|
||||
net use t: /delete
|
||||
|
||||
|
||||
net use y: \\nas1\public
|
||||
net use x: \\nas1\devry
|
||||
net use z: \\nas1\docker
|
||||
net use w: \\rasp2\share
|
||||
@@ -0,0 +1,8 @@
|
||||
net use w: \\nas\public
|
||||
net use s: \\nas\downloadedmedia
|
||||
net use z: \\nas\quarantine
|
||||
net use x: \\nas\samantha-personal
|
||||
net use u: \\nas\traver-personal
|
||||
net use t: \\nas\VM-proxmox
|
||||
net use r: \\nas\downloads
|
||||
net use v: \\nas\vm-shared
|
||||
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
net use z: /delete
|
||||
|
||||
net use z: "\\192.168.1.4\lodestone backup"
|
||||
@@ -0,0 +1,2 @@
|
||||
robocopy \\nas\public d:\ /z /s /r:2 /w:3 /purge /copy:dt /XD "\\nas\public\vm" /XD "\\nas\public\proxmox"
|
||||
#robocopy \\nas\downloadedmedia D:\nasdownloadedmedia /z /s /r:2 /w:3 /purge /copy:dt
|
||||
@@ -0,0 +1,15 @@
|
||||
#robocopy C:\Users\trave\OneDrive\Ark "d:\naspublic\Ark" /z /s /r:2 /w:3 /copy:dt /purge
|
||||
#robocopy C:\Users\trave\OneDrive\Documents d:\naspublic\documents /z /s /r:2 /w:2 /copy:dt /purge
|
||||
#robocopy "C:\Users\trave\OneDrive\Family Health Docs" d:\naspublic\FamilyHealthDocs /z /s /r:2 /w:3 /copy:dt /purge
|
||||
#robocopy C:\Users\trave\OneDrive\Devry D:\nasdevry /z /s /r:2 /w:2 /copy:dt /purge
|
||||
#robocopy C:\Users\traverssd\OneDrive\Devry D:\nasdevry /z /s /r:2 /w:2 /copy:dt /purge
|
||||
#robocopy C:\Users\trave\OneDrive\Desktop d:\naspublic\desktop /z /s /r:2 /w:2 /copy:dt /purge
|
||||
#robocopy "C:\Users\trave\OneDrive\IT Work" d:\naspublic\ITWork /z /s /r:2 /w:2 /copy:dt /purge
|
||||
#robocopy C:\Users\trave\OneDrive\Ark \\NAS\public\Ark /z /s /r:2 /w:3 /copy:dt /purge
|
||||
#robocopy C:\Users\trave\OneDrive\Documents \\NAS\public\documents /z /s /r:2 /copy:dt /w:2
|
||||
#robocopy "C:\Users\trave\OneDrive\Family Health Docs" \\NAS\public\FamilyHealthDocs /z /copy:dt /s /r:2 /w:3 /purge
|
||||
#robocopy C:\Users\trave\OneDrive\Desktop \\NAS\public\desktop /z /s /r:2 /w:2 /copy:dt /purge
|
||||
#robocopy C:\Users\trave\Downloads d:\naspublic\Downloads /z /s /r:2 /w:3 /copy:dt /XD "C:\Users\trave\Downloads\VMs"
|
||||
#robocopy C:\Users\trave\OneDrive\Devry \\NAS\devry /z /s /r:2 /w:2 /copy:dt /purge
|
||||
#robocopy \\NAS\public d:\naspublic /z /s /r:2 /w:3 /copy:dt /purge /MT:8 /compress
|
||||
#robocopy \\nas\vm d:\vms /z /s /r:2 /w:3 /copy:dt /purge /MT:8 /compress
|
||||
@@ -0,0 +1,52 @@
|
||||
<<<<<<< HEAD
|
||||
# Older Files
|
||||
|
||||
## Purpose
|
||||
This directory contains files related to **Older Files**.
|
||||
|
||||
## Contents
|
||||
- `Devry local to USB and NAS.bat`
|
||||
- `Map Drives.bat`
|
||||
- `Local to Rasp2.bat`
|
||||
- `Local to nas1 it-work.bat`
|
||||
- `Complete backup.ps1`
|
||||
- `Matts Network drives.bat`
|
||||
- `Local to NAS1.bat`
|
||||
- `NAS to local Backup.bat`
|
||||
- `Backup with out purge.bat`
|
||||
- `Old batch commands.txt`
|
||||
- ...and 5 more files
|
||||
|
||||
## Usage
|
||||
- Review each script or configuration file before running
|
||||
- Some scripts may require **root or sudo**
|
||||
- Paths and variables may need adjustment for your environment
|
||||
|
||||
## Notes
|
||||
- This folder is part of the **public-setupfiles** repository
|
||||
- Files are provided as-is for reference or automation
|
||||
|
||||
## Safety
|
||||
Always back up data before running scripts that modify system state.
|
||||
=======
|
||||
# Older Files
|
||||
|
||||
## Overview
|
||||
This directory is part of the **public-setupfiles** repository.
|
||||
It contains scripts, configuration files, or resources related to **Older Files**.
|
||||
|
||||
## Usage
|
||||
- Review scripts before execution
|
||||
- Some files may require **root or sudo privileges**
|
||||
- Paths, variables, or credentials may need customization
|
||||
|
||||
## Logging & Output
|
||||
Scripts may generate logs or output files in the same directory or system locations.
|
||||
|
||||
## Safety Notes
|
||||
- Always back up important data before running scripts
|
||||
- Test in a non-production environment when possible
|
||||
- Use at your own risk
|
||||
|
||||
---
|
||||
>>>>>>> main
|
||||
@@ -0,0 +1,7 @@
|
||||
robocopy C:\Users\trave\Pictures "W:\Traver's Personal\Photos" /z /s /r:2 /copy:dt /w:2
|
||||
|
||||
## robocopy C:\Users\trave\OneDrive\Pictures "W:\Traver's Personal\Photos" /z /s /r:2 /copy:dt /w:2
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
<<<<<<< HEAD
|
||||
# batch_files
|
||||
|
||||
## Purpose
|
||||
This directory contains files related to **batch files**.
|
||||
|
||||
## Contents
|
||||
- `Murder VM Backup.bat`
|
||||
- `Map Drives.bat`
|
||||
- `Education to education nas.bat`
|
||||
- `coding and programming backup.bat`
|
||||
- `Skyrim Copy from Nas to Local.bat`
|
||||
- `Backup Videos.bat`
|
||||
- `Traver-desk VM Backup.bat`
|
||||
- `familymedicalbackup.bat`
|
||||
- `Pictures backup.bat`
|
||||
- `NAS to 4tb Local USB.bat`
|
||||
- ...and 6 more files
|
||||
|
||||
## Usage
|
||||
- Review each script or configuration file before running
|
||||
- Some scripts may require **root or sudo**
|
||||
- Paths and variables may need adjustment for your environment
|
||||
|
||||
## Notes
|
||||
- This folder is part of the **public-setupfiles** repository
|
||||
- Files are provided as-is for reference or automation
|
||||
|
||||
## Safety
|
||||
Always back up data before running scripts that modify system state.
|
||||
=======
|
||||
# batch_files
|
||||
|
||||
## Overview
|
||||
This directory is part of the **public-setupfiles** repository.
|
||||
It contains scripts, configuration files, or resources related to **batch_files**.
|
||||
|
||||
## Usage
|
||||
- Review scripts before execution
|
||||
- Some files may require **root or sudo privileges**
|
||||
- Paths, variables, or credentials may need customization
|
||||
|
||||
## Logging & Output
|
||||
Scripts may generate logs or output files in the same directory or system locations.
|
||||
|
||||
## Safety Notes
|
||||
- Always back up important data before running scripts
|
||||
- Test in a non-production environment when possible
|
||||
- Use at your own risk
|
||||
|
||||
---
|
||||
>>>>>>> main
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
robocopy \\nas\public\game_backups\skyrim\config "C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition" /z /s /r:2 /copy:dt /w:2 /purge
|
||||
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
robocopy "C:\Program Files (x86)\Steam\steamapps\common\Skyrim Special Edition" \\nas\public\game_backups2\skyrim3\config /z /s /r:2 /copy:dt /w:2 /purge
|
||||
|
||||
robocopy "C:\Users\trave\OneDrive\Documents\My Games" \\nas\public\game_backups\game_saves /z /s /r:2 /copy:dt /w:2 /purge
|
||||
@@ -0,0 +1,10 @@
|
||||
net use w: \\nas\public
|
||||
net use s: \\nas\downloadedmedia
|
||||
net use t: \\nas\VM-proxmox
|
||||
net use r: \\nas\downloads
|
||||
|
||||
robocopy "C:\Users\Traver\OneDrive\Personal Vault" "W:\Traver's Personal\Private files\Super Private Files2" /z /s /r:2 /w:2 /copy:dt
|
||||
robocopy "C:\Users\Trave\OneDrive\Personal Vault" "W:\Traver's Personal\Private files\Super Private Files2" /z /s /r:2 /w:2 /copy:dt
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
net use w: \\nas\public
|
||||
net use s: \\nas\downloadedmedia
|
||||
net use r: \\nas\downloads
|
||||
|
||||
robocopy C:\Users\trave\Downloads\VMs \\NAS\public2\vm\sam-desk /z /s /r:2 /w:2 /copy:dt /purge /compress
|
||||
@@ -0,0 +1 @@
|
||||
robocopy "C:\Users\trave\OneDrive\Documents\Coding and Programming" "\\nas\public\Coding and Programming" /z /s /r:2 /w:2 /copy:dt /purge
|
||||
@@ -0,0 +1,5 @@
|
||||
net use w: \\nas\public
|
||||
|
||||
robocopy "C:\Users\Traver\OneDrive\Family Health Docs" "\\nas\public\Health Documents" /z /s /r:2 /w:1 /purge
|
||||
robocopy "C:\Users\Trave\OneDrive\Family Health Docs" "\\nas\public\Health Documents" /z /s /r:2 /w:1 /purge
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
# cockpit
|
||||
|
||||
<<<<<<< HEAD
|
||||
## Purpose
|
||||
This directory contains files related to **cockpit**.
|
||||
|
||||
## Contents
|
||||
- `cockpit_install.sh`
|
||||
|
||||
## Usage
|
||||
- Review each script or configuration file before running
|
||||
- Some scripts may require **root or sudo**
|
||||
- Paths and variables may need adjustment for your environment
|
||||
|
||||
## Notes
|
||||
- This folder is part of the **public-setupfiles** repository
|
||||
- Files are provided as-is for reference or automation
|
||||
|
||||
## Safety
|
||||
Always back up data before running scripts that modify system state.
|
||||
=======
|
||||
## Overview
|
||||
This directory is part of the **public-setupfiles** repository.
|
||||
It contains scripts, configuration files, or resources related to **cockpit**.
|
||||
|
||||
## Usage
|
||||
- Review scripts before execution
|
||||
- Some files may require **root or sudo privileges**
|
||||
- Paths, variables, or credentials may need customization
|
||||
|
||||
## Logging & Output
|
||||
Scripts may generate logs or output files in the same directory or system locations.
|
||||
|
||||
## Safety Notes
|
||||
- Always back up important data before running scripts
|
||||
- Test in a non-production environment when possible
|
||||
- Use at your own risk
|
||||
|
||||
---
|
||||
>>>>>>> main
|
||||
@@ -0,0 +1 @@
|
||||
sudo apt -y install cockpit
|
||||
+189
@@ -0,0 +1,189 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
OUTPUT="./info.txt"
|
||||
|
||||
#--------------------------------------------------
|
||||
# Detect OS and package manager
|
||||
#--------------------------------------------------
|
||||
if [ -r /etc/os-release ]; then
|
||||
. /etc/os-release
|
||||
DISTRO="$ID"
|
||||
DISTRO_NAME="$PRETTY_NAME"
|
||||
else
|
||||
DISTRO="unknown"
|
||||
DISTRO_NAME="Unknown Linux"
|
||||
fi
|
||||
|
||||
if command -v apt-get >/dev/null 2>&1; then
|
||||
PKG_INSTALL="apt-get install -y"
|
||||
PKG_UPDATE="apt-get update"
|
||||
elif command -v dnf >/dev/null 2>&1; then
|
||||
PKG_INSTALL="dnf install -y"
|
||||
PKG_UPDATE=":"
|
||||
elif command -v yum >/dev/null 2>&1; then
|
||||
PKG_INSTALL="yum install -y"
|
||||
PKG_UPDATE=":"
|
||||
elif command -v pacman >/dev/null 2>&1; then
|
||||
PKG_INSTALL="pacman -Sy --noconfirm"
|
||||
PKG_UPDATE=":"
|
||||
elif command -v apk >/dev/null 2>&1; then
|
||||
PKG_INSTALL="apk add"
|
||||
PKG_UPDATE="apk update"
|
||||
elif command -v zypper >/dev/null 2>&1; then
|
||||
PKG_INSTALL="zypper --non-interactive install"
|
||||
PKG_UPDATE="zypper refresh"
|
||||
else
|
||||
echo "Unsupported package manager."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
run_install() {
|
||||
if [ "$EUID" -eq 0 ]; then
|
||||
eval "$PKG_UPDATE"
|
||||
eval "$PKG_INSTALL $*"
|
||||
elif command -v sudo >/dev/null 2>&1; then
|
||||
sudo bash -c "$PKG_UPDATE"
|
||||
sudo bash -c "$PKG_INSTALL $*"
|
||||
else
|
||||
echo "Cannot install packages (sudo not found)."
|
||||
fi
|
||||
}
|
||||
|
||||
#--------------------------------------------------
|
||||
# Ensure commands exist
|
||||
#--------------------------------------------------
|
||||
|
||||
need_cmd() {
|
||||
local cmd="$1"
|
||||
shift
|
||||
|
||||
if ! command -v "$cmd" >/dev/null 2>&1; then
|
||||
echo "Installing package(s): $*"
|
||||
run_install "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
case "$DISTRO" in
|
||||
debian|ubuntu|linuxmint|pop)
|
||||
need_cmd lspci pciutils
|
||||
need_cmd lsusb usbutils
|
||||
need_cmd xrandr x11-xserver-utils
|
||||
;;
|
||||
fedora|rhel|centos|rocky|almalinux)
|
||||
need_cmd lspci pciutils
|
||||
need_cmd lsusb usbutils
|
||||
need_cmd xrandr xrandr
|
||||
;;
|
||||
arch|manjaro)
|
||||
need_cmd lspci pciutils
|
||||
need_cmd lsusb usbutils
|
||||
need_cmd xrandr xorg-xrandr
|
||||
;;
|
||||
alpine)
|
||||
need_cmd lspci pciutils
|
||||
need_cmd lsusb usbutils
|
||||
need_cmd xrandr xrandr
|
||||
;;
|
||||
opensuse*|sles)
|
||||
need_cmd lspci pciutils
|
||||
need_cmd lsusb usbutils
|
||||
need_cmd xrandr xrandr
|
||||
;;
|
||||
*)
|
||||
need_cmd lspci pciutils || true
|
||||
need_cmd lsusb usbutils || true
|
||||
need_cmd xrandr xrandr || true
|
||||
;;
|
||||
esac
|
||||
|
||||
#--------------------------------------------------
|
||||
# Collect Information
|
||||
#--------------------------------------------------
|
||||
|
||||
{
|
||||
echo "=================================================="
|
||||
echo "System Information Report"
|
||||
echo "=================================================="
|
||||
echo
|
||||
|
||||
echo "Date: $(date)"
|
||||
echo "Distribution: $DISTRO_NAME"
|
||||
echo
|
||||
|
||||
echo "===== HOSTNAME ====="
|
||||
hostnamectl 2>/dev/null || hostname
|
||||
echo
|
||||
|
||||
echo "===== KERNEL ====="
|
||||
uname -a
|
||||
echo
|
||||
|
||||
echo "===== CPU ====="
|
||||
lscpu 2>/dev/null
|
||||
echo
|
||||
|
||||
echo "===== MEMORY ====="
|
||||
free -h 2>/dev/null
|
||||
echo
|
||||
|
||||
echo "===== STORAGE ====="
|
||||
lsblk -o NAME,SIZE,FSTYPE,TYPE,MOUNTPOINT,MODEL
|
||||
echo
|
||||
|
||||
echo "===== GPU ====="
|
||||
lspci | grep -Ei 'vga|3d|display'
|
||||
echo
|
||||
|
||||
echo "===== PCI DEVICES ====="
|
||||
lspci
|
||||
echo
|
||||
|
||||
echo "===== USB DEVICES ====="
|
||||
lsusb
|
||||
echo
|
||||
|
||||
echo "===== NETWORK ====="
|
||||
ip addr
|
||||
echo
|
||||
|
||||
echo "===== ROUTES ====="
|
||||
ip route
|
||||
echo
|
||||
|
||||
echo "===== DNS ====="
|
||||
cat /etc/resolv.conf
|
||||
echo
|
||||
|
||||
echo "===== DISPLAY ====="
|
||||
|
||||
if command -v xrandr >/dev/null 2>&1; then
|
||||
echo "--- xrandr ---"
|
||||
DISPLAY=${DISPLAY:-:0} xrandr --current 2>/dev/null || true
|
||||
echo
|
||||
fi
|
||||
|
||||
if [ -f /sys/class/graphics/fb0/virtual_size ]; then
|
||||
echo "--- framebuffer ---"
|
||||
cat /sys/class/graphics/fb0/virtual_size
|
||||
echo
|
||||
fi
|
||||
|
||||
for f in /sys/class/drm/card*-*/modes; do
|
||||
[ -f "$f" ] || continue
|
||||
echo "--- $(basename "$(dirname "$f")") ---"
|
||||
cat "$f"
|
||||
echo
|
||||
done
|
||||
|
||||
echo "===== CONNECTED DISPLAYS ====="
|
||||
for f in /sys/class/drm/card*-*/status; do
|
||||
[ -f "$f" ] || continue
|
||||
printf "%-30s %s\n" "$(basename "$(dirname "$f")")" "$(cat "$f")"
|
||||
done
|
||||
|
||||
} > "$OUTPUT"
|
||||
|
||||
echo
|
||||
echo "Report saved to: $(realpath "$OUTPUT")"
|
||||
@@ -0,0 +1,2 @@
|
||||
:: Run Robocopy to Move Files
|
||||
robocopy C:\Users\yates\AppData\Local\Packages\Microsoft.MinecraftUWP_8wekyb3d8bbwe\LocalState\games\com.mojang \\nas\public\game_backups\Minecraft\Brandons-backup /z /s /r:2 /w:3 /XD /purge
|
||||
@@ -0,0 +1,45 @@
|
||||
<<<<<<< HEAD
|
||||
# copy-move-files
|
||||
|
||||
## Purpose
|
||||
This directory contains files related to **copy move files**.
|
||||
|
||||
## Contents
|
||||
- `Brandons-Minecraft_backup.sh`
|
||||
- `media_to_usb.sh`
|
||||
- `nas public.sh`
|
||||
- `public_to_usb.sh`
|
||||
|
||||
## Usage
|
||||
- Review each script or configuration file before running
|
||||
- Some scripts may require **root or sudo**
|
||||
- Paths and variables may need adjustment for your environment
|
||||
|
||||
## Notes
|
||||
- This folder is part of the **public-setupfiles** repository
|
||||
- Files are provided as-is for reference or automation
|
||||
|
||||
## Safety
|
||||
Always back up data before running scripts that modify system state.
|
||||
=======
|
||||
# copy-move-files
|
||||
|
||||
## Overview
|
||||
This directory is part of the **public-setupfiles** repository.
|
||||
It contains scripts, configuration files, or resources related to **copy-move-files**.
|
||||
|
||||
## Usage
|
||||
- Review scripts before execution
|
||||
- Some files may require **root or sudo privileges**
|
||||
- Paths, variables, or credentials may need customization
|
||||
|
||||
## Logging & Output
|
||||
Scripts may generate logs or output files in the same directory or system locations.
|
||||
|
||||
## Safety Notes
|
||||
- Always back up important data before running scripts
|
||||
- Test in a non-production environment when possible
|
||||
- Use at your own risk
|
||||
|
||||
---
|
||||
>>>>>>> main
|
||||
@@ -0,0 +1,4 @@
|
||||
sudo mount -a
|
||||
|
||||
rsync -r -E -u -z --progress --delete /media/nasmedia/Movies/ /media/traver/File_store/
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
sudo mount -a -v
|
||||
rsync -r -t -v -P --delete --exclude '.recycle/*' --exclude 'vm/*' --exclude 'john_deere/*' /media/naspublic /home/pi/4tbdrive
|
||||
@@ -0,0 +1,3 @@
|
||||
sudo mount -a
|
||||
|
||||
rsync -r -E -z -u --progress --exclude '/vm' --exclude '/proxmox' --delete /media/naspublic/ /media/traver/4tb/public
|
||||
@@ -0,0 +1,40 @@
|
||||
# copy_palworld_local
|
||||
|
||||
<<<<<<< HEAD
|
||||
## Purpose
|
||||
This directory contains files related to **copy palworld local**.
|
||||
|
||||
## Contents
|
||||
- `copy_palworld_local.py`
|
||||
|
||||
## Usage
|
||||
- Review each script or configuration file before running
|
||||
- Some scripts may require **root or sudo**
|
||||
- Paths and variables may need adjustment for your environment
|
||||
|
||||
## Notes
|
||||
- This folder is part of the **public-setupfiles** repository
|
||||
- Files are provided as-is for reference or automation
|
||||
|
||||
## Safety
|
||||
Always back up data before running scripts that modify system state.
|
||||
=======
|
||||
## Overview
|
||||
This directory is part of the **public-setupfiles** repository.
|
||||
It contains scripts, configuration files, or resources related to **copy_palworld_local**.
|
||||
|
||||
## Usage
|
||||
- Review scripts before execution
|
||||
- Some files may require **root or sudo privileges**
|
||||
- Paths, variables, or credentials may need customization
|
||||
|
||||
## Logging & Output
|
||||
Scripts may generate logs or output files in the same directory or system locations.
|
||||
|
||||
## Safety Notes
|
||||
- Always back up important data before running scripts
|
||||
- Test in a non-production environment when possible
|
||||
- Use at your own risk
|
||||
|
||||
---
|
||||
>>>>>>> main
|
||||
@@ -0,0 +1,86 @@
|
||||
import ftplib
|
||||
import os
|
||||
import time
|
||||
|
||||
# FTP Credentials
|
||||
FTP_HOST = "ftp.example.com"
|
||||
FTP_USER = "your_username"
|
||||
FTP_PASS = "your_password"
|
||||
|
||||
# Directories
|
||||
REMOTE_DIR = "/remote_directory" # Change this to the directory you want to sync
|
||||
LOCAL_DIR = "/local/directory" # Change this to the local path where files should be saved
|
||||
|
||||
def connect_ftp():
|
||||
"""Connect to FTP server with passive mode enabled."""
|
||||
ftp = ftplib.FTP(FTP_HOST)
|
||||
ftp.login(FTP_USER, FTP_PASS)
|
||||
ftp.set_pasv(True) # Enable passive mode
|
||||
return ftp
|
||||
|
||||
def ensure_local_dir(path):
|
||||
"""Ensure the local directory exists."""
|
||||
if not os.path.exists(path):
|
||||
os.makedirs(path)
|
||||
|
||||
def download_file(ftp, remote_filepath, local_filepath):
|
||||
"""Download a file only if it's newer than the local version."""
|
||||
try:
|
||||
# Get remote file timestamp
|
||||
remote_time = ftp.sendcmd(f"MDTM {remote_filepath}")[4:].strip()
|
||||
remote_timestamp = time.mktime(time.strptime(remote_time, "%Y%m%d%H%M%S"))
|
||||
|
||||
# Check if the local file exists
|
||||
if os.path.exists(local_filepath):
|
||||
local_timestamp = os.path.getmtime(local_filepath)
|
||||
if local_timestamp >= remote_timestamp:
|
||||
print(f"Skipping {remote_filepath} (Already up to date)")
|
||||
return # Skip download if local file is newer
|
||||
|
||||
# Download file
|
||||
with open(local_filepath, "wb") as f:
|
||||
ftp.retrbinary(f"RETR {remote_filepath}", f.write)
|
||||
|
||||
# Update local file timestamp
|
||||
os.utime(local_filepath, (remote_timestamp, remote_timestamp))
|
||||
print(f"Downloaded: {remote_filepath} -> {local_filepath}")
|
||||
|
||||
except ftplib.error_perm as e:
|
||||
print(f"Failed to download {remote_filepath}: {e}")
|
||||
|
||||
def download_directory(ftp, remote_dir, local_dir):
|
||||
"""Recursively download an entire directory from FTP."""
|
||||
ensure_local_dir(local_dir)
|
||||
|
||||
# Change to the target directory
|
||||
ftp.cwd(remote_dir)
|
||||
|
||||
# List directory contents
|
||||
items = ftp.nlst()
|
||||
|
||||
for item in items:
|
||||
remote_path = f"{remote_dir}/{item}"
|
||||
local_path = os.path.join(local_dir, item)
|
||||
|
||||
try:
|
||||
# Check if item is a directory
|
||||
ftp.cwd(remote_path)
|
||||
print(f"Entering Directory: {remote_path}")
|
||||
download_directory(ftp, remote_path, local_path)
|
||||
ftp.cwd("..") # Go back after downloading the directory
|
||||
except ftplib.error_perm:
|
||||
# If changing directory fails, it's a file
|
||||
download_file(ftp, remote_path, local_path)
|
||||
|
||||
def main():
|
||||
"""Main function to sync FTP directory."""
|
||||
ftp = connect_ftp()
|
||||
print(f"Connected to {FTP_HOST}")
|
||||
|
||||
download_directory(ftp, REMOTE_DIR, LOCAL_DIR)
|
||||
|
||||
ftp.quit()
|
||||
print("FTP Sync Completed.")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,26 @@
|
||||
MAILTO="alert@tyates.one"
|
||||
0 */6 * * * root apt-get update && apt install upgrade -y && apt-get -y -d full-upgrade && apt-get autoremove -y
|
||||
|
||||
#* */4 * * * /home/pi/Desktop/sync.sh
|
||||
# sudo apt-get update
|
||||
# sudo apt-get upgrade -y
|
||||
|
||||
|
||||
#https://crontab-generator.org/
|
||||
#apt-get install cron-apt -y
|
||||
#https://www.techrepublic.com/article/automatically-update-your-ubuntu-system-with-cron-apt/
|
||||
#https://www.linuxfordevices.com/tutorials/linux/automatic-updates-cronjob
|
||||
|
||||
|
||||
#[minute] [hour] [day_of_month] [month] [day_of_week] [user] [command_to_run]
|
||||
|
||||
#0 0 * * 0 root (apt-get update && apt-get -y -d upgrade)
|
||||
|
||||
sudo apt install cron cron-apt -y
|
||||
sudo systemctl enable cron
|
||||
sudo nano /etc/crontab
|
||||
|
||||
#MAILTO="alerts@tyates.one"
|
||||
#0 */6 * * * root apt-get update && apt-get -y -d full-upgrade && apt-get autoremove -y
|
||||
|
||||
#sudo apt-get update && sudo apt-get full-upgrade -y && sudo apt autoremove -y
|
||||
@@ -0,0 +1,44 @@
|
||||
<<<<<<< HEAD
|
||||
# cron-job-setup-files
|
||||
|
||||
## Purpose
|
||||
This directory contains files related to **cron job setup files**.
|
||||
|
||||
## Contents
|
||||
- `setup_cron_job_updates-nomount.sh`
|
||||
- `CronUpdates-readme.txt`
|
||||
- `setup_cron_job_updates.sh`
|
||||
|
||||
## Usage
|
||||
- Review each script or configuration file before running
|
||||
- Some scripts may require **root or sudo**
|
||||
- Paths and variables may need adjustment for your environment
|
||||
|
||||
## Notes
|
||||
- This folder is part of the **public-setupfiles** repository
|
||||
- Files are provided as-is for reference or automation
|
||||
|
||||
## Safety
|
||||
Always back up data before running scripts that modify system state.
|
||||
=======
|
||||
# cron-job-setup-files
|
||||
|
||||
## Overview
|
||||
This directory is part of the **public-setupfiles** repository.
|
||||
It contains scripts, configuration files, or resources related to **cron-job-setup-files**.
|
||||
|
||||
## Usage
|
||||
- Review scripts before execution
|
||||
- Some files may require **root or sudo privileges**
|
||||
- Paths, variables, or credentials may need customization
|
||||
|
||||
## Logging & Output
|
||||
Scripts may generate logs or output files in the same directory or system locations.
|
||||
|
||||
## Safety Notes
|
||||
- Always back up important data before running scripts
|
||||
- Test in a non-production environment when possible
|
||||
- Use at your own risk
|
||||
|
||||
---
|
||||
>>>>>>> main
|
||||
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Script: setup_auto_updates.sh
|
||||
# Description: Configure automatic system updates via cron on Debian 12
|
||||
|
||||
# Exit immediately on error
|
||||
set -e
|
||||
|
||||
# Update package lists and install cron
|
||||
sudo apt update
|
||||
sudo apt install -y cron
|
||||
|
||||
# Enable and start the cron service
|
||||
sudo systemctl enable cron
|
||||
sudo systemctl restart cron
|
||||
|
||||
# Write the cron job to /etc/cron.d/auto_updates properly using EOF
|
||||
sudo tee /etc/cron.d/auto_updates > /dev/null << 'EOF'
|
||||
MAILTO="alerts@tyates.one"
|
||||
0 */6 * * * root apt-get update && apt-get -y -d full-upgrade && apt-get autoremove -y && apt-get clean -y && apt-get purge -y
|
||||
EOF
|
||||
|
||||
# Set proper permissions
|
||||
sudo chmod 644 /etc/cron.d/auto_updates
|
||||
sudo chown root:root /etc/cron.d/auto_updates
|
||||
|
||||
echo "[✓] Auto update cron job installed. Runs every 6 hours."
|
||||
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Script: setup_auto_updates.sh
|
||||
# Description: Script to set up automatic system updates using cron
|
||||
|
||||
# Update package lists and install cron
|
||||
sudo apt update
|
||||
sudo apt install cron -y
|
||||
|
||||
# Enable and start the cron service
|
||||
sudo systemctl enable cron
|
||||
sudo systemctl start cron
|
||||
|
||||
# Stop the cron service to make changes
|
||||
sudo systemctl stop cron
|
||||
|
||||
# Add the update and upgrade cron job to /etc/cron.d/
|
||||
# Old line that doesnt work
|
||||
# echo 'MAILTO="alerts@tyates.one"
|
||||
# 0 */6 * * * root apt-get update && apt-get -y -d full-upgrade && apt-get autoremove -y && sudo apt-get clean -y && sudo apt-get purge -y' | sudo tee /etc/cron.d/auto_updates
|
||||
|
||||
# Add the update and upgrade cron job to /etc/cron.d/auto_updates
|
||||
echo 'MAILTO="alerts@tyates.one"
|
||||
0 */6 * * * root apt-get update && apt-get -y -d full-upgrade && apt-get autoremove -y && sudo apt-get clean -y && sudo apt-get purge -y
|
||||
0 */1 * * * root mount -a' | sudo tee /etc/cron.d/auto_updates
|
||||
|
||||
# Restart the cron service to apply the new cron job
|
||||
sudo systemctl start cron
|
||||
@@ -0,0 +1,42 @@
|
||||
# debian-dist-upgrades
|
||||
|
||||
<<<<<<< HEAD
|
||||
## Purpose
|
||||
This directory contains files related to **debian dist upgrades**.
|
||||
=======
|
||||
## Overview
|
||||
This directory is part of the **public-setupfiles** repository.
|
||||
It contains scripts, configuration files, or resources related to **debian-dist-upgrades**.
|
||||
|
||||
## Usage
|
||||
- Review scripts before execution
|
||||
- Some files may require **root or sudo privileges**
|
||||
- Paths, variables, or credentials may need customization
|
||||
|
||||
## Logging & Output
|
||||
Scripts may generate logs or output files in the same directory or system locations.
|
||||
|
||||
## Safety Notes
|
||||
- Always back up important data before running scripts
|
||||
- Test in a non-production environment when possible
|
||||
- Use at your own risk
|
||||
|
||||
---
|
||||
A **safe, interactive Debian system upgrade utility** designed for real-world administration.
|
||||
Supports standard upgrades, full upgrades, controlled distro upgrades (Debian 12 / 13), and optional Parrot Linux conversion — with logging and guardrails.
|
||||
>>>>>>> main
|
||||
|
||||
## Contents
|
||||
- `dist-upgrade.sh`
|
||||
|
||||
## Usage
|
||||
- Review each script or configuration file before running
|
||||
- Some scripts may require **root or sudo**
|
||||
- Paths and variables may need adjustment for your environment
|
||||
|
||||
## Notes
|
||||
- This folder is part of the **public-setupfiles** repository
|
||||
- Files are provided as-is for reference or automation
|
||||
|
||||
## Safety
|
||||
Always back up data before running scripts that modify system state.
|
||||
@@ -0,0 +1,179 @@
|
||||
#!/bin/bash
|
||||
set -o pipefail
|
||||
|
||||
LOGFILE="./log.txt"
|
||||
exec > >(tee -a "$LOGFILE") 2>&1
|
||||
|
||||
echo "===== Debian Upgrade Script Started: $(date) ====="
|
||||
|
||||
# --------------------------------------------------
|
||||
# Helper: yes/no prompt (accepts y|yes / n|no)
|
||||
# --------------------------------------------------
|
||||
ask_yes_no() {
|
||||
local prompt="$1"
|
||||
local reply
|
||||
while true; do
|
||||
read -rp "$prompt [y/n]: " reply
|
||||
case "${reply,,}" in
|
||||
y|yes) return 0 ;;
|
||||
n|no) return 1 ;;
|
||||
*) echo "Please answer yes or no." ;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
# --------------------------------------------------
|
||||
# 1. Verify Debian-based OS
|
||||
# --------------------------------------------------
|
||||
if [[ ! -f /etc/os-release ]]; then
|
||||
echo "ERROR: Cannot detect OS."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
source /etc/os-release
|
||||
|
||||
if [[ "$ID_LIKE" != *"debian"* && "$ID" != "debian" ]]; then
|
||||
echo "ERROR: This system is not Debian-based."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Detected OS: $PRETTY_NAME"
|
||||
|
||||
# --------------------------------------------------
|
||||
# 2. Identify version and prompt
|
||||
# --------------------------------------------------
|
||||
DEBIAN_VERSION="$VERSION_ID"
|
||||
DEBIAN_CODENAME="$VERSION_CODENAME"
|
||||
|
||||
echo "Current Debian Version: $DEBIAN_VERSION ($DEBIAN_CODENAME)"
|
||||
|
||||
ask_yes_no "Continue?" || exit 0
|
||||
|
||||
# --------------------------------------------------
|
||||
# 3. Upgrade Menu
|
||||
# --------------------------------------------------
|
||||
echo ""
|
||||
echo "Select upgrade option:"
|
||||
echo "1) apt upgrade"
|
||||
echo "2) apt full-upgrade"
|
||||
echo "3) Debian distro upgrade"
|
||||
echo "4) Convert Debian to Parrot Linux"
|
||||
read -rp "Choice [1-4]: " CHOICE
|
||||
|
||||
# Non-interactive + keep config files
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
APT_OPTS=(
|
||||
"-o" "Dpkg::Options::=--force-confold"
|
||||
"-o" "Dpkg::Options::=--force-confdef"
|
||||
)
|
||||
|
||||
# --------------------------------------------------
|
||||
# Option 1: apt upgrade
|
||||
# --------------------------------------------------
|
||||
if [[ "$CHOICE" == "1" ]]; then
|
||||
apt update
|
||||
apt upgrade -y "${APT_OPTS[@]}"
|
||||
apt autoremove -y
|
||||
echo "apt upgrade completed."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# --------------------------------------------------
|
||||
# Option 2: apt full-upgrade
|
||||
# --------------------------------------------------
|
||||
if [[ "$CHOICE" == "2" ]]; then
|
||||
apt update
|
||||
apt upgrade -y "${APT_OPTS[@]}"
|
||||
apt full-upgrade -y "${APT_OPTS[@]}"
|
||||
apt autoremove -y
|
||||
echo "apt full-upgrade completed."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# --------------------------------------------------
|
||||
# Option 4: Parrot Linux Conversion
|
||||
# --------------------------------------------------
|
||||
if [[ "$CHOICE" == "4" ]]; then
|
||||
echo "WARNING: This will convert Debian into Parrot Linux."
|
||||
ask_yes_no "Are you sure you want to proceed?" || exit 1
|
||||
|
||||
git clone https://gitlab.com/parrotsec/project/debian-conversion-script.git
|
||||
cd debian-conversion-script || exit 1
|
||||
chmod +x ./install.sh
|
||||
./install.sh
|
||||
exit $?
|
||||
fi
|
||||
|
||||
# --------------------------------------------------
|
||||
# Option 3: Debian Distro Upgrade
|
||||
# --------------------------------------------------
|
||||
if [[ "$CHOICE" != "3" ]]; then
|
||||
echo "Invalid selection."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Select Debian upgrade target:"
|
||||
echo "1) Debian 12 (Bookworm - Stable)"
|
||||
echo "2) Debian 13 (Trixie - Testing)"
|
||||
read -rp "Choice [1-2]: " TARGET
|
||||
|
||||
# Backup sources.list
|
||||
cp /etc/apt/sources.list /etc/apt/sources.list.bak.$(date +%F)
|
||||
|
||||
# Comment out existing entries (do not delete)
|
||||
sed -i 's/^[^#]/#&/' /etc/apt/sources.list
|
||||
|
||||
# --------------------------------------------------
|
||||
# Debian 12
|
||||
# --------------------------------------------------
|
||||
if [[ "$TARGET" == "1" ]]; then
|
||||
echo "Preparing upgrade to Debian 12 (Bookworm)"
|
||||
|
||||
cat <<EOF >> /etc/apt/sources.list
|
||||
|
||||
# Debian 12 Bookworm Repositories
|
||||
deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
|
||||
deb http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
|
||||
deb http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
|
||||
EOF
|
||||
|
||||
apt update
|
||||
apt upgrade -y "${APT_OPTS[@]}"
|
||||
apt full-upgrade -y "${APT_OPTS[@]}"
|
||||
apt autoremove -y
|
||||
|
||||
echo "Upgrade to Debian 12 completed."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# --------------------------------------------------
|
||||
# Debian 13 (Double Confirmation)
|
||||
# --------------------------------------------------
|
||||
if [[ "$TARGET" == "2" ]]; then
|
||||
echo "WARNING: Debian 13 (Trixie) is TESTING."
|
||||
|
||||
ask_yes_no "Do you understand this is a testing release?" || exit 1
|
||||
ask_yes_no "Confirm upgrade to Debian 13?" || exit 1
|
||||
|
||||
cat <<EOF >> /etc/apt/sources.list
|
||||
|
||||
# Debian 13 Trixie Repositories
|
||||
deb http://deb.debian.org/debian trixie main contrib non-free non-free-firmware
|
||||
deb http://deb.debian.org/debian trixie-updates main contrib non-free non-free-firmware
|
||||
deb http://security.debian.org/debian-security trixie-security main contrib non-free non-free-firmware
|
||||
EOF
|
||||
|
||||
apt update
|
||||
apt upgrade -y "${APT_OPTS[@]}"
|
||||
apt full-upgrade -y "${APT_OPTS[@]}"
|
||||
apt autoremove -y
|
||||
apt clean
|
||||
apt purge -y '~c'
|
||||
|
||||
echo "Upgrade to Debian 13 completed."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Unknown error occurred."
|
||||
exit 1
|
||||
@@ -0,0 +1,43 @@
|
||||
<<<<<<< HEAD
|
||||
# debian-files
|
||||
|
||||
## Purpose
|
||||
This directory contains files related to **debian files**.
|
||||
|
||||
## Contents
|
||||
- `update_tailscale.sh`
|
||||
- `install-bashtop.sh`
|
||||
|
||||
## Usage
|
||||
- Review each script or configuration file before running
|
||||
- Some scripts may require **root or sudo**
|
||||
- Paths and variables may need adjustment for your environment
|
||||
|
||||
## Notes
|
||||
- This folder is part of the **public-setupfiles** repository
|
||||
- Files are provided as-is for reference or automation
|
||||
|
||||
## Safety
|
||||
Always back up data before running scripts that modify system state.
|
||||
=======
|
||||
# debian-files
|
||||
|
||||
## Overview
|
||||
This directory is part of the **public-setupfiles** repository.
|
||||
It contains scripts, configuration files, or resources related to **debian-files**.
|
||||
|
||||
## Usage
|
||||
- Review scripts before execution
|
||||
- Some files may require **root or sudo privileges**
|
||||
- Paths, variables, or credentials may need customization
|
||||
|
||||
## Logging & Output
|
||||
Scripts may generate logs or output files in the same directory or system locations.
|
||||
|
||||
## Safety Notes
|
||||
- Always back up important data before running scripts
|
||||
- Test in a non-production environment when possible
|
||||
- Use at your own risk
|
||||
|
||||
---
|
||||
>>>>>>> main
|
||||
@@ -0,0 +1,4 @@
|
||||
git clone https://github.com/aristocratos/bashtop.git
|
||||
cd bashtop
|
||||
sudo apt install -y make
|
||||
sudo make install
|
||||
@@ -0,0 +1,145 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Update Tailscale on Debian/Ubuntu/Raspbian.
|
||||
# - Ensures official repo is present (with signed-by keyring for modern releases)
|
||||
# - apt-get update && apt-get install -y tailscale
|
||||
# - Starts/enables tailscaled if systemd is available
|
||||
|
||||
REPO_FILE="/etc/apt/sources.list.d/tailscale.list"
|
||||
KEYRING_DIR="/usr/share/keyrings"
|
||||
KEYRING_FILE="${KEYRING_DIR}/tailscale-archive-keyring.gpg"
|
||||
|
||||
need_cmd() {
|
||||
command -v "$1" >/dev/null 2>&1 || {
|
||||
echo "Installing missing dependency: $1"
|
||||
sudo apt-get update -y
|
||||
sudo apt-get install -y "$1"
|
||||
}
|
||||
}
|
||||
|
||||
require_root() {
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
echo "Please run as root (use: sudo bash $0)"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
main() {
|
||||
require_root
|
||||
|
||||
# Base dependencies
|
||||
need_cmd curl
|
||||
need_cmd tee
|
||||
need_cmd apt-get
|
||||
|
||||
# Detect distro and codename
|
||||
if [ -r /etc/os-release ]; then
|
||||
. /etc/os-release
|
||||
else
|
||||
echo "Cannot read /etc/os-release; aborting."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Normalize ID to expected repo path segments
|
||||
# (tailscale supports 'debian', 'ubuntu', 'raspbian')
|
||||
case "${ID:-}" in
|
||||
debian) repo_base="debian" ;;
|
||||
ubuntu) repo_base="ubuntu" ;;
|
||||
raspbian) repo_base="raspbian" ;;
|
||||
*)
|
||||
# Some derivatives set ID_LIKE
|
||||
if [[ "${ID_LIKE:-}" =~ debian ]]; then
|
||||
# Default to debian rules for derivatives
|
||||
repo_base="debian"
|
||||
else
|
||||
echo "Unsupported distro ID: '${ID:-}' (ID_LIKE: '${ID_LIKE:-}')."
|
||||
echo "This script supports Debian, Ubuntu, or Raspbian."
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
codename="${VERSION_CODENAME:-}"
|
||||
if [ -z "$codename" ]; then
|
||||
# Fallback: parse from /etc/debian_version if needed
|
||||
if [ -r /etc/debian_version ] && [ "$repo_base" = "debian" ]; then
|
||||
debver="$(cut -d'.' -f1 < /etc/debian_version || true)"
|
||||
case "$debver" in
|
||||
12) codename="bookworm" ;;
|
||||
11) codename="bullseye" ;;
|
||||
10) codename="buster" ;;
|
||||
9) codename="stretch" ;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$codename" ]; then
|
||||
echo "Could not detect VERSION_CODENAME. Aborting to avoid wrong repo."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Detected: ID='${ID:-unknown}' (${repo_base}), CODENAME='${codename}'."
|
||||
|
||||
mkdir -p -m 0755 "$KEYRING_DIR"
|
||||
|
||||
# URLs per Tailscale official instructions
|
||||
key_url="https://pkgs.tailscale.com/stable/${repo_base}/${codename}.noarmor.gpg"
|
||||
list_url="https://pkgs.tailscale.com/stable/${repo_base}/${codename}.tailscale-keyring.list"
|
||||
|
||||
# Some older suites (e.g., buster/stretch) don't have *.noarmor.gpg + *.tailscale-keyring.list.
|
||||
# In that case, fall back to legacy apt-key instructions.
|
||||
use_legacy=false
|
||||
if curl -fsI "$key_url" >/dev/null 2>&1 && curl -fsI "$list_url" >/dev/null 2>&1; then
|
||||
echo "Using keyring-based repo for ${repo_base}/${codename}."
|
||||
curl -fsSL "$key_url" | tee "$KEYRING_FILE" >/dev/null
|
||||
chmod 0644 "$KEYRING_FILE"
|
||||
curl -fsSL "$list_url" | tee "$REPO_FILE" >/dev/null
|
||||
else
|
||||
echo "Keyring URLs not available for ${repo_base}/${codename}. Falling back to legacy method."
|
||||
use_legacy=true
|
||||
fi
|
||||
|
||||
if [ "$use_legacy" = true ]; then
|
||||
# Legacy (deprecated) apt-key method for older releases
|
||||
# Keep this branch only for suites where keyring method isn't provided upstream.
|
||||
asc_url="https://pkgs.tailscale.com/stable/${repo_base}/${codename}.asc"
|
||||
list_legacy_url="https://pkgs.tailscale.com/stable/${repo_base}/${codename}.list"
|
||||
|
||||
if ! curl -fsI "$asc_url" >/dev/null 2>&1 || ! curl -fsI "$list_legacy_url" >/dev/null 2>&1; then
|
||||
echo "No repo artifacts found for ${repo_base}/${codename}. Please upgrade your OS or install via https://tailscale.com/install.sh"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
need_cmd apt-key
|
||||
curl -fsSL "$asc_url" | apt-key add -
|
||||
curl -fsSL "$list_legacy_url" | tee "$REPO_FILE" >/dev/null
|
||||
fi
|
||||
|
||||
echo "Refreshing package lists…"
|
||||
apt-get update -y
|
||||
|
||||
echo "Installing/upgrading tailscale…"
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y tailscale
|
||||
|
||||
# Start/enable service if systemd is available
|
||||
if command -v systemctl >/dev/null 2>&1; then
|
||||
systemctl enable --now tailscaled || true
|
||||
fi
|
||||
|
||||
echo "Done. Tailscale version:"
|
||||
tailscale version || true
|
||||
|
||||
cat <<'EOF'
|
||||
|
||||
If this device hasn't been authenticated yet, run:
|
||||
sudo tailscale up
|
||||
|
||||
Common options:
|
||||
sudo tailscale up --accept-routes --advertise-exit-node
|
||||
sudo tailscale up --advertise-routes=10.0.0.0/16
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -0,0 +1,179 @@
|
||||
services:
|
||||
vulnerability-tests:
|
||||
image: greenbone/vulnerability-tests
|
||||
environment:
|
||||
STORAGE_PATH: /var/lib/openvas/22.04/vt-data/nasl
|
||||
volumes:
|
||||
- vt_data_vol:/mnt
|
||||
|
||||
notus-data:
|
||||
image: greenbone/notus-data
|
||||
volumes:
|
||||
- notus_data_vol:/mnt
|
||||
|
||||
scap-data:
|
||||
image: greenbone/scap-data
|
||||
volumes:
|
||||
- scap_data_vol:/mnt
|
||||
|
||||
cert-bund-data:
|
||||
image: greenbone/cert-bund-data
|
||||
volumes:
|
||||
- cert_data_vol:/mnt
|
||||
|
||||
dfn-cert-data:
|
||||
image: greenbone/dfn-cert-data
|
||||
volumes:
|
||||
- cert_data_vol:/mnt
|
||||
depends_on:
|
||||
- cert-bund-data
|
||||
|
||||
data-objects:
|
||||
image: greenbone/data-objects
|
||||
volumes:
|
||||
- data_objects_vol:/mnt
|
||||
|
||||
report-formats:
|
||||
image: greenbone/report-formats
|
||||
volumes:
|
||||
- data_objects_vol:/mnt
|
||||
depends_on:
|
||||
- data-objects
|
||||
|
||||
gpg-data:
|
||||
image: greenbone/gpg-data
|
||||
volumes:
|
||||
- gpg_data_vol:/mnt
|
||||
|
||||
redis-server:
|
||||
image: greenbone/redis-server
|
||||
restart: on-failure
|
||||
volumes:
|
||||
- redis_socket_vol:/run/redis/
|
||||
|
||||
pg-gvm:
|
||||
image: greenbone/pg-gvm:stable
|
||||
restart: on-failure
|
||||
volumes:
|
||||
- psql_data_vol:/var/lib/postgresql
|
||||
- psql_socket_vol:/var/run/postgresql
|
||||
|
||||
gvmd:
|
||||
image: greenbone/gvmd:stable
|
||||
restart: on-failure
|
||||
volumes:
|
||||
- gvmd_data_vol:/var/lib/gvm
|
||||
- scap_data_vol:/var/lib/gvm/scap-data/
|
||||
- cert_data_vol:/var/lib/gvm/cert-data
|
||||
- data_objects_vol:/var/lib/gvm/data-objects/gvmd
|
||||
- vt_data_vol:/var/lib/openvas/plugins
|
||||
- psql_data_vol:/var/lib/postgresql
|
||||
- gvmd_socket_vol:/run/gvmd
|
||||
- ospd_openvas_socket_vol:/run/ospd
|
||||
- psql_socket_vol:/var/run/postgresql
|
||||
depends_on:
|
||||
pg-gvm:
|
||||
condition: service_started
|
||||
scap-data:
|
||||
condition: service_completed_successfully
|
||||
cert-bund-data:
|
||||
condition: service_completed_successfully
|
||||
dfn-cert-data:
|
||||
condition: service_completed_successfully
|
||||
data-objects:
|
||||
condition: service_completed_successfully
|
||||
report-formats:
|
||||
condition: service_completed_successfully
|
||||
|
||||
gsa:
|
||||
image: greenbone/gsa:stable
|
||||
restart: on-failure
|
||||
ports:
|
||||
- 127.0.0.1:9392:80
|
||||
volumes:
|
||||
- gvmd_socket_vol:/run/gvmd
|
||||
depends_on:
|
||||
- gvmd
|
||||
|
||||
ospd-openvas:
|
||||
image: greenbone/ospd-openvas:stable
|
||||
restart: on-failure
|
||||
hostname: ospd-openvas.local
|
||||
cap_add:
|
||||
- NET_ADMIN # for capturing packages in promiscuous mode
|
||||
- NET_RAW # for raw sockets e.g. used for the boreas alive detection
|
||||
security_opt:
|
||||
- seccomp=unconfined
|
||||
- apparmor=unconfined
|
||||
command:
|
||||
[
|
||||
"ospd-openvas",
|
||||
"-f",
|
||||
"--config",
|
||||
"/etc/gvm/ospd-openvas.conf",
|
||||
"--mqtt-broker-address",
|
||||
"mqtt-broker",
|
||||
"--notus-feed-dir",
|
||||
"/var/lib/notus/advisories",
|
||||
"-m",
|
||||
"666"
|
||||
]
|
||||
volumes:
|
||||
- gpg_data_vol:/etc/openvas/gnupg
|
||||
- vt_data_vol:/var/lib/openvas/plugins
|
||||
- notus_data_vol:/var/lib/notus
|
||||
- ospd_openvas_socket_vol:/run/ospd
|
||||
- redis_socket_vol:/run/redis/
|
||||
depends_on:
|
||||
redis-server:
|
||||
condition: service_started
|
||||
gpg-data:
|
||||
condition: service_completed_successfully
|
||||
vulnerability-tests:
|
||||
condition: service_completed_successfully
|
||||
|
||||
mqtt-broker:
|
||||
restart: on-failure
|
||||
image: greenbone/mqtt-broker
|
||||
networks:
|
||||
default:
|
||||
aliases:
|
||||
- mqtt-broker
|
||||
- broker
|
||||
|
||||
notus-scanner:
|
||||
restart: on-failure
|
||||
image: greenbone/notus-scanner:stable
|
||||
volumes:
|
||||
- notus_data_vol:/var/lib/notus
|
||||
- gpg_data_vol:/etc/openvas/gnupg
|
||||
environment:
|
||||
NOTUS_SCANNER_MQTT_BROKER_ADDRESS: mqtt-broker
|
||||
NOTUS_SCANNER_PRODUCTS_DIRECTORY: /var/lib/notus/products
|
||||
depends_on:
|
||||
- mqtt-broker
|
||||
- gpg-data
|
||||
- vulnerability-tests
|
||||
|
||||
gvm-tools:
|
||||
image: greenbone/gvm-tools
|
||||
volumes:
|
||||
- gvmd_socket_vol:/run/gvmd
|
||||
- ospd_openvas_socket_vol:/run/ospd
|
||||
depends_on:
|
||||
- gvmd
|
||||
- ospd-openvas
|
||||
|
||||
volumes:
|
||||
gpg_data_vol:
|
||||
scap_data_vol:
|
||||
cert_data_vol:
|
||||
data_objects_vol:
|
||||
gvmd_data_vol:
|
||||
psql_data_vol:
|
||||
vt_data_vol:
|
||||
notus_data_vol:
|
||||
psql_socket_vol:
|
||||
gvmd_socket_vol:
|
||||
ospd_openvas_socket_vol:
|
||||
redis_socket_vol:
|
||||
@@ -0,0 +1,21 @@
|
||||
#remove previous conflicting packages
|
||||
for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do sudo apt remove $pkg; done
|
||||
|
||||
#updates, setup souces and install.
|
||||
sudo install -m 0755 -d /etc/apt/keyrings
|
||||
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
||||
sudo chmod a+r /etc/apt/keyrings/docker.gpg
|
||||
echo \
|
||||
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
|
||||
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
|
||||
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||
sudo apt update
|
||||
|
||||
#install docker
|
||||
sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin -y
|
||||
|
||||
#Adduser to docker
|
||||
sudo usermod -aG docker $USER && su $USER
|
||||
|
||||
# create download dir:
|
||||
export DOWNLOAD_DIR=$HOME/greenbone-community-container && mkdir -p $DOWNLOAD_DIR
|
||||
@@ -0,0 +1 @@
|
||||
curl -f -O https://greenbone.github.io/docs/latest/_static/setup-and-start-greenbone-community-edition.sh && chmod u+x setup-and-start-greenbone-community-edition.sh
|
||||
@@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Update the package index
|
||||
sudo apt update
|
||||
|
||||
# Install prerequisites
|
||||
sudo apt install -y ca-certificates curl gnupg lsb-release
|
||||
|
||||
# Add Docker's official GPG key
|
||||
sudo install -m 0755 -d /etc/apt/keyrings
|
||||
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
||||
sudo chmod a+r /etc/apt/keyrings/docker.gpg
|
||||
|
||||
# Set up the Docker repository
|
||||
CODENAME=$(lsb_release -cs)
|
||||
echo \
|
||||
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
|
||||
$CODENAME stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||
|
||||
# Update the package index again
|
||||
sudo apt update
|
||||
|
||||
# Install Docker Engine, CLI, and containerd
|
||||
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
||||
|
||||
# Optional: Add the current user to the Docker group
|
||||
if [ "$USER" != "root" ]; then
|
||||
echo "Adding user $USER to the Docker group. Log out and log back in to apply the changes."
|
||||
sudo usermod -aG docker $USER
|
||||
fi
|
||||
|
||||
# Done
|
||||
echo "Docker has been installed successfully!"
|
||||
@@ -0,0 +1,27 @@
|
||||
# Update package lists and install dependencies
|
||||
sudo apt update
|
||||
sudo apt-get install libffi-dev libssl-dev python3-dev python3-pip -y
|
||||
|
||||
# Script install docker
|
||||
curl -fsSL https://get.docker.com -o get-docker.sh
|
||||
sh get-docker.sh
|
||||
|
||||
# Script: install_docker_compose.sh
|
||||
# Description: Script to install Docker Compose and its dependencies on Linux
|
||||
|
||||
# Install Docker Compose using pip
|
||||
sudo pip3 install docker-compose
|
||||
|
||||
# Download Docker Compose executable
|
||||
DOCKER_COMPOSE_VERSION=2.20.3
|
||||
sudo curl -L --fail https://github.com/docker/compose/releases/download/v${DOCKER_COMPOSE_VERSION}/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
|
||||
|
||||
# Make Docker Compose executable
|
||||
sudo chmod +x /usr/local/bin/docker-compose
|
||||
|
||||
# Check if Docker Compose installation was successful
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Docker Compose is installed and ready to use."
|
||||
else
|
||||
echo "Failed to install Docker Compose."
|
||||
fi
|
||||
@@ -0,0 +1,25 @@
|
||||
GNU nano 6.2 docker-compose.yml
|
||||
version: "3.5"
|
||||
services:
|
||||
jellyfin:
|
||||
image: ghcr.io/linuxserver/jellyfin:latest
|
||||
# image: ghcr.io/linuxserver/jellyfin:arm64v8-10.8.12
|
||||
container_name: jellyfin
|
||||
network_mode: "bridge"
|
||||
volumes:
|
||||
- /home/traver/docker/jellyfin/config:/config
|
||||
- /home/traver/docker/jellyfin/cache:/cache
|
||||
- /media/nasmedia:/media
|
||||
restart: "unless-stopped"
|
||||
# Optional - alternative address used for autodiscovery
|
||||
environment:
|
||||
- JELLYFIN_PublishedServerUrl=http://docker2
|
||||
ports:
|
||||
- 8096:8096
|
||||
- 8920:8920 #optional
|
||||
- 7359:7359/udp #optional
|
||||
- 1900:1900/udp #optional
|
||||
#group_add:
|
||||
# - "109" # Change this to match your "render" host group id and remove this comment
|
||||
devices:
|
||||
- /dev/dri/renderD128:/dev/dri/renderD128
|
||||
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Script: setup_portainer.sh
|
||||
# Description: Script to set up Portainer using Docker on Linux
|
||||
|
||||
# Variables
|
||||
PORTAINER_PORT=8099
|
||||
DOCKER_SOCK=/var/run/docker.sock
|
||||
|
||||
# Create the portainer volume
|
||||
docker volume create portainer_data
|
||||
|
||||
# Download and create portainer container
|
||||
docker run -d -p $PORTAINER_PORT:8000 -p 9443:9443 --name portainer --restart=always -v $DOCKER_SOCK:$DOCKER_SOCK -v portainer_data:/data portainer/portainer-ce:latest
|
||||
|
||||
# Check if the container started successfully
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Portainer container is up and running."
|
||||
else
|
||||
echo "Failed to start Portainer container."
|
||||
fi
|
||||
@@ -0,0 +1,5 @@
|
||||
docker stop portainer
|
||||
docker rm portainer
|
||||
docker pull portainer/portainer-ce:latest
|
||||
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
echo "=================================================="
|
||||
echo " WickedYoda System Update & Docker Cleanup"
|
||||
echo " Started: $(date)"
|
||||
echo "=================================================="
|
||||
|
||||
#
|
||||
# Step 1 - Update local setup scripts from GitHub
|
||||
#
|
||||
echo
|
||||
echo "==> Updating setup scripts from GitHub..."
|
||||
curl -fsSL https://raw.githubusercontent.com/wickedyoda/public-setupfiles/refs/heads/main/update-from_repo.sh | sudo bash
|
||||
|
||||
#
|
||||
# Step 2 - Run the update script
|
||||
#
|
||||
echo
|
||||
echo "==> Running system update..."
|
||||
sudo ./public-setupfiles/updates_scripts/updates.sh
|
||||
|
||||
#
|
||||
# Step 3 - Remove unused Docker images
|
||||
#
|
||||
echo
|
||||
echo "==> Pruning unused Docker images..."
|
||||
docker image prune -af
|
||||
|
||||
#
|
||||
# Step 4 - Remove unused Docker networks
|
||||
#
|
||||
echo
|
||||
echo "==> Pruning unused Docker networks..."
|
||||
docker network prune -f
|
||||
|
||||
#
|
||||
# Step 5 - Remove stopped containers
|
||||
#
|
||||
echo
|
||||
echo "==> Pruning stopped Docker containers..."
|
||||
docker container prune -f
|
||||
|
||||
#
|
||||
# Step 6 - Remove unused build cache
|
||||
#
|
||||
echo
|
||||
echo "==> Pruning Docker build cache..."
|
||||
docker builder prune -af
|
||||
|
||||
echo
|
||||
echo "=================================================="
|
||||
echo " Update and cleanup completed successfully!"
|
||||
echo " Finished: $(date)"
|
||||
echo "=================================================="
|
||||
@@ -0,0 +1,213 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# Docker installer for Debian 12 (bookworm) and Debian 13 (trixie).
|
||||
# Installs Docker Engine, CLI, containerd, Buildx, and Docker Compose plugin.
|
||||
# Optionally configures unattended upgrades for Docker packages.
|
||||
|
||||
SCRIPT_NAME="$(basename "$0")"
|
||||
AUTO_UPDATES=true
|
||||
|
||||
log() {
|
||||
printf "[%s] %s\n" "$(date +"%Y-%m-%d %H:%M:%S")" "$*"
|
||||
}
|
||||
|
||||
die() {
|
||||
printf "Error: %s\n" "$*" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
Usage: sudo ./${SCRIPT_NAME} [options]
|
||||
|
||||
Options:
|
||||
--no-auto-updates Do not configure unattended-upgrades for Docker packages
|
||||
--auto-updates Configure unattended-upgrades for Docker packages (default)
|
||||
-h, --help Show this help text
|
||||
|
||||
Examples:
|
||||
sudo ./${SCRIPT_NAME}
|
||||
sudo ./${SCRIPT_NAME} --no-auto-updates
|
||||
EOF
|
||||
}
|
||||
|
||||
parse_args() {
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
--no-auto-updates)
|
||||
AUTO_UPDATES=false
|
||||
;;
|
||||
--auto-updates)
|
||||
AUTO_UPDATES=true
|
||||
;;
|
||||
-h|--help)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
die "Unknown option: $1"
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
}
|
||||
|
||||
require_root() {
|
||||
if [[ "${EUID}" -ne 0 ]]; then
|
||||
die "Please run as root: sudo ./${SCRIPT_NAME}"
|
||||
fi
|
||||
}
|
||||
|
||||
check_os() {
|
||||
[[ -r /etc/os-release ]] || die "Cannot read /etc/os-release"
|
||||
# shellcheck disable=SC1091
|
||||
source /etc/os-release
|
||||
|
||||
[[ "${ID:-}" == "debian" ]] || die "This script supports Debian only. Detected: ${ID:-unknown}"
|
||||
|
||||
case "${VERSION_CODENAME:-}" in
|
||||
bookworm|trixie)
|
||||
;;
|
||||
*)
|
||||
die "Unsupported Debian codename: ${VERSION_CODENAME:-unknown}. Supported: bookworm (12), trixie (13)."
|
||||
;;
|
||||
esac
|
||||
|
||||
log "Detected Debian ${VERSION_ID:-unknown} (${VERSION_CODENAME})"
|
||||
}
|
||||
|
||||
install_prereqs() {
|
||||
log "Installing prerequisite packages..."
|
||||
apt-get update
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
||||
ca-certificates \
|
||||
curl \
|
||||
gnupg \
|
||||
lsb-release \
|
||||
apt-transport-https
|
||||
}
|
||||
|
||||
setup_docker_repo() {
|
||||
local keyring_dir="/etc/apt/keyrings"
|
||||
local keyring_file="${keyring_dir}/docker.asc"
|
||||
local repo_file="/etc/apt/sources.list.d/docker.list"
|
||||
local main_sources_file="/etc/apt/sources.list"
|
||||
local repo_line
|
||||
local arch
|
||||
arch="$(dpkg --print-architecture)"
|
||||
repo_line="deb [arch=${arch} signed-by=${keyring_file}] https://download.docker.com/linux/debian ${VERSION_CODENAME} stable"
|
||||
|
||||
log "Configuring Docker APT repository..."
|
||||
install -m 0755 -d "${keyring_dir}"
|
||||
|
||||
curl -fsSL https://download.docker.com/linux/debian/gpg -o "${keyring_file}"
|
||||
chmod a+r "${keyring_file}"
|
||||
|
||||
cat > "${repo_file}" <<EOF
|
||||
${repo_line}
|
||||
EOF
|
||||
|
||||
# Ensure the Docker repo line is present in the main sources.list as requested.
|
||||
touch "${main_sources_file}"
|
||||
if grep -Fq "https://download.docker.com/linux/debian ${VERSION_CODENAME} stable" "${main_sources_file}"; then
|
||||
log "Docker repository already present in ${main_sources_file}."
|
||||
else
|
||||
log "Adding Docker repository to ${main_sources_file}..."
|
||||
printf "\n# Docker repository\n%s\n" "${repo_line}" >> "${main_sources_file}"
|
||||
fi
|
||||
}
|
||||
|
||||
install_docker() {
|
||||
log "Installing Docker Engine and plugins..."
|
||||
apt-get update
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
||||
docker-ce \
|
||||
docker-ce-cli \
|
||||
containerd.io \
|
||||
docker-buildx-plugin \
|
||||
docker-compose-plugin
|
||||
}
|
||||
|
||||
enable_services() {
|
||||
log "Enabling and starting Docker services..."
|
||||
systemctl enable --now docker
|
||||
systemctl enable --now containerd
|
||||
}
|
||||
|
||||
configure_user_group() {
|
||||
local target_user="${SUDO_USER:-}"
|
||||
|
||||
if ! getent group docker >/dev/null; then
|
||||
groupadd docker
|
||||
fi
|
||||
|
||||
if [[ -n "${target_user}" && "${target_user}" != "root" ]]; then
|
||||
if id -nG "${target_user}" | tr ' ' '\n' | grep -qx docker; then
|
||||
log "User '${target_user}' is already in docker group."
|
||||
else
|
||||
log "Adding user '${target_user}' to docker group..."
|
||||
usermod -aG docker "${target_user}"
|
||||
log "User '${target_user}' must log out and back in for group changes to apply."
|
||||
fi
|
||||
else
|
||||
log "No non-root sudo user detected. Skipping docker group assignment."
|
||||
fi
|
||||
}
|
||||
|
||||
configure_unattended_upgrades() {
|
||||
log "Configuring unattended-upgrades for Docker packages..."
|
||||
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y unattended-upgrades
|
||||
|
||||
local auto_file="/etc/apt/apt.conf.d/20auto-upgrades"
|
||||
local docker_upgrade_file="/etc/apt/apt.conf.d/52docker-unattended-upgrades"
|
||||
|
||||
cat > "${auto_file}" <<'EOF'
|
||||
APT::Periodic::Update-Package-Lists "1";
|
||||
APT::Periodic::Unattended-Upgrade "1";
|
||||
EOF
|
||||
|
||||
cat > "${docker_upgrade_file}" <<'EOF'
|
||||
Unattended-Upgrade::Origins-Pattern {
|
||||
"origin=Docker";
|
||||
};
|
||||
|
||||
Unattended-Upgrade::Package-Blacklist {
|
||||
};
|
||||
EOF
|
||||
|
||||
systemctl enable --now unattended-upgrades
|
||||
}
|
||||
|
||||
print_versions() {
|
||||
log "Installed versions:"
|
||||
docker --version || true
|
||||
docker compose version || true
|
||||
containerd --version || true
|
||||
}
|
||||
|
||||
main() {
|
||||
parse_args "$@"
|
||||
require_root
|
||||
check_os
|
||||
install_prereqs
|
||||
setup_docker_repo
|
||||
install_docker
|
||||
enable_services
|
||||
configure_user_group
|
||||
|
||||
if [[ "${AUTO_UPDATES}" == "true" ]]; then
|
||||
configure_unattended_upgrades
|
||||
else
|
||||
log "Skipping unattended-upgrades configuration."
|
||||
fi
|
||||
|
||||
print_versions
|
||||
|
||||
log "Docker installation complete."
|
||||
log "Test with: docker run --rm hello-world"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -0,0 +1,199 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# setup-docker-remote-api.sh
|
||||
# Enables Docker remote API on tcp://0.0.0.0:2375 using a systemd override.
|
||||
# Optional: lock port 2375 down to a single source IP.
|
||||
#
|
||||
# Usage:
|
||||
# sudo bash setup-docker-remote-api.sh
|
||||
# sudo bash setup-docker-remote-api.sh --allow-ip 10.0.84.50
|
||||
#
|
||||
# Notes:
|
||||
# - This exposes the Docker API over unencrypted TCP.
|
||||
# - Anyone who can reach port 2375 can effectively control Docker on the host.
|
||||
# - Strongly recommended: use --allow-ip with your Uptime Kuma server IP.
|
||||
|
||||
ALLOW_IP=""
|
||||
OVERRIDE_DIR="/etc/systemd/system/docker.service.d"
|
||||
OVERRIDE_FILE="${OVERRIDE_DIR}/override.conf"
|
||||
BACKUP_SUFFIX="$(date +%Y%m%d-%H%M%S)"
|
||||
|
||||
usage() {
|
||||
cat <<EOF
|
||||
Usage:
|
||||
sudo bash $0 [--allow-ip IP]
|
||||
|
||||
Options:
|
||||
--allow-ip IP Allow only this source IP to access TCP 2375 using iptables.
|
||||
-h, --help Show this help.
|
||||
|
||||
Examples:
|
||||
sudo bash $0
|
||||
sudo bash $0 --allow-ip 10.0.84.50
|
||||
EOF
|
||||
}
|
||||
|
||||
log() {
|
||||
echo "[INFO] $*"
|
||||
}
|
||||
|
||||
warn() {
|
||||
echo "[WARN] $*" >&2
|
||||
}
|
||||
|
||||
err() {
|
||||
echo "[ERROR] $*" >&2
|
||||
}
|
||||
|
||||
require_root() {
|
||||
if [[ "${EUID}" -ne 0 ]]; then
|
||||
err "Run this script as root or with sudo."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
parse_args() {
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
--allow-ip)
|
||||
shift
|
||||
[[ $# -gt 0 ]] || { err "Missing value for --allow-ip"; exit 1; }
|
||||
ALLOW_IP="$1"
|
||||
;;
|
||||
-h|--help)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
err "Unknown argument: $1"
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
}
|
||||
|
||||
check_prereqs() {
|
||||
command -v systemctl >/dev/null 2>&1 || { err "systemctl not found."; exit 1; }
|
||||
command -v docker >/dev/null 2>&1 || { err "docker not found."; exit 1; }
|
||||
command -v ss >/dev/null 2>&1 || { err "ss not found."; exit 1; }
|
||||
command -v curl >/dev/null 2>&1 || { err "curl not found."; exit 1; }
|
||||
|
||||
if ! systemctl list-unit-files | grep -q '^docker.service'; then
|
||||
err "docker.service not found."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
backup_existing_override() {
|
||||
mkdir -p "${OVERRIDE_DIR}"
|
||||
|
||||
if [[ -f "${OVERRIDE_FILE}" ]]; then
|
||||
cp -a "${OVERRIDE_FILE}" "${OVERRIDE_FILE}.bak.${BACKUP_SUFFIX}"
|
||||
log "Backed up existing override to ${OVERRIDE_FILE}.bak.${BACKUP_SUFFIX}"
|
||||
fi
|
||||
}
|
||||
|
||||
write_override() {
|
||||
cat > "${OVERRIDE_FILE}" <<'EOF'
|
||||
[Service]
|
||||
ExecStart=
|
||||
ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2375 --containerd=/run/containerd/containerd.sock
|
||||
EOF
|
||||
|
||||
log "Wrote Docker systemd override: ${OVERRIDE_FILE}"
|
||||
}
|
||||
|
||||
reload_and_restart() {
|
||||
log "Reloading systemd..."
|
||||
systemctl daemon-reload
|
||||
|
||||
log "Restarting Docker..."
|
||||
systemctl restart docker
|
||||
|
||||
log "Checking Docker service status..."
|
||||
systemctl --no-pager --full status docker.service || true
|
||||
}
|
||||
|
||||
verify_listener() {
|
||||
log "Verifying Docker is listening on TCP 2375..."
|
||||
if ss -lntp | grep -q ':2375'; then
|
||||
ss -lntp | grep ':2375' || true
|
||||
log "Docker is listening on port 2375."
|
||||
else
|
||||
err "Docker is not listening on port 2375."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
verify_local_api() {
|
||||
log "Verifying local Docker API response..."
|
||||
if curl -fsS http://127.0.0.1:2375/version >/dev/null; then
|
||||
curl -fsS http://127.0.0.1:2375/version
|
||||
echo
|
||||
log "Local Docker API test succeeded."
|
||||
else
|
||||
err "Local Docker API test failed."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
configure_firewall() {
|
||||
if [[ -z "${ALLOW_IP}" ]]; then
|
||||
warn "No --allow-ip provided. Port 2375 will remain reachable by anything that can route to this host."
|
||||
return
|
||||
fi
|
||||
|
||||
command -v iptables >/dev/null 2>&1 || {
|
||||
warn "iptables not found. Skipping firewall rules."
|
||||
return
|
||||
}
|
||||
|
||||
log "Applying iptables rules to allow only ${ALLOW_IP} to TCP 2375..."
|
||||
|
||||
# Avoid duplicate rules
|
||||
iptables -C INPUT -p tcp -s "${ALLOW_IP}" --dport 2375 -j ACCEPT 2>/dev/null || \
|
||||
iptables -A INPUT -p tcp -s "${ALLOW_IP}" --dport 2375 -j ACCEPT
|
||||
|
||||
iptables -C INPUT -p tcp --dport 2375 -j DROP 2>/dev/null || \
|
||||
iptables -A INPUT -p tcp --dport 2375 -j DROP
|
||||
|
||||
log "iptables rules applied."
|
||||
warn "Make sure your firewall rules are saved persistently on this host."
|
||||
}
|
||||
|
||||
show_summary() {
|
||||
echo
|
||||
echo "Done."
|
||||
echo
|
||||
echo "Docker remote API should now be available at:"
|
||||
echo " tcp://$(hostname -I | awk '{print $1}'):2375"
|
||||
echo
|
||||
echo "Use this in Uptime Kuma:"
|
||||
echo " tcp://HOST_IP:2375"
|
||||
echo
|
||||
if [[ -n "${ALLOW_IP}" ]]; then
|
||||
echo "Access restricted to source IP:"
|
||||
echo " ${ALLOW_IP}"
|
||||
else
|
||||
echo "No IP restriction was applied."
|
||||
fi
|
||||
echo
|
||||
}
|
||||
|
||||
main() {
|
||||
require_root
|
||||
parse_args "$@"
|
||||
check_prereqs
|
||||
backup_existing_override
|
||||
write_override
|
||||
reload_and_restart
|
||||
verify_listener
|
||||
verify_local_api
|
||||
configure_firewall
|
||||
show_summary
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -0,0 +1,43 @@
|
||||
<<<<<<< HEAD
|
||||
# domains
|
||||
|
||||
## Purpose
|
||||
This directory contains files related to **domains**.
|
||||
|
||||
## Contents
|
||||
- `netflix_domains.txt`
|
||||
- `blocked_domains.txt`
|
||||
|
||||
## Usage
|
||||
- Review each script or configuration file before running
|
||||
- Some scripts may require **root or sudo**
|
||||
- Paths and variables may need adjustment for your environment
|
||||
|
||||
## Notes
|
||||
- This folder is part of the **public-setupfiles** repository
|
||||
- Files are provided as-is for reference or automation
|
||||
|
||||
## Safety
|
||||
Always back up data before running scripts that modify system state.
|
||||
=======
|
||||
# domains
|
||||
|
||||
## Overview
|
||||
This directory is part of the **public-setupfiles** repository.
|
||||
It contains scripts, configuration files, or resources related to **domains**.
|
||||
|
||||
## Usage
|
||||
- Review scripts before execution
|
||||
- Some files may require **root or sudo privileges**
|
||||
- Paths, variables, or credentials may need customization
|
||||
|
||||
## Logging & Output
|
||||
Scripts may generate logs or output files in the same directory or system locations.
|
||||
|
||||
## Safety Notes
|
||||
- Always back up important data before running scripts
|
||||
- Test in a non-production environment when possible
|
||||
- Use at your own risk
|
||||
|
||||
---
|
||||
>>>>>>> main
|
||||
@@ -0,0 +1,20 @@
|
||||
bambulab.com
|
||||
api.bambulab.com
|
||||
e.bambulab.com
|
||||
account.bambulab.com
|
||||
makerworld.com
|
||||
api.makerworld.com
|
||||
bambulab.cn
|
||||
public-cdn.bambulab.cn
|
||||
bblmw.com
|
||||
public-cdn.bblmw.com
|
||||
bblcdn.com
|
||||
cdn.bambulab.com
|
||||
fw-cdn.bambulab.com
|
||||
ota.bambulab.com
|
||||
mqtt.bambulab.com
|
||||
cloud.bambulab.com
|
||||
amazonaws.com
|
||||
aws.amazon.com
|
||||
cloudflare.com
|
||||
cloudflare-dns.com
|
||||
@@ -0,0 +1,241 @@
|
||||
about.meta.com
|
||||
abs.twimg.com
|
||||
accounts.facebook.com
|
||||
accounts.twitter.com
|
||||
accounts.fetlife.com
|
||||
ads-api.twitter.com
|
||||
ads.facebook.com
|
||||
ads.twitter.com
|
||||
analytics.twitter.com
|
||||
api.facebook.com
|
||||
api.twitter.com
|
||||
api.x.com
|
||||
api.fetlife.com
|
||||
apps.facebook.com
|
||||
badoo.com
|
||||
bellesa.co
|
||||
bellesa.com
|
||||
bluesky.app
|
||||
bsky.social
|
||||
business.facebook.com
|
||||
business.twitter.com
|
||||
camwhores.tv
|
||||
cards.twitter.com
|
||||
cdn.syndication.twimg.com
|
||||
cdninstagram.com
|
||||
cdn.fetlife.com
|
||||
clubhouse.com
|
||||
connect.facebook.com
|
||||
connect.facebook.net
|
||||
crazyshit.com
|
||||
darknessporn.com
|
||||
developers.facebook.com
|
||||
developer.twitter.com
|
||||
dev.twitter.com
|
||||
dipseastories.com
|
||||
edge.facebook.com
|
||||
facebook.com
|
||||
facebook.net
|
||||
fansly.com
|
||||
faphouse.com
|
||||
fabxh.site
|
||||
fb.com
|
||||
fb.gg
|
||||
fb.me
|
||||
fb.watch
|
||||
fbcdn.com
|
||||
fbcdn.net
|
||||
fbsbx.com
|
||||
fetlife.com
|
||||
www.fetlife.com
|
||||
static.fetlife.com
|
||||
media.fetlife.com
|
||||
images.fetlife.com
|
||||
beta.fetlife.com
|
||||
m.fetlife.com
|
||||
flickr.com
|
||||
frolicme.com
|
||||
fullporno.xxx
|
||||
graphql.twitter.com
|
||||
graph.facebook.com
|
||||
help.twitter.com
|
||||
hotscope.tv
|
||||
imgur.com
|
||||
imgur.io
|
||||
instagram.com
|
||||
jtvnw.net
|
||||
kick.com
|
||||
licdn.com
|
||||
linkedin.com
|
||||
l.facebook.com
|
||||
literotica.com
|
||||
login.twitter.com
|
||||
lm.facebook.com
|
||||
mastodon.social
|
||||
medium.com
|
||||
meetup.com
|
||||
messenger.com
|
||||
meta.com
|
||||
metacdn.com
|
||||
mobile.twitter.com
|
||||
m.twitter.com
|
||||
mobile.x.com
|
||||
motherless.com
|
||||
motherlessmedia.com
|
||||
musical.ly
|
||||
nextdoor.com
|
||||
oauth.twitter.com
|
||||
oculus.com
|
||||
onlyfans.com
|
||||
parler.com
|
||||
pbs.twimg.com
|
||||
pinterest.com
|
||||
pinimg.com
|
||||
platform.twitter.com
|
||||
pornhub.com
|
||||
promoted.twitter.com
|
||||
publish.twitter.com
|
||||
quinn.com
|
||||
quora.com
|
||||
redtube.com
|
||||
rule34.xxx
|
||||
rumble.com
|
||||
sc-cdn.net
|
||||
secure.facebook.com
|
||||
signal.org
|
||||
snap.com
|
||||
snapchat.com
|
||||
snapkit.com
|
||||
spaces.twitter.com
|
||||
static.ak.connect.facebook.com
|
||||
static.ak.facebook.com
|
||||
static.xx.fbcdn.net
|
||||
staticflickr.com
|
||||
status.twitterstat.us
|
||||
stream.twitter.com
|
||||
support.twitter.com
|
||||
syndication.twimg.com
|
||||
t.co
|
||||
www.t.co
|
||||
telegram.org
|
||||
t.me
|
||||
www.t.me
|
||||
tfbnw.net
|
||||
theporndude.com
|
||||
thexh.today
|
||||
threads.net
|
||||
tiktok.com
|
||||
tiktokcdn.com
|
||||
tiktokcdn-eu.com
|
||||
tiktokcdn-us.com
|
||||
tiktoklinksafety.us
|
||||
tiktokw.us
|
||||
tiktok.us
|
||||
tiktokv.com
|
||||
tiktokv.eu
|
||||
tiktokv.us
|
||||
ton.twitter.com
|
||||
ton.twimg.com
|
||||
truthsocial.com
|
||||
tryquinn.com
|
||||
tsyndicate.com
|
||||
tumblr.com
|
||||
twitch.tv
|
||||
ttvnw.net
|
||||
twitter.com
|
||||
www.twitter.com
|
||||
twimg.com
|
||||
upload.facebook.com
|
||||
upload.twitter.com
|
||||
video.twimg.com
|
||||
video.xx.fbcdn.net
|
||||
vimeo.com
|
||||
vimeocdn.com
|
||||
vk.com
|
||||
vk.ru
|
||||
vkuser.net
|
||||
weibo.cn
|
||||
weibo.com
|
||||
whatsapp.com
|
||||
whatsapp.net
|
||||
white.ish.instagram.com
|
||||
x.com
|
||||
www.x.com
|
||||
xhcdn.com
|
||||
xhamster.com
|
||||
xvideos.com
|
||||
youporn.com
|
||||
googletagmanager.com
|
||||
goo.gl
|
||||
xnxx.com
|
||||
www.xnxx.com
|
||||
spankbang.com
|
||||
www.spankbang.com
|
||||
tube8.com
|
||||
www.tube8.com
|
||||
beeg.com
|
||||
www.beeg.com
|
||||
brazzers.com
|
||||
www.brazzers.com
|
||||
realitykings.com
|
||||
www.realitykings.com
|
||||
mofos.com
|
||||
www.mofos.com
|
||||
bangbros.com
|
||||
www.bangbros.com
|
||||
teamskeet.com
|
||||
www.teamskeet.com
|
||||
naughtyamerica.com
|
||||
www.naughtyamerica.com
|
||||
eporner.com
|
||||
www.eporner.com
|
||||
txxx.com
|
||||
www.txxx.com
|
||||
porn.com
|
||||
www.porn.com
|
||||
sex.com
|
||||
www.sex.com
|
||||
sxyprn.com
|
||||
www.sxyprn.com
|
||||
thumbzilla.com
|
||||
www.thumbzilla.com
|
||||
tnaflix.com
|
||||
www.tnaflix.com
|
||||
empflix.com
|
||||
www.empflix.com
|
||||
jable.tv
|
||||
www.jable.tv
|
||||
missav.com
|
||||
www.missav.com
|
||||
hanime.tv
|
||||
www.hanime.tv
|
||||
hentaifox.com
|
||||
www.hentaifox.com
|
||||
nhentai.net
|
||||
www.nhentai.net
|
||||
gelbooru.com
|
||||
www.gelbooru.com
|
||||
manyvids.com
|
||||
www.manyvids.com
|
||||
chaturbate.com
|
||||
www.chaturbate.com
|
||||
stripchat.com
|
||||
www.stripchat.com
|
||||
myfreecams.com
|
||||
www.myfreecams.com
|
||||
camsoda.com
|
||||
www.camsoda.com
|
||||
livejasmin.com
|
||||
www.livejasmin.com
|
||||
bongacams.com
|
||||
www.bongacams.com
|
||||
cam4.com
|
||||
www.cam4.com
|
||||
streamate.com
|
||||
www.streamate.com
|
||||
adultfriendfinder.com
|
||||
www.adultfriendfinder.com
|
||||
ashleymadison.com
|
||||
www.ashleymadison.com
|
||||
web.libera.com
|
||||
librea.com
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,134 @@
|
||||
facebook.com
|
||||
facebook.net
|
||||
fb.com
|
||||
fb.me
|
||||
fb.watch
|
||||
fb.gg
|
||||
fbcdn.net
|
||||
fbcdn.com
|
||||
fbsbx.com
|
||||
tfbnw.net
|
||||
connect.facebook.com
|
||||
connect.facebook.net
|
||||
graph.facebook.com
|
||||
api.facebook.com
|
||||
upload.facebook.com
|
||||
secure.facebook.com
|
||||
login.facebook.com
|
||||
accounts.facebook.com
|
||||
business.facebook.com
|
||||
developers.facebook.com
|
||||
apps.facebook.com
|
||||
ads.facebook.com
|
||||
static.ak.facebook.com
|
||||
static.ak.connect.facebook.com
|
||||
l.facebook.com
|
||||
lm.facebook.com
|
||||
edge.facebook.com
|
||||
video.xx.fbcdn.net
|
||||
static.xx.fbcdn.net
|
||||
messenger.com
|
||||
instagram.com
|
||||
cdninstagram.com
|
||||
whatsapp.com
|
||||
whatsapp.net
|
||||
meta.com
|
||||
metacdn.com
|
||||
about.meta.com
|
||||
oculus.com
|
||||
threads.net
|
||||
31.13.24.0/21
|
||||
31.13.64.0/18
|
||||
66.220.144.0/20
|
||||
69.63.176.0/20
|
||||
69.171.224.0/19
|
||||
74.119.76.0/22
|
||||
103.4.96.0/22
|
||||
129.134.0.0/16
|
||||
157.240.0.0/16
|
||||
173.252.64.0/18
|
||||
179.60.192.0/22
|
||||
185.60.216.0/22
|
||||
204.15.20.0/22
|
||||
tiktok.com
|
||||
tiktokcdn.com
|
||||
tiktokcdn-us.com
|
||||
tiktokcdn-eu.com
|
||||
tiktokv.com
|
||||
tiktokv.us
|
||||
tiktokv.eu
|
||||
tiktokw.us
|
||||
tiktoklinksafety.us
|
||||
musical.ly
|
||||
byteoversea.com
|
||||
ibyteimg.com
|
||||
bytedance.com
|
||||
bytedance.net
|
||||
bytedanceapi.com
|
||||
47.246.0.0/16
|
||||
103.136.220.0/22
|
||||
161.117.0.0/16
|
||||
snapchat.com
|
||||
snap.com
|
||||
sc-cdn.net
|
||||
snapkit.com
|
||||
snapads.com
|
||||
34.192.0.0/10
|
||||
52.0.0.0/11
|
||||
linkedin.com
|
||||
licdn.com
|
||||
linkedin.cn
|
||||
13.107.0.0/16
|
||||
40.0.0.0/8
|
||||
52.96.0.0/12
|
||||
pinterest.com
|
||||
pinimg.com
|
||||
pinterestcdn.com
|
||||
199.96.56.0/21
|
||||
tumblr.com
|
||||
twitch.tv
|
||||
ttvnw.net
|
||||
jtvnw.net
|
||||
kick.com
|
||||
rumble.com
|
||||
vimeo.com
|
||||
vimeocdn.com
|
||||
mastodon.social
|
||||
truthsocial.com
|
||||
bluesky.app
|
||||
bsky.social
|
||||
parler.com
|
||||
weibo.com
|
||||
weibo.cn
|
||||
sinaimg.cn
|
||||
vk.com
|
||||
vk.ru
|
||||
vkuser.net
|
||||
vkcdn.net
|
||||
87.240.128.0/18
|
||||
95.213.0.0/16
|
||||
93.186.224.0/20
|
||||
telegram.org
|
||||
t.me
|
||||
telegram.me
|
||||
91.108.4.0/22
|
||||
91.108.8.0/22
|
||||
91.108.12.0/22
|
||||
91.108.16.0/22
|
||||
91.108.56.0/22
|
||||
149.154.160.0/20
|
||||
signal.org
|
||||
quora.com
|
||||
quoracdn.net
|
||||
medium.com
|
||||
cdn-medium.com
|
||||
flickr.com
|
||||
staticflickr.com
|
||||
imgur.com
|
||||
imgur.io
|
||||
imgurmedia.com
|
||||
badoo.com
|
||||
meetup.com
|
||||
nextdoor.com
|
||||
clubhouse.com
|
||||
clubhouseapi.com
|
||||
@@ -0,0 +1,105 @@
|
||||
netflix.com
|
||||
nflxext.com
|
||||
nflximg.com
|
||||
nflxso.net
|
||||
nflxvideo.net
|
||||
netflix.net
|
||||
netflixdnstest0.com
|
||||
31.13.64.0/18
|
||||
45.57.0.0/17
|
||||
64.120.128.0/17
|
||||
66.197.128.0/17
|
||||
69.53.224.0/19
|
||||
108.175.32.0/20
|
||||
192.173.64.0/18
|
||||
198.38.96.0/19
|
||||
198.45.48.0/20
|
||||
207.45.72.0/22
|
||||
208.75.76.0/22
|
||||
hbomax.com
|
||||
hbo.com
|
||||
warnermediacdn.com
|
||||
wbdstreaming.com
|
||||
max.com
|
||||
wmcdp.io
|
||||
wmcdp.com
|
||||
34.192.0.0/10
|
||||
52.0.0.0/11
|
||||
hulu.com
|
||||
hulustream.com
|
||||
huluim.com
|
||||
huluad.com
|
||||
vortex.hulu.com
|
||||
doppler.hulu.com
|
||||
conviva.com
|
||||
hulu.hb.omtrdc.net
|
||||
disneyplus.com
|
||||
disney.com
|
||||
bamgrid.com
|
||||
bam.nr-data.net
|
||||
cdn.registerdisney.go.com
|
||||
disneystreaming.com
|
||||
dssott.com
|
||||
paramountplus.com
|
||||
cbsivideo.com
|
||||
cbsaavideo.com
|
||||
cbs.com
|
||||
viacomcbs.com
|
||||
peacocktv.com
|
||||
nbc.com
|
||||
nbcuni.com
|
||||
nbcucdn.com
|
||||
tubitv.com
|
||||
fox.com
|
||||
foxsports.com
|
||||
fubo.tv
|
||||
pluto.tv
|
||||
roku.com
|
||||
rokutime.com
|
||||
crunchyroll.com
|
||||
vrv.co
|
||||
funimation.com
|
||||
aiv-cdn.net
|
||||
primevideo.com
|
||||
amazon.com
|
||||
amazonaws.com
|
||||
cloudfront.net
|
||||
s3.amazonaws.com
|
||||
atv-ext.amazon.com
|
||||
imdb.com
|
||||
imdbtv.com
|
||||
freevee.com
|
||||
apple.com
|
||||
apple-dns.net
|
||||
apple.com.edgekey.net
|
||||
mzstatic.com
|
||||
apple-tv-plus.com
|
||||
tv.apple.com
|
||||
17.0.0.0/8
|
||||
224.0.0.0/4
|
||||
vudu.com
|
||||
moviefone.com
|
||||
mubi.com
|
||||
shudder.com
|
||||
britbox.com
|
||||
acorn.tv
|
||||
sling.com
|
||||
philo.com
|
||||
xumo.com
|
||||
discoveryplus.com
|
||||
dplay.com
|
||||
espn.com
|
||||
espncdn.com
|
||||
espn.net
|
||||
mlb.com
|
||||
mlbstatic.com
|
||||
nba.com
|
||||
nfl.com
|
||||
nhl.com
|
||||
nhlstatic.com
|
||||
spotify.com
|
||||
scdn.co
|
||||
pandora.com
|
||||
soundcloud.com
|
||||
deezer.com
|
||||
tidal.com
|
||||
@@ -0,0 +1 @@
|
||||
facebook.com
|
||||
@@ -0,0 +1,15 @@
|
||||
//nas/public /media/naspublic cifs vers=2.0,username=admin,password=(enterhere),file_mode=0777,dir_mode=0777,_netdev,auto 0 0
|
||||
//nas/DownloadedMedia /media/nasdownloadedmedia cifs vers=2.0,username=admin,password=(Enterhere),file_mode=0777,dir_mode=0777,_netdev,auto 0 0
|
||||
|
||||
# old
|
||||
//nas/public /home/traver/naspublic cifs vers=2.0,username=admin,password=(enterhere),file_mode=0777,dir_mode=0777,_netdev,auto 0 0
|
||||
//nas/DownloadedMedia /home/traver/nasdownloadedmedia cifs vers=2.0,username=admin,password=(Enterhere),file_mode=0777,dir_mode=0777,_netdev,auto 0 0
|
||||
|
||||
//nas/public /media/naspublic cifs vers=2.0,username=admin,password=$PASSWORD,file_mode=0777,dir_mode=0777,_netdev,auto 0 0
|
||||
//nas/DownloadedMedia /media/nasmedia cifs vers=2.0,username=admin,password=$PASSWORD,file_mode=0777,dir_mode=0777,_netdev,auto 0 0
|
||||
//nas/public-share2 /media/naspublic-share2 cifs vers=2.0,username=admin,password=$PASSWORD,file_mode=0777,dir_mode=0777,_netdev,auto 0 0
|
||||
|
||||
|
||||
//nas/public /mnt/naspublic cifs vers=2.0,username=admin,password=$PASSWORD,file_mode=0777,dir_mode=0777,_netdev,auto 0 0
|
||||
//nas/DownloadedMedia /mnt/nasmedia cifs vers=2.0,username=admin,password=$PASSWORD,file_mode=0777,dir_mode=0777,_netdev,auto 0 0
|
||||
//nas/public-share2 /mnt/naspublic-share2 cifs vers=2.0,username=admin,password=$PASSWORD,file_mode=0777,dir_mode=0777,_netdev,auto 0 0
|
||||
@@ -0,0 +1,44 @@
|
||||
<<<<<<< HEAD
|
||||
# fstab-setup
|
||||
|
||||
## Purpose
|
||||
This directory contains files related to **fstab setup**.
|
||||
|
||||
## Contents
|
||||
- `setup-fstab.sh`
|
||||
- `Fstab entries.txt`
|
||||
- `setup-fstab-remake-mnt.sh`
|
||||
|
||||
## Usage
|
||||
- Review each script or configuration file before running
|
||||
- Some scripts may require **root or sudo**
|
||||
- Paths and variables may need adjustment for your environment
|
||||
|
||||
## Notes
|
||||
- This folder is part of the **public-setupfiles** repository
|
||||
- Files are provided as-is for reference or automation
|
||||
|
||||
## Safety
|
||||
Always back up data before running scripts that modify system state.
|
||||
=======
|
||||
# fstab-setup
|
||||
|
||||
## Overview
|
||||
This directory is part of the **public-setupfiles** repository.
|
||||
It contains scripts, configuration files, or resources related to **fstab-setup**.
|
||||
|
||||
## Usage
|
||||
- Review scripts before execution
|
||||
- Some files may require **root or sudo privileges**
|
||||
- Paths, variables, or credentials may need customization
|
||||
|
||||
## Logging & Output
|
||||
Scripts may generate logs or output files in the same directory or system locations.
|
||||
|
||||
## Safety Notes
|
||||
- Always back up important data before running scripts
|
||||
- Test in a non-production environment when possible
|
||||
- Use at your own risk
|
||||
|
||||
---
|
||||
>>>>>>> main
|
||||
@@ -0,0 +1,48 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Define variables
|
||||
CREDENTIALS_FILE="/root/.smbcredentials"
|
||||
FSTAB_FILE="/etc/fstab"
|
||||
|
||||
# 1️⃣ Prompt for Username and Password
|
||||
read -p "Enter NAS Username: " NAS_USER
|
||||
read -s -p "Enter NAS Password: " NAS_PASS
|
||||
echo "" # Move to a new line after password entry
|
||||
|
||||
# 2️⃣ Install CIFS Utilities
|
||||
echo "🔹 Installing CIFS utilities..."
|
||||
sudo apt update && sudo apt install -y cifs-utils
|
||||
|
||||
# 3️⃣ Create Mount Points
|
||||
echo "🔹 Creating mount points..."
|
||||
sudo mkdir -p /mnt/naspublic /mnt/nasmedia /mnt/naspublic-share2
|
||||
|
||||
# 4️⃣ Securely Store Credentials
|
||||
echo "🔹 Creating SMB credentials file..."
|
||||
sudo bash -c "echo -e 'username=$NAS_USER\npassword=$NAS_PASS' > $CREDENTIALS_FILE"
|
||||
sudo chmod 600 "$CREDENTIALS_FILE"
|
||||
|
||||
# 5️⃣ Update fstab Entries
|
||||
echo "🔹 Updating /etc/fstab..."
|
||||
FSTAB_ENTRIES="
|
||||
//nas/Public /mnt/naspublic cifs credentials=$CREDENTIALS_FILE,vers=2.0,file_mode=0777,dir_mode=0777,_netdev,x-systemd.automount,nofail 0 0
|
||||
//nas/media /mnt/nasmedia cifs credentials=$CREDENTIALS_FILE,vers=2.0,file_mode=0777,dir_mode=0777,_netdev,x-systemd.automount,nofail 0 0
|
||||
//nas/public2 /mnt/naspublic-share2 cifs credentials=$CREDENTIALS_FILE,vers=2.0,file_mode=0777,dir_mode=0777,_netdev,x-systemd.automount,nofail 0 0
|
||||
"
|
||||
|
||||
if ! grep -q "//nas/Public" "$FSTAB_FILE"; then
|
||||
echo "$FSTAB_ENTRIES" | sudo tee -a "$FSTAB_FILE" > /dev/null
|
||||
echo "✅ fstab updated."
|
||||
else
|
||||
echo "✅ fstab entries already exist."
|
||||
fi
|
||||
|
||||
# 6️⃣ Apply the Mounts
|
||||
echo "🔹 Mounting all fstab entries..."
|
||||
sudo mount -a
|
||||
|
||||
# Verify if the shares are mounted
|
||||
echo "🔹 Checking mounted shares..."
|
||||
df -h | grep /mnt/nas
|
||||
|
||||
echo "✅ Setup complete!"
|
||||
@@ -0,0 +1,50 @@
|
||||
# Set path for credentials file
|
||||
CREDENTIALS_FILE="$HOME/.smbcredentials"
|
||||
|
||||
# Prompt for username and password
|
||||
echo "Creating SMB credentials file at $CREDENTIALS_FILE"
|
||||
read -p "Enter your SMB username: " SMB_USER
|
||||
read -s -p "Enter your SMB password: " SMB_PASS
|
||||
echo
|
||||
|
||||
# Write to .smbcredentials securely
|
||||
cat <<EOF > "$CREDENTIALS_FILE"
|
||||
username=$SMB_USER
|
||||
password=$SMB_PASS
|
||||
EOF
|
||||
|
||||
chmod 600 "$CREDENTIALS_FILE"
|
||||
echo "Created credentials file with 600 permissions."
|
||||
|
||||
|
||||
# installed needed package
|
||||
apt update
|
||||
apt-get -y install \
|
||||
samba-common-bin \
|
||||
smbclient \
|
||||
cifs-utils \
|
||||
exfat-fuse \
|
||||
curl \
|
||||
unattended-upgrades \
|
||||
cron-apt \
|
||||
git \
|
||||
curl
|
||||
|
||||
# Make directories
|
||||
cd /mnt
|
||||
mkdir nasmedia
|
||||
mkdir naspublic
|
||||
mkdir naspublic-share2
|
||||
|
||||
# Echo the command below into the file /etc/fstab
|
||||
echo '# NAS Public Share
|
||||
//nas/public /mnt/naspublic cifs credentials=/root/.smbcredentials,vers=3.0,file_mode=0777,dir_mode=0777,_netdev,x-systemd.automount,nofail 0 0
|
||||
|
||||
# NAS Media Share
|
||||
//nas/media /mnt/nasmedia cifs credentials=/root/.smbcredentials,vers=3.0,file_mode=0777,dir_mode=0777,_netdev,x-systemd.automount,nofail 0 0
|
||||
|
||||
# NAS Public2 Share
|
||||
//nas/public2 /mnt/naspublic-share2 cifs credentials=/root/.smbcredentials,vers=3.0,file_mode=0777,dir_mode=0777,_netdev,x-systemd.automount,nofail 0 0' | sudo tee -a /etc/fstab
|
||||
|
||||
# Mount the file systems
|
||||
mount -a
|
||||
@@ -0,0 +1,45 @@
|
||||
#!/bin/bash
|
||||
|
||||
DATE=$(date +%Y-%m-%d_%H-%M-%S)
|
||||
HOST=$(hostname)
|
||||
|
||||
umask 077
|
||||
OUTDIR=$(mktemp -d "/tmp/${DATE}-${HOST}.XXXXXX")
|
||||
ZIPFILE="/tmp/${DATE}-${HOST}.zip"
|
||||
|
||||
if [ -z "$OUTDIR" ]; then
|
||||
echo "Failed to create output directory."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Collecting logs into $OUTDIR..."
|
||||
|
||||
# Common logs
|
||||
cp -a /var/log/syslog* "$OUTDIR/" 2>/dev/null
|
||||
cp -a /var/log/auth.log* "$OUTDIR/" 2>/dev/null
|
||||
cp -a /var/log/kern.log* "$OUTDIR/" 2>/dev/null
|
||||
cp -a /var/log/daemon.log* "$OUTDIR/" 2>/dev/null
|
||||
cp -a /var/log/dmesg* "$OUTDIR/" 2>/dev/null
|
||||
cp -a /var/log/boot.log* "$OUTDIR/" 2>/dev/null
|
||||
cp -a /var/log/dpkg.log* "$OUTDIR/" 2>/dev/null
|
||||
cp -a /var/log/apt "$OUTDIR/" 2>/dev/null
|
||||
|
||||
# Journal logs
|
||||
journalctl -b > "$OUTDIR/journal-current-boot.log" 2>/dev/null
|
||||
journalctl > "$OUTDIR/journal-all.log" 2>/dev/null
|
||||
|
||||
hostname > "$OUTDIR/hostname.txt" 2>/dev/null
|
||||
uname -a > "$OUTDIR/uname.txt"
|
||||
hostnamectl > "$OUTDIR/hostnamectl.txt" 2>/dev/null
|
||||
df -h > "$OUTDIR/disk-usage.txt"
|
||||
free -h > "$OUTDIR/memory.txt"
|
||||
ip addr > "$OUTDIR/ip-addresses.txt"
|
||||
systemctl --failed > "$OUTDIR/failed-services.txt" 2>/dev/null
|
||||
|
||||
# Create zip
|
||||
zip -r "$ZIPFILE" "$OUTDIR" >/dev/null
|
||||
|
||||
echo ""
|
||||
echo "Done."
|
||||
echo "Created zip:"
|
||||
echo "$ZIPFILE"
|
||||
Loaded 100 of 195 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user