Skip to content

Instantly share code, notes, and snippets.

View charlesrocket's full-sized avatar
🔥
feeding daemons

-k charlesrocket

🔥
feeding daemons
View GitHub Profile
gcc -nostdlib -static -o a.out flag.s
objcopy --dump-section .text=flag.bin a.out
hd flag.bin
@charlesrocket
charlesrocket / .netrc
Last active July 15, 2023 03:35
git-credential-netrc template (github)
machine github.com login USER password PASS protocol https

Keybase proof

I hereby claim:

  • I am charlesrocket on github.
  • I am charlesrocket (https://keybase.io/charlesrocket) on keybase.
  • I have a public key ASCzfft_LCXMUTerQU0gfL3DApju_qtEEx9IXTxLtVBKFQo

To claim this, I am signing this object:

@charlesrocket
charlesrocket / git-parent-branch.sh
Last active October 8, 2019 14:13
find the parent branch
#!/bin/bash
git show-branch -a \
| grep '\*' \
| grep -v `git rev-parse --abbrev-ref HEAD` \
| head -n1 \
| sed 's/.*\[\(.*\)\].*/\1/' \
| sed 's/[\^~].*//'
@charlesrocket
charlesrocket / CreateICNS.src
Last active February 20, 2020 01:16
bash$ source CreateICNS.src {PNG filename}
IFS='.' read -ra ADDR <<< "$1"
ICONSET=${ADDR[0]}.iconset
mkdir $ICONSET
sips -z 16 16 $1 --out $ICONSET/icon_16x16.png
sips -z 32 32 $1 --out $ICONSET/icon_16x16@2x.png
sips -z 32 32 $1 --out $ICONSET/icon_32x32.png
sips -z 64 64 $1 --out $ICONSET/icon_32x32@2x.png
sips -z 128 128 $1 --out $ICONSET/icon_128x128.png
sips -z 256 256 $1 --out $ICONSET/icon_128x128@2x.png
sips -z 256 256 $1 --out $ICONSET/icon_256x256.png
mkicns() {
if [[ -z "$*" ]] || [[ "${*##*.}" != "png" ]]; then
echo "input file invalid"
else
filename="${1%.*}"
mkdir "$filename".iconset
for i in 16 32 128 256 ; do
n=$(( i * 2 ))
sips -z $i $i "$1" --out "$filename".iconset/icon_${i}x${i}.png
sips -z $n $n "$1" --out "$filename".iconset/icon_${i}x${i}@2x.png