Skip to content

Instantly share code, notes, and snippets.

View tuananh's full-sized avatar
☁️
Head of Tech Platform @ VPBank. AWS Community Builder

Tuan Anh Tran tuananh

☁️
Head of Tech Platform @ VPBank. AWS Community Builder
View GitHub Profile
@tuananh
tuananh / cilium.yaml
Created February 27, 2023 08:43
cilium melange
package:
name: cilium-cli
version: 0.13.0
epoch: 0
description: CLI to install, manage & troubleshoot Kubernetes clusters running Cilium
target-architecture:
- all
copyright:
- license: Apache-2.0
paths:
@tuananh
tuananh / intersection.sh
Created February 13, 2023 10:57
Bash: intersection of 2 lists
export LIST1=a b c d
export LIST2=b c d e f
INTERSECTION=($(comm -12 <(for X in "${LIST1[@]}"; do echo "${X}"; done|sort) <(for X in "${LIST2[@]}"; do echo "${X}"; done|sort)))
echo ${INTERSECTION[@]}
# b c d
package:
name: kubevela
version: 1.7.0
epoch: 0
description: KubeVela is a modern application delivery platform that makes deploying and operating applications across today's hybrid, multi-cloud environments easier, faster and more reliable
target-architecture:
- all
copyright:
- license: Apache-2.0
paths:
@tuananh
tuananh / glob_test.go
Created December 23, 2022 02:08 — forked from imjasonh/glob_test.go
Unit test for image ref glob matching, with support for **
package glob_test
import (
"fmt"
"regexp"
"strings"
"testing"
"github.com/google/go-containerregistry/pkg/name"
)
@tuananh
tuananh / FREEDOM.sh
Created December 5, 2022 07:07 — forked from jdolitsky/FREEDOM.sh
Mirror a list of images to GHCR with crane (and sign them with cosign!)
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
if ! crane version >/dev/null; then echo "Must install crane."; exit 1; fi
if ! cosign version >/dev/null; then echo "Must install cosign."; exit 1; fi
GHCR_ROOT_NAMESPACE="${GHCR_ROOT_NAMESPACE:-}"
@tuananh
tuananh / enable-cgroup-v2-manjaro-arch.md
Created March 29, 2021 14:41
Enable cgroup v2 on Manjaro/Arch
sudo nano /etc/default/grub
# add systemd.unified_cgroup_hierarchy=1 to the key GRUB_CMDLINE_LINUX_DEFAULT (space separated list)
sudo grub-mkconfig -o /boot/grub/grub.cfg
# reboot
@tuananh
tuananh / microk8s-raspberry-pi-4.md
Last active October 8, 2021 14:09
microk8s on Raspberry Pi 4
@tuananh
tuananh / configmap.yaml
Last active November 17, 2023 13:00
Pi-hole on Kubernetes
apiVersion: v1
kind: ConfigMap
metadata:
name: pihole-config
data:
WEBPASSWORD: pihole
TZ: 'Asia/Ho_Chi_Minh'
DNS1: 1.1.1.1
DNS2: 1.0.0.1
const data = [
{
roomId: 1,
rateId: 2,
name: 'room 1'
},
{
roomId: 1,
@tuananh
tuananh / sort_zset_cols.py
Created June 9, 2018 23:27 — forked from josiahcarlson/sort_zset_cols.py
A method to get sql-like multiple-column order by in Redis
'''
sort_zset_cols.py
Copyright 2013 Josiah Carlson
Released into the public domain.
'''
'''
Let's imagine that there are 3 restaurants with price, score, distance info
being: