- The WebsocketUpgrader has to be put so far up the chain within frontend.go, otherwise you have a non-hijackable ResponseWriter.
- The RoundRobin class is used to determine which backend to net.Dial against.
- I could not yet figure out how to shove the RoundRobin rebalencer into this. The API for it does not have a NextServer().
- The whole Bidir stuff on the bottom of the upgrader is by someone else. (vulcand/vulcand#78 (comment))
- The bidir code causes some errors to be logged when the connection is closed.
- The code isn't using an http.Handler errorHandler like it should.
- NO TLS???
This file contains hidden or 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 | |
# derived from https://stackoverflow.com/a/67161907/277767 | |
# Changes to the StackOverflow version: | |
# * delete temporary files that contain vaults! | |
# * prompt for passwords instead of passing them as program argument | |
# * more precise vault replacement | |
# * a bit nicer error messages that points at the line where re-keying failed | |
# * decryption if no password is provided |
This file contains hidden or 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
# WSL? | |
if [[ "$(< /proc/sys/kernel/osrelease)" == *microsoft* ]]; then | |
export $(dbus-launch) | |
export LIBGL_ALWAYS_INDIRECT=1 | |
export WSL_VERSION=$(wsl.exe -l -v | grep -a '[*]' | sed 's/[^0-9]*//g') | |
export WSL_HOST=$(tail -1 /etc/resolv.conf | cut -d' ' -f2) | |
export DISPLAY=$WSL_HOST:0 | |
# pip path if using --user | |
export PATH=$PATH:$HOME/.local/bin | |
# SSH |
This file contains hidden or 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 contextlib | |
import io | |
import warnings | |
import pytest | |
from click.testing import CliRunner | |
""" | |
In your tests: |
This file contains hidden or 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/python | |
# -*- coding: utf-8 -*- | |
# | |
# Copyright (C) 2019 Avi Networks | |
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) | |
from __future__ import absolute_import, division, print_function | |
__metaclass__ = type | |
DOCUMENTATION = ''' |
This file contains hidden or 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 | |
TMP_FILE=/tmp/docker-compose.$$.yaml | |
finish() { | |
rm ${TMP_FILE} ${TMP_FILE}.tmp 2>/dev/null | |
} | |
trap finish EXIT |
This file contains hidden or 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
Write-Host "Update Visual Studio Installer" -ForegroundColor Cyan | |
# [Microsoft Developer community](https://developercommunity.visualstudio.com/content/problem/307261/unattend-self-update-of-vs-installer.html) | |
$vsCommunityDownloadUrl = "https://download.visualstudio.microsoft.com/download/pr/8a973d5d-2ccb-428c-8204-290a15d30e2c/be8c694b12879a8f47f34369d55d453c/vs_community.exe"; | |
$vsSetupDirectory = "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Setup" | |
$vsCommunitySetupPath = "$vsSetupDirectory\vs_community.exe"; | |
if((Test-Path -Path $vsSetupDirectory) -eq $false){ | |
$r = md $vsSetupDirectory | |
} | |
if((Test-Path -Path $vsCommunitySetupPath) -eq $false){ |
This file contains hidden or 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
""" | |
A DAG definition file in Airflow, written in Python. | |
""" | |
from datetime import datetime, timedelta | |
from airflow.models import DAG # Import the DAG class | |
from airflow.operators.bash_operator import BashOperator | |
from airflow.operators.sensors import TimeDeltaSensor | |
default_args = { | |
'owner': 'you', |
This file contains hidden or 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 node | |
process.env.RANCHER_URL = '<your project URL here>'; | |
process.env.RANCHER_ACCESS_KEY = '<your access key here>'; | |
process.env.RANCHER_SECRET_KEY = '<your secret key here>'; | |
var spawn = require('child_process').spawn; | |
var exec = require('child_process').exec; | |
var path = require('path'); | |
var fs = require('fs') |
This file contains hidden or 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 requests | |
from checks import AgentCheck | |
class ConsulCheck(AgentCheck): | |
def should_check(self): | |
r = requests.get(self.init_config["consul_url"] + "/v1/agent/self") | |
if r.status_code != 200: | |
return False | |
agent = r.json() |
NewerOlder