Skip to content

Instantly share code, notes, and snippets.

@wheech-lv
wheech-lv / cloudflare_purge_dns.php
Created February 23, 2024 08:49
Php script for purging Cloudflare DNS Records of a zone
$zone = 'zone_id'; // find it at https://api.cloudflare.com/client/v4/zones/
$apiToken = 'secret_token';
$apiUrl = "https://api.cloudflare.com/client/v4/zones/$zone/dns_records";
$ch = curl_init($apiUrl);
$user_email = '[email protected]';
@wheech-lv
wheech-lv / dns_namesilo.sh
Created June 8, 2020 10:25
Namesilo API client for acme.sh with the min TTL set
#!/usr/bin/env sh
#Author: meowthink
#Created 01/14/2017
#Utilize namesilo.com API to finish dns-01 verifications.
Namesilo_API="https://www.namesilo.com/api"
######## Public functions #####################
@wheech-lv
wheech-lv / gist:fc544d79f50e5521f78bb997bd532314
Created February 3, 2020 14:08 — forked from Darkflib/gist:1884948
Sitemaps in SimpleXML in PHP
<?php
header('Content-type: text/xml');
//connect to db
$link=mysql_pconnect($db['write']['host'],$db['write']['user'],$db['write']['pass']) or die ("Could not connect to datadase");
mysql_select_db($db['write']['name']) or die ("could not select database");
$base='http://'.$_SERVER['HTTP_HOST'];
$xml = new SimpleXMLElement("<?xml version='1.0' encoding='UTF-8' ?>\n".'<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" />');
@wheech-lv
wheech-lv / cloudflare-delete-all-records.sh
Created January 13, 2020 16:54 — forked from slayer/cloudflare-delete-all-records.sh
Delete all DNS records for specified zone
#!/bin/bash
[email protected]
KEY=11111111111111111111111111
ZONE_ID=2222222222222222222222222
curl -X GET https://api.cloudflare.com/client/v4/zones/${ZONE_ID}/dns_records?per_page=500 \
-H "X-Auth-Email: ${EMAIL}" \
-H "X-Auth-Key: ${KEY}" \
-H "Content-Type: application/json" | jq .result[].id | tr -d '"' | (