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.
"""
@avilum
avilum / Running netron on colab and open IFrame
Created May 11, 2023 14:46
Visualizing model inside google Colab.
import IPython
import threading
import time
import os
def display_netron(path):
os.system(f'netron {path}')
thread = threading.Thread(target=display_netron, args=(output_path,))
thread.start()
TOOLKIT_CUDA_VERSION=cu114 pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/$TOOLKIT_CUDA_VERSION
alias locate='find / -name $!'
@avilum
avilum / whoami.sh
Created July 4, 2021 12:07
Who Am I ? (Whois on my public IP - ISP level)
wget -qO- "http://ipwhois.app/json/$(wget -qO- http://checkip.amazonaws.com)"
# Optionally - pipe the JSON output to jq:
# wget -qO- "http://ipwhois.app/json/$(wget -qO- http://checkip.amazonaws.com)" | jq
@avilum
avilum / bruteforce_wordpress_users.sh
Last active July 1, 2024 18:01
Bruteforce Wordpress Website Using WP-JSON Users API, With 1000 With Top Common Passwords
#
# This file can be saved as 'bruteforce_wordpress_users.sh'
#
# Requirements:
# - python2 (with requests)
# - jq
# - wget
# - WPForce
# 1. Cloning WPForce:
# git clone https://github.com/n00py/WPForce.git && cd ./WPForce
python -c 'import redis; print(redis.Redis().flushall())'
@avilum
avilum / invalid_ssh_logins_usernames.sh
Created March 9, 2020 09:11
Print the names of the users that failed to connect to a machine using ssh
cat /var/log/auth.log | grep -i -e "disconnected from invalid user" | awk -F' ' '{print $10}' | sort | uniq # INVALID LOGINS USERNAMES (for bash autocompletion and reverse-i search)