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 | |
# set -x | |
ORG=kumahq | |
REPO=kuma | |
SELF_HOSTED_TAG=kong | |
if [[ ! -z "$1" ]]; then | |
ORG=$1 | |
fi | |
if [[ ! -z "$2" ]]; then |
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
{ | |
"configs": [ | |
{ | |
"@type": "type.googleapis.com/envoy.admin.v3.BootstrapConfigDump", | |
"bootstrap": { }, | |
"last_updated": "2024-01-16T07:23:56.160Z" | |
}, | |
{ | |
"@type": "type.googleapis.com/envoy.admin.v3.ClustersConfigDump", | |
"version_info": "3586351e-0f89-466a-8321-bc4da29e4bd2", |
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
# Example policies to enforce mTLS between sidecar and egress gateway, the connection between sidecar | |
# and egress gateway could be: | |
# 1. plaintext in (Istio) mTLS or | |
# 2. TLS in (Istio) mTLS; | |
# An AuthorizationPolicy is applied on egress gateway to enforce egress access control. | |
--- | |
apiVersion: networking.istio.io/v1beta1 | |
kind: ServiceEntry | |
metadata: | |
name: httpbin-org-ext |
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 | |
# This script depends on the "yq" utility: https://github.com/mikefarah/yq | |
SERVICE_NAME=$1 | |
NEW_IMAGE=$2 | |
LATEST_VERSION=$(kubectl get deployment --selector app=$SERVICE_NAME -o 'jsonpath={.items[*].metadata.labels.version}' | tr " " "\n" | sed 's/^v//' | sort -n -r | tr "\n" " " | cut -d ' ' -f 1) | |
NEXT_VERSION=$((LATEST_VERSION+1)) |
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/sh | |
FULL_HOST=$1 | |
if [ -z "$FULL_HOST" ]; then | |
FULL_HOST=localhost:443 | |
fi | |
HOST=$(echo $FULL_HOST | cut -d ':' -f 1) | |
PORT=$(echo $FULL_HOST | cut -d ':' -f 2) |
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
using Xunit; | |
using MyNamespace; | |
using Microsoft.AspNetCore.TestHost; | |
using Microsoft.AspNetCore.Hosting.Server; | |
using Microsoft.AspNetCore.Hosting.Internal; | |
using Microsoft.AspNetCore.Http; | |
using Microsoft.AspNetCore.Http.Features; | |
using Microsoft.AspNetCore.Hosting; | |
using System.Threading.Tasks; |
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
public static void MergeDirectories(string sourceDir, string destDir, bool moveMode = false, bool overwriteMode = false) | |
{ | |
if (!Directory.Exists(destDir)) | |
{ | |
Directory.CreateDirectory(destDir); | |
} | |
var dir = new DirectoryInfo(sourceDir); | |
foreach (var file in dir.GetFiles()) |
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
using Microsoft.AspNet.Builder; | |
using Microsoft.AspNet.FileProviders; | |
using Microsoft.AspNet.Hosting; | |
using Microsoft.AspNet.Mvc.Razor; | |
using Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.Extensions.Logging; | |
using Microsoft.Extensions.PlatformAbstractions; | |
using Microsoft.Extensions.Primitives; | |
using System; |
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
// javascript code to clean up Zhihu anwser page | |
$('#zh-question-answer-wrap .zm-item-rich-text .zm-editable-content').first().prepend('<p>作者:<strong>' + $.trim($('.zm-item-answer-author-info:first').text()).replace(/,/, ' </strong>').replace(/收起/g, '') + '</p>'); | |
[".zu-top", | |
"#zh-footer", | |
".zu-main-sidebar", | |
".zm-tag-editor", | |
"#zh-question-meta-wrap", | |
".zm-votebar", |