Skip to content

Instantly share code, notes, and snippets.

@sirkirby
sirkirby / create-cert.sh
Created December 20, 2024 16:37
Create let's encrypt wildcard cert through Cloudflare with acme.sh
curl https://get.acme.sh | sh -s email=blog@chriskirby.net
# Source the installed script (or restart your terminal)
source ~/.bashrc # or source ~/.zshrc for macOS
# Export Cloudflare API Token
export CF_Token="your-cloudflare-api-token"
# Optional: Add this to your ~/.bashrc or ~/.zshrc to make it permanent
# Issue the certificate
@sirkirby
sirkirby / adguard-values.yaml
Created December 19, 2024 19:45
AdGuard Home Helm Chart values
image:
repository: adguard/adguardhome
pullPolicy: IfNotPresent
tag: latest
env:
TZ: America/Detroit
# customizing my web and dns services
# using the LoadBalancer to expose outside of the cluster
@sirkirby
sirkirby / AdGuardHome.yaml
Last active December 19, 2024 20:21
AdGuard Home yaml configuration example
bind_host: 0.0.0.0
bind_port: 3000
# I recommend adding a user account, but this is optional
# requires hashed password htpasswd -B -n -b <USERNAME> <PASSWORD>
users:
- name: admin
password: XXXXXXXXXXXXXXXXXXXXXXXX
auth_attempts: 5
block_auth_min: 15
http_proxy: ""
@sirkirby
sirkirby / migrate-dns-rewrites.py
Created December 17, 2024 22:34
Migrate pi-hole A and CNAME dns records to AdGuard DNS Rewrite rules
import sys
import yaml
import re
from typing import List, Dict, Any
class NoAliasDumper(yaml.SafeDumper):
"""Custom YAML dumper that ignores aliases."""
def ignore_aliases(self, data):
return True
@sirkirby
sirkirby / migrate-domains-user-rules.py
Last active December 20, 2024 16:31
Migrate Pi-hole whitelists and blacklists to AdGuard custom rules configuration
import json
import yaml
import sys
from datetime import datetime
import re
def clean_comment(comment):
"""Clean up comment by removing newlines and extra spaces."""
if not comment:
return ""
@sirkirby
sirkirby / migrate-adlists-filters.py
Created December 17, 2024 20:08
Migrate Pi-Hole adlist to Adguard DNS Blocklist Filters yaml
import json
import yaml
import sys
from datetime import datetime, timezone
def convert_adlists(adlists_json):
"""Convert Pi-hole adlists to AdGuard Home filters format."""
try:
adlists_data = json.loads(adlists_json)
except json.JSONDecodeError:
@sirkirby
sirkirby / GetFirewallRule.bru
Created September 20, 2024 19:01
Bruno UDM Network API get firewall rule
meta {
name: GetFirewallRule
type: http
seq: 3
}
get {
url: https://{{udm-ip}}/proxy/network/api/s/default/rest/firewallrule/{{rule-id}}
body: none
auth: none
@sirkirby
sirkirby / GetTrafficRule.bru
Created September 20, 2024 18:59
Bruno UDM Network API get traffic rule
meta {
name: GetTrafficRule
type: http
seq: 6
}
get {
url: https://{{udm-ip}}/proxy/network/v2/api/site/default/trafficrule/{{rule-id}}
body: none
auth: none
@sirkirby
sirkirby / GetTrafficRules.bru
Created September 20, 2024 16:35
UDM Network API get traffic rules
meta {
name: GetTrafficRules
type: http
seq: 4
}
get {
url: https://{{udm-ip}}/proxy/network/v2/api/site/default/trafficrules
body: none
auth: none
@sirkirby
sirkirby / GetFirewallRules.bru
Created September 20, 2024 16:32
UDM Network API get firewall rules
meta {
name: GetFirewallRules
type: http
seq: 3
}
get {
url: https://{{udm-ip}}/proxy/network/api/s/default/rest/firewallrule
body: none
auth: none