Skip to content

Instantly share code, notes, and snippets.

View thomasvincent's full-sized avatar

Thomas Vincent thomasvincent

  • Relenz, LLC
  • San Francisco, California, USA
View GitHub Profile
@thomasvincent
thomasvincent / Makefile
Created June 12, 2024 22:23
Modern Go Makefile
# --- Project Configuration ---
PACKAGE := hellogopher
DATE ?= $(shell date +%FT%T%z)
VERSION ?= $(shell git describe --tags --always --dirty --match=v* 2> /dev/null || echo v0)
# --- Go Configuration ---
BIN := ./bin # Binary output directory
PKGS := $(shell go list ./... | grep -v /vendor/)
TESTPKGS := $(shell go list -f '{{ if or .TestGoFiles .XTestGoFiles }}{{ .ImportPath }}{{ end }}' ./...)
GO := go
variable "aws_access_key" {
type = string
description = "AWS access key ID"
sensitive = true // Mark as sensitive for security
}
variable "aws_secret_key" {
type = string
description = "AWS secret access key"
sensitive = true // Mark as sensitive for security
variable "vpc_id" {
type = string
description = "VPC ID for the instance"
default = "{{env `BUILD_VPC_ID`}}"
}
variable "subnet_id" {
type = string
description = "Subnet ID for the instance"
default = "{{env `BUILD_SUBNET_ID`}}"
"""
Author: Thomas Vincent
Date: June 12, 2024
Gist: https://gist.github.com/thomasvincent/2bb5cf173756df8b7d8d784e2382560a
Description: This script moves files from Amazon S3 to an SFTP server, triggered by S3 events or by retrying failed messages from an SQS queue.
"""
import argparse
import json
@thomasvincent
thomasvincent / Athena.py
Last active June 12, 2024 22:07
Athena query in python
#!/usr/bin/env python3
"""
Author: Thomas Vincent
Date: June 12, 2024
Gist: https://gist.github.com/thomasvincent/0880d8d38e596d5442daaa58e9cfff74
This script executes Athena queries to create and manage a database and table,
then runs additional queries against the data.
"""
@thomasvincent
thomasvincent / backups3.sh
Last active August 8, 2017 16:43
S3 backup script
#!/bin/bash
##############################################################################
#
# S3 Backup Script
#
# Author: Thomas Vincent
# Based on template used for all Thomas Vincent shell scripts
#
# If your going to run this under OS X, you need to install GNU grep via brew
#
aws --output text iam list-users | awk '{print $NF}' | xargs -P10 -n1 aws --output text iam list-access-keys --user-name

Keybase proof

I hereby claim:

  • I am thomasvincent on github.
  • I am thomasvincent (https://keybase.io/thomasvincent) on keybase.
  • I have a public key ASD8QIkRNu1btUnnV63PTZdmj84UAYEkIEz-FC1pJd2hSAo

To claim this, I am signing this object:

# Based on https://github.com/gitlabhq/gitlab-ci-runner/blob/master/Dockerfile
# by Sytse Sijbrandij <sytse@gitlab.com>
# This script will start a runner in a docker container.
#
# First build the container and give a name to the resulting image:
# docker build -t codingforce/gitlab-ci-runner-testkitchen github.com/codingforce/gitlab-ci-runner-testkitchen
#
# Then set the environment variables and run the gitlab-ci-runner in the container:
# docker run -e CI_SERVER_URL=https://ci.example.com -e REGISTRATION_TOKEN=replaceme -e HOME=/root -e GITLAB_SERVER_FQDN=gitlab.example.com codingforce/gitlab-ci-runner-testkitchen
@thomasvincent
thomasvincent / hc-vcs.py
Created July 29, 2014 01:46
fix for hc-vcs.py
#!/usr/bin/env python
import hcvcs, time, os
"""
Health Check script:
1. Dump / report cluster configuration data.
a. How many nodes do you need to start the cluster? (/etc/gabtab)
b. How is LLT configured? (lltconfig -T query)
c. What are the members of the cluster and their status?