Skip to content

Instantly share code, notes, and snippets.

@xucian
xucian / ddns-cf-win.ps1
Last active January 31, 2024 20:28
Cloudflare DDNS for Windows
# Create or Update a Cloudflare domain or subdomain with your current IP, and schedule a recurring run via Task Scheduler
# (Optional but recommended) Rename this to include the subdomain name, such as ddns-cf-win_x.example.com.ps1 or simply x.example.com.ps1
# Place this somewhere you're comfortable running it from (C:/PortablePrograms/ddns-cf/)
# Right-click and Run in PowerShell
# This will run once, and schedule itself to run via Task Scheduler every x minutes (will ask for Admin priviledges for this)
# If the Task already exists for this record, it won't be duplicated
# Can run multiple of these for different records (task name includes the recordFullName)
# Stop the script on any errors
@xucian
xucian / ovf2kvm.sh
Last active December 5, 2023 14:04 — forked from riblo/ovf2kvm.sh
Import VMware images (ovf based) to Proxmox VE
#!/bin/bash
# Script that imports VMware images (ovf based) to Proxmox VE
# Your VM_NAME needs to be the same for: VM_NAME (directory) and VM_NAME.ovf
set -euo pipefail
PROXMOX_USER=root
PROXMOX_PASS='???'
PROXMOX_HOST='???'
PROXMOX_PORT=22
@xucian
xucian / gsutilcpifnewer.sh
Last active November 3, 2023 10:20
Copy a file to a Google Storage Bucket only if it's new or newer
#!/bin/bash
# Exists with code 3 if no changes are made
# Be professional
set -euo pipefail
# Check for the correct number of arguments
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <local_file> <bucket_destination>"