Skip to content

Instantly share code, notes, and snippets.

View nmarley's full-sized avatar
🦀
我想吃一點點東西。

Nathan Marley nmarley

🦀
我想吃一點點東西。
View GitHub Profile
@nmarley
nmarley / audit.sh
Created September 22, 2025 23:33
s3index audit script
#! /bin/bash
for BUCKET in $(cat here); do
./target/release/s3index --bucket "$BUCKET" --outfile "buckets/${BUCKET}.csv" >"buckets/${BUCKET}.log" 2>&1
done
@nmarley
nmarley / claude-code-tools.md
Created August 18, 2025 19:13 — forked from wong2/claude-code-tools.md
Tools and system prompt of Claude Code

Task

Launch a new agent that has access to the following tools: Bash, Glob, Grep, LS, exit_plan_mode, Read, Edit, MultiEdit, Write, NotebookRead, NotebookEdit, WebFetch, TodoRead, TodoWrite, WebSearch. When you are searching for a keyword or file and are not confident that you will find the right match in the first few tries, use the Agent tool to perform the search for you.

When to use the Agent tool:

  • If you are searching for a keyword like "config" or "logger", or for questions like "which file does X?", the Agent tool is strongly recommended

When NOT to use the Agent tool:

  • If you want to read a specific file path, use the Read or Glob tool instead of the Agent tool, to find the match more quickly
  • If you are searching for a specific class definition like "class Foo", use the Glob tool instead, to find the match more quickly
  • If you are searching for code within a specific file or set of 2-3 files, use the Read tool instead of the Agent tool, to find the match more quickly
@nmarley
nmarley / README.md
Last active March 31, 2025 22:32
Go / C++ bindings example

Go / C++ bindings example

This is an example of Go code calling to a C++ library with a C wrapper.

Build

go build  # this only ensures it compiles
@nmarley
nmarley / cursor-updates.sh
Created March 21, 2025 15:32
Cursor AI - fake the update URL so it stops auto-updating
#! /bin/bash
# I don't know what this hash is, I'm just getting it from the logs. Seems to
# be the same whether I'm coming from v0.45 or v0.47
SOME_HASH="a63aba471623a41801c50fa53f56f7c39d330ab06bb4926d53909805c61a66fe"
# VERSION=0.45.17
VERSION=0.47.8
# URL="https://api2.cursor.sh/updates/api/update/darwin/cursor/${VERSION}/a63aba471623a41801c50fa53f56f7c39d330ab06bb4926d53909805c61a66fe?http2Disabled=false"
@nmarley
nmarley / dec.py
Last active March 6, 2025 11:56
AWS KMS encryption/decryption using Python/Boto3
import boto3
import base64
if __name__ == '__main__':
session = boto3.session.Session()
kms = session.client('kms')
encrypted_password = 'AQECAHjgTiiE7TYRGp5Irf8jQ3HzlaQaHGYgsUJDaavnHcFm0gAAAGswaQYJKoZIhvcNAQcGoFwwWgIBADBVBgkqhkiG9w0BBwEwHgYJYIZIAWUDBAEuMBEEDDwxVQuG0oVwpkU7nQIBEIAoVGk1/wpserb+GVUOzE7PiL/Nr9fTDFKZfpKpF0ip2ct4B2q0Wn6ZZw=='
binary_data = base64.b64decode(encrypted_password)
@nmarley
nmarley / audio.sh
Created January 22, 2025 17:52
Download best quality audio from YouTube video
#! /bin/bash
# yt-dlp command to download the best audio quality from a youtube video
# yt-dlp --format bestaudio --extract-audio --audio-format opus --audio-quality 0 https://www.youtube.com/watch?v=jhoG3WcECnw
if [ -z "$1" ]; then
echo "Usage: $0 <youtube-url>"
exit 1
fi
PostgreSQL Type PostgreSQL Size Description Range Diesel Type Rust Type
Nullable Types nullable Nullable``
@nmarley
nmarley / kapture.sh
Created July 18, 2013 01:43
OSX can capture WiFi packets using only tcpdump (and without needing a clunky interface such as KisMAC). Used for testing security strength of home WiFi setup.
#! /bin/bash
# This is for Mac OSX only.
# =============================================
# explanation of arguments used with 'tcpdump':
# =============================================
# -y IEEE802_11_RADIO => makes it capture __WIFI__ packets, turns resultant file
# into a dump which can be read by aircrack-ng, etc.
#
# -I => puts interface into monitor mode (required to capture packets)
@nmarley
nmarley / filter.sh
Created May 15, 2017 14:12
CloudTrail log parsing/event selection with jq
# `aws s3 sync` the cloudtrail files you want into a dir, then...
cat * | jq '.Records[] | select(.eventSource == "kms.amazonaws.com")' | jq '.userIdentity.arn'
@nmarley
nmarley / README.md
Last active February 8, 2023 15:31
JSON Schema validation example in Node.JS

test json schema validation in Node.JS

Setup Package

$ npm i jsonschema --save

Test/Play:

$ node ./v.js