Skip to content

Instantly share code, notes, and snippets.

@ejlevin1
ejlevin1 / script.sh
Last active December 10, 2021 16:58
sudo su
unset HISTFILE
cat /etc/os-release
exit
history
# Check History:
unset HISTFILE
sudo su
unset HISTFILE
echo "test worked"

Update Deployment (force refresh)

kubectl set env deployment nginx-admin DEPLOY_DATE="$(date)"

Follow logs (pretty-print)

kubectl logs rs-oidc-d58f7dccf-wfzl7 --follow | tee >(grep -v "^{") | grep "^{" | jq . kubectl logs $(k8p rs-oidc) --follow | tee >(grep -v "^{") | grep "^{" | jq . Reference

export MYZK=z-2.kafka-cluster-dev.wi53u7.c7.kafka.us-east-1.amazonaws.com:2181 kafka-topics --list --zookeeper ${MYZK} | xargs

@ejlevin1
ejlevin1 / example-commands
Last active August 26, 2021 00:59
rsi script runners
# Example command for running within osx:
curl -s -L https://bit.ly/rs-rsi-osx | bash
@ejlevin1
ejlevin1 / index.json
Created March 27, 2021 17:47
ElasticSearch Quick Example Files
{
"section-launches": {
"aliases": {},
"mappings": {
"properties": {
"processKey": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
#!/usr/bin/python3
import os, sys, getopt
import syslog
def log(s):
print(s)
syslog.syslog(s)
def main(argv):
directory = os.popen('pwd').read().split("\n")[0]
@ejlevin1
ejlevin1 / docker-log-util.sh
Created October 17, 2020 17:02
Script to follow or purge a docker container log by id or name.
#!/bin/bash
set -e
set -u
set -o pipefail
debug=0
purge=0
follow=0
while getopts 'c:fpn:v' OPTION; do
@ejlevin1
ejlevin1 / inotifywait-folder-watcher.sh
Created March 21, 2019 17:33
Script that copies files written to a specific folder to a different backup folder.
#!/bin/bash
SRC_DIR=$1
DST_DIR=$2
if ! [ -d "$SRC_DIR" ]; then
echo "Directory specified to watch does not exist."
fi
if ! [ -d "$DST_DIR" ]; then
public static class MessageConverter
{
private static InheritedTypeConverter<IMessage> _default = null;
public static InheritedTypeConverter<IMessage> Default
{
get
{
// TODO would be nice to have an attribute I could plug onto classes and have it "auto" find the classes through an assembly
if (_default == null)
return {
value: "this works"
}
return
{
value: "this doesn't work"
}