Skip to content

Instantly share code, notes, and snippets.

View AnthonyWC's full-sized avatar
💭
The Net is Vast and Infinite.

AnthonyWC AnthonyWC

💭
The Net is Vast and Infinite.
View GitHub Profile
@AnthonyWC
AnthonyWC / vswitch-lldp.sh
Created March 3, 2016 19:10
Enable vSwitch LLDP for all VMNIC interfaces
VSISH_VSWITCH_PATH=/net/portsets
for vSwitch in $(vsish -e ls ${VSISH_VSWITCH_PATH});
do
VSWITCH=$(echo ${vSwitch} | sed 's/\///g')
for port in $(vsish -e ls ${VSISH_VSWITCH_PATH}/${vSwitch}ports);
do
PORT=$(echo ${port} | sed 's/\///g')
PORTINFO=$(vsish -e get ${VSISH_VSWITCH_PATH}/${vSwitch}ports/${port}status | sed 's/^[ \t]*//;s/[ \t]*$//');
CLIENT=$(echo ${PORTINFO} | sed 's/ /\n/g' | grep "clientName:" | awk -F ":" '{print $2}')
MACADDRESS=$(echo ${PORTINFO} | sed 's/ /\n/g' | grep "unicastAddr:" | uniq | sed 's/unicastAddr://;s/\(.*\)./\1/')
@AnthonyWC
AnthonyWC / README.md
Created July 21, 2023 16:19 — forked from aojea/README.md
upgrade kind kubernetes cluster
@AnthonyWC
AnthonyWC / git: gitignore.md
Created March 19, 2023 02:24 — forked from jstnlvns/git: gitignore.md
a gitignore cheatsheet

Git sees every file in your working copy as one of three things:

  1. tracked - a file which has been previously staged or committed;
  2. untracked - a file which has not been staged or committed; or
  3. ignored - a file which Git has been explicitly told to ignore.

Ignored files are usually build artifacts and machine generated files that can be derived from your repository source or should otherwise not be committed. Some common examples are:

  • dependency caches, such as the contents of /node_modules or /packages
  • compiled code, such as .o, .pyc, and .class files
@AnthonyWC
AnthonyWC / bash_strict_mode.md
Created January 17, 2023 19:30 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o, -x pipefail explanation
@AnthonyWC
AnthonyWC / prometheus.yml
Created May 5, 2022 19:41 — forked from reachlin/prometheus.yml
sample prometheus configuration explained
// For all the confusing Prometheus configuration and
// regular expressions,
// explained in examples.
// Remember, there are default values for each item if it's missing.
// regex is (.*),
// replacement is $1,
// separator is ;
// ,and action is replace
@AnthonyWC
AnthonyWC / iam-policy.json
Created February 7, 2022 19:44 — forked from quiver/iam-policy.json
How to connect to Amazon RDS PostgreSQL with IAM credentials
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"rds-db:connect"
],
"Resource": [
"arn:aws:rds-db:region:account-id:dbuser:dbi-resource-id/database-user-name"
#!/bin/zsh
###################
# Mac version
###################
CUR_DIR=$(pwd)
# If you come from bash you might have to change your $PATH.
# Path to your oh-my-zsh installation.
#!/bin/zsh
###################
# Mac version
###################
CUR_DIR=$(pwd)
# If you come from bash you might have to change your $PATH.
# Path to your oh-my-zsh installation.
@AnthonyWC
AnthonyWC / lifecycle-cheat-sheet.md
Created August 14, 2019 15:12 — forked from HyperBrain/lifecycle-cheat-sheet.md
Serverless Lifecycle Cheat Sheet

Serverless plugin author's cheat sheet

This cheat sheet provides a detailed overview of the exposed lifecycle events and available commands (and entrypoints) of the Serverless framework, that can be hooked by plugins (internal and external ones). The document is structured by the commands invoked by the user.

Lifecycle events are shown as the globally available outer events (all providers) and sub lifecycle events that are provider specific in the called order. Currently only the AWS provider is shown. If you have information about the other provider,

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDBQkaB5rQXDDIgxSQKs16gbfzmpSK774B892qI9VkOL6CDIXWbpeuX8mU+r7FWZtBEK10BuOBe4dRz59ucGCjnkQ50j/u9pzl+XHcBDS9MtdwVN07rrUwUrIh+GyUV6G+oFvYO7cJ2fJxSIr6ulehEvWwyUkQpKnqtdBczeChmfCGDz9wMK1EKWRRRU6sqAu5uElNU0HZ+KqLdbS7KS0g9axqbF6mk5851GNzOQGk9P7xXKSiaqgTDSBfaxYKRf08gT6udhidKn4evhF8VYWKCU5gzKmcWXEaHaL9RAd3wRgIOpJQQqwDijKRvZ1aMSUn5hurCYTBJ+m/7Mg6FGr8J antho@NY-ACheng