Skip to content

Instantly share code, notes, and snippets.

View Samueladewole's full-sized avatar

Samuel A. Adewole Samueladewole

  • Digital Security Insights
View GitHub Profile
@Samueladewole
Samueladewole / you_are_not_right.sh
Created September 24, 2025 09:12 — forked from dgnsrekt/you_are_not_right.sh
A UserPromptSubmit hook for Claude Code to stop it saying "You're right"
#!/bin/bash
set -euo pipefail
trap 'echo "at line $LINENO, exit code $? from $BASH_COMMAND" >&2; exit 1' ERR
# This is a Claude Code hook to stop it saying "you are right".
#
# Installation:
# 1. Save this script and chmod +x it to make it executable.
# 2. Within Claude Code, /hooks / UserPromptSubmit > Add a new hook (this file)
#
@Samueladewole
Samueladewole / claude_code_hooks_for_uv.md
Created August 2, 2025 11:06 — forked from glennmatlin/claude_code_hooks_for_uv.md
Claude Code hooks for working with `uv`

Claude Code Hooks for working with uv

by Glenn Matlin / glennmatlin on all socials

Installation

  1. Download and copy all files in this gist to ~/.claude/
  2. Move the .py files to ~/.claude/hooks
  3. Restart Claude Code.
@Samueladewole
Samueladewole / cloudflare-ddns-update.sh
Created August 30, 2022 19:29 — forked from jjnilton/cloudflare-ddns-update.sh
A bash script to update a Cloudflare DNS A record with the external IP of the source machine
#!/bin/bash
# A bash script to update a Cloudflare DNS A record with the external IP of the source machine
# Used to provide DDNS service for my home
# Needs the DNS record pre-creating on Cloudflare
# Proxy - uncomment and provide details if using a proxy
#export https_proxy=http://<proxyuser>:<proxypassword>@<proxyip>:<proxyport>
# Cloudflare zone is the zone which holds the record

Disclaimer: I'm not the original author of this sheet, but can't recall where I found it. If you know the author, please let me know so I give the attribution.

Note: Since this seems to be helpful to some people, I formatted it to improve readability of the original. Also, note that this is from 2016, many things may have changed, and I don't use macOS anymore, so I probably can't help in case of questions, but maybe someone else can.

Mac Network Commands Cheat Sheet

After writing up the presentation for MacSysAdmin in Sweden, I decided to go ahead and throw these into a quick cheat sheet for anyone who’d like to have them all in one place. Good luck out there, and stay salty.

Get an ip address for en0:

@Samueladewole
Samueladewole / files.sh
Created March 6, 2020 09:33 — forked from schollz/files.sh
Go upload/recieve files via POST
#! /bin/bash
for n in {1..100}; do
dd if=/dev/urandom of=file$( printf %d "$n" ).bin bs=1 count=$(( RANDOM + 1024 ))
done
@Samueladewole
Samueladewole / .bash_profile
Created August 8, 2019 14:31 — forked from jimothyGator/.bash_profile
Display current Git branch and root directory in Mac OS X Terminal title bar.
# Add to .bash_profile
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
get_git_root() {
basename $(git rev-parse --show-toplevel 2> /dev/null) 2> /dev/null
}
@Samueladewole
Samueladewole / .bash_profile
Created August 2, 2019 13:06 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@Samueladewole
Samueladewole / fish.txt
Created July 9, 2019 08:38 — forked from danechitoaie/fish.txt
Remove folder from Git history with Fish Shell
# Make a fresh clone of YOUR_REPO
git clone YOUR_REPO
cd YOUR_REPO
# Create tracking branches of all branches
for remote in (git branch -r | grep -v /HEAD)
git checkout --track (echo -n $remote | tr -d '[:space:]')
end
# Remove DIRECTORY_NAME from all commits, then remove the refs to the old commits
#!/bin/bash
#
# When you are working on your macbook sitting in cafe and you have to go pee,
# you need some way to guard you machine.
#
# Start this script, remove any earphones, and go do the job.
# The assumption is the thief will close the lid of the laptop before taking it away.
# This script detects the closing of the lid and plays some loud audio that will
# likely distract the thief and/or grab attention of nearby people, making the