Go to file
Brett 562b2bf4cc github only support 2024-10-01 16:49:15 -04:00
__pycache__ silly 2024-09-26 19:54:50 -04:00
examples systemd services 2024-05-01 20:10:09 -04:00
nixpkgs/blt-utils nix 2024-09-26 17:05:05 -04:00
util logic 2024-06-17 15:55:48 -04:00
Brett_C++Config_reshaper.xml silly little guy 2024-05-29 13:52:33 -04:00
GPL_Copyright_notice.txt add GPL copyright notice 2023-10-26 15:41:34 -04:00
LICENSE Initial commit 2023-03-16 13:49:07 -04:00
README.md Update README.md 2023-05-07 15:44:19 -04:00
bargo.py silly 2024-09-26 19:54:50 -04:00
clion_cmake_exec.txt bargo working 2024-06-01 14:08:25 -04:00
clion_cmake_lib.txt bargo working 2024-06-01 14:08:25 -04:00
clion_color_comment.txt add clion custom colors 2023-10-26 15:44:01 -04:00
clion_header_conf.txt add GPL copyright notice 2023-10-26 15:41:34 -04:00
color_io.py systemd 2024-04-17 18:14:17 -04:00
commit.py github only support 2024-10-01 16:49:15 -04:00
create_git_repo.py silly 2024-09-26 19:54:50 -04:00
create_site.py logic 2024-06-17 15:55:48 -04:00
create_systemd_service.py fix parser 2024-05-01 20:11:38 -04:00
create_webasm_page.py systemd services 2024-05-01 20:10:09 -04:00
default.nix nix 2024-09-26 17:05:05 -04:00
dns_fetch.py Upload files to '' 2023-03-16 13:53:27 -04:00
gl_doc_generator.py return null on page not existing 2023-12-22 12:32:17 -05:00
site_gen.py update site_gen.py 2023-05-07 15:51:51 -04:00

README.md

Scripts

General useful scripts (mostly for Linux)

dns_fetch.py


This lovely python script allows you to fetch ip address form cloudflare dns records. This is useful for remote servers with dynamic ips you wish to keep private. Pretty nifty eh?

Env file


The script searches for a file named dns_resolv_env.json in:

  • your home directory (~/)
  • the config folder (~/.local/share/dns_helper/)
  • the local folder (./)
  • the parent folder (../) The file is a json file with 3 possible attributes
{
        "auth_key": "key here",
        "zone_id": "zone id here",
        "default_name": "website name here"
}

Notes


  • The env file and its arguments are optional.
  • If no auth key is specified, the script will require you to pass your auth key with --auth "key here"
  • Zone id can be provided via the commandline arg --zone or in the env file.
  • If no zone id is provided the script will fetch and print from ALL zones on your cloudflare account.
  • If default_name is not specified by either file or via -n "name", filtering will be ignored.
  • Commandline args are always prefered.

Usage Examples


  • python3 dns_fetch.py -a -n -i
    • Returns only the ip address of the A record corresponding to default_name.
      • This can be used in bash commands: ssh username@$(python3 dns_fetch.py -a -n -i)
  • python3 dns_fetch.py -a
    • Returns all A records
  • python3 dns_fetch.py -c
    • Returns all CNAME records
  • python3 dns_fetch.py
    • Prints the raw json from cloudflare
  • python3 dns_fetch.py -n
    • Prints all records corresponding to default_name

site_gen.py


Allows you to easily generate and install nginx site configs.