Skip to content

Instantly share code, notes, and snippets.

View mbijon's full-sized avatar
🎯
Focusing

Mike Bijon mbijon

🎯
Focusing
View GitHub Profile
@mbijon
mbijon / ci_version_check.py
Created December 21, 2025 20:59
CI version check on python package versions
###
# CI check to prevent version regression
# Fail builds if NLTK is below the fixed version.
###
import nltk
from packaging.version import Version
MIN_SAFE = Version("X.Y.Z") # set to your validated fixed version
if Version(nltk.__version__) < MIN_SAFE:
raise SystemExit(f"NLTK too old: {nltk.__version__} < {MIN_SAFE}")
@mbijon
mbijon / mitigation.py
Created December 21, 2025 20:45 — forked from sethmlarson/mitigation.py
Mitigation for CVE-2025-4517, CVE-2025-4330, CVE-2025-4138, and CVE-2024-12718
import pathlib
# Avoid insecure segments in link names.
# 'tar' is a tarfile open for reading.
for member in tar.getmembers():
if member.linkname and '..' in pathlib.Path(member.linkname).parts:
raise OSError("Tarfile with insecure segment ('..') in linkname")
# Now safe to extract members with the data filter.
tar.extractall(filter="data")
@mbijon
mbijon / repo-security-patterns-scan.sh
Created December 4, 2025 04:07
Repo security pattern search commands
# Secrets, Evals, and Unsafe practices
grep -r "password\|secret\|api_key\|token" /repo -e .env -e .env.local --include="*.ts" --include="*.tsx" --include="*.js" --include="*.jsx" 2>/dev/null | head -20
grep -r "http://" /repo/src --include="*.ts" --include="*.tsx" 2>/dev/null | grep -v "https://" | head -20
grep -r "(eval|Function)\(|dangerouslySetInnerHTML|__html|v-html" /repo 2>/dev/null | head -20
grep -r "public/**/*.html" /repo 2>/dev/null | head -20
grep -r "localStorage|sessionStorage|document\.cookie" /repo 2>/dev/null | head -20
grep -r "userAgent|navigator\." /repo 2>/dev/null | head -20
grep -r "maxLength|minLength|pattern=|validation|sanitize" /repo/src/components 2>/dev/null | head -20
# JS and NPM
@mbijon
mbijon / bash_export.sh
Created September 10, 2025 02:03
Use Kimi model by Moonshot in Claude Code. This function shims your .bashrc/.zshrc
# Shim the Kimi model by Moonshot into Claude Code
export ANTHROPIC_AUTH_TOKEN={Your Kimi / Moonshot API key}
export ANTHROPIC_BASE_URL=https://api.moonshot.ai/anthropic
@mbijon
mbijon / reflection.md
Created August 16, 2025 00:12 — forked from a-c-m/reflection.md
reflection.md - a way to have claude-code self improve its context.

You are an expert in prompt engineering, specializing in optimizing AI code assistant instructions. Your task is to analyze and improve the instructions for Claude Code. Follow these steps carefully:

  1. Analysis Phase: Review the chat history in your context window.

Then, examine the current Claude instructions, commands and config <claude_instructions> /CLAUDE.md /.claude/commands/*

@mbijon
mbijon / agent loop
Created March 14, 2025 18:01 — 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
Encoded Traversal Strings:
../
..\
..\/
%2e%2e%2f
%252e%252e%252f
%c0%ae%c0%ae%c0%af
%uff0e%uff0e%u2215
%uff0e%uff0e%u2216
@mbijon
mbijon / probabalistic-patterened-blur.rb
Created May 8, 2021 00:30
Example of complex blur using Image Magick + mini_magick
# Copyright Ognjen Regoje, 2021
# https://ognjen.io/generating-more-interesting-image-previews-using-imagemagick/
#
####
require 'mini_magick'
INPUT_FILE = "input-1-lg.jpg"
image = MiniMagick::Image.open(INPUT_FILE)
size = image.dimensions.map{|x| x}
@mbijon
mbijon / webrick-ssl.rb
Created April 22, 2021 16:14
Configure Webrick Server as SSL
#!/usr/bin/env ruby
require 'rubygems'
require 'rails/commands/server'
require 'rack'
require 'webrick'
require 'webrick/https'
module Rails
class Server < ::Rack::Server
def default_options
@mbijon
mbijon / git.nginx.conf
Created March 15, 2021 22:07
Serving git over "smart HTTP" >> nginx config for git-http-backend
# From: https://gemini.nytpu.com/gemlog/2021-03-07.gmi
########
#
# you should have other ssl configuration elsewhere...
server {
listen 443 ssl http2;
server_name git.nytpu.com;
charset utf-8;
# where cgit is installed to