This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* If you get any part of this process wrong, Google gives the really helpful error message "invalid JWT provided". | |
* | |
* Mozilla (Firefox) gives a slightly just-as-useful error: | |
* { | |
* "code": 401, "errno": 109, "error": "Unauthorized", | |
* "more_info": "http://autopush.readthedocs.io/en/latest/http.html#error-codes", | |
* "message": "Request did not validate Invalid Authorization Header" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
ITERATIONS=2000 | |
BYTES=3000 | |
pppp() { | |
PLAINTEXT=$(head -c${BYTES} /dev/random |base64) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Verifying that "stampycode.id" is my Blockstack ID. https://onename.com/stampycode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function print_re($data, $depth = 0, $max = 5) { | |
if(!headers_sent()) { | |
header('content-type: application/json'); | |
} | |
$sp = str_repeat(" ", $depth); | |
if(is_numeric($data)) { | |
echo $data; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ ! -f bin/docker-credential-registrycreds ]] ; then | |
[[ ! -d bin ]] && mkdir bin | |
cat > bin/docker-credential-registrycreds <<FFF | |
cat <<JSON | |
{ | |
"ServerURL": "https://registry.local/v1", | |
"Username": "${DOCKER_USER}", | |
"Secret": "${DOCKER_PASS}" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
events { | |
worker_connections 1024; | |
} | |
http { | |
resolver 127.0.0.11; | |
server { | |
server_name ~^(?<ctrn>[^\.]+)-(qa|dev)\.; | |
location / { | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh ${SERVER} <<ENDSSH | |
cd ${REPO} | |
sudo -s -- <<SUDO | |
unset HISTFILE | |
[[ ! -d /root/.docker ]] && mkdir /root/.docker | |
[[ ! -e /root/.docker/config.json ]] && echo '{"credsStore": "registrycreds"}' > /root/.docker/config.json | |
[[ ! -d /root/bin ]] && mkdir /root/bin | |
echo > /root/bin/docker-credential-registrycreds <<<RRR | |
#!/bin/bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$data = str_split($data, 72); | |
$color = '#888'; | |
$placeholder = '.'; | |
$repl = function($m) use (&$color, &$placeholder) { | |
$x = str_repeat($placeholder, strlen($m[0])); | |
return "<span style=\"background-color:{$color};\">{$x}</span>'; | |
}; | |
foreach($data as &$d) { | |
$d = str_replace(['<','>'], ['<','>'], $d); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Example Key | Key Alphabet | Number of Possible Combinations | |
------------------------------------------------------------------------------------------------------------------------- | |
10**3 | 976 | Numerical | 1000 | |
16**3 | 6d2 | Hexadecimal | 4096 | |
10**4 | 9766 | Numerical | 10000 // eg. Bank Card Pin number | |
26**3 | bsa | Alphabetical | 17576 | |
16**4 | 6d20 | Hexadecimal | 65536 | |
10**5 | 97667 | Numerical | 100000 | |
62**3 | bSA | a-zA-Z0-9 | 238328 | |
64**3 | bSA | Base64 | 262144 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Browse a specified (v2) Docker Registry, examine layers, extract useful data >.> | |
**/ | |
ini_set('error_reporting', E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED & ~E_WARNING); | |
$headers = []; | |
$type = isset($_GET['type']) ? $_GET['type'] : '_catalog'; | |
$registry = (isset($_GET['registry'])) ? $_GET['registry'] : ''; |
NewerOlder