Skip to content

Instantly share code, notes, and snippets.

View ozbillwang's full-sized avatar
:octocat:

Bill Wang ozbillwang

:octocat:
View GitHub Profile
@ozbillwang
ozbillwang / test
Created November 5, 2023 12:20
New article published on Medium
https://medium.com/@ozbillwang
@ozbillwang
ozbillwang / a text mode of openai
Last active May 2, 2023 03:44
Run as text mode of https://chat.openai.com with model `gpt-3.5-turbo` via API
A python code runs as text mode of https://chat.openai.com with model `gpt-3.5-turbo` via API
### Usage
1. install openai pythonpackage
```
pip install openai python-dotenv
```
@ozbillwang
ozbillwang / kubernetes-auto-completion-fish.md
Last active March 28, 2024 18:46
Kubernetes auto-completion works with FISH (better than Bash)
@ozbillwang
ozbillwang / rkind.sh
Created June 13, 2020 13:28 — forked from anapsix/rkind.sh
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
RANCHER_CONTAINER_NAME="rancher-for-kind"
RANCHER_HTTP_HOST_PORT=$[$[RANDOM%9000]+30000]
@ozbillwang
ozbillwang / ssh-fingerprint.md
Created April 27, 2020 01:26
show ssh key's fingerprint

ssh-keygen -l -E md5 -f id_rsa

@ozbillwang
ozbillwang / packer-on-gcp.md
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
ozbillwang / Git_Behind_Proxy.md
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'
Parameters:
ClusterArn:
Description: 'ANR of cluster the service resides in'
Type: String
ServiceName:
Description: 'Name of the service to register'
Type: String
ContainerName:

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
ozbillwang / a new way to manage tags with terraform.md
Created February 1, 2018 02:06
a new way to manage tags with terraform