Skip to content

Instantly share code, notes, and snippets.

@fabriziosalmi
fabriziosalmi / gpt-dev-tools.md
Last active November 30, 2024 08:10
GPT Development Tools

Hi, on every your messages in the first row put such informations then your message content must be shown after a newline, as this example (replace values with real obtained values)

"⚙️ 1 | 🆔 Funny Name | 💻 developer | 🎚️ 50% | 🐞 0 | 🛡️ yes | 🚀 no | 🔠 1323"

header fields explanation:

  • Iteration Number (⚙️): To track the number of messages exchanged.
  • Label ID (🆔): A random funny name.
  • Mode (💻): To indicate the mode in which I'm operating (developer, as you mentioned).
  • Skill Level (🎚️): To indicate the craziness of the coding skills being simulated.
@fabriziosalmi
fabriziosalmi / ai_chatbot_encryption.html
Created November 4, 2023 17:28
AI chatbot encrypter/decrypter
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AI chatbot encrypter/decrypter</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<style>
body {
background-color: #f7f7f7;
@fabriziosalmi
fabriziosalmi / interview.md
Last active July 3, 2024 13:07
interview.md
Difficoltà Domanda Livello di Dettaglio Tecnico Risposta
Facile (1-5) Cosa intendi per "Architettura di Soluzione"? Basso L'architettura di soluzione è un approccio per progettare, descrivere e gestire una soluzione tecnica completa.
Puoi descrivere un recente progetto su cui hai lavorato e il tuo ruolo in esso? Basso
@fabriziosalmi
fabriziosalmi / PyMod.txt
Created July 5, 2024 08:02
PyMod - Analyzes and modularizes Python scripts with full code refactoring and enhanced error handling.
PyMod specializes in processing Python scripts, suggesting modularization, and providing complete refactoring suggestions without placeholders. When given a Python script, it will analyze the code, identify potential areas for modularization, and offer a detailed workflow and full code for implementation, always ensuring that existing functionalities are maintained. It can also help troubleshoot errors based on user feedback, suggesting fixes and improvements to ensure smooth refactoring. Responses should emphasize precision, accuracy, ease of debugging, and modularity.
When modularizing a script, PyMod will:
1. Create a new directory named similarly to the script being modularized, using a logical naming convention to avoid conflicts.
2. Ensure that the original script remains usable to maintain compatibility with other scripts that may call it.
3. Always manage the existing script in its position (which must be the root repo folder unless specified otherwise) and link it to its new folder and modularized s
@fabriziosalmi
fabriziosalmi / check_metrics.sh
Created July 22, 2024 13:33
Cloudflare Tunnels metrics display
#!/bin/bash
# Fetch metrics
metrics=$(curl -s http://127.0.0.1:60123/metrics)
# Define the metrics to be displayed
metric_names=(
"cloudflared_tcp_active_sessions"
"cloudflared_tunnel_active_streams"
"cloudflared_tunnel_ha_connections"
#!/bin/bash
# requirements: wget, sudo
VERSION=v4.9.6
BINARY=yq_linux_amd64
wget https://github.com/mikefarah/yq/releases/download/${VERSION}/${BINARY} -O yq
sudo mv yq /usr/local/bin/yq
sudo chmod +x /usr/local/bin/yq
@fabriziosalmi
fabriziosalmi / hello-world-docker-compose.yaml
Last active August 24, 2024 20:13
hello-world-docker-compose.yaml
version: '3'
services:
nginx:
image: nginx:latest
ports:
- "88:80"
@fabriziosalmi
fabriziosalmi / httpd-error-analyzer.sh
Created August 26, 2024 08:23
httpd-error-analyzer.sh
#!/bin/bash
# Define the directory containing Apache error logs
LOG_DIR="/var/log/httpd/" # Adjust the path according to your configuration
# Define the temporary file path
TMP_DIR=$(mktemp -d)
TMP_LOG_FILE="$TMP_DIR/combined_error.log"
# Define the output file for the summary

Full Code Implementation

#!/bin/bash

# Load configuration from YAML (using yq to parse YAML)
CONFIG_FILE="/path/to/your/config.yaml"

# Function to get value from YAML
get_yaml_value() {