Skip to content

Instantly share code, notes, and snippets.

View baurzhan-konurbayev's full-sized avatar

Baurzhan Konurbayev baurzhan-konurbayev

View GitHub Profile
I'll be omitting syscalls with ellipsis.
The first thing that happens after you press enter is that bash resolves
curl to /usr/bin/curl and then forks(). The strace output is from the
forked process.
Fist execve() the /usr/bin/curl binary and pass an array of arguments to it.
execve("/usr/bin/curl", ["curl", "http://github.com"], [/* 8 vars */]) = 0
...
@baurzhan-konurbayev
baurzhan-konurbayev / gist:5eb4eebeaa0da3f5bc2fdf560e977f75
Created July 13, 2020 20:10 — forked from t2psyto/gist:f5453707d2658173715f49293d096fe5
powershell oneliner for encode/decode base64 to file
# encode from binary file to base64txt
powershell -C "& {$outpath = (Join-Path (pwd) 'out_base64.txt'); $inpath = (Join-Path (pwd) 'data.jpg'); [IO.File]::WriteAllText($outpath, ([convert]::ToBase64String(([IO.File]::ReadAllBytes($inpath)))))}"
# decode from base64txt to binary file
powershell -C "& {$outpath = (Join-Path (pwd) 'outdata2.jpg'); $inpath = (Join-Path (pwd) 'out_base64.txt'); [IO.File]::WriteAllBytes($outpath, ([convert]::FromBase64String(([IO.File]::ReadAllText($inpath)))))}"
@baurzhan-konurbayev
baurzhan-konurbayev / git-pre-receive-hook.sh
Created February 20, 2019 17:13 — forked from caniszczyk/git-pre-receive-hook.sh
A reasonable git pre-receive-hook
#!/bin/sh
#
# For each ref, validate the commit.
#
# - It disallows deleting branches without a /.
# - It disallows non fast-forward on branches without a /.
# - It disallows deleting tags without a /.
# - It disallows unannotated tags to be pushed.