Skip to content

Instantly share code, notes, and snippets.

View wu0407's full-sized avatar

wowqing wu0407

View GitHub Profile
@huandu
huandu / nginx-cors.conf
Last active July 11, 2020 12:28 — forked from sbuzonas/nginx-cors.conf
Nginx CORS maps
map $http_origin $allow_origin {
default "$http_origin";
}
map $request_method $cors_method {
default "allowed";
"OPTIONS" "preflight";
}
map $cors_method $cors_max_age {
@roylee0704
roylee0704 / dockergrep.sh
Created December 9, 2016 08:24
how to grep docker log
docker logs nginx 2>&1 | grep "127."
# ref: http://stackoverflow.com/questions/34724980/finding-a-string-in-docker-logs-of-container
@kiview
kiview / upgrade.yml
Last active November 3, 2023 12:52
Ubuntu upgrade with Ansible
---
- hosts:
- all
become: true
tasks:
- name: Update apt cache
apt: update_cache=yes
- name: Upgrade packages
apt: upgrade=dist
@Vince-Cercury
Vince-Cercury / gist:43c7afc1a6b0f580b0cb6fb27e650042
Created September 1, 2017 00:12
How to monitor an external secure etcd cluster with Prometheus Operator
# How to monitor a secure external etcd service with Prometheus Operator
This guide will help you monitor an external etcd cluster. When the etcd is not hosted inside Kubernetes.
This is often the case with the Kubernetes setup. This has been tested with kube-aws but same principals will apply to other tools.
# Step 1 - Make the etcd certificates available to Prometheus pod
Prometheus Operator (and Prometheus) allow us to specify a tlsConfig. This is required as most likely your etcd metrics end points is secure.
## a - Create the secrets in the namespace
Prometheus Operator allows us to mount secrets in the pod. By loading the secrets as files, they can be made available inside the Prometheus pod.
@navicore
navicore / jsonpath.md
Last active January 24, 2024 17:25
for getting multiple kubernetes yaml fields from kubectl via jsonpath

get name and image and startTime

kubectl get pods -Ao jsonpath='{range .items[*]}{@.metadata.name}{" "}{@..spec..containers[*].image}{" "}{@.status.phase}{" "}{@.status.startTime}{"\n"}{end}'

edited 10/2022 with .. and A suggestions

@baymaxium
baymaxium / content.md
Created October 18, 2017 09:17
孙宇聪:来自Google的DevOps理念及实践

原文:中生代技术

经过数年蛰伏,DevOps成为了业界焦点,不过如何实现DevOps,依然路漫漫,本期文章转载自数人云组织的DevOps系列分享实录,了解并学习Google的DevOps实践

SRE(Site Reliability Engineering)是最早由Google提出,又经由Google发展完善的一个崭新运维理念。如今SRE已成为一个涵盖运维理念、思路、组织架构和具体实践的完整体系。数人云推出SRE系列教程,由SRE经验丰富的技术大牛们为大家分享运维一线的独家干货,揭示SRE背后的秘密。

数人云邀请了前Google SRE、《SRE:Google运维解密》的译者孙宇聪与大家进行了线上分享。本文讲述了SRE的基本概念和核心原理。与孙老师本人一样风趣幽默的文章,小数希望大家阅读愉快:)

PS:文末线下活动有孙老师翻译著作书籍赠送

@yonglai
yonglai / playbook_centos_install_docker.yaml
Created November 15, 2017 18:04
An Ansible playbook to install docker-ce on Centos
---
- name: Install docker
gather_facts: No
hosts: default
tasks:
- name: Install yum utils
yum:
name: yum-utils
state: latest
@miguelmota
miguelmota / userhomedir.go
Last active April 11, 2022 00:33
Golang get user home directory path
package main
import (
"fmt"
"os"
"runtime"
)
func userHomeDir() string {
if runtime.GOOS == "windows" {
@Integralist
Integralist / Long and Short Flag.go
Last active January 3, 2024 19:35
[Golang Long and Short Flags] #go #golang #flags
var myFlagType string
func init() {
const (
flagValue = "default value is foo"
flagUsage = "this is my flag explanation"
)
flag.StringVar(&myFlagType, "foo", flagValue, flagUsage)
flag.StringVar(&myFlagType, "f", flagValue, flagUsage+" (shorthand)")
flag.Parse()
@ykfq
ykfq / Kubernetes 调度优化--重平衡策略方案整理.md
Created January 29, 2019 06:50
Kubernetes 调度优化--重平衡策略方案整理
<title>Kubernetes 调度优化--重平衡策略方案整理</title>