This file contains hidden or 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
name: tfc-status | |
on: | |
workflow_dispatch: | |
push: | |
jobs: | |
watch-tfc: | |
runs-on: ubuntu-latest | |
env: | |
TFC_TOKEN: ${{ secrets.TFC_TOKEN }} |
This file contains hidden or 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
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 |
This file contains hidden or 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
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 |
This file contains hidden or 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
aws s3api list-buckets --query "Buckets[].Name" --output text \ | |
| xargs -n1 -I {} aws s3 rm s3://{} --recursive |
This file contains hidden or 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
name: Schedule Dynatrace Maintenance Window | |
on: | |
workflow_dispatch: # Can be triggered manually | |
jobs: | |
schedule-maintenance: | |
runs-on: ubuntu-latest | |
steps: |
This file contains hidden or 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
/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 |
This file contains hidden or 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
/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) --- |
This file contains hidden or 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
/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 |
This file contains hidden or 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 | |
# 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) |
NewerOlder