Data from [https://snowflake.medium.com/]
This file contains hidden or 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
| # 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. |
This file contains hidden or 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 ( | |
| "log" | |
| "encoding/json" | |
| "fmt" | |
| "os" | |
| "math/rand" |
This notes is written by Sheldon. You can find me with #iOSBySheldon in Github, Youtube, Facebook, etc.
Convert .mov/.MP4 to .gif
As a developer, I feel better to upload a short video when I create the pull request to show other viewers what I did in this PR. I tried .mov format directly got after finishing recording screen using Quicktime, however, gif offers preview in most web pages, and has smaller file size.
This is not limited to developer, anyone has this need can use this method to convert the files.
This file contains hidden or 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
| # coding:utf-8 | |
| from gevent import monkey, sleep, spawn, joinall | |
| monkey.patch_all() | |
| import datetime | |
| from sqlalchemy import Column, Integer, String, DateTime, Numeric, create_engine, VARCHAR, UniqueConstraint | |
| from sqlalchemy.ext.declarative import declarative_base | |
| from sqlalchemy.orm import sessionmaker | |
| import sqlalchemy | |
| import time |
This file contains hidden or 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
| """ | |
| aiohttp shooting | |
| """ | |
| import os | |
| import asyncio | |
| import aiohttp | |
| import time | |
| url = "https://example/isalive" |
This file contains hidden or 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
| import json | |
| import os | |
| import luigi | |
| import requests | |
| from collections import Counter | |
| from luigi.contrib.external_program import ExternalProgramTask | |
| class Meetup(luigi.WrapperTask): | |
| def run(self): |
This file contains hidden or 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
| #!/usr/bin/env python | |
| # encoding: utf-8 | |
| import MySQLdb | |
| from upsert import upsert | |
| db = MySQLdb.connect(host="localhost", user="root", passwd="", db="demo", charset="utf8") | |
| c = db.cursor() | |
| import warnings | |
| warnings.filterwarnings("ignore", "Unknown table.*") |
This file contains hidden or 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
| alias kc='kubectl' | |
| alias kclf='kubectl logs --tail=200 -f' | |
| alias kcgs='kubectl get service -o wide' | |
| alias kcgd='kubectl get deployment -o wide' | |
| alias kcgp='kubectl get pod -o wide' | |
| alias kcgn='kubectl get node -o wide' | |
| alias kcdp='kubectl describe pod' | |
| alias kcds='kubectl describe service' | |
| alias kcdd='kubectl describe deployment' | |
| alias kcdf='kubectl delete -f' |