Skip to content

Instantly share code, notes, and snippets.

View Japestrale's full-sized avatar
🧯
Firefighter

Tom Luce Japestrale

🧯
Firefighter
View GitHub Profile
@kddnewton
kddnewton / annoy_scanners_server.rb
Last active August 15, 2024 03:36
Annoy scanners
# I really don't like getting routing error notifications when scanners try to
# find vulnerabilities in our application. As such, this extends our routing
# to actually give a response, but it's likely not what they were looking for.
# If they're not using a headless browser, the `alert` is going to kill their
# productivity. If they are, they just might enjoy the youtube video anyway.
class AnnoyScannersServer
SCANNER_PATHS = %w[
/a2billing/admin/Public/index.php
/a2billing/common/javascript/misc.js
/a2billing/customer/templates/default/css/popup.css
@chrismccoy
chrismccoy / gitcheats.txt
Last active January 5, 2026 21:36
git cheats
# alias to edit commit messages without using rebase interactive
# example: git reword commithash message
reword = "!f() {\n GIT_SEQUENCE_EDITOR=\"sed -i 1s/^pick/reword/\" GIT_EDITOR=\"printf \\\"%s\\n\\\" \\\"$2\\\" >\" git rebase -i \"$1^\";\n git push -f;\n}; f"
# convert users public repos into private
gh repo list --source --visibility public --limit 5000 --json nameWithOwner | jq -r '.[].nameWithOwner' | xargs -I % sh -c 'echo "Converting % to private..."; gh repo edit % --visibility private --accept-visibility-change-consequences'
# convert users public repos into private (legacy gh-cli version)
gh api user/repos --paginate | jq -r '.[] | select(.fork == false and .private == false) | .full_name' | xargs -I % sh -c 'echo "Converting % to private..."; gh repo edit % --visibility private --accept-visibility-change-consequences'