This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -name 'node_modules' -type d -prune -exec du -sh {} + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ "$1" = "" ]; then | |
echo "Usage: ./ksh <pod>" | |
exit 1 | |
fi | |
echo Getting pods... | |
PODS=$(kubectl get pods --no-headers --output=name | grep $1) | |
PODS=(${PODS}) | |
NUM_PODS=${#PODS[@]} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -name node_modules -type d -maxdepth 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export PATH=$(brew --prefix coreutils)/libexec/gnubin:/usr/local/bin:/usr/local/sbin:$PATH | |
export GOPATH=$HOME/go | |
export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx | |
export CLICOLOR=1 | |
alias k=kubectl | |
alias cat=bat | |
alias preview="fzf --preview 'bat --color \"always\" {}'" | |
# add support for ctrl+o to open selected file in VS Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kubectl exec db-mongodb-replicaset-0 -- sh -c 'mongo --quiet --eval="printjson(rs.isMaster().primary)"' | sed 's/"//g' | awk -F\. '{print $1}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Perform a best effort extraction of up to two initials from a space delimited name string | |
* @param {string} text The text | |
* @return {string} The result | |
*/ | |
function initials(text) { | |
if (!text) { | |
return "" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component, PureComponent } from "react" | |
import PropTypes from "prop-types" | |
import { | |
StyleSheet, | |
View, | |
Text, | |
ViewPropTypes, | |
TouchableWithoutFeedback, | |
SectionList | |
} from "react-native" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# disable stackdriver logging in the cluster | |
gcloud beta container clusters update [CLUSTER_NAME] --logging-service none | |
# delete the label on the specific node | |
kubectl label nodes [NODE_NAME] beta.kubernetes.io/fluentd-ds-ready- | |
# apply config | |
kubectl apply -f https://raw.githubusercontent.com/GoogleCloudPlatform/kubernetes-engine-customize-fluentd/master/kubernetes/fluentd-configmap.yaml | |
# apply daemonset | |
kubectl apply -f https://raw.githubusercontent.com/GoogleCloudPlatform/kubernetes-engine-customize-fluentd/master/kubernetes/fluentd-daemonset.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://download.geonames.org/export/zip/US.zip | |
mongoimport -d mydb -c zipcodes \ | |
--columnsHaveTypes --type tsv --file US.txt \ | |
--stopOnError --drop \ | |
--fields="countryCode.string(),postalCode.string(),placeName.string(),adminName1.string(),adminCode1.string(),adminName2.string(),adminCode2.string(),adminName3.string(),adminCode3.string(),latitude.double(),longitude.double(),accuracy.string()" |