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
@Cdaprod
Cdaprod / UDP_GRO_TAILSCALE.md
Created August 30, 2024 22:36
This script configures UDP GRO settings for Tailscale and makes them persistent. Make sure your system meets the requirements, like having `networkd-dispatcher` enabled, before running the script.

Here's a script to configure UDP GRO settings for Tailscale on your device and make them persistent across reboots. You can name this script configure_tailscale_gro.sh.

Script: configure_tailscale_gro.sh

#!/bin/bash

# Determine the network device name
NETDEV=$(ip -o route get 8.8.8.8 | cut -f 5 -d " ")
@Cdaprod
Cdaprod / FIX_TMUX_MULTIPATH_TCP.md
Last active August 13, 2024 03:13
By following these steps, you should be able to resolve the issue with the interface output queue being full after using tmux. If the problem persists, consider reaching out to your network administrator or consulting the Multipath TCP community for further assistance.

Fixing Multipath TCP Queue Full Error After Using tmux

If the issue "shell failed Multipath TCP: The operation couldn't be completed. Interface output queue is full" started after using tmux, it might be related to how tmux handles network connections and output. Here are some steps to address the issue:

Restart tmux:

Restart tmux to clear any internal buffers or queues:

tmux kill-server
@Cdaprod
Cdaprod / StableDiffusion.md
Created August 6, 2024 18:01
By following these steps, I was able to create blended videos using AI-generated images and video editing tools. It’s a fun and creative journey!

Creating blended videos using AI tools like Stable Diffusion can be both fun and rewarding. Here's how I got started:

Step 1: Install Required Software

  1. Stable Diffusion:
    • First, I made sure I had Python installed on my machine.
    • Then, I installed the diffusers library from Hugging Face.
      pip install diffusers[torch]
@Cdaprod
Cdaprod / [notes]neural_network_engineered_parts_from_idea.md
Last active July 10, 2024 02:46
By leveraging these resources and steps, you can build a neural network capable of developing engineered parts from ideas and allow interactive design modifications through human input.

To build a neural network that can develop engineered parts from an idea, you need a diverse and well-annotated dataset. Here are the properties and considerations for the dataset:

1. Data Types

  • Textual Descriptions:

    • Detailed descriptions of mechanical parts, their functions, materials, and constraints.
    • Examples: "A hinge that allows a door to swing open and close, made of stainless steel, with a 90-degree rotation limit."
  • 2D Drawings/Sketches:

  • Hand-drawn sketches or technical drawings of parts.

@Cdaprod
Cdaprod / Wireless-Bluetooth-USB-C-Keyboard-with-ESP32-S2-Mini.md
Created July 7, 2024 02:22
This setup enables your ESP32-S3 Mini to act as a wireless Bluetooth keyboard using a USB-C keyboard. Ensure you adapt the provided code examples to fit your specific setup and environment.

Building a Wireless Bluetooth USB-C Keyboard with ESP32-S3 Mini

Creating a wireless Bluetooth USB-C keyboard using an ESP32-S3 Mini involves connecting a USB-C keyboard to an ESP32-S3 via a USB Host Shield. This project allows you to transform a wired keyboard into a wireless one, leveraging Bluetooth communication. Below is a detailed guide on how to set up and program this system.

Components Needed

  1. ESP32-S3 Mini
  2. USB Host Shield or USB Host Adapter (e.g., USB Host Shield for Arduino or a USB Host Module)
  3. USB-C Keyboard
  4. USB-C to USB-A Adapter (if necessary)
@Cdaprod
Cdaprod / video_and_audio_captions.md
Created July 3, 2024 22:55
This approach allows you to analyze and generate captions for videos using LangChain's experimental video captioning capabilities. For more detailed information and advanced usage, refer to the LangChain API documentation:

To analyze and generate captions for videos using LangChain, you can leverage the langchain_experimental.video_captioning module. Below is a comprehensive guide, including the necessary Python classes for handling video and audio models and generating captions.

Key Classes

  1. BaseModel: This class serves as a base for video and audio models.
  2. VideoModel: Represents a video segment, including start and end times and a description of the visual content.
  3. AudioModel: Represents an audio segment, including start and end times and subtitle text.
  4. CaptionModel: Represents a caption generated from video or audio models.

Implementation

@Cdaprod
Cdaprod / langchain_video_analysis.md
Created July 3, 2024 18:57
These steps provide a structured approach to processing, analyzing, and searching video files using LangChain and related tools. This workflow leverages the strengths of various components to provide comprehensive video analysis capabilities.

To process and analyze video files using LangChain, you can follow some best practices and examples from the LangChain cookbook and related resources. Here's a comprehensive approach to accomplish video analysis and search:

Extracting Frames from Video

First, you need to extract frames from the video, which can be done using a library like OpenCV:

import cv2
import os
@Cdaprod
Cdaprod / ChatGPT_Function_Call_Application_Design.md
Created July 2, 2024 18:53
By following these steps, you create a backend service that allows ChatGPT to perform actions based on user prompts. This setup leverages Python and Flask, avoiding the need for direct JavaScript interactions, and can be expanded to include more complex logic and additional services as needed.

To have ChatGPT perform actions in your application based on user prompts without using JavaScript, you can create a backend service that handles the interactions between the user inputs and the OpenAI API. Below is a step-by-step guide on how to set this up using Python and a Flask backend:

1. Define the Functions

Define the necessary functions that ChatGPT will call to interact with services like MinIO. Here’s an example:

functions = [
    {
        "name": "list_buckets",
@Cdaprod
Cdaprod / selfhosted_golang_photography_site.md
Last active July 1, 2024 21:33
By following these steps, you can create a dynamic, recursive photo album viewer in Golang, where each webpage represents a folder and its image contents, with filenames and folder names persisted.

To create a recursive-like traversal of folders and files for your photography albums, where each webpage represents a folder and its image contents, you can dynamically generate the pages based on the directory structure. This way, you won't need to manually specify folder or file names. Here's a step-by-step guide to achieve this using Golang:

Step 1: Organize Your Photos

Ensure your photos are organized into folders as follows:

/albums
  /vacation2024
    - photo1.jpg
    - photo2.jpg

Engineering My Data-Centric AI Solution

CDA-NAMESPACE by David Cannan

Lets build on the initial state I've been using, by expanding my favorite tools as a framework with additional functionalities and improving the robustness of the deployment. Here, we'll focus on the following new aspects:

  1. Advanced Data Processing with LLMs
  2. Integrating Additional AI Services
  3. Enhanced Security and Compliance
  4. Scalable Deployment
  5. Real-Time Monitoring and Alerting