Skip to content

Instantly share code, notes, and snippets.

View abatilo's full-sized avatar

Aaron Batilo abatilo

View GitHub Profile
---
apiVersion: argoproj.io/v1alpha1
kind: AnalysisTemplate
metadata:
name: integrationtests
spec:
metrics:
- name: integrationtests
failureLimit: 0
provider:
@abatilo
abatilo / Dockerfile
Created July 3, 2020 15:46
Example failure of precompiling failing on empty projects
FROM golang:1.14-alpine as backend
# Precompile standard library
RUN CGO_ENABLED=0 GOOS=linux go install -v -a std
# Install dependencies
WORKDIR /go/src/cache-failure
COPY ./go.mod ./go.sum ./
SHELL ["/bin/ash", "-o", "pipefail", "-c"]
RUN go mod graph | awk '{if ($1 !~ "@") print $2}' | xargs go get -v
@abatilo
abatilo / app.yaml
Created February 16, 2020 20:00 — forked from akhenakh/app.yaml
Example of graceful shutdown with grpc healthserver * httpserver
readinessProbe:
exec:
command: ["/root/grpc_health_probe", "-addr=:6666"]
initialDelaySeconds: 1
livenessProbe:
exec:
command: ["/root/grpc_health_probe", "-addr=:6666"]
initialDelaySeconds: 2
imagePullPolicy: IfNotPresent
@abatilo
abatilo / vpc_endpoint.tf
Created October 23, 2019 13:18
Basic example of a vpc_endpoint in Terraform
resource "aws_vpc_endpoint" "s3" {
vpc_id = "${aws_vpc.main.id}"
service_name = "com.amazonaws.us-west-2.s3"
tags = {
Environment = "test"
}
}
@abatilo
abatilo / gen.py
Created June 1, 2019 03:56
Time based uuid
import random
from datetime import datetime, timezone
BASE62 = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
def encode(num, alphabet=BASE62):
"""Encode a positive number in Base X
Arguments:
- `num`: The number to encode
- `alphabet`: The alphabet to use for encoding
@abatilo
abatilo / req.py
Created March 3, 2019 21:29
Use a single aiohttp session to make multiple HTTP requests concurrently using asyncio
import asyncio
from aiohttp import ClientSession
async def fetch(url, session):
async with session.get(url) as response:
return await response.json()
async def main():
url = 'http://localhost:8000'
@abatilo
abatilo / evernoteDate
Created September 11, 2018 01:53
Create the header for a new day in evernote
#!/bin/sh
date -u +"%a, %Y-%m-%d" | xclip -sel clip
echo "Evernote header date has been copied to your clipboard"
@abatilo
abatilo / shortiso
Created September 11, 2018 01:49
Copy a short ISO8601 date to the clipboard
#!/bin/sh
date -u +"%Y-%m-%d" | xclip -sel clip
echo "Short ISO 8601 date has been copied to your clipboard."
@abatilo
abatilo / iso8601
Created September 11, 2018 01:49
Copy an ISO8601 timestamp to the clipboard
#!/bin/sh
date -u +"%Y-%m-%dT%H:%M:%SZ" | xclip -sel clip
echo "ISO 8601 compliant timestamp has been copied to your clipboard."