Skip to content

Instantly share code, notes, and snippets.

@orikad
orikad / git-web
Last active June 12, 2025 13:08
`git web` command to go to the web page of a git repo
#!/usr/bin/env bash
set -e
set -o pipefail
REMOTE=$(git remote show origin -n | grep Fetch | cut -d ' ' -f 5)
URL=$(echo "$REMOTE" | grep http || echo "$REMOTE" | sed 's/ssh:\/\///' | sed 's/:/\//' | sed 's/git@/http:\/\//')
open "$URL"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.orikad.kbremmaper</string>
<key>Program</key>
<string>/Users/user/.local/bin/remmaper.sh</string>
<key>ProgramArguments</key>
<array>
@orikad
orikad / edit-header.sh
Last active July 7, 2021 08:19
Get header paths from the compiler
#!/usr/bin/env bash
if [ -z $1 ]
then
echo "Usage: $0 path/to/system/header.h"
echo "Example: $0 fcntl.h"
echo "Opens header in \$EDITOR ($EDITOR)"
exit -1
fi
@orikad
orikad / compilerbot_sol.py
Created December 30, 2019 12:50
compilerbot solution from 36c3 ctf
#!/usr/bin/env python3
import socket, base64
flag = ''
def trycompile(code):
con = socket.create_connection(("88.198.154.157", 8011))
con.recv(10)
@orikad
orikad / convert.py
Last active March 1, 2023 17:40
34c3 ctf minbashmaxfun solution
#!/usr/bin/env python
# write up:
# https://medium.com/@orik_/34c3-ctf-minbashmaxfun-writeup-4470b596df60
import sys
a = "bash -c 'expr $(grep + /tmp/out)' | /get_flag > /tmp/out; cat /tmp/out"
if len(sys.argv) == 2:
a = sys.argv[1]