This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
brew install --cask cloudflare-warp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cat <<EOF >> ~/.zshrc | |
alias myip4='dig +short @1.1.1.1 whoami.cloudflare ch txt | sed "s/\"//g"' | |
alias myip6='dig +short @2606:4700:4700::1111 -6 ch txt whoami.cloudflare | sed "s/\"//g"' | |
EOF | |
source ~/.zshrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo killall -HUP mDNSResponder | |
sudo killall mDNSResponderHelper | |
sudo dscacheutil -flushcache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://developers.cloudflare.com/workers/examples/return-html | |
// The value of const can't be changed through reassignment | |
// Template literals allow us to define multiple lines using `` | |
const html = `<!DOCTYPE html> | |
<body> | |
<h1>Hello World</h1> | |
<p>This markup was generated by a Cloudflare Worker.</p> | |
</body>` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import Library | |
from bs4 import BeautifulSoup | |
import urllib.request | |
# Set URL | |
url = "https://api.cloudflare.com/" | |
# Retrieve from URL | |
html = urllib.request.urlopen(url) | |
# Use BeautifulSoup | |
soup = BeautifulSoup(html, "html.parser") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export EMAIL='YOUR_EMAIL' | |
export APIKEY='YOUR_APIKEY' | |
export ACCOUNT_ID='YOUR_ACCOUNT_ID' | |
export ZONE_NAME='example.com' | |
curl -sX POST "https://api.cloudflare.com/client/v4/zones" \ | |
-H "X-Auth-Email: $EMAIL" \ | |
-H "X-Auth-Key: $APIKEY" \ | |
-H "Content-Type: application/json" \ | |
--data '{"name":"'"$ZONE_NAME"'","account":{"id":"'"$ACCOUNT_ID"'"},"jump_start":false,"type":"partial"}' | jq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/client/v4/accounts | |
/client/v4/accounts/:account_id/gateway/categories | |
/client/v4/accounts/:account_id/rulesets | |
/client/v4/accounts/:account_id/rulesets/:ruleset_id | |
/client/v4/accounts/:account_id/rulesets/:ruleset_id/rules | |
/client/v4/accounts/:account_id/rulesets/:ruleset_id/rules/:rule_id | |
/client/v4/accounts/:account_id/rulesets/:ruleset_id/versions | |
/client/v4/accounts/:account_id/rulesets/:ruleset_id/versions/:ruleset_version | |
/client/v4/accounts/:account_id/rulesets/phases/:ruleset_phase/entrypoint | |
/client/v4/accounts/:account_identifier/addressing/loa_documents |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm install wrangler --save-dev && wrangler --version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git init && gh repo create --source $(git rev-parse --show-toplevel) --public | |
git add -A && git commit -m 'initial commit' && git push -u origin main | |
gh repo edit --add-topic cloudflare,cloudflare-workers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm config set cafile ~/.npm/Cloudflare_CA.pem | |
// To disable the config above... | |
// npm config delete cafile | |
// or | |
// npm config delete cafile --location=global |
OlderNewer