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 / ._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 17, 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.
@jaytaylor
jaytaylor / rm-and-preserve-parent-mtime.py
Last active Nov 17, 2018
Removes a file or directory while preserving the modification time (mtime) of the parent directory.
View rm-and-preserve-parent-mtime.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Removes a file or directory while preserving the modification time (mtime) of
the parent directory.
Pure-python implementation.
"""
@jaytaylor
jaytaylor / backup-andromeda-db.sh
Last active Nov 14, 2018
Utility for backing up a remote Andromeda Postgres DB. Preserves only the past X database dumps.
View backup-andromeda-db.sh
#!/usr/bin/env bash
##
# @author J. Elliot Taylor (@jaytaylor)
#
# @date 2018-11-14
#
# @description Andromeda postgres DB remote backup utility.
#
@jaytaylor
jaytaylor / ansi_terminal_color_codes_cleaner.go
Created Oct 31, 2018
ANSI terminal color-codes cleaner for Go.
View ansi_terminal_color_codes_cleaner.go
package main
import (
"fmt"
"io/ioutil"
"regexp"
"github.com/spf13/cobra"
)
You can’t perform that action at this time.