Skip to content

Instantly share code, notes, and snippets.

View truevis's full-sized avatar
💭
Hacking existence

Eric B truevis

💭
Hacking existence
View GitHub Profile
@truevis
truevis / cursor_skills_scan-codebase-vulnerabilities_SKILL.md.
Created July 26, 2026 07:23
Cursor-native adaptation of the Claude Security workflow
---
name: scan-codebase-vulnerabilities
description: >-
Multi-agent vulnerability scan of a repository or diff: map architecture,
threat-model, hunt findings, independently verify, write a report, then
optionally suggest reviewable patches. Use when the user asks to scan for
vulnerabilities, run /claude-security, deep security scan, threat model the
codebase, scan changes/PR/commit for security issues, or turn findings into
patches. Distinct from the lighter /review-security single-pass review.
---
@truevis
truevis / security_vps_audit_gist.md
Last active July 25, 2026 07:52
A prompt developed with several July 2026 frontier LLMs that turns an AI into a paranoid sysadmin: SSH into your VPS, assume it’s already owned, harden whatever it can without asking, then write a report blaming your deploy scripts.

VPS Security Audit Prompt

Copy this into an agent (or operator brief) that has shell access to a Linux VPS. Adapt the Stack context section to match your host before running.


You are a senior Linux security engineer with access to the VPS. Your job is to inspect the server, identify security issues, and fix them directly.

Stack context (fill in before the run)

@truevis
truevis / convert_videos_to_mp3.py
Created February 16, 2026 19:16
Convert all video files in a folder to MP3
"""
Convert all video files in the vids/ folder to MP3 (128 kbps, mono).
Usage:
python tests/convert_vids_to_mp3.py # convert all mp4/mov/avi/webm in vids/
python tests/convert_vids_to_mp3.py --dry-run # preview what would be converted
python tests/convert_vids_to_mp3.py --smallest # convert only the smallest video (for testing)
python tests/convert_vids_to_mp3.py -v # verbose: show ffmpeg command and progress
Requires ffmpeg to be installed and available on PATH.
@truevis
truevis / test_usb.py
Last active February 8, 2026 07:40
USB Drive Capacity and Integrity Tester
"""
USB Capacity and Integrity Tester (Quick Test Mode)
--------------------------------------------------
This script performs a quick verification of a USB drive by writing a small
amount of verifiable data and reading it back to check for corruption.
"""
import os
import hashlib
import time
@truevis
truevis / streamlit_csv_display_with_filter.py
Last active September 18, 2025 18:43
Streamlit app that loads a CSV of window specs and lets users filter rows by keyword. Basically a searchable window catalog that saves you from endless Home Depot tabs.
import io
import pandas as pd
import streamlit as st
# Window CSV data
EMBEDDED_CSV = """"Manufacturer","Series/Model","Type","Material","Glazing/Insulation","U-Factor (typ)","SHGC (typ)","Common Size Range (in)","Typical Price (USD)","Notes"
"Andersen","100 Series","Single-Hung","Fibrex composite","Low-E dual-pane argon","0.28-0.30","0.19-0.30","24-48 W x 36-72 H","450-900","Budget composite line; ENERGY STAR options"
"Andersen","100 Series","Gliding","Fibrex composite","Low-E SmartSun option","0.27-0.29","0.19-0.28","36-72 W x 24-60 H","600-1,000","Retail sizes like 47.5x47.5 sold at Home Depot"
"Andersen","100 Series","Picture","Fibrex composite","Low-E dual-pane","0.27-0.29","0.20-0.30","24-72 W x 24-72 H","300-800","Fixed unit; high VT options"
"Andersen","400 Series","Double-Hung","Wood clad","Low-E dual-pane","~0.30","~0.19","24-48 W x 36-72 H","700-1,400","Classic wood-clad favorite"
@truevis
truevis / apply+lamda_demo.py
Last active September 18, 2025 18:07
This is a demo script using pandas showing how to use apply() + lambda in different contexts: Build a sample DataFrame with two cols A & B. Filter rows that contain “4” anywhere. Square values in column A. Create a new column = A + B (row wise). Compute sum over each column.
import pandas as pd
# Create sample data for demonstration
data = {'A': [4, 8, 3, 4], 'B': [4, 5, 6, 7]}
# data = {
# 'A': [4, 8, 3, 4, 9, 2, 7, 5, 6, 1, 10, 12, 14, 4, 8, 11, 13, 15, 16, 17],
# 'B': [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]
# }
@truevis
truevis / add_github_collaborator.bat
Created July 9, 2025 12:38
GitHub Bulk Collaborator Management Script A Windows batch script that allows you to add collaborators to multiple GitHub repositories
@echo off
setlocal enabledelayedexpansion
REM ===================================================================
REM GitHub Bulk Collaborator Management Script
REM ===================================================================
REM This script adds a collaborator to multiple GitHub repositories
REM in bulk using the GitHub CLI (gh).
REM
REM Prerequisites:
@truevis
truevis / ftp_changed_pages.py
Created June 18, 2025 08:53
Upload new changed files to FTP
import os
import ftplib
import json
from datetime import datetime, date
import fnmatch
# Import FTP credentials from configuration file
from ftp_config import FTP_HOST, FTP_USER, FTP_PASS
# --- Local Configuration ---
import os
import base64
import json
import time
from pathlib import Path
from mistralai import Mistral
from typing import Optional
# API key - directly defined
api_key = "YO123"
@truevis
truevis / looks_like_nec_page
Created March 6, 2025 09:39
Validate text using Gemini and output true or false in JSON
model = "gemini-2.0-pro-exp-02-05"
# Set API key
GEMINI_API_KEY = "abc"
def log_failed_validation(pdf_path):
"""Log failed validation to failed.log with timestamp"""
if pdf_path:
base_name = os.path.splitext(os.path.basename(pdf_path))[0]
timestamp = datetime.now().isoformat()
with open('failed.log', 'a') as f: