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
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"io" | |
"log" | |
"net/http" | |
"os" | |
"path" |
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
{ | |
"keyMappings": "# Insert your preferred key mappings here.\nunmap d\nmap d scrollFullPageDown\nmap <down> scrollFullPageDown\nmap e scrollFullPageUp\nmap <up> scrollUp\n#map e scrollPageUp\nmap w nextTab\nmap a previousTab\n\nunmap l\nmap s goBack\nmap l goForward\n\nmap z restoreTab\nmap c goNext\nmap h goPrevious\n\nunmap f\nunmap F\n\n\nmap F LinkHints.activateModeToOpenInNewForegroundTab\nmap f LinkHints.activateModeToOpenInNewTab\nmap o Vomnibar.activateInNewTab\nmap q visitPreviousTab\n\n# map t createTab http://www.google.com/\n#map t createTab https://www.deepl.com/write\nmap t duplicateTab\n\nmap ; Marks.activateGotoMode swap\nmap m Marks.activateCreateMode swap\n\nmap <c-,> moveTabLeft count=99\nmap <c-.> moveTabRight count=99\n\nmap <c-f> LinkHints.activateModeWithQueue\n\nunmap p\nmap p openCopiedUrlInNewTab\n\nmap <c-p> togglePinTab\nmap <c-d> LinkHints.activateModeToDownloadLink\n\nunmap b\nmap b Vomnibar.activateTabSelection", | |
"linkHintCharacters": "asdfwerzxcv", | |
"nextPatterns": "下一篇, |
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
package main | |
// https://cloud.tencent.com/developer/ask/sof/115441746 | |
import ( | |
"bytes" | |
"context" | |
"flag" | |
"fmt" | |
"log" |
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
// Watch Pod update events | |
podInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ | |
UpdateFunc: func(old interface{}, new interface{}) { | |
oldPod, newPod := old.(*v1.Pod), new.(*v1.Pod) | |
oldPodRestartCount := getPodRestartCount(oldPod) | |
newPodRestartCount := getPodRestartCount(newPod) | |
// Compare the RestartCount | |
if newPodRestartCount > oldPodRestartCount { | |
key, err := cache.MetaNamespaceKeyFunc(new) | |
if err == nil { |
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
apiVersion: apiextensions.k8s.io/v1 | |
kind: CustomResourceDefinition | |
metadata: | |
annotations: | |
kubectl.kubernetes.io/last-applied-configuration: | | |
{"apiVersion":"apiextensions.k8s.io/v1","kind":"CustomResourceDefinition","metadata":{"annotations":{},"name":"serviceboards.airwallex.com"},"spec":{"group":"airwallex.com","names":{"kind":"ServiceBoard","plural":"serviceboards","shortNames":["svcb"],"singular":"serviceboard"},"scope":"Namespaced","versions":[{"additionalPrinterColumns":[{"jsonPath":".spec.serviceInfomation.pods.status.ready","name":"Ready","type":"string"},{"jsonPath":".spec.serviceInfomation.pods.imageTags","name":"ImageTags","type":"string"},{"jsonPath":".spec.serviceInfomation.ingress.hosts","name":"IngressHosts","type":"string"},{"jsonPath":".spec.serviceInfomation.updatedAt","name":"UpdatedAt","type":"date"}],"name":"v1alpha1","schema":{"openAPIV3Schema":{"properties":{"spec":{"properties":{"serviceInfomation":{"properties":{"clusterName":{"type":"string"},"ingress":{"properties":{"hos |
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 | |
# check TLS/SSL certificate expiration date | |
# openssl x509 -text -noout -in inputfile | |
# https://www.sslshopper.com/certificate-decoder.html | |
echo -e "\n## SSL Certificates List: \n\n| File Name | Valid From | Valid To | Comment |\n| --- | --- | --- | --- |" >> README.md | |
for file in $(find .); do | |
if test -f $file; then | |
if grep -q "\-BEGIN CERTIFICATE\-" $file; 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
package main | |
import ( | |
"flag" | |
"fmt" | |
"path/filepath" | |
"time" | |
"k8s.io/klog/v2" | |
_ "k8s.io/client-go/plugin/pkg/client/auth" |
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
package main | |
import ( | |
"flag" | |
"log" | |
"path/filepath" | |
_ "k8s.io/client-go/plugin/pkg/client/auth" | |
v1 "k8s.io/apimachinery/pkg/apis/meta/v1" | |
"k8s.io/client-go/informers" | |
"k8s.io/client-go/kubernetes" |
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
package main | |
import ( | |
"flag" | |
"path/filepath" | |
_ "k8s.io/client-go/plugin/pkg/client/auth" | |
"k8s.io/client-go/kubernetes" | |
"k8s.io/client-go/rest" |
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 | |
# ------------------------------------------------------------------------------ | |
# 您好!本脚本纯shell编写,用于收集系统日志以及相关服务日志等, | |
# | |
# 目前兼容TKE的Ubuntu、Centos,脚本开源,您可以直接用vim打开脚本查阅里面的代码。 | |
# | |
# 确认脚本无误后,放到容器节点运行。成功后,请把/tmp/tkelog/tkelog.tar.gz打包文件发我们进行问题排查,感谢您的支持! | |
# ------------------------------------------------------------------------------ | |
export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin/bash | |
version='2020.1' |
NewerOlder