Skip to content

Instantly share code, notes, and snippets.

View enoch85's full-sized avatar

enoch85

  • Datacenter Manager
  • Sweden
  • 01:05 (UTC +02:00)
View GitHub Profile
@enoch85
enoch85 / test
Last active September 25, 2025 13:45
# Test script to debug folder detection logic and regex extraction
# This mimics the behavior in the main rclone script
$BackupConfig = @{
RCLONE_PATH = "C:\rclone.exe"
REMOTE_NAME = "nextcloud"
REMOTE_DIR = "SERVERS_DATA"
}
# Exclude Patterns - copy from main script to test extraction
# Windows User Data Backup Script using Rclone - Nextcloud/WebDAV Version
# Simplified version for Nextcloud with reasonable server load
# FIXED FOR POWERSHELL ISE 5 COMPATIBILITY
#
# DIRECTORY STRUCTURE:
# - SERVERS_DATA/COMPUTERNAME/C (entire C: drive contents)
# - SERVERS_DATA/COMPUTERNAME/D (entire D: drive contents)
# - SERVERS_DATA/COMPUTERNAME/E (etc.)
#
# SYNC MODES:
# SQL Server Database Backup Script - Auto-detects SQL Instance
# Works on any server without modification
# Auto-elevates permissions if needed (requires Domain Admin rights)
param(
[string]$BackupPath = "C:\SQLBackups",
[bool]$IncludeSystemDatabases = $false,
[bool]$UseCompression = $true,
[bool]$UseWindowsAuth = $true, # Set to false for SQL Auth
[string]$Username = "", # Only used if UseWindowsAuth = false
#!/bin/bash
# Run this script without any param for a dry run
# Run the script with root and with exec param for removing old kernels after checking
# the list printed in the dry run
uname -a
IN_USE=$(uname -a | awk '{ print $3 }')
echo "Your in use kernel is $IN_USE"
OLD_KERNELS=$(
@enoch85
enoch85 / Protonmail.md
Last active August 1, 2023 18:09 — forked from ibaiul/Protonmail.md
Configure the protonmail bridge linux client on Ubuntu 20.04 with Nextcloud

Protonmail on Ubuntu 20.04 server

#protonmail #ubuntu #linux

Before you start

Currently protonmail bridge for linux is distributed as part of an open beta program, but soon it will be made public (https://protonmail.com/bridge/install).

Consider that the bridge linux client requires a paid protonmail account to work.

Get the protonmail bridge linux installer

#!/bin/bash
# Root is needed
if [ "$EUID" -ne 0 ]
then
echo "This script must be run with root or sudo privileges! Please try again. :)"
exit
fi
# Check if Ubuntu
# USER: ubuntu
# PASS: Elefant09
# People should live in Sweden
d-i debian-installer/country string SE
# Computers should speak English
d-i debian-installer/language string en
d-i debian-installer/locale string en_US.UTF-8
d-i localechooser/preferred-locale string en_US.UTF-8
# nginx@nginx:~$ cat /etc/nginx/sites-available/outlook.conf
server {
listen 192.168.128.2:80;
server_name yourdomain.com;
return 301 https://yourdomain.com$request_uri;
}
server {
listen 192.168.128.2:443;
#!/bin/bash
# Tech and Me © - 2018, https://www.techandme.se/
# shellcheck disable=2034,2059
true
# shellcheck source=lib.sh
FIRST_IFACE=1 . <(curl -sL https://raw.githubusercontent.com/nextcloud/vm/master/lib.sh)
unset FIRST_IFACE
@enoch85
enoch85 / test.sh
Last active January 19, 2017 10:15
#!/bin/bash
# Tech and Me, ©2017 - www.techandme.se
#
# This install from Nextcloud official stable build with PHP 7, MySQL 5.7 and Apche 2.4.
# Ubuntu 16.04 is required.
# Check for errors + debug code and abort if something isn't right
# 1 = ON
# 0 = OFF