Skip to content

Instantly share code, notes, and snippets.

Tom Davidson tomdavidson

Block or report user

Report or block tomdavidson

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
@tomdavidson
tomdavidson / README.md
Last active Jun 3, 2020
mono repo tool to id dirs with files that have changed
View README.md

lolaus

A simple monorepo lifecycle/pipeline tool for running one or more commands on one or more directories that have diffs compared to an ancestor. The primary use case is selective CI jobs within a trunk based workflow such Git Flow.

Usage

lolaus has for optional positional arguments: lolaus [glob] [command] [target_ref] [source_ref]

@tomdavidson
tomdavidson / userinit.sh
Created Apr 15, 2015
Android route hotspot traffic over vpn
View userinit.sh
##!/system/bin/sh
iptables -t filter -F FORWARD
iptables -t nat -F POSTROUTING
iptables -t filter -I FORWARD -j ACCEPT
iptables -t nat -I POSTROUTING -j MASQUERADE
ip rule add from 192.168.43.0/24 lookup 61
ip route add default dev tun0 scope link table 61
ip route add 192.168.43.0/24 dev wlan0 scope link table 61
ip route add broadcast 255.255.255.255 dev wlan0 scope link table 61
@tomdavidson
tomdavidson / tf-config-files.tf
Created Dec 5, 2019
Terraform example loading config from dir of files
View tf-config-files.tf
variable "config_files_path" {
default = "../../teams/*.yaml"
description = "The path to team config files"
}
data "local_file" "configs" {
for_each = { for k, file in fileset(dirname(var.config_files_path), basename(var.config_files_path)) :
k => abspath("${dirname(var.config_files_path)}/${file}")
}
View lolaus.sh
#!/usr/bin/env bash
help() {
cat <<EOF
Simple monorepo lifecycle/pipeline tool for running one or more commands on one
or more directories that have diffs compared to an ansector. The primary
use case is for selective CI jobs within a trunk based workflow.
Takes two arguments, <glob> <command>. The command is invoked from each
directory context matching the glob.
@tomdavidson
tomdavidson / ghteams.tf
Last active Sep 3, 2019
tf to create children teams after looking up parent ids
View ghteams.tf
## Existing list of teams with members list:
"0" = {
"description" = "No one cared enough to add a description to this team"
"members" = [
{
"role" = "maintainer"
"username" = "bob"
},
{
@tomdavidson
tomdavidson / main.tf
Created Sep 1, 2019
the find file sub mod
View main.tf
variable "filter" {
type = string
default = "*.yaml"
description = "The pattern used to filter files, i.e. '*.yaml'."
}
variable "search_dir" {
type = string
default = "."
description = "The the directory to search from. Default is '.'."
View gist:26a05aff8b31ee85338ae3b348732dd8
$ terraform plan
2019/09/01 02:45:19 [INFO] Terraform version: 0.12.7
2019/09/01 02:45:19 [INFO] Go runtime version: go1.12.9
2019/09/01 02:45:19 [INFO] CLI args: []string{"/home/tom/.asdf/installs/terraform/0.12.7/bin/terraform", "plan"}
2019/09/01 02:45:19 [DEBUG] Attempting to open CLI config file: /home/tom/.terraformrc
2019/09/01 02:45:19 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2019/09/01 02:45:19 [INFO] CLI command args: []string{"plan"}
2019/09/01 02:45:19 [TRACE] Meta.Backend: no config given or present on disk, so returning nil config
2019/09/01 02:45:19 [TRACE] Meta.Backend: backend has not previously been initialized in this working directory
2019/09/01 02:45:19 [DEBUG] New state was assigned lineage "156a7836-272f-0a26-f953-8f8fc4b37f8b"
@tomdavidson
tomdavidson / install_gnucmd_osx.sh
Created Jul 19, 2015
Installs GNU Command Line Tools & then some.
View install_gnucmd_osx.sh
#!/usr/bin/env bash
# Installs GNU Command Line Tools & then some. Requires homebrew.
# Most are newer and more powerful that than OSX’s but also solves most OS compatibility issues
echo "Installing GNU coreutils and various."
export PATH="$(brew --prefix coreutils)/libexec/gnubin:/usr/local/bin:$PATH"
brew install coreutils
brew install binutils
brew install diffutils
brew install ed --with-default-names
brew install findutils --with-default-names
@tomdavidson
tomdavidson / config.tf
Last active Feb 24, 2018
tectonic-installer#3025
View config.tf
/**
* Defaults and other config items for the K8S Installer
*
*/
terraform {
backend "s3" {}
required_version = ">= 0.10.7"
}
You can’t perform that action at this time.