Skip to content

Instantly share code, notes, and snippets.

View Heisenberg3562's full-sized avatar
🎯
Focusing

Omkar Babrekar Heisenberg3562

🎯
Focusing
View GitHub Profile
@Heisenberg3562
Heisenberg3562 / cloudflare-worker.js
Created January 9, 2024 18:39
This script continuously monitors the availability of primary and backup servers and dynamically switches the DNS record to direct traffic to the most responsive server. By automating this process, you can achieve load balancing, distribute traffic efficiently, and enhance the overall reliability and availability of your site.
// Replace these values with your Cloudflare API credentials
const CF_API_EMAIL = 'your_email@example.com';
const CF_API_KEY = 'your_api_key';
const CF_ACCOUNT_ID = 'your_account_id';
const ZONE_ID = 'your_zone_id';
const LIST_OF_SUBDOMAIN_TO_MONITOR = ['cgpa.devomkar.com', 'www.devomkar.com'];
async function handleRequest() {
// Replace these values with your primary and backup IP addresses
@Heisenberg3562
Heisenberg3562 / ntfy.py
Created November 14, 2023 09:03
This Python script monitors Proxmox Virtual Environment (PVE) tasks and sends notifications for completed tasks to a specified Ntfy server.
import proxmoxer
import requests
import time
# Proxmox API details
PROXMOX_API_URL = '192.168.0.100:8006'
PROXMOX_USER = 'root@pam'
PROXMOX_PASSWORD = 'your_password'
NODE_NAME = 'your_node_name'