Skip to content

Instantly share code, notes, and snippets.

@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 '"' | (