Skip to content

Instantly share code, notes, and snippets.

View hex108's full-sized avatar

Jun Gong hex108

  • Tencent
View GitHub Profile
@hex108
hex108 / tags_for_proto.pl
Created June 13, 2019 07:44
Generate vim tags for protocol buffer files
#!/usr/bin/perl
use strict;
my $tag_file = "tags";
check_and_backup($tag_file);
my @proto_files = `find . -name *.proto`;
for my $proto_file (@proto_files){
chomp($proto_file);
# OSX leaves these everywhere on SMB shares
._*
# OSX trash
.DS_Store
# Eclipse files
.classpath
.project
.settings/**
@hex108
hex108 / generate_kubeconfig.sh
Created July 13, 2020 10:48
Generate kubeconfig for users with proper permissions and quota in the specified namespace.
#!/usr/bin/bash
set -e
set -u
set -o pipefail
#set -x
# Please set these variables first, then run the script on the master node.
APISERVER_ADDRESS="https://127.0.0.1:6443" # If you have a VIP for apiservers, use the VIP.
USER=test # user name