Skip to content

Instantly share code, notes, and snippets.

@magicstone1412
magicstone1412 / borg_backup.sh
Created December 12, 2024 23:03
Borg Backup Script
#!/bin/bash
# Exit immediately if a command exits with a non-zero status
set -e
# Variables (Customize these)
BACKUP_REPO="/path/to/backup/repo" # Borg repository location
BACKUP_SOURCE="/path/to/backup/source" # Directory to back up
PASSPHRASE="your-borg-passphrase" # Borg passphrase (avoid exposing in scripts; use environment variables instead)
BACKUP_LOG="/var/log/borg_backup.log" # Log file location
@magicstone1412
magicstone1412 / rclone-mount-yandex
Created November 18, 2024 14:44
Mount Yandex disk using rclone docker compose
---
services:
rclone-mount:
image: rclone/rclone:latest
container_name: rclone-mount
restart: unless-stopped
environment:
- RCLONE_CONFIG=/config/.rclone.conf
- PUID=1001
- PGID=100
@magicstone1412
magicstone1412 / qbittorrent
Created November 17, 2024 10:00
OVM qbittorrent docker compose file
---
services:
---
qbittorrent:
image: lscr.io/linuxserver/qbittorrent:latest
container_name: qbittorrent
environment:
- PUID=1001
- PGID=100
- TZ=${TZ}
@magicstone1412
magicstone1412 / Dockerfile
Created October 27, 2024 01:38
Tor proxy using Docker
# Set the latest version of Alpine Linux as the base image
FROM alpine:latest
# Updates the package list in the Alpine package manager and installs the Tor package.
RUN apk update && apk add tor
# Instructs Tor to send log notices to the standard output
RUN echo "Log notice stdout" >> /etc/torrc
# Configures Tor to listen for SOCKS connections on all network interfaces (0.0.0.0) on port 9050
@magicstone1412
magicstone1412 / cloudflare-tunnel.yml
Created October 20, 2024 00:20
Cloudflare Zero Trust Tunnel docker-compose file for Openmediavault
---
services:
# cloudflare tunnel
cloudflare-tunnel:
image: cloudflare/cloudflared
container_name: cloudflare-tunnel
restart: unless-stopped
command: tunnel run
environment:
- "TUNNEL_TOKEN=${CLOUDFLARE_TUNNEL_TOKEN}" #Add varible to environment file
@magicstone1412
magicstone1412 / immich.yml
Created October 19, 2024 14:15
Immich Docker compose file for Openmediavault (OMV)
---
services:
# Main Immich Server service configuration
immich-server:
container_name: immich-server
image: ghcr.io/immich-app/immich-server:v1.118.2 # Image to be used
ports: # Mapping ports from the host OS to the container
- 2283:2283
volumes: # Mounting directories for persistent data storage - CHANGE THIS
- /srv/immich:/usr/src/app/upload
@magicstone1412
magicstone1412 / wg-auto-reconnect.sh
Created September 15, 2024 23:03
Auto reconnect Wireguard on Debian
#!/bin/bash
# Function to check internet connection
check_internet() {
if ping -q -c 1 -W 1 8.8.8.8 >/dev/null 2>&1; then
return 0 # Internet is available
else
return 1 # No internet connection
fi
}
@magicstone1412
magicstone1412 / android_gateway.txt
Created September 8, 2024 10:24 — forked from gcleaves/android_gateway.txt
Wireguard peer as internet gateway, using Android USB tethering
# attempt 6, success
# relies on Magisk auto start script
# pause script to give wireguard time to autostart
bullhead:/ # cat /data/adb/service.d/prep_gateway.sh
#!/system/bin/sh
sleep 2m
su -c 'iptables -F tetherctrl_FORWARD'
su -c 'sysctl -w net.ipv4.ip_forward=1'
su -c 'iptables -A FORWARD -i tun0 -j ACCEPT'
su -c 'iptables -t nat -A POSTROUTING -o rmnet_data0 -j MASQUERADE'
{
"target": "terminus_exec",
"cancel": "terminus_cancel_build",
"focus": true,
"timeit": true,
"cmd": ["python3", "-u", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python",
  1. Install Notepad++ (check "set as default HTML editor" to replace Notepad in IE).

  2. Run Notepad++, update its plugins, and install "NppExec" via Plugins, Plugin Manager.

  3. Download DBGpPlugin . Place in C:\Program Files (x86)\Notepad++\plugins\DBGpPlugin

  4. Use this link to download a modified version of the Komodo Remote Debugging Package. Place in plugin directory. (Unmodified Komodo package does not work with DBGpPlugin) Also contains DBGpPlugin

  5. Enter these scripts for Python debugging:

    Press F6 to create a NppExec Execute script, save as "Run Python":

    cd "$(CURRENT_DIRECTORY)"