Skip to content

Instantly share code, notes, and snippets.

View josephbolus's full-sized avatar

Joseph Bolus josephbolus

View GitHub Profile
@josephbolus
josephbolus / bug-smash.md
Created September 13, 2025 04:25
Incredibly powerful Claude Code prompt when dealing with a pesky bug:

Incredibly powerful Claude Code prompt when dealing with a pesky bug:

I am experiencing the following bug:

[explain_bug_here]

I need your help to identify the exact cause of this bug and implement an effective solution. To do this, carefully follow the workflow below, in this specific order:

# Use a specific Ubuntu version for better reproducibility
FROM mcr.microsoft.com/devcontainers/base:ubuntu-22.04
# Find the latest URL from: https://dev.mysql.com/downloads/shell/
# Make sure to select "Ubuntu Linux" and version "Ubuntu Linux 22.04 (x86, 64-bit)"
ARG MYSQL_SHELL_URL="https://dev.mysql.com/get/Downloads/MySQL-Shell/mysql-shell_8.0.43-1ubuntu22.04_amd64.deb"
# Set DEBIAN_FRONTEND to noninteractive to prevent prompts during build
ENV DEBIAN_FRONTEND=noninteractive
@josephbolus
josephbolus / agent loop
Created March 10, 2025 09:27 — forked from jlia0/agent loop
Manus tools and prompts
You are Manus, an AI agent created by the Manus team.
You excel at the following tasks:
1. Information gathering, fact-checking, and documentation
2. Data processing, analysis, and visualization
3. Writing multi-chapter articles and in-depth research reports
4. Creating websites, applications, and tools
5. Using programming to solve various problems beyond development
6. Various tasks that can be accomplished using computers and the internet

You are an AI assistant tasked with creating a highly engaging, personalized check-in flow for a user. This flow should emulate a beautifully designed iOS app, focusing on simplicity, clear call-to-actions, and an overall delightful user experience. Your role combines that of a personality coach and an expert UX designer.

Here's the theme for today's check-in: {{THEME}}

And here's the context we have about the user: <user_context> {{USER_CONTEXT}}

@josephbolus
josephbolus / README.md
Last active October 28, 2024 02:39
Calculates optimized MySQL 8 settings based on system resources.

How to use:

jbolus@sandbox:/tmp$ chmod +x mysql-conf-optimizer.sh
jbolus@sandbox:/tmp$ ./mysql-conf-optimizer.sh
MySQL Optimization Suggestions:
---------------------------------
innodb_buffer_pool_size: 24GB
innodb_buffer_pool_instances: 20
innodb_io_capacity: 4000
#!/bin/bash
# https://docs.rockylinux.org/guides/interoperability/import_rocky_to_wsl/
sudo dnf upgrade --refresh
dnf upgrade --refresh
sudo
dnf install -y nano mc passwd sudo dnf-plugin-config-manager wget dnf-plugins-core tree dos2unix epel-release NetworkManager iproute
su root
sudo mc
ls
sudo dnf config-manager --set-enabled crb
@josephbolus
josephbolus / mysql-high-cpu.md
Last active October 3, 2024 06:29
Troubleshooting High CPU in MySQL

Troubleshooting High CPU in MySQL

tags: linux dba mysql

Overview

With MySQL 5.7, the PERFORMANCE_SCHEMA.THREADS table added THREAD_OS_ID. This column helps identify sessions consuming high CPU resources, especially when one query overloads a CPU core.

To troubleshoot, use pidstat from the sysstat package. The -t option shows thread-level usage, and -p with the MySQL process ID filters results to MySQL threads:

@josephbolus
josephbolus / docker-iptables-fix.sh
Last active August 9, 2024 02:59 — forked from pedrolamas/docker-iptables-fix.sh
Forwarding real IP when running as a container by fixing Docker iptables on Synology NAS
#!/bin/bash
currentAttempt=0
totalAttempts=10
delay=15
while [ $currentAttempt -lt $totalAttempts ]
do
currentAttempt=$(( $currentAttempt + 1 ))
echo "Attempt $currentAttempt of $totalAttempts..."