Skip to content

Instantly share code, notes, and snippets.

View Cdaprod's full-sized avatar
🏠
Learn something new everyday!

David Cdaprod

🏠
Learn something new everyday!
View GitHub Profile

Integrating the Python module in pfSense's DNS Resolver (Unbound) with an OpenAI API call can open up a range of advanced functionalities. For example, you can dynamically analyze DNS queries and responses, filter content, or log and process data for further analysis. Here's how you can set this up to do something "awesome."

Example Use Case: Intelligent Content Filtering with OpenAI

Let's create a scenario where you want to filter DNS queries based on the content of the domains being requested. We'll use OpenAI's API to analyze the domain names and decide whether to allow or block the requests.

Step-by-Step Guide

1. Create an OpenAI Account and Obtain API Key

@Cdaprod
Cdaprod / paper_scanner_camera_automator.md
Created June 19, 2024 19:29
By following these steps, you can automate the process of capturing images of each page and compile them into a single PDF using your Nikon Z7, a stepper motor-driven feeder, and a Raspberry Pi.

To automate the process of capturing images of each page using your Nikon Z7, a stepper motor-driven paper feeder, a capture card, and a Raspberry Pi (RPi), you can follow these steps:

Hardware Setup

  1. Nikon Z7 Camera: Mount it on a tripod positioned above the paper feeder.
  2. Stepper Motor: Connect the stepper motor to your paper feeder to automate the feeding of each page.
  3. Capture Card: Connect your Nikon Z7 to the Raspberry Pi using an HDMI capture card.
  4. Raspberry Pi: Use it to control both the stepper motor and the camera.

Software and Libraries

  1. gPhoto2: To control the Nikon Z7 from the Raspberry Pi.
@Cdaprod
Cdaprod / DOC.md
Last active June 17, 2024 18:50
Install Kubernetes on Ubuntu

Based on the information gathered from multiple sources, it appears that using a /24 CIDR for the Weave Net pod network should work, but there are a few considerations to ensure proper configuration.

Key Steps to Configure Weave Net with a /24 CIDR

  1. Remove Incorrect Repository and Add Correct One: Ensure you remove any existing incorrect Kubernetes repositories and add the correct one for your version of Ubuntu.

  2. Disable Swap: Disabling swap is necessary for Kubernetes to function correctly.

@Cdaprod
Cdaprod / Python_DevOps_Funcs.md
Created June 14, 2024 22:17
More cool Python funcs with a devops spin

Based on the search results, here are some enhanced and cool DevOps examples using exec(), permutations(), partial(), choice(), and askopenfilename() in Python:

1. exec()

Dynamic Infrastructure Management Using exec(), you can dynamically manage infrastructure code, making it adaptable to different environments or scenarios.

# Define a dynamic configuration script
config_script = """
@Cdaprod
Cdaprod / Pfsense_DHCP_Over_API.md
Last active June 13, 2024 20:53
Here's how you can fetch your DNS and DHCP records from your pfSense box with IP address `192.168.0.1` using the API:

Here's how you can fetch your DNS and DHCP records from your pfSense box with IP address 192.168.0.1 using the API:

Fetching DNS Host Overrides

Use the following curl command to fetch DNS Host Overrides:

curl -X GET "http://192.168.0.1/api/v1/services/dnsmasq/host_override" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-api-key"
@Cdaprod
Cdaprod / minio-weaviate-ts.md
Created June 13, 2024 19:36
This setup allows you to deploy MinIO and Weaviate servers with dedicated Tailscale containers, ensuring secure connectivity and integration within your tailnet. The bash functions and aliases make it easy to interact with these services from the command line.

Here's the updated docker-compose.yml file for deploying MinIO and Weaviate servers, each with a dedicated Tailscale container. This setup ensures that both services are accessible over your Tailscale tailnet with the appropriate environment variables and configurations.

docker-compose.yml

version: '3.8'

# Set Variables: TS_AUTHKEY, TS_CERT_DOMAIN, MINIO_DOMAIN, MINIO_BROWSER_REDIRECT_URL, MINIO_ROOT_USER, MINIO_ROOT_PASSWORD, WEAVIATE_ORIGIN
# Configuration Files: TS_SERVE_CONFIG
@Cdaprod
Cdaprod / Ghost-Docker-Deployment.md
Created June 13, 2024 19:32
To deploy a Ghost blog using the command line interface (CLI), follow these steps:

To deploy a Ghost blog using the command line interface (CLI), follow these steps:

Step 1: Install Docker and Docker Compose

Make sure Docker and Docker Compose are installed on your machine. If not, follow the installation instructions from the Docker website and Docker Compose installation page.

Step 2: Set Up the Project Directory

Create a directory for your Ghost blog project:

mkdir ghost-blog
cd ghost-blog
@Cdaprod
Cdaprod / My Dev Tools.md
Last active June 13, 2024 02:20
These steps provide a cohesive setup with MinIO, Weaviate, and Tailscale, along with the necessary tools for your DevOps and AIOps tasks.

Setting Up CLI and Python Integration for MinIO and Weaviate in a Hybrid Cloud Environment

Description:

This guide provides detailed instructions for configuring a cohesive multi-server interface architecture using Tailscale, MinIO, Weaviate, GitHub, Python, and Docker/KinD within a hybrid cloud environment. It includes steps to install necessary tools, create Python scripts for interacting with MinIO and Weaviate, and define bash functions and aliases for streamlined CLI operations. The provided scripts and commands ensure seamless file uploads to MinIO and indexing in Weaviate, enhancing your DevOps and AIOps workflows.

Implementation:

Here’s how to configure your environment with the specified settings for GitHub, MinIO, and Weaviate.

@Cdaprod
Cdaprod / contrib_llm_dev.md
Created June 5, 2024 19:57
Explains my passion for AI development and what my specialties are.

Contributing to LLM Development: Key Areas and Expertise

Hey team,

I'm excited about the opportunity to contribute to our LLM development project. Here are some areas where I believe I can add significant value based on my experience and passion for integration and application layer development.

1. Data Management and Storage

Integrate MinIO for Efficient Data Handling

@Cdaprod
Cdaprod / debian_fixing_apt.md
Last active June 4, 2024 17:20
This guide should help anyone facing APT key issues on their Debian-based systems, including Raspberry Pi OS and CasaOS.

Resolving APT Key Issues on Debian-based Systems

Overview: This guide walks you through fixing the common APT key issues that might occur during package installation on Debian-based systems, such as Raspberry Pi OS. It covers updating system keys, resolving deprecated key issues, and ensuring your system is properly set up to install necessary packages.

Table of Contents:

  1. Introduction
  2. Understanding APT Key Issues
  3. Step-by-Step Fix for APT Key Issues
  4. Conclusion