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: networking.istio.io/v1beta1 | |
kind: Gateway | |
metadata: | |
name: gw | |
namespace: test | |
spec: | |
selector: | |
app: istio-ingressgateway | |
istio: ingressgateway | |
servers: |
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
data "azurerm_client_config" "current" {} | |
resource "azurerm_key_vault" "keyvault" { | |
count = "${length(var.vaultnames)}" | |
name = "${var.servicename}-${var.vaultnames[count.index]}" | |
location = "${var.keyvault_location}" | |
resource_group_name = "${var.keyvault_resource_group}" | |
tenant_id = "${data.azurerm_client_config.current.tenant_id}" | |
sku_name = "standard" |
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 ( | |
"fmt" | |
"io/ioutil" | |
"strings" | |
) | |
const data = `66.249.65.159 - - [06/Nov/2014:19:10:38 +0600] "GET /news/53f8d72920ba2744fe873ebc.html HTTP/1.1" 404 177 | |
66.249.65.3 - - [06/Nov/2014:19:11:24 +0600] "GET /?q=%E0%A6%AB%E0%A6%BE%E0%A7%9F%E0%A6%BE%E0%A6%B0 HTTP/1.1" 200 4223" |
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
# List pods which has CONSUL_HOST | |
kubectl get pods -o=jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.spec.containers[*].env[?(@.name=="CONSUL_HOST")].value}{"\n"}{end}' | awk ' NF==2 {print $0} ' | |
# List deployment which has CONSUL_HOST | |
kubectl get deployment -o jsonpath="{range .items[*]}{.metadata.name}{'\t'}{.spec.template.spec.containers[*].env[*].name}{'\n'}{end}" | grep "CONSUL_HOST" | |
# Patch deployment env | |
kubectl patch deployment xyz-deployment -p '{"spec":{"template":{"spec":{"containers":[{"name":"xyz", "env":[{"name":"HTTP_PROXY", "value":"xyz-proxy.exampe.com"}]}]}}}}}' |
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
# List pods which has CONSUL_HOST | |
kubectl get pods -o=jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.spec.containers[*].env[?(@.name=="CONSUL_HOST")].value}{"\n"}{end}' | awk ' NF==2 {print $0} ' | |
# List deployment which has CONSUL_HOST | |
kubectl get deployment -o jsonpath="{range .items[*]}{.metadata.name}{'\t'}{.spec.template.spec.containers[*].env[*].name}{'\n'}{end}" | grep "CONSUL_HOST" |
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
# ########################################################## # | |
# Makefile for Golang Project | |
# Includes cross-compiling, installation, cleanup | |
# ########################################################## # | |
# Check for required command tools to build or stop immediately | |
EXECUTABLES = git go find pwd | |
K := $(foreach exec,$(EXECUTABLES),\ | |
$(if $(shell which $(exec)),some string,$(error "No $(exec) in 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
#!/bin/bash | |
PROXYS='proxy.txt' | |
PROXY_TYPE='http' | |
CHECK_URL='https://api.ipify.org?format=json' | |
MAX_CONNECT=10 | |
GOOD_ARR=() | |
FAIL_ARR=() | |
GOOD=0 | |
FAIL=0 |
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
pipeline { | |
agent any | |
parameters { | |
string(name: 'COOKBOOKS', defaultVaule: "[jenkins,common,base]", description:"Add your cookbooks as []") | |
} | |
stages { | |
stage('fetch target chef') { | |
steps { | |
git 'ssh://[email protected]/leitu/chef-cookbook.git' | |
} |
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 | |
CONSOLE_RED="\033[2;31m" | |
CONSOLE_GREEN="\033[2;32m" | |
CONSOLE_CLEAR="\033[0m" | |
JENKINS_SERVER=http://my_jenkins_server | |
JOB=$1 | |
JOB_QUERY=/job/${JOB} |
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
jenkins_script env_name do | |
command <<-EOH.gsub(/^ {8}/, '') | |
import jenkins.model.* | |
import com.cloudbees.plugins.credentials.* | |
import com.cloudbees.plugins.credentials.domains.* | |
import com.cloudbees.jenkins.plugins.awscredentials.* | |
domain = Domain.global() | |
store = Jenkins.instance.getExtensionList('com.cloudbees.plugins.credentials.SystemCredentialsProvider')[0].getStore() | |
credentials = new AWSCredentialsImpl( |
NewerOlder