Skip to content

Instantly share code, notes, and snippets.

View groundcat's full-sized avatar

groundcat

  • Pennsylvania, US
  • 10:52 (UTC -04:00)
View GitHub Profile
@groundcat
groundcat / singleDomainChecker.py
Created July 25, 2024 02:39
PSL Single Domain Checker
import datetime
import sys
import os
import subprocess
import re
import webbrowser
from typing import List
def is_valid_domain(domain: str) -> bool:
regex = re.compile(
@groundcat
groundcat / wireguard-and-tailscale-example.conf
Created July 19, 2024 01:16
Make Wireguard VPN works together with Tailscale
[Interface]
PrivateKey = EXAMPLE
Address = EXAMPLE
DNS = EXAMPLE
MTU = EXAMPLE
[Peer]
PublicKey = EXAMPLE
AllowedIPs = 0.0.0.0/2, 64.0.0.0/3, 96.0.0.0/6, 100.0.0.0/10, 100.128.0.0/9, 101.0.0.0/8, 102.0.0.0/7, 104.0.0.0/5, 112.0.0.0/4, 128.0.0.0/1, ::/1, 8000::/2, c000::/3, e000::/4, f000::/5, f800::/6, fc00::/8, fd00::/10, fd40::/11, fd60::/12, fd70::/13, fd78::/15, fd7a::/20, fd7a:1000::/24, fd7a:1100::/26, fd7a:1140::/28, fd7a:1150::/29, fd7a:1158::/30, fd7a:115c::/33, fd7a:115c:8000::/35, fd7a:115c:a000::/40, fd7a:115c:a100::/41, fd7a:115c:a180::/42, fd7a:115c:a1c0::/43, fd7a:115c:a1e1::/48, fd7a:115c:a1e2::/47, fd7a:115c:a1e4::/46, fd7a:115c:a1e8::/45, fd7a:115c:a1f0::/44, fd7a:115c:a200::/39, fd7a:115c:a400::/38, fd7a:115c:a800::/37, fd7a:115c:b000::/36, fd7a:115c:c000::/34, fd7a:115d::/32, fd7a:115e::/31, fd7a:1160::/27, fd7a:1180::/25, fd7a:1200::/23, fd7a:1400::/22, fd7a:1800::/21, fd7a:2000::/19, fd7a:4000::/18, fd7a:8000::/17, fd7b::/16, fd7c::/14, fd80::/9, fe00::/7
Endpoint = EXAMPLE
@groundcat
groundcat / auto-delete-cf-dns.js
Created April 7, 2024 09:19 — forked from azliabdullah/auto-delete-cf-dns.js
bulk delete all DNS records in cloudflare
/**
* 1. open cloudflare dashboard, choose domain, go to DNS section
* 2. open browser's dev tool (via F12 or inspect or however)
* 3. in devtool, go to console tab
* 4. clear all existing messages
* 5. paste all script below
* 6. hit enter and watch
* 7. script only delete records displayed in the screen
* 8. if want to delete more, refresh browser and run script again
*
@groundcat
groundcat / virtualizor-auto-restart-vps.sh
Last active February 26, 2024 22:09
Auto restart the VPS through the Virtualizor end-user API when the VPS is down
#!/bin/bash
# Define variables
VPS_IP=""
API_KEY=""
API_PASSWORD=""
PANEL_URL="https://panel.example.com:4083"
# Stop the VPS
stop_vps() {

A one-line command that creates the script in the /opt directory and sets up the cronjob to run at 2:10 AM:

sudo bash -c 'echo -e "#!/bin/bash\nsudo apt-get update\nsudo apt-get install --only-upgrade tailscale -y" > /opt/update_tailscale.sh && chmod +x /opt/update_tailscale.sh && (crontab -l 2>/dev/null; echo "10 2 * * * /opt/update_tailscale.sh") | crontab -'
@groundcat
groundcat / enable-clipboard.sh
Created September 7, 2023 06:20
Fix clipboard sharing for Virtualbox Ubuntu VMs
# optionally: sudo apt-get remove virtualbox-guest-x11
sudo apt-get install virtualbox-guest-x11
sudo /usr/bin/VBoxClient --clipboard
||sogou.com^
||ocsp.apple.com^
||file.apicvn.com^
||dldir1.qq.com^
||360.com^
||360.cn^
||izatcloud.net^
||fengkongcloud.com^
||tebiefuza.cn^
||fengkongcloud.com^
@groundcat
groundcat / backup-proxmox-to-s3.md
Created August 2, 2023 05:25
Backup proxmox files to S3

Here is a step-by-step guide on how to use AWS CLI with a non-AWS custom endpoint, access id, and key to move (upload then delete) files to object storage.

  1. Install AWS CLI

This can be done by running the following command in your terminal:

$ curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
@groundcat
groundcat / check.sh
Last active July 16, 2023 21:06
CDN and Load Balancer Tester
#!/bin/bash
if [ "$#" -ne 1 ]; then
echo "Usage: ./check.sh [domain]"
exit 1
fi
DOMAIN=$1
ALL_RECORDS=$(dig @8.8.8.8 +short $DOMAIN)
@groundcat
groundcat / readme.md
Created July 8, 2023 21:22
Checks connection and auto connect to Cloudflare Warp

Cloudflare Warp Status Check Script

This bash script checks the status of Cloudflare Warp for a given endpoint (https://cloudflare.com/cdn-cgi/trace). It uses curl to make a HTTP request to the specified URL, checks if the response contains "warp=on" or "warp=plus", and acts accordingly.

Prerequisites

Before running the script, make sure you have the following tools installed on your system:

  • curl: A command-line tool for making HTTP requests. You can install it with a package manager like apt, brew, or yum.
  • warp-cli: A command-line interface for managing Cloudflare Warp. Follow Cloudflare's instructions to install it.