Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am lopcode on github.
  • I am carrot (https://keybase.io/carrot) on keybase.
  • I have a public key ASAZjN3hpzbhivNauI_C1A8qprDIefU31MpYN3PiAujZsgo

To claim this, I am signing this object:

FROM --platform=$TARGETPLATFORM eclipse-temurin:18-jdk as jre-build
ARG jar
ARG docs
WORKDIR /app
RUN mkdir build
ADD $jar build/service.jar
RUN jdeps \
--ignore-missing-deps \
--multi-release 18 \
package sponsor.api.fetcher
import io.ktor.client.HttpClient
import io.ktor.client.call.receive
import io.ktor.client.request.header
import io.ktor.client.request.parameter
import io.ktor.client.request.request
import io.ktor.client.statement.HttpResponse
import io.ktor.http.HttpMethod
import kotlinx.serialization.SerialName
@lopcode
lopcode / Dockerfile
Created February 21, 2021 23:10
Example of filtering RDS region-specific certificates, installed to an OpenJDK Docker image, to speed up image build time (eu-west-2)
FROM openjdk:16-jdk-buster
LABEL org.opencontainers.image.source="https://github.com/KaleCharity/snip"
ARG jar
ADD $jar /service.jar
RUN curl -sS "https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem" > rds-combined-ca-bundle.pem
RUN awk 'split_after == 1 {n++;split_after=0} /-----END CERTIFICATE-----/ {split_after=1}{print > "rds-ca-" n ".pem"}' < rds-combined-ca-bundle.pem
RUN for CERT in rds-ca-*; do \
@lopcode
lopcode / install_nomad_server.yaml
Last active July 25, 2018 22:08
Simple Nomad installation and updating using Ansible
# To update to a new version of Nomad:
# Download and calculate checksums:
# http --download https://releases.hashicorp.com/nomad/0.8.4/nomad_0.8.4_linux_amd64.zip
# shasum --algorithm 256 --binary nomad_0.8.4_linux_amd64.zip
# unzip nomad_0.8.4_linux_amd64.zip
# shasum --algorithm 256 --binary nomad
# Update facts in this script
# Only run on one hashimaster at a time!
- name: Set nomad version
fun extractGraphemeClusters(input: String): List<String> {
val characters = mutableListOf<String>()
val iterator = BreakIterator.getCharacterInstance()
iterator.setText(input)
var start = iterator.first()
var iterated = false
while (!iterated) {
val next = iterator.next()
@lopcode
lopcode / code-of-conduct.md
Last active July 20, 2017 17:37
#compsoc code of conduct

#compsoc Code of Conduct

#compsoc aims at being a nice place to chat about computer related things for anyone involved with Edinburgh University.

With that in mind, there is a single rule:

  • Be nice

Not being nice could include:

Keybase proof

I hereby claim:

  • I am carrotcodes on github.
  • I am carrot (https://keybase.io/carrot) on keybase.
  • I have a public key ASDeLjES8LMAdIUKm3q9b_KJyaVRIfO9Vn1du1paiU4q5wo

To claim this, I am signing this object:

@lopcode
lopcode / CLA-WillowChat.md
Created January 14, 2017 14:35
CLA-WillowChat

Contributor License Agreement

The following terms are used throughout this agreement:

  • You - the person or legal entity including its affiliates asked to accept this agreement. An affiliate is any entity that controls or is controlled by the legal entity, or is under common control with it.
  • Project - is an umbrella term that refers to any and all WillowChat open source projects.
  • Contribution - any type of work that is submitted to a Project, including any modifications or additions to existing work.
  • Submitted - conveyed to a Project via a pull request, commit, issue, or any form of electronic, written, or verbal communication with WillowChat, contributors or maintainers.

1. Grant of Copyright License.

Contributor License Agreement

The following terms are used throughout this agreement:

  • You - the person or legal entity including its affiliates asked to accept this agreement. An affiliate is any entity that controls or is controlled by the legal entity, or is under common control with it.
  • Project - is an umbrella term that refers to any and all CarrotCodes open source projects.
  • Contribution - any type of work that is submitted to a Project, including any modifications or additions to existing work.
  • Submitted - conveyed to a Project via a pull request, commit, issue, or any form of electronic, written, or verbal communication with CarrotCodes, contributors or maintainers.

1. Grant of Copyright License.