Skip to content

Instantly share code, notes, and snippets.

View boznius's full-sized avatar

Bozhidar Bozhev boznius

View GitHub Profile
name: tfc-status
on:
workflow_dispatch:
push:
jobs:
watch-tfc:
runs-on: ubuntu-latest
env:
TFC_TOKEN: ${{ secrets.TFC_TOKEN }}
for region in $(aws ec2 describe-regions --query "Regions[*].RegionName" --output text); do
echo "Checking region: $region"
for snap in $(aws ec2 describe-snapshots \
--owner-ids self \
--query "Snapshots[*].SnapshotId" \
--output text \
--region $region); do
echo "Deleting $snap in $region"
aws ec2 delete-snapshot --snapshot-id $snap --region $region
done
name: Scheduled Terraform Cloud Apply
on:
schedule:
- cron: "0 22 * * 5" # Every Friday 22:00 UTC (adjust as needed)
workflow_dispatch: {}
jobs:
apply:
runs-on: ubuntu-latest
aws s3api list-buckets --query "Buckets[].Name" --output text \
| xargs -n1 -I {} aws s3 rm s3://{} --recursive
@boznius
boznius / gist:7c03df4b2a3ee5bfb68c7263e2530c1d
Created August 5, 2025 13:50
dynatrace-maintenance window
name: Schedule Dynatrace Maintenance Window
on:
workflow_dispatch: # Can be triggered manually
jobs:
schedule-maintenance:
runs-on: ubuntu-latest
steps:
/system script add name=autoSetup source={
### --- Secure Password ---
/user set admin password="YourStrongPa$$"
### --- NTP Setup ---
/system ntp client set enabled=yes primary-ntp=pool.ntp.org mode=unicast
### --- DNS Setup (Cloudflare + Google) ---
/ip dns set servers=1.1.1.1,8.8.8.8 allow-remote-requests=yes cache-size=2048KiB
/system script add name=autoSetup source={
### --- Basic Security ---
/user set 0 password="YourStrongPa$$"
### --- Time Sync & DNS ---
/system ntp client set enabled=yes primary-ntp=pool.ntp.org
/ip dns set servers=1.1.1.1,8.8.8.8 allow-remote-requests=yes
### --- WAN Setup (Ether1 via DHCP) ---
/system script add name=autoSetup source={
# set password
/user set 0 password="YourStrongPa$$"
# configure NTP
/system ntp client set enabled=yes primary-ntp=pool.ntp.org
# set DNS servers
/ip dns set servers=1.1.1.1,8.8.8.8 allow-remote-requests=yes
# setup WAN via DHCP on ether1
/ip dhcp-client add interface=ether1 disabled=no
# add default firewall basic drop rules
#!/bin/bash
# Optional exclusion file (full relative paths)
EXCLUDE_FILE=".ns_record_exclude"
# Read exclusion list into array
declare -A excluded
if [[ -f "$EXCLUDE_FILE" ]]; then
while IFS= read -r line; do
trimmed=$(echo "$line" | xargs)
We couldn’t find that file to show.