Skip to content

Instantly share code, notes, and snippets.

J. Elliot Taylor jaytaylor

Block or report user

Report or block jaytaylor

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jaytaylor
jaytaylor / ubuntu-18.04-web-server-init.sh
Created Nov 3, 2019
Common Ubuntu server setup for LAMP-ish configuration.
View ubuntu-18.04-web-server-init.sh
#!/usr/bin/env bash
set -o errexit
set -o pipefail
set -o nounset
if [ "$1" = '-v' ] ; then
set -o xtrace
shift
fi
@jaytaylor
jaytaylor / java-format-cleanup.sh
Created Oct 8, 2019
Perl-based Java codebase aesthetics format scrubber.
View java-format-cleanup.sh
#!/usr/bin/env bash
set -o errexit
set -o pipefail
set -o nounset
for f in $(find . -name '*.java'); do
perl \
-0 \
-i \
@jaytaylor
jaytaylor / math.sh
Created Aug 8, 2019
Math functions from python as bash "builtins".
View math.sh
#!/usr/bin/env bash
##
#
# @author Jay E. Taylor <jay@jaytaylor.com>
#
# @description Math functions for bash!
#
##
@jaytaylor
jaytaylor / ._README.md
Last active Jul 19, 2019
Bash shell programming snippets quick reference
View ._README.md

Bash shell programming snippets

Quick references to common and useful bash programming snippets

@jaytaylor
jaytaylor / ._README.md
Last active Jul 23, 2019
URL shortener Base-62 encoder / decoder C++ Proof-of-Concept
View ._README.md
@jaytaylor
jaytaylor / fix-helm-k8s-missing-priorityClass.md
Created Jun 28, 2019
Manual fix for missing priorityClass after helm upgrade
View fix-helm-k8s-missing-priorityClass.md

Problem Statement

I've been hitting cases where kubernetes cluster actions are blocked due to priorityClass being absent after a helm install --upgrade.

For example:

  Type     Reason        Age                  From                    Message
  ----     ------        ----                 ----                    -------
  Warning  FailedCreate  3m (x1405 over 11h)  statefulset-controller  create Pod elasticsearch-data-2 in StatefulSet elasticsearch-data failed error: pods "elasticsearch-data-2" is forbidden: no PriorityClass with name elasticsearch-data was found```
@jaytaylor
jaytaylor / dircnt-jay.c
Created Jun 10, 2019
Linux file and directory counter under one or more paths.
View dircnt-jay.c
/**
* dircnt.c - a fast file-counting program.
*
* Written 2015-02-06 by Christopher Schultz as a programming demonstration
* for a StackOverflow answer:
* https://stackoverflow.com/questions/1427032/fast-linux-file-count-for-a-large-number-of-files/28368788#28368788
*
* This code is licensed under the Apache License 2.0. Please read the file
* LICENSE for more information.
*
@jaytaylor
jaytaylor / md5sum_multi_part.go
Last active Jun 3, 2019
High-performance multi-threaded MD5 hash calculator for multi-part file uploads to S3 / object storage.
View md5sum_multi_part.go
package main
// Also see the Python version: https://gist.github.com/jaytaylor/76de9c99acbfac637e68f78809dbd27e
import (
"bytes"
"crypto/md5"
"encoding/base64"
"fmt"
"io"
@jaytaylor
jaytaylor / md5sum_multi_part.py
Last active Jun 3, 2019
MD5 hash calculator for multi-part file uploads to S3 / object storage.
View md5sum_multi_part.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
@author Jay E. Taylor <outtatime@gmail.com>
@date 2019-06-03
@description MD5 hash calculator for multi-part file uploads to S3 / object storage.
@jaytaylor
jaytaylor / k8s-delete-ns-resources.sh
Created Mar 4, 2019
Delete all resources from a Kubernetes namespace.
View k8s-delete-ns-resources.sh
#!/usr/bin/env bash
#
# @author Jay Taylor [jaytaylor.com](https://jaytaylor.com)
#
# @date 2019-03-04
#
# Sometimes Kubernetes seems to get stuck and doesn't
# delete the contents of a namespace from my cluster after
# `kubectl delete namespace X` has been run.
You can’t perform that action at this time.