Skip to content

Instantly share code, notes, and snippets.

View dyipon's full-sized avatar

dy dyipon

  • iPon Computer
  • Eger, Hungary
View GitHub Profile
@olivierlambert
olivierlambert / deb12-generator.pkr.hcl
Last active June 25, 2024 17:59
Debian 12 generator for Packer on XCP-ng
packer {
required_plugins {
xenserver= {
version = "= v0.7.0"
source = "github.com/ddelnano/xenserver"
}
}
}
variable "remote_host" {
type = string
@eggplants
eggplants / ghcr.sh
Last active May 31, 2024 17:12
How to get information from ghcr Docker Registry HTTP API V2 with curl
#!/usr/bin/env bash
# ref: https://github.community/t/how-to-check-if-a-container-image-exists-on-ghcr/154836/3
# public image's {USER}/{IMAGE}
USER_IMAGE=eggplants/asciiquarium-docker
# get token ('{"token":"***"}' -> '***')
TOKEN="$(
curl "https://ghcr.io/token?scope=repository:${USER_IMAGE}:pull" |
awk -F'"' '$0=$4'
# Source: https://gist.github.com/c7cdfef142bd65cc744789d3c1e90170
###########################################
# Talos Linux: OS Designed For Kubernetes #
# https://youtu.be/iEFb2Zg4xUg #
###########################################
# Additional Info:
# - Talos Linux: https://www.talos.dev/
# - How To Create, Provision, And Operate Kubernetes With Cluster API (CAPI): https://youtu.be/8yUDUhZ6ako
######################################################
# Devtron #
# Kubernetes-Native User-Friendly CI, CD, and GitOps #
# https://youtu.be/ZKcfZC-zSMM #
######################################################
# Referenced videos:
# - Argo CD - Applying GitOps Principles To Manage Production Environment In Kubernetes: https://youtu.be/vpWQeoaiRM4
# - Argo Workflows and Pipelines - CI/CD, Machine Learning, and Other Kubernetes Workflows: https://youtu.be/UMaivwrAyTA
# - Argo Events - Event-Based Dependency Manager for Kubernetes: https://youtu.be/sUPkGChvD54
@nicedreams
nicedreams / bmenu.sh
Last active October 2, 2023 23:46
bmenu - Shell application launcher using fzf
#!/bin/bash
# bmenu - Shell application launcher using fzf.
# Searches $PATH for executable files and runs selected program.
# Fzf preview window shows info about file.
# Requires: fzf
# Usage: As script like ~/bin/bmenu or copy/paste bmenu() function in ~/.bashrc
bmenu() {
launchapp=$(IFS=':'; \
for p in ${PATH}; \
brew tap homebrew/cask-fonts
brew install --cask font-cascadia-code
brew install --cask font-cascadia-code-pl
brew install --cask font-cascadia-mono
brew install --cask font-cascadia-mono-pl
@zanonnicola
zanonnicola / k6_script.js
Created November 16, 2020 20:19
K6 Load test example
import { group, sleep, check } from "k6";
import { parseHTML } from 'k6/html';
import { Trend } from "k6/metrics";
import http from "k6/http";
import { randomIntBetween, uuidv4 } from "https://jslib.k6.io/k6-utils/1.0.0/index.js";
const usersToken = JSON.parse(open("./users.json"));
const URL = "https://myapp.com";
const TEST_NAME = "First Test - simple user flow";
@UrsaDK
UrsaDK / Caching multi-stage builds in GA.md
Last active July 9, 2024 14:34
Speed up your multistage builds in GitHub Actions

Caching multi-stage builds in GitHub Actions

Caching Docker builds in GitHub Actions is an excellent article by @dtinth which analyses various strategies for speeding up builds in GitHub Actions. The upshot of the article is a fairly decisive conclusion that the best two ways to improve build times are:

  1. Build images via a standard docker build command, while using GitHub Packages' Docker registry as a cache = Longer initial build but fastest re-build times.

  2. Build your images via docker integrated BuildKit (DOCKER_BUILDKIT=1 docker build), while using a local registry and actions/cache to persist build caches = Fastest initial build but slightly longer re-build times.

The problem

@ruanbekker
ruanbekker / k3s_on_alpine.md
Last active January 14, 2024 20:28
Install k3s on Alpine Linux
$ apk add --no-cache curl
$ echo "cgroup /sys/fs/cgroup cgroup defaults 0 0" >> /etc/fstab

$ cat > /etc/cgconfig.conf <<EOF
mount {
  cpuacct = /cgroup/cpuacct;
  memory = /cgroup/memory;
  devices = /cgroup/devices;
  freezer = /cgroup/freezer;
@movd
movd / create_docker_compose_basic_auth_string_for_traefik.sh
Last active January 20, 2024 19:27 — forked from TechupBusiness/create_docker_compose_basic_auth_string_for_traefik.sh
Generator to create basic authentication string for traefik (docker-compose.yml and .env)
#!/usr/bin/env bash
command -v docker >/dev/null 2>&1 || { echo >&2 "I require Docker but it's not installed. Aborting."; exit 1; }
echo "Basic auth for traefik >= v1.7"
read -p "User: " USER
read -p "Password: " PW
# Pull httpd:alpine image (small and includes httpasswd)
docker pull httpd:alpine >/dev/null 2>&1