Skip to content

Instantly share code, notes, and snippets.

View pichuang's full-sized avatar

Phil Huang pichuang

View GitHub Profile
@pichuang
pichuang / ENV
Created April 17, 2024 05:11
Disable ARM_PROVIDER_ENHANCED_VALIDATION
$ ARM_PROVIDER_ENHANCED_VALIDATION=false terraform plan
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the
following symbols:
+ create
Terraform will perform the following actions:
# azurerm_resource_group.rg-taiwannorth will be created
+ resource "azurerm_resource_group" "rg-taiwannorth" {
@pichuang
pichuang / sources.list
Last active April 9, 2024 03:07
Kali Linux source.list /etc/apt/sources.list
deb http://http.kali.org/kali kali-rolling main contrib non-free
deb-src http://http.kali.org/kali kali-rolling main contrib non-free
#deb http://kali.cs.nctu.edu.tw/kali kali-rolling main non-free contrib
@pichuang
pichuang / network
Last active January 1, 2024 14:58
OpenWrt /etc/config/network
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config interface 'lan1'
option ifname 'eth0.1'
option proto 'static'
@pichuang
pichuang / check_etcd.sh
Last active November 15, 2023 09:12
Check etcd status on OCP 4.6.1
#!/bin/bash
# Ref: https://docs.openshift.com/container-platform/4.6/backup_and_restore/backing-up-etcd.html
etcd_node=`oc get pods -n openshift-etcd -l app=etcd -o=jsonpath='{.items[0].spec.nodeName}'`
ssh -i ~/.ssh/dmz-ocp4-rsa core@$etcd_node
id=$(sudo crictl ps --name etcdctl | awk 'FNR==2{ print $1}') && sudo crictl exec -it $id /bin/bash
etcdctl member list -w table
etcdctl endpoint health --cluster
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update
helm install ingress-nginx ingress-nginx/ingress-nginx \
--create-namespace \
--namespace ingress-basic \
--set controller.service.annotations."service\.beta\.kubernetes\.io/azure-load-balancer-health-probe-request-path"=/healthz
---
apiVersion: apps/v1
kind: Deployment
spec:
selector:
matchLabels:
app: night9-app
component: night9-app
node-type: worker
progressDeadlineSeconds: 600
@pichuang
pichuang / sample-tmc-deployment.yaml
Created November 12, 2021 03:09
Tanzu Mission Control Agent Deployment
apiVersion: v1
kind: Namespace
metadata:
labels:
control-plane: extension-manager
tmc-extension: "true"
controller-tools.k8s.io: "1.0"
name: vmware-system-tmc
---
apiVersion: v1
#!/usr/bin/env python2
from mininet.topo import Topo
from mininet.net import Mininet
from mininet.link import TCLink
from mininet.log import setLogLevel, info
from mininet.node import Controller, RemoteController
from mininet.cli import CLI
from mininet.link import Intf
from mininet.util import dumpNodeConnections
{
"id": "/subscriptions/964df7ca-3f8/providers/Microsoft.Authorization/roleDefinitions/fd429c21-039b-4ba7-bfb3-f791a6ce8e94",
"properties": {
"roleName": "Starkiller",
"description": "see: https://linuxacademy.atlassian.net/wiki/spaces/ET/pages/818348034/Student+Lab+Permissions",
"assignableScopes": [
"/subscriptions/9ed9933ef0",
],
"permissions": [
{
@pichuang
pichuang / octant-workflow
Created November 30, 2021 15:15
octant
tee /usr/lib/systemd/system/octant.service <<-'EOF'
[Unit]
Description=octant
[Service]
Environment="HOME=/root"
Environment="OCTANT_ACCEPTED_HOSTS=10.45.112.173"
Environment="KUBECONFIG=/home/livefire/.kube/config"
Environment="OCTANT_LISTENER_ADDR=0.0.0.0:8900"