This gist provides a complete example of client-side authentication for Apache APISIX.
It includes the process of:
- generating a certificate
- configuring the certificate in APISIX
- configuring the route in APISIX
| mkdir -p certs/dev/csrs && for f in revoked-root-ca revoked tls; do echo "[]" > certs/dev/$f.json; done |
| import requests | |
| import json | |
| def fetch_json(url): | |
| response = requests.get(url) | |
| return response.json() | |
| def main(): |
| { | |
| "image": "mcr.microsoft.com/devcontainers/universal:2", | |
| "features": { | |
| "ghcr.io/devcontainers/features/terraform:1": { | |
| "tflint":"none", | |
| "installTFsec": "true", | |
| "terragrunt": "none" | |
| }, | |
| "ghcr.io/devcontainers/features/aws-cli:1": {} | |
| }, |
UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.
Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/
sudo amazon-linux-extras install docker
sudo service docker start| #!/bin/bash | |
| yum install httpd -y | |
| /sbin/chkconfig --levels 235 httpd on | |
| service httpd start | |
| instanceId=$(curl http://169.254.169.254/latest/meta-data/instance-id) | |
| region=$(curl http://169.254.169.254/latest/dynamic/instance-identity/document | grep region | awk -F\" '{print $4}') | |
| echo "<h1>$instanceId</h1>" > /var/www/html/index.html | |
| aws ec2 create-tags --resources "$instanceId" --tags Key=Name,Value="PROD-$instanceId" --region "$region" |
| """Script for fine-tuning Pegasus | |
| Example usage: | |
| # use XSum dataset as example, with first 1000 docs as training data | |
| from datasets import load_dataset | |
| dataset = load_dataset("xsum") | |
| train_texts, train_labels = dataset['train']['document'][:1000], dataset['train']['summary'][:1000] | |
| # use Pegasus Large model as base for fine-tuning | |
| model_name = 'google/pegasus-large' | |
| train_dataset, _, _, tokenizer = prepare_data(model_name, train_texts, train_labels) |
| pipeline { | |
| agent any | |
| parameters { | |
| string(name: 'environment', defaultValue: 'default', description: 'Workspace/environment file to use for deployment') | |
| string(name: 'version', defaultValue: '', description: 'Version variable to pass to Terraform') | |
| booleanParam(name: 'autoApprove', defaultValue: false, description: 'Automatically run apply after generating plan?') | |
| } | |
| environment { |
choco install microsoft-windows-terminalTIP: Pin the Terminal to your Taskbar for quick and easy access
Great docs here: https://docs.microsoft.com/en-us/windows/terminal/