Skip to content

Instantly share code, notes, and snippets.

docker build -t friendlyname . # Create image using this directory's Dockerfile
docker run -p 4000:80 friendlyname # Run "friendlyname" mapping port 4000 to 80
docker run -d -p 4000:80 friendlyname # Same thing, but in detached mode
docker exec -it [container-id] bash # Enter a running container
docker ps # See a list of all running containers
docker stop <hash> # Gracefully stop the specified container
docker ps -a # See a list of all containers, even the ones not running
docker kill <hash> # Force shutdown of the specified container
docker rm <hash> # Remove the specified container from this machine
docker rm $(docker ps -a -q) # Remove all containers from this machine
  • XML GET
curl -H "Accept: application/xml" -H "Content-Type: application/xml" -X GET "http://hostname/resource"
  • JSON GET
curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X GET "http://hostname/resource"
  • JSON PUT
@sharpicx
sharpicx / resources.md
Created April 25, 2022 22:14 — forked from muff-in/resources.md
A curated list of Assembly Language / Reversing / Malware Analysis / Game Hacking-resources
@sharpicx
sharpicx / sed-cheatsheet.txt
Created April 29, 2022 17:53 — forked from ssstonebraker/sed cheatsheet
Sed Cheatsheet
FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'

Command line options

-L: List of supported IO plugins
-q: Exit after processing commands
-w: Write mode enabled
-i [file]: Interprets a r2 script
-A: Analyze executable at load time (xrefs, etc)
-n: Bare load. Do not load executable info as the entrypoint
-c 'cmds': Run r2 and execute commands (eg: r2 -wqc'wx 3c @ main')
-p [prj]: Creates a project for the file being analyzed (CC add a comment when opening a file as a project)
@sharpicx
sharpicx / GDB.md
Created November 2, 2022 17:02 — forked from xelemental/GDB.md
  • Breakpoints
 → break <address> : Sets a new breakpoint
→ delete <breakpoint#> : Deletes a breakpoint
→ enable < breakpoint#> : Enable a disabled breakpoint
  • Variables and memory display
→ print <query> : Prints content of variable or register.
→ display : Prints the information after stepping each instruction
site:*/sign-in
site:*/account/login
site:*/forum/ucp.php?mode=login
inurl:memberlist.php?mode=viewprofile
intitle:"EdgeOS" intext:"Please login"
inurl:user_login.php
intitle:"Web Management Login"
site:*/users/login_form
site:*/access/unauthenticated
site:account.*.*/login
@sharpicx
sharpicx / playerctl.sh
Created November 22, 2022 09:26
playerctl dunstify's script.
#/bin/bash
# sharpicx
PATH_ICON="$HOME/.icons/Arc/actions/24@2x"
STATUS_PLAYED=$(playerctl --player=spotify status | grep Playing)
DESC_PAUSED="Music just get paused!"
DESC_PLAYED="Music just get playing!"
ART_DESC=$(playerctl --player=spotify metadata | grep artist | sed 's/spotify xesam:artist//g; s/^[ \t]*//g')
SONG_DESC=$(playerctl --player=spotify metadata | grep title | sed 's/spotify xesam:title//g; s/^[ \t]*//g')
TITLE="$ART_DESC - $SONG_DESC"
@sharpicx
sharpicx / collatz.py
Last active January 14, 2023 11:07
collatz conjecture, the fabulous unsolved problems in math.
## https://www.mathcelebrity.com/collatz.php?num=+109&pl=Show+Collatz+Conjecture
## https://goodcalculators.com/collatz-conjecture-calculator/
## sharpicx
def collatz(num):
i = [num]
while num != 1:
if num % 2 == 1:
num = 3 * num + 1
else: