Skip to content

Instantly share code, notes, and snippets.

@tundragon
tundragon / main.sh
Last active February 18, 2026 10:16
run Cargo Clean for every directory in Current Working Directory - bash
#!/bin/bash
find . -type f -name Cargo.toml -print0 | while IFS= read -r -d '' manifest; do
dir="$(dirname "$manifest")"
echo "Cleaning $dir"
(cd "$dir" && cargo clean) | tee -a cargo_clean_output.txt
done
@tundragon
tundragon / Dockerfile
Created November 22, 2025 18:08
Dockerfile - rust security checks
FROM rust:1.91.0-slim-trixie AS security-checks
RUN apt-get update \
&& apt-get upgrade -y \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
# Install security tools
RUN cargo install --locked cargo-audit \
&& rustup component add clippy rustfmt
@tundragon
tundragon / gcp-netbox-managed.sh
Created March 11, 2025 08:43 — forked from mikesparr/gcp-netbox-managed.sh
Experiment setting up Netbox on Google Cloud Platform leveraging managed services
#!/usr/bin/env bash
#####################################################################
# REFERENCES
# - https://docs.netbox.dev/en/stable/installation/3-netbox/
# - https://github.com/netbox-community/netbox-docker/wiki/
# - https://hub.docker.com/r/netboxcommunity/netbox
# - https://cloud.google.com/sql/docs/postgres/configure-private-ip
# - https://cloud.google.com/sql/docs/postgres/create-instance
# - https://cloud.google.com/sql/docs/postgres/create-manage-databases#gcloud
@tundragon
tundragon / Flashing Messages (in method).py
Created February 17, 2023 23:04 — forked from jimbrayrcp/Flashing Messages (in method).py
placing line break flash messages ~or~ multi line flash messages in a python flask html template
# EDIT THIS CODE TO YOUR SPECIFIC NEEDS
# THIS CODE REQUIRES SPECIFIC HTML CODE TO BE PLACED
# INSIDE THE TEMPLATE EXAMPLE FOUND BELOW
from flask import Flask, flash
def some_method():
@tundragon
tundragon / create_script.py
Last active February 16, 2023 01:10
Create a script from a docstring and execute it.
import pathlib
def write_it():
if not pathlib.Path('hehe').is_file():
other_var = "MyName"
my_var = f'''
def main():
print(
"""Hello {other_var},
@tundragon
tundragon / Dockerfile
Created December 29, 2022 11:31 — forked from kaikousa/Dockerfile
Install Terraform on Docker
FROM ubuntu:16.04
RUN apt-get update && apt-get install -y \
wget \
unzip \
&& rm -rf /var/lib/apt/lists/*
RUN wget --quiet https://releases.hashicorp.com/terraform/0.11.3/terraform_0.11.3_linux_amd64.zip \
&& unzip terraform_0.11.3_linux_amd64.zip \
&& mv terraform /usr/bin \
@tundragon
tundragon / first.py
Last active September 22, 2022 19:54
Use a randomly generated number across multiple files ( first.py and second.py - in this case )
import rand_numb
def main():
b = rand_numb.gg
print(b)
return b