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
# Since redirect_url is not in https, ensure you set OAUTHLIB_INSECURE_TRANSPORT environment varaible | |
from flask import Flask, jsonify, request, redirect, url_for | |
from flask_dance.consumer import OAuth2ConsumerBlueprint | |
app = Flask(__name__) | |
app.secret_key = 'xxx' | |
keycloak = OAuth2ConsumerBlueprint( | |
name="keycloak", |
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
#!/usr/bin/env python3 | |
import argparse | |
import json | |
import csv | |
from rich.console import Console | |
from rich.table import Table | |
import sys | |
def main(args): |
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
import logging | |
import argparse | |
logger = logging.getLogger(__name__) | |
def main(): | |
logger.debug("debug message not visible except if you use --debug") | |
logger.critical("critical message, always visible") |
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
#!/usr/bin/env bash | |
export VAULT_ADDR=http://localhost:8200 | |
VAULT=/opt/vault/bin/vault | |
VAULT_DATA=/var/lib/vault | |
VAULT_POLICIES=/opt/vault/etc/policies | |
# Ensure policies directory exists | |
mkdir -p $VAULT_POLICIES |
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
ESX Configuration for VNC during Packer configuration | |
[root@esxi:/etc/vmware/firewall] more vnc.xml | |
<ConfigRoot> | |
<service id='0200'> | |
<id>VNC</id> | |
<rule id='0000'> | |
<direction>inbound</direction> | |
<protocol>tcp</protocol> | |
<porttype>dst</porttype> |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"> | |
<!-- | |
Fira Code + Color Emoji Font Configuration. | |
Currently the only Terminal Emulator I'm aware that supports colour fonts is Konsole. | |
Usage: | |
0. Ensure that the Fira Code fonts are installed on your machine. | |
1. Install this file to ~/.config/fontconfig/conf.d/99-fira-code-color-emoji.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
class ComponentCommit(db.Model): | |
__tablename__ = 'component_version' | |
__table_args__ = ( | |
db.UniqueConstraint('component_id', 'commit_id', name='unique_component_commit'), | |
) | |
id = db.Column(db.Integer, primary_key=True) | |
component_id = db.Column(db.Integer, db.ForeignKey("component.id")) | |
commit_id = db.Column(db.String) | |
branch = db.Column(db.String) | |
dependencies = db.Column(db.Text) |
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
from flask import Flask | |
from flask_sqlalchemy import SQLAlchemy | |
def create_app(config: str=None): | |
app = Flask(__name__, instance_relative_config=True) | |
if config is None: | |
app.config.from_pyfile('dev.py') | |
else: | |
logger.debug('Using %s as configuration', config) | |
app.config.from_pyfile(config) |
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
#!/usr/bin/env python | |
from __future__ import print_function | |
try: | |
import mock | |
except ImportError: | |
from unittest import mock | |
import unittest |
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
04ca9e56705c865b9437eb7ce2e8ec50e7b6ec1c28dfcd387f12a42e1171843522292a4efbbdfe508e8ebdadb6ef20315a1545d71c7e04e992b15e830472b023f7;frbayart |
NewerOlder