Skip to content

Instantly share code, notes, and snippets.

@rmchale
rmchale / mkver.conf
Created January 8, 2022 17:40
mkver.conf for main
# prefix for tags in git
tagPrefix: v
# defaults are used if they are not overriden by a branch config
defaults {
# whether to really tag the branch when `git mkver tag` is called
tag: false
# message for annotated version tags in git
tagMessageFormat: "release {Tag}"
# format tring for the pre-release. The format must end with {PreReleaseNumber} if it is used.
# Examples:
@rmchale
rmchale / Makefile
Last active December 1, 2021 18:40
Makefile template borrowed from MIke Small
.PHONY: clean init plan apply format lint validate
## hello
hello:
@echo "hello world"
# https://stackoverflow.com/a/25668869
# https://stackoverflow.com/a/19107231
ifeq (, $(shell which fzf))
# simple, brief make rules help generated from comments in Makefile.
@rmchale
rmchale / Makefile
Last active August 28, 2021 18:02
My makefile template
SHELL := /bin/bash
.DEFAULT_GOAL := help
hello: ## hello
@echo "hello world"
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
@rmchale
rmchale / Dockerfile
Created May 24, 2020 15:22
Gcloud Dockerfile
from debian:stable
# install gcloud
RUN apt-get install -y lsb-release
RUN apt-get install -y gnupg2
RUN echo "deb http://packages.cloud.google.com/apt cloud-sdk-$(lsb_release -c -s) main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
# RUN cat /etc/apt/sources.list.d/google-cloud-sdk.list
RUN apt-get update && apt-get install -y google-cloud-sdk
<html>
Test
<table class="mdl-data-table mdl-js-data-table mdl-data-table--selectable mdl-shadow--2dp">
<thead>
<tr>
<th class="mdl-data-table__cell--non-numeric">Material</th>
<th>Quantity</th>
<th>Unit price</th>
</tr>
</thead>
@rmchale
rmchale / apps.yml
Last active April 11, 2020 02:10
ChromeOS application setup
---
- name: Pixel slate apps
hosts: localhost
become: yes
tasks:
- shell: lsb_release -cs
register: release
import boto3
dynamodb = boto3.client('dynamodb', region_name='us-east-2')
dynamodb.put_item(TableName='emails',
Item={
'id': {'S': 'ryan.mchale@gmail.com'}
}
)
@rmchale
rmchale / gcedown.sh
Created November 26, 2019 20:44
gcedown
for i in `gcloud compute instances list --project=rmchale-1093 |grep -i mchale |grep RUNNING |awk '{ print $1 }'`
do
zone=$(gcloud compute instances list --project=rmchale-1093 |grep -i $i |awk '{ print $2 }')
yes Y | gcloud compute instances delete $i --zone=$zone --project=rmchale-1093
done
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-deployment
spec:
selector:
matchLabels:
run: hello
replicas: 1
template:
{"data":{"y":"ArrayList","v":[{"_":"com.ni.api.jobtrain.model.Job","id":849,"jobType":"create-audience","jobRequests":[{"id":708,"userEmail":"","jobType":"create-audience","startDateTime":1387308666742,"status":0,"rank":708000,"runImmediately":false,"partitionLocks":[{"attribute":"media_v3.authored_month","value":"2012-10","lockType":0},{"attribute":"media_v3.authored_month","value":"2012-11","lockType":0},{"attribute":"media_v3.authored_month","value":"2012-12","lockType":0}],"parameters":[{"key":"audienceId","value":"126680"},{"key":"blocklistFileName","value":"global_blocklist.txt"},{"key":"blocklistUrl","value":"hdfs://nn1.colo.networkedinsights.com:8020/ods/global_blocklist.txt"},{"key":"classifierDefinitions","value":"hdfs://nn1.colo.networkedinsights.com:8020/classification/gender_classifier.json"},{"key":"endMonth","value":"{partitionValue}"},{"key":"esClusterName","value":"esaud_cluster1"},{"key":"esHosts","value":"esaud1.colo.networkedinsights.com,esaud2.colo.networkedinsights.com,esaud3.colo.networ