Skip to content

Instantly share code, notes, and snippets.

---
AWSTemplateFormatVersion: "2010-09-09"
Resources:
BucketA:
Type: AWS::S3::Bucket
DeletionPolicy: Delete
Properties:
ObjectLockEnabled: true
# In both B and C, CloudFormation seems to create the buckets (a CreateBucket appears in
---
AWSTemplateFormatVersion: "2010-09-09"
Description: >-
Creates a basic setup with an application load balancer and several EC2 instances
spread across various subnets. The application is deployed in a two-tier architecture.
A VPC is created. Each AZ has two subnets (public and private). Instances live in the
private subnet and the load balancer, gateways, and other supporting resources live in
the public subnet.
@kylelaker
kylelaker / PKGBUILD
Created March 4, 2021 02:03
Failing Dockerfile with podman
FROM docker.io/archlinux:base-devel
ARG PKGBUILD
RUN pacman -Syu --noconfirm git sudo \
&& useradd -Um builduser \
&& echo "builduser ALL=(ALL) NOPASSWD: ALL" | tee -a /etc/sudoers \
&& mkdir /home/builduser/pkg \
&& chown -R builduser:builduser /home/builduser/pkg
@kylelaker
kylelaker / PKGBUILD
Last active February 28, 2021 21:58
python-readchar PKGBUILD
pkgname=python-readchar
pkgver=3.0.3
pkgrel=1
pkgdesc="Python library to read characters and key strokes"
arch=("any")
url="https://github.com/magmax/python-readchar"
license=("MIT")
depends=("python")
makedepends=("python-setuptools" "flake8")
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/magmax/python-readchar/archive/v$pkgver.tar.gz"
#!/usr/bin/env python3
"""
Implements a string truncation service. Requires a Lexmark printer.
"""
import asyncio
import base64
import click
@kylelaker
kylelaker / PKGBUILD
Created March 20, 2020 01:34
aws-cli-v2 PKGBUILD
pkgname=aws-cli-v2
pkgver=2.0.4
pkgrel=1
pkgdesc='Universal Command Line Interface for Amazon Web Services version 2'
arch=('i686' 'x86_64')
url='https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html'
license=('Apache')
provides=('aws-cli')
conflicts=('aws-cli')
makedepends=('python-setuptools')
FROM archlinux:latest
COPY test-pkgbuild.sh /usr/bin/test-pkgbuild.sh
RUN pacman -Syu --noconfirm sudo base-devel \
&& useradd -m builduser \
&& echo "builduser ALL=(ALL) NOPASSWD: ALL" | tee -a /etc/sudoers
USER builduser
2020/02/20 19:02:22 [INFO] Packer version: 1.5.4 [go1.13.7 linux amd64]
2020/02/20 19:02:22 Checking 'PACKER_CONFIG' for a config file path
2020/02/20 19:02:22 'PACKER_CONFIG' not set; checking the default config file path
2020/02/20 19:02:22 Attempting to open config file: /home/lakerka/.packerconfig
2020/02/20 19:02:22 [WARN] Config file doesn't exist: /home/lakerka/.packerconfig
2020/02/20 19:02:22 Setting cache directory: /home/lakerka/Documents/cs-vm-build/packer/hcl/packer_cache
2020/02/20 19:02:22 Creating plugin client for path: /home/lakerka/Documents/cs-vm-build/packer/hcl/packer
2020/02/20 19:02:22 Starting plugin: /home/lakerka/Documents/cs-vm-build/packer/hcl/packer []string{"/home/lakerka/Documents/cs-vm-build/packer/hcl/packer", "plugin", "packer-builder-virtualbox-iso"}
2020/02/20 19:02:22 Waiting for RPC address for: /home/lakerka/Documents/cs-vm-build/packer/hcl/packer
2020/02/20 19:02:22 packer-builder-virtualbox-iso plugin: [INFO] Packer version: 1.5.4 [go1.13.7 linux amd64]
variable "vm_name" {
type = string
}
variable "semester" {
type = string
}
variable "mint_version" {
type = string
}
variable "build_id" {
@kylelaker
kylelaker / benford.py
Created November 6, 2019 04:07
Benford's Law w/ VA Election Data
#!/usr/bin/env python3
import json
import requests
url = "https://results.elections.virginia.gov/vaelections/2019%20November%20General/Json/GeneralAssembly.json"
results = {}
for i in range(1, 10):
results[str(i)] = 0