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
class TwitterHandler(tornado.web.RequestHandler, | |
tornado.auth.TwitterMixin): | |
"""Handling Twitter authentication at URL http://www.yoursite.com/twitter""" | |
@tornado.web.asynchronous | |
def get(self): | |
if self.get_argument("oauth_token", None): | |
user = self.get_authenticated_user(self.async_callback(self._on_auth)) | |
return | |
self.authenticate_redirect() |
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') |
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" |
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\"}]}}}" | |
}, |
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\"}]}}}" | |
}, |
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\"]}}" | |
}, |
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; |
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\"}]}}}" | |
}, |
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 |
OlderNewer