Skip to content

Instantly share code, notes, and snippets.

View tonybaloney's full-sized avatar

Anthony Shaw tonybaloney

View GitHub Profile
@tonybaloney
tonybaloney / tidy.sh
Last active April 22, 2023 20:17
tidy script
# Delete all forks that haven't been updated since 2020
gh auth refresh -h github.com -s delete_repo
gh search repos \
--owner tonybaloney \
--updated="<2020-01-01" \
--include-forks=only \
--limit 100 \
--json url \
--jq ".[] .url" \ | xargs -I {} gh repo delete {} --confirm
@tonybaloney
tonybaloney / install.sh
Created November 11, 2022 02:53
Install perf on WSL2
git clone --depth=1 https://github.com/microsoft/WSL2-Linux-kernel.git
sudo apt install -y build-essential flex bison libssl-dev libelf-dev libbabeltrace-dev libunwind-dev libdw-dev binutils-dev libiberty-dev
cd WSL2-Linux-kernel/tools/perf/
make -j2 -s && make install
>>> dis.dis(bench_match.mapping_match_logical)
63 0 LOAD_CONST 1 ('🐓')
2 LOAD_CONST 2 (1)
4 BUILD_MAP 1
64 6 LOAD_CONST 2 (1)
8 LOAD_CONST 2 (1)
10 LOAD_CONST 3 (('🦊', '🌽'))
12 BUILD_CONST_KEY_MAP 2
[[[[[[[[[[[[[[[����������������������������������[[[[[[[[[[[[[[[������������[[[[[[[[��������������[[[����������[[[[[[[[[[[[[[[������������[[[[[[[[��������������[[[[[[[[[[[[[[[[[������������������������[[[[[[[[[[[[[[[[[[[[[����������������������������������[[[[[[[[[[[[[[[������������[[[[[[[[��������������[[[����������[[[[[[[[[[[[[[[������������[[[[[[[[��������������[[[[[[[[[[[[[[[[[������������������������[[[[[[[[[[[[[[[������������[[[[[[[[��������������[[[[[[[[[[[[[[[[[��������������������������[[[[[[[[[[[[[[[������������������������[[[[[[[[[[[[[[[��[[[���������������������������������������[[[[[[[[[[[[[[[[[������������[[[[[[[[��������������[[[[[[[[[[[[[[[[[��������������������������[[[[[[[[[[[[[[[������������������������[[[[[[[[[[[[[[[��[[[���������������������������������������[[[[[[[[[[[[[[[������������[[[[[[[[��������������[[[[[[[[[[[[[[[[[������������������������[[[[[[[[[[[[[[[������������[[[[[[[[��������������[[[[[[[[[[[[[[[[[��������������������������[[[[[[���������������������������o de][���� ss2", ]]
@tonybaloney
tonybaloney / grype_print.py
Last active August 24, 2022 01:59
Grype results printer
"""
Requirements --
- orjson
- rich
Usage:
> grype /path/to/scan -o json > output.json
> python grype_print.py output.json
or
@tonybaloney
tonybaloney / tasks.json
Last active December 6, 2021 22:08
Pip audit task
{
"version": "2.0.0",
"tasks": [
{
"label": "Pip Audit",
"type": "shell",
"command": "${command:python.interpreterPath}",
"args": ["-m", "pip_audit"],
"isBackground": true,
"group": "none",
@tonybaloney
tonybaloney / brute_token.py
Created December 1, 2021 20:32
Brute force a admin login and 2FA endpoint with token ranges 100,000 - 1,000,000
import asyncio
import aiohttp
from itertools import islice, chain
LOGIN_FORM = 'http://asd.sdfsdf/admin'
LOGIN_URL = 'http://asd.fsdfsdf/admin'
TWOFA_FORM = 'http://asda.asdas/doAdminTwoFactor.action'
INVALID_MESSAGE = 'Invalid token, please try again'
def batch(iterable, size):
"""
Usage:
>>> tracer.add_span_processor(BatchSpanProcessor(RichSpanExporter()))
"""
import datetime
import typing
from typing import Optional
import opentelemetry.trace