Skip to content

Instantly share code, notes, and snippets.

View clcollins's full-sized avatar

Christopher Collins clcollins

View GitHub Profile
@clcollins
clcollins / get_node_hostname_labels
Created February 18, 2020 19:43
Scripts for patching a project namespace and deploying pods onto specified nodes in OpenShift
#!/usr/bin/env bash
oc get nodes -l type=compute -o=jsonpath='{range .items[*]}{.metadata.labels.hostname}{"\n"}{end}'
@clcollins
clcollins / bashrc_snippet.sh
Created December 9, 2019 14:55
Print all or an index of $GOPATH
# Without an argument, prints the current gopath
# With a integer argument, prints the directory at the index of a multi-directory GOPATH
gopath ()
{
if [ -z "$GOPATH" ]; then
echo "GOPATH not set...";
exit 1;
fi;
local gopath="${GOPATH}";
@clcollins
clcollins / sum-es-indices.py
Created November 12, 2019 17:35 — forked from portante/sum-es-indices.py
A script to generate a report of Elasticsearch index usage (from _cat/indices?v&bytes=b) by prefix for a set of known date suffixes.
#!/usr/bin/env python2
# A script to generate a report of Elasticsearch index usage
# (from _cat/indices?v&bytes=b) by prefix for a set of known
# date suffixes.
#
# E.g.
# $ curl -X GET http://localhost:9200/_cat/indices?v\&bytes=b -o indices.lis
# $ ./sum-es-indices.py indices.lis
#
@clcollins
clcollins / id_ed25518.pub
Created September 6, 2019 14:43
Throwaway Public Key
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMOHCYwjPmYsW9EKpuEQkMxolLijxMfqbXAT//34sGox
@clcollins
clcollins / oc-dummy-go.go
Last active August 12, 2019 18:21
Trying to figure out how to use client-go for oc and kubectl...
package main
import (
"flag"
"fmt"
"os"
"path/filepath"
// "time"
// "k8s.io/client-go/rest"
@clcollins
clcollins / main.go
Last active June 19, 2019 14:36
Help a Go Newbie
package main
import (
"fmt"
"os"
"path/filepath"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
@clcollins
clcollins / language_DWARF.txt
Created May 9, 2019 19:40
DwarfFortress Dwarf Language File
language_DWARF
[OBJECT:LANGUAGE]
[TRANSLATION:DWARF]
[T_WORD:ABBEY:kulet]
[T_WORD:ACE:alak]
[T_WORD:ACT:bidok]
[T_WORD:AFTER:nicol]
[T_WORD:AGE:anam]
@clcollins
clcollins / python_openshift_api_snippet.cson
Last active December 3, 2018 14:50
Atom Snippet: Python OpenShift Dynamic Client init function
# A snippet for instantiating an OpenShift dynamic client
# for working with the OpenShist Rest API
#
# Requires:
# OpenShift-RestClient-Python - https://github.com/openshift/openshift-restclient-python
# Kubernetes Python Client - https://github.com/kubernetes-client/python
#
# `pip3 install --user kubernetes && pip3 install --user openshift`
#
# import kubernetes
@clcollins
clcollins / WorkingWithDockerHub.md
Last active May 15, 2019 15:16
Working WIth Docker Hub

Working With Docker Hub

Documentation for creating/managing repositories and images for the STINGAR organization on Docker Hub.

NOTE: This should ONLY be done this way until we get some automation.

Before you start

@clcollins
clcollins / WorkingWithForks.md
Created July 30, 2018 16:47
Git Cheet Sheet

Working With Forks/Upstream

Get Upstream Tags

Update Git config

Add this to the [upstream] section in .git/config

fetch = +refs/tags/*:refs/tags/*