Skip to content

Instantly share code, notes, and snippets.

View pydevops's full-sized avatar
🏠
Working from home

Victor Yang pydevops

🏠
Working from home
View GitHub Profile
@pydevops
pydevops / ppj.go
Last active December 13, 2022 18:37
pretty print json yaml
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"os"
flatten "github.com/jeremywohl/flatten"
@pydevops
pydevops / markdown_html.sh
Created October 13, 2018 19:48
markdown to html
#!/bin/bash
SRC_DIR=$HOME/Desktop
DEST_DIR=$HOME/man
mkdir -p $DEST_DIR
for mdfile in ${SRC_DIR}/*.md
do
filename=${mdfile##*/}
basename=${filename%.md}
@pydevops
pydevops / bitbucket.py
Last active October 13, 2018 19:59
bitbucket clone repo
#!/usr/bin/env python
from __future__ import print_function
import json
import sys
import requests
import getpass
'''
Given the bitbucket.org user id,
@pydevops
pydevops / gke-ingress-manged-tls.md
Last active August 10, 2023 09:20
Create a GCP managed TLS certificate for the GKE ingress

GKE ingress in a nutshell

Solution #1 (ManagedCertificate CRD in GKE)

  • GKE with Google-managed SSL certificates
    • Use ManagedCertificate CRD to create a object.
    • Associate the ManagedCertificate object to an Ingress by adding an annotation networking.gke.io/managed-certificates to the Ingress. This annotation is a comma-separated list of ManagedCertificate resources, cert1,cert2,cert3 for example.

Solution #2 (Google Cloud SSL Certificate)

Assumption

@pydevops
pydevops / firebase_demo.md
Last active November 1, 2018 22:25
set up firebase demo

Steps

  1. git clone https://github.com/pydevops/quickstart-js.git on your laptop.
  2. Insert the corresponding firebase web app config copied from firebase web console in storage/index.html
  3. Set up for development and deploy
$ brew install node # install node if you haven't
$ npm install -g firebase-tools
$ cd storage
$ firebase login
@pydevops
pydevops / k8s-crd.md
Last active September 1, 2023 00:41 — forked from smileisak/operators.md
k8s crd operator
@pydevops
pydevops / dict.md
Last active January 24, 2019 22:09
python refer name defined in another module

main.py

import config
globals().update(config.constants())
print(PI)

config.py

def constants():
 c={'PI':'3.14'}
@pydevops
pydevops / VirtualBox Cheat Sheet
Created January 27, 2019 23:59 — forked from githubfoam/VirtualBox Cheat Sheet
VirtualBox Cheat Sheet
"VBoxManage" command is different from "sudo VBoxManage" command
VBoxManage --version
sudo apt-get dist-upgrade -y -> Debian-based linux makes sure VirtualBox Guest Additions is installed
VBoxManage list runningvms -> Find running vm to box
vagrant package --base xxxxx_1522057296984_52705 --output ubuntu1604.box --> Package running vm as vagrant box
# Download an ISO image of VirtualBox Guest Additions