Skip to content

Instantly share code, notes, and snippets.

@tylrd
tylrd / install.sh
Created April 10, 2021 18:41
Gradle Enterprise Patch
#!/usr/bin/env bash
set -e
cd "${BASH_SOURCE%/*}"
K8S_NAMESPACE=gradle-enterprise
if [[ -z $K8S_NAMESPACE ]]; then
echo "Installing Gradle Enterprise"
else
echo "Installing Gradle Enterprise into 'gradle-enterprise' namespace..."
@tylrd
tylrd / demo.js
Last active October 8, 2018 19:55
Pass-through API for NodeJS lambda
const https = require('https');
const handler = async (event, context, callback) => {
const options = {
host: 'jsonplaceholder.typicode.com',
path: '/todos/1',
};
const postOptions = {
@tylrd
tylrd / open_tunnel.sh
Created September 16, 2018 23:12
SSH Tunneling
ssh -fTnNL 9090:<internal_hostname>:9090 <bastion_hostname>
# It kinda looks like "f-TunNeL" but without vowels. It's a "Fun Tunnel".
@tylrd
tylrd / certbot.sh
Last active March 17, 2021 18:59
Use certbot google-dns plugin to generate and store letsencyrpt certs
#!/usr/bin/env bash
project=""
domain=""
email=""
tmpdir=$(mktemp -d)
finish() {
rm -rf "$tmpdir"
}
@tylrd
tylrd / keybase.md
Created May 7, 2018 00:46
keybase.md

Keybase proof

I hereby claim:

  • I am tylrd on github.
  • I am taylord (https://keybase.io/taylord) on keybase.
  • I have a public key ASDInT__twGKB_gzMJRqr7Loy8c5GzVpEDsUpXDCCAm-Nwo

To claim this, I am signing this object:

@tylrd
tylrd / misc.md
Last active June 22, 2018 03:33
Useful Commands

Useful Misc Commands

Download and untar

$ curl -SL http://somewhere.com/path/to/something.tar.xz | tar xJv

View files in an archive

resource "google_compute_subnetwork" "subnet" {
count = "${length(var.subnetworks)}"
network = "${google_compute_network.default.self_link}"
ip_cidr_range = "${element(values(var.subnetworks), count.index)}"
name = "${var.env}-gcp-${var.region}-${element(keys(var.subnetworks), count.index)}"
}
@tylrd
tylrd / external_ip.sh
Last active February 24, 2018 04:08
Google Cloud Project commands
curl -s -H "Metadata-Flavor: Google" http://metadata.google.internal/computeMetadata/v1/instance/?recursive=true | jq -r '.networkInterfaces[0].accessConfigs[0].externalIp'
@tylrd
tylrd / idea.sh
Last active February 16, 2018 20:44
idea.sh
cat << "EOL" > /usr/local/bin/idea
#!/bin/sh
# check for where the latest version of IDEA is installed
IDEA=`ls -1d /Applications/IntelliJ\ * | tail -n1`
wd=`pwd`
# were we given a directory?
if [ -d "$1" ]; then
# echo "checking for things in the working dir given"
function killp () {
if (( $# == 0 ))
then
echo usage: killp portNumber1 portNumber2 ...
else
for i;do
PROCESS=$(lsof -t -i:$i)
if [[ $PROCESS ]]; then
kill -9 $PROCESS
echo "killed process $PROCESS"