View manual-authentication-with-acr.txt
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
# As per the instructions at https://github.com/Azure/acr/blob/main/docs/AAD-OAuth.md | |
# Prep: Set env variables | |
registry="<USE_YOUR_REGISTRY_HERE>" | |
tenant="<USE_YOUR_TENANT_HERE>" | |
subscription="<USE_YOUR_SUBSCRIPTION_HERE>" | |
scope="registry:catalog:*" | |
# Step 1: Get AAD access token | |
aad_access_token=`az account get-access-token --subscription $subscription --query "accessToken" --output tsv` | |
echo $aad_access_token | |
# Step 2: Get a refresh token for ACR |
View creating-self-signed-certificates.txt
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
# Generate fake signing key and request | |
openssl req -utf8 -nameopt multiline,utf8 -config real-cert-data.conf -new -sha256 -newkey rsa:4096 -nodes -keyout real-key.pem -days 730 -out real-req.pem | |
# Check the fake signing key and request | |
openssl req -text -nameopt lname,sep_multiline,utf8 -in real-req.pem -noout | |
# or | |
openssl req -text -nameopt lname,utf8 -in real-req.pem -noout | grep Subject: | |
# Self-sign the fake certificate request | |
openssl x509 -req -nameopt lname,utf8 -days 730 -in real-req.pem -signkey real-key.pem -out real-cert.crt |
View l4-docker-registry.gist.json
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
{ | |
"modulesContent": { | |
"$edgeAgent": { | |
"properties.desired": { | |
"modules": { | |
"registry": { | |
"settings": { | |
"image": "registry:latest", | |
"createOptions": "{\"HostConfig\":{\"PortBindings\":{\"5000/tcp\":[{\"HostPort\":\"5000\"}]}}}" | |
}, |
View nginx.conf
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 { } | |
http { | |
proxy_buffers 32 160k; | |
proxy_buffer_size 160k; | |
proxy_read_timeout 3600; | |
error_log /dev/stdout info; | |
access_log /dev/stdout; |
View l4-connected-registry.gist.api-proxy.conn-str.json
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
{ | |
"modulesContent": { | |
"$edgeAgent": { | |
"properties.desired": { | |
"modules": { | |
"connectedRegistry": { | |
"settings": { | |
"image": "10.16.7.4/acr/connected-registry:0.2.0", | |
"createOptions": "{\"HostConfig\":{\"Binds\":[\"/home/azureuser/connected-registry:/var/acr/data\",\"/usr/local/share/ca-certificates:/usr/local/share/ca-certificates\",\"/etc/ssl/certs:/etc/ssl/certs\"]}}" | |
}, |
View gist:502c9615e6215fd612c3fd4a579db661
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
{ | |
"modulesContent": { | |
"$edgeAgent": { | |
"properties.desired": { | |
"modules": { | |
"connectedRegistry": { | |
"settings": { | |
"image": "mcr.microsoft.com/acr/connected-registry:0.2.0", | |
"createOptions": "{\"HostConfig\":{\"Binds\":[\"/home/azureuser/connected-registry:/var/acr/data\"],\"PortBindings\":{\"8080/tcp\":[{\"HostPort\":\"8080\"}]}}}" | |
}, |
View gist:3aec198a24cb9579299ba5728e174cd0
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
{ | |
"modulesContent": { | |
"$edgeAgent": { | |
"properties.desired": { | |
"modules": { | |
"registry": { | |
"settings": { | |
"image": "registry:latest", | |
"createOptions": "{\"HostConfig\":{\"PortBindings\":{\"5000/tcp\":[{\"HostPort\":\"5000\"}]}}}" | |
}, |
View fix.sh
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 | |
# based on https://github.com/mew2057/CAST/blob/6c7f7d514b7af3c512635ec145aa829c535467dc/csm_big_data/config-scripts/logstashFixupScript.sh | |
# see: https://github.com/elastic/logstash/issues/10755 | |
apt-get update | |
apt-get install -f zip unzip | |
STARTDIR=$(pwd) | |
JARDIR="/usr/share/logstash/logstash-core/lib/jars" |
View unicode.py
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
# reset the default encoding from ASCII to Unicode | |
# Note: it may not always work (depends on installations) | |
# see: http://blog.ianbicking.org/illusive-setdefaultencoding.html | |
import sys | |
reload(sys) # else the method will be missing | |
sys.setdefaultencoding('utf-8') | |
# convert from <type 'str'> to <type 'unicode'> | |
text.decode('utf-8') |
NewerOlder