Skip to content

Instantly share code, notes, and snippets.

View alexjoedt's full-sized avatar
⛰️

Alex Joedt alexjoedt

⛰️
View GitHub Profile
package bytes
import (
"encoding/binary"
"io"
)
// ErrBufferOverflow is triggered when the buffer overflows.
var (
ErrBufferOverflow = errors.New("buffer overflow")
@alexjoedt
alexjoedt / get-grip.sh
Last active November 1, 2023 08:21
get-grip.sh
#!/bin/bash
set -euo pipefail
TEMP_DIR=""
install_grip() {
local PLATFORM=$1
local ARCH=$2
#!/bin/bash
# This script build docker images and create docker tags using git tags with Semantic Versioning pattern
# https://semver.org/spec/v2.0.0.html
# However, it only partially supports pre-release tags as mentioned in part 9 (https://semver.org/spec/v2.0.0.html#spec-item-9)
# Supported git tags: v1.0.0, v1.0.0-beta.1, v1.0.0-alpha.1
# Array of repos for the docker image
REPOS=("<REPO_URL_1>" "<REPO_URL_2>")
SEMANTIC_VERSION_PATTERN="^v([0-9]+)\.([0-9]+)\.([0-9]+)(-([A-Za-z-]+(\.[0-9A-Za-z-]+)?))?$"
@alexjoedt
alexjoedt / install_docker.sh
Last active November 6, 2023 11:58
Docker Install
#!/bin/bash
set -e -E -o pipefail
sudo apt-get update -y
sudo apt-get install \
ca-certificates \
curl \
gnupg
sudo mkdir -m 0755 -p /etc/apt/keyrings
#!/bin/bash
# shellcheck disable=SC2016
function install_go_tools {
if go version >/dev/null 2>&1 && curl -fLo "/tmp/go-tools.go" https://gist.githubusercontent.com/alexjoedt/9c61f9cc4ce211430257b2febd68be9f/raw/f45048da7b29d9037579bbf726db1ff39cfaeef3/tools.go; then
go run "/tmp/go-tools.go"
fi
}
function install_go {