Skip to content

Instantly share code, notes, and snippets.

@clrung
clrung / halconfig.py
Created Oct 26, 2020
Eases pain of sharing halconfig with teammates by syncing local version with AWS S3 and Secrets Manager
View halconfig.py
#!/usr/bin/env python3
import argparse
import base64
import boto3
import datetime
import distutils.dir_util
import json
import os
import re
@clrung
clrung / clone_all_repos.sh
Last active Apr 6, 2021
Clones all repos in a GitHub organization
View clone_all_repos.sh
#!/bin/bash
# Usage: clone_all_repos.sh [organization] <output directory>
ORG=$1
PER_PAGE=100
GIT_OUTPUT_DIRECTORY=${2:-"/tmp/${ORG}_repos"}
if [ -z "$GITHUB_TOKEN" ]; then
echo -e "Variable GITHUB_TOKEN isn't set! Please specify your GitHub token.\n\nMore info: https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/"
exit 1
View expanded.upbot.tmpl.yaml
kind: Secret
apiVersion: v1
metadata:
name: upbot
data:
slack_token: U3VwM3IkZWNyZTd0MGtlbgo=
View upbot.tmpl.yaml.expanded
kind: Secret
apiVersion: v1
metadata:
name: upbot
data:
slack_token: U3VwM3IkZWNyZTd0MGtlbgo=
View upbot.tmpl.yaml
kind: Secret
apiVersion: v1
metadata:
name: upbot
data:
slack_token: $((slack_token|base64))
View keybase.md

Keybase proof

I hereby claim:

  • I am clrung on github.
  • I am clrung (https://keybase.io/clrung) on keybase.
  • I have a public key ASAR1J34__AweBxY3uawb20oxtOBUP3cLiEYtNjtwHTtOgo

To claim this, I am signing this object:

View Jenkinsfile
#!groovy
import groovy.json.JsonOutput
import java.util.Optional
import hudson.tasks.test.AbstractTestResultAction
import hudson.model.Actionable
import hudson.tasks.junit.CaseResult
def speedUp = '--configure-on-demand --daemon --parallel'
def nebulaReleaseScope = (env.GIT_BRANCH == 'origin/master') ? '' : "-Prelease.scope=patch"
@clrung
clrung / tail_log_until_string_found.sh
Created Mar 23, 2017
Tails a log until a string is found
View tail_log_until_string_found.sh
#!/bin/bash
# Date: 12/28/2016
# Author: Christopher Rung
# Description: Tails a log until a (case-insensitive) string is found
# Usage: ./tail_log_until_string_found.sh [host] [log file] [search term] [timeout]
# Example: ./tail_log_until_string_found.sh server /var/log/clrung/application.log "finished" 5m
# Exit codes: 0: successful; the search term was found in the log within the specified timeout
# 1: unsuccessful; the search term was not found in the log within the specified timeout
HOST=$1
@clrung
clrung / jekyll.conf
Created Apr 6, 2016
Service to generate jekyll sites
View jekyll.conf
description "Jekyll"
author "Christopher Rung<clrung@gmail.com>"
# adapted from https://gist.github.com/hazanjon/8725263#file-jekyll-conf
env SITENAME=[site name here-just used for log name; I used christopherrung.com]
env SOURCE=[Jekyll source directory; I used /home/clrung/Dropbox/website]
env SITEDIR=[output directory here; I used /var/www/christopherrung.com/]
env JEKYLL=/usr/local/bin/jekyll
#Make sure mounting is completed before starting