Skip to content

Instantly share code, notes, and snippets.

View ozbillwang's full-sized avatar

Bill Wang ozbillwang

View GitHub Profile
ozbillwang / test
Created November 5, 2023 12:20
New article published on Medium
ozbillwang / a text mode of openai
Last active May 2, 2023 03:44
Run as text mode of with model `gpt-3.5-turbo` via API
A python code runs as text mode of with model `gpt-3.5-turbo` via API
### Usage
1. install openai pythonpackage
pip install openai python-dotenv
ozbillwang /
Last active March 28, 2024 18:46
Kubernetes auto-completion works with FISH (better than Bash)
ozbillwang /
Created June 13, 2020 13:28 — forked from anapsix/
Rancher in KIND (Rancher in Kubernetes-in-Docker)
#!/usr/bin/env bash
# RKIND is a naive helper script to start KIND and Rancher Management Server
set -u
set -o pipefail
ozbillwang /
Created April 27, 2020 01:26
show ssh key's fingerprint

ssh-keygen -l -E md5 -f id_rsa

ozbillwang /
Last active September 5, 2023 23:03
google cloud - account.json file for packer

The problem

The document quality of Google Cloud is far away if compare with AWS. Here is a sample.

If you met below error, when running packer or other SDK,

$ cat packer.json
 "builders": [
ozbillwang /
Last active June 14, 2024 15:25
Configure Git to use a proxy (https or SSH+GIT)
AWSTemplateFormatVersion: 2010-09-09
Description: 'Registers ecs tasks to a second target group'
Description: 'ANR of cluster the service resides in'
Type: String
Description: 'Name of the service to register'
Type: String

Unfortunately as of writing this (Oct 18, 2017) there is no built in integration for multiple target groups per AWS ECS service. Here are a few things you can try:

  1. If your application just serves port 80 (HTTP) & port 443 (HTTPS) then you should consider using the application load balancer and terminating SSL at the load balancer. This will allow your application to function using just port 80.

  2. If your application serves different ports that are backed by different components, perhaps speaking different protocols then you should consider splitting the application into multiple ECS services. This has the benefit of allowing the different components to independently scale

ozbillwang / a new way to manage tags with
Created February 1, 2018 02:06
a new way to manage tags with terraform