Skip to content

Instantly share code, notes, and snippets.

View eshleebien's full-sized avatar

Esh Romero eshleebien

View GitHub Profile

Become a Certificate Authority

Create config

>crt.cfg cat <<-EOF
RANDFILE = NV::HOME/.rnd
[ req ]
default_bits = 2048
default_keyfile = ca.key
@eshleebien
eshleebien / kube-api-drain.sh
Created July 19, 2019 08:34
kubectl drain using kubernetes api
HOSTNAME=`curl -s http://169.254.169.254/latest/meta-data/local-hostname`
SERVER=$1
TOKEN=$2
curl -s --insecure -k -v -H "Accept: application/json" -H "Authorization: Bearer $TOKEN" -XPATCH -d '{"spec":{"unschedulable":true}}' -H "Content-Type: application/merge-patch+json" $SERVER/api/v1/nodes/$HOSTNAME
for each in $(curl -s -k -H "Authorization: Bearer $TOKEN" --insecure -XGET $SERVER/api/v1/namespaces | jq -r '.items[].metadata.name');
do arr=($(curl -s -k -H "Authorization: Bearer $TOKEN" --insecure -XGET $SERVER/api/v1/namespaces/$each/pods | jq --arg node $HOSTNAME -r '.items[] | select(.spec.nodeName == $node) | .metadata.name'));
for i in ${arr[@]};
@eshleebien
eshleebien / k8s-update-secret.md
Created January 2, 2019 08:01 — forked from dleske/k8s-update-secret.md
k8s: Updating a Secret

Hopefully helped another k8s newbie with the following. The question was, how do you update a single key in a secret in k8s? I don't know anything about secrets but I will probably want to know this in the future, so here we go.

First, to create a dummy secret:

apiVersion: v1
kind: Secret
metadata:
  name: test-secret
data:
@tkuther
tkuther / kubernetes-filebeat.yaml
Created July 12, 2018 12:33
Filebeat kubernetes config with nginx module for ingress-nginx
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: filebeat
namespace: kube-system
labels:
k8s-app: filebeat
spec:
template:
metadata:
@huangzhuolin
huangzhuolin / deploy-create-react-app-with-nginx.md
Last active April 5, 2024 11:09
[Deploy create-react-app(react-router) with nginx] #react #nginx

Create-react-app

Create React apps with no build configuration.

Thanks to create-react-app. It's saves a lot of my time. I remember several months ago I had to setup a lot just for a react app, webpack, babel, test environment and so on... Fortunately, everything becomes easy now. Though you have many choices of start boiler plate, you worth trying this.

React router

If you are build a SPA with react, you probably use react-router.

seleniumArgs = {
baseURL: 'https://selenium-release.storage.googleapis.com',
version: '2.48',
drivers: {
chrome: {
version: '2.25',
arch: process.arch,
baseURL: 'https://chromedriver.storage.googleapis.com'
},
firefox: {
@owenallenaz
owenallenaz / dnsCaller.js
Created January 13, 2017 17:53
Showing stalled file reads because of `dns.lookup`
var dns = require("dns");
var http = require("http");
var fs = require("fs");
var net = require("net");
dns.setServers(["127.0.0.1"]);
var makeCallLookup = function(cb) {
dns.lookup("testSlow.com", cb);
}
@milmazz
milmazz / imposter-handbook-links.md
Last active April 1, 2024 10:31
Useful links found in The Imposter's Handbook by Rob Conery