Skip to content

Instantly share code, notes, and snippets.

View DavidEredics's full-sized avatar

Dávid Eredics DavidEredics

View GitHub Profile
@DavidEredics
DavidEredics / debian-initramfs-ipv6-hook-script
Last active October 21, 2023 12:04 — forked from Someguy123/debian-initramfs-ipv6-hook-script
Scripts to support IPv6 networking in Debian pre-boot (initramfs) environment
#!/bin/sh
##########################################################################################
# Script to be placed in /etc/initramfs-tools/hooks/ipv6
#
# These initramfs IPv6 scripts were originally made by zajdee, and were modified by Someguy123
# at Privex Inc. ( https://www.privex.io ) to fix some issues and add debug logging.
#
# It can be found online here: https://gist.github.com/Someguy123/8092bdc9834aa210fb4bd1523e9a1c38
#
# (Original Gist this was based off of (broken script!): https://gist.github.com/zajdee/65aad61f35d3a63c56c7d1cc76c22e14)
@DavidEredics
DavidEredics / cloudflare_cache_purge_files.sh
Created August 17, 2021 15:01
Cloudflare API Purge Files by URL example
curl -X POST "https://api.cloudflare.com/client/v4/zones/[zone_identifier]/purge_cache" \
-H "Authorization: Bearer [api_token]" \
-H "Content-Type: application/json" \
--data '{"files":["https://example.com/data.json","https://www.example.com/favicon.ico"]}'
@DavidEredics
DavidEredics / cloudflare-dns.md
Created August 14, 2021 19:46
Cloudflare DNS addresses

Cloudflare DNS addresses

1.1.1.1
1.0.0.1
2606:4700:4700::1111
2606:4700:4700::1001

DNS over TLS

1dot1dot1dot1.cloudflare-dns.com

@DavidEredics
DavidEredics / resolved.conf
Last active May 30, 2024 08:25
Cloudflare DNS over TLS systemd resolved config
[Resolve]
DNS=1.1.1.1#1dot1dot1dot1.cloudflare-dns.com 1.0.0.1#1dot1dot1dot1.cloudflare-dns.com 2606:4700:4700::1111#1dot1dot1dot1.cloudflare-dns.com 2606:4700:4700::1001#1dot1dot1dot1.cloudflare-dns.com
DNSSEC=yes
DNSOverTLS=yes
@DavidEredics
DavidEredics / dbBackup.sh
Created November 16, 2020 19:00
Shell script to backup mysql database and/or specific table
#!/bin/sh
date=$(date +"%Y-%m-%d")
now=$(date --iso-8601=seconds)
dbname=''
table1=''
options="--defaults-extra-file=/path/mysql-credentials.cnf --no-tablespaces"
LOGFILE=/path/dbBackupErrors.txt
@DavidEredics
DavidEredics / update_ip.sh
Last active January 5, 2022 20:04
Bash script to update Cloudflare DNS records to the current ip
#!/bin/bash
api_token="" #Cloudflare API Token
zone_identifier="" #Zone ID
record_name="" #the dns records name (e.g. example.com)
ttl=1 #Time to live, in seconds (60-86400 or 1 for automatic)
proxied=true #whether the record should proxied by Cloudflare (true|false)
@DavidEredics
DavidEredics / DateTime.js
Created October 14, 2018 15:41
JavaScript UTC DateTime function
function DateTime(){
var date = new Date();
var year = date.getUTCFullYear();
var month = date.getUTCMonth() + 1;
month = (month < 10 ? "0" : "") + month;
var day = date.getUTCDate();
day = (day < 10 ? "0" : "") + day;
var hour = date.getUTCHours();

Keybase proof

I hereby claim:

  • I am davideredics on github.
  • I am davideredics (https://keybase.io/davideredics) on keybase.
  • I have a public key ASCKU0XqksdsrzSGDlzMtKmrCmiacJ4RvtVUHGQF_H53Swo

To claim this, I am signing this object: