Skip to content

Instantly share code, notes, and snippets.

View runlevel5's full-sized avatar

Trung Lê runlevel5

View GitHub Profile
@runlevel5
runlevel5 / list_all_versions_grouped_by_package.bash
Last active November 22, 2022 22:50
Just a quick script to create a JSON of which key is the NPM package name and value is the array of all versions
#!/bin/bash
set -euo pipefail
PACKAGE="null"
packages_filepath="packages"
detailed_packages_filepath="detailed_packages"
username="shortlyster"
CLEANUP="false"
main() {
From ea8c5e8b91938abafd79da1ca79b4fdd9ae4635d Mon Sep 17 00:00:00 2001
From: Trung LE <8@tle.id.au>
Date: Mon, 21 Nov 2022 21:41:42 +1100
Subject: [PATCH] Update to version 0.25.0
---
.gitignore | 1 +
changelog | 3 +++
crossterm-fix-metadata.diff | 16 ++++++++++------
rust-crossterm.spec | 2 +-
@runlevel5
runlevel5 / fedora35-uuid-static-rpm.patch
Created November 17, 2022 06:33
This the patch to build RPM with static .a files
Date: Thu, 17 Nov 2022 17:10:48 +1100
Subject: [PATCH] Build static
---
uuid.spec | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/uuid.spec b/uuid.spec
index c99d307..8f39927 100644
--- a/uuid.spec
@runlevel5
runlevel5 / amdgpu_6600xt_kernel_6_1_0_rc3.txt
Created November 9, 2022 23:24
dmesg of amdgpu loaded up for AMD Radeon RX 6600 XT on Linux 6.1.0.rc3 ppc64le 64K pagesize
[ 0.000000] (thread shift is 2)
[ 0.000000] Allocated 3584 bytes for 32 pacas
[ 0.000000] -----------------------------------------------------
[ 0.000000] phys_mem_size = 0x1000000000
[ 0.000000] dcache_bsize = 0x80
[ 0.000000] icache_bsize = 0x80
[ 0.000000] cpu_features = 0x0001b8eb8f5fb187
[ 0.000000] possible = 0x000ffbfbcf5fb187
[ 0.000000] always = 0x0000000380008181
[ 0.000000] cpu_user_features = 0xdc0065c2 0xaef00000
@runlevel5
runlevel5 / amdgpu_6600xt.txt
Created November 8, 2022 08:37
Loading AMDGPU driver (Kernel 6.0.3 ppc64le 64K pagesize) for Radeon 6600 XT card on Raptor Blackbird POWER9 computer
$ uname -ar
Linux shrimp-paste 6.0.6-300.fc37.ppc64le #1 SMP Tue Nov 1 19:24:50 UTC 2022 ppc64le ppc64le ppc64le GNU/Linux
$ lspci | grep ATI
0000:01:00.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 XL Upstream Port of PCI Express Switch (rev c1)
0000:02:00.0 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 XL Downstream Port of PCI Express Switch
0000:03:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Navi 23 [Radeon RX 6600/6600 XT/6600M] (rev c1)
0000:03:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Navi 21/23 HDMI/DP Audio Controller
$ sudo modprobe amdgpu
@runlevel5
runlevel5 / trung_id_rsa.pub
Created February 21, 2021 00:43
Trung public key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCgyvCeNY1X7DmUPzLgpYoyIglrFT5YO40DIYoL9WuHFwdiXU0m8S+dnc2aGQ78XU6SJCUaOmg2uUnTqjYwf8JmwFmTp9iil4qmw+opudUFZw++Yh6MF/Qt9aC68YWxa3b+NxbHK4ouNFO4ODTgPcHdmK5ENX1TNvb8xxMlPAxpgfiQKHiJL4ItcZZiVDmx9sMJRNqJ4REV4ZyyzotRRXAsThjm4rVSg95jbfl4UEnTfd23K8k5zhAuwPf84NlhlEdwuCxpWmGmSJ0QgMh6076bSC1++d9nMKU8xY9oX4NiVvdaJHL2dLdrhLh7CZ9efUeOVcJ4spKM1wJCW4Btt8Sj trung.le@ruby-journal.com
@runlevel5
runlevel5 / setup_containerd_for_k8s.sh
Last active January 11, 2024 05:06
Setup containerd for K8S on Alpine Linux
#!/bin/bash
set -e
## CRI containrd
## CNI flannel
# Alpine Edge only! Let's hope alpine 3.13 or 3.14 would have k8s in main tree
echo http://dl-cdn.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories
echo http://dl-cdn.alpinelinux.org/alpine/edge/community >> /etc/apk/repositories
@runlevel5
runlevel5 / k8s_metrics_server.md
Last active June 16, 2020 15:42
Kubernetes Metrics Server (ppc64le)
  1. SSH into master node
  2. Modify spec.containers.command in /etc/kubernetes/manifests/kube-apiserver.yaml to have - --enable-aggregator-routing=true flag if you do not run kube-proxy on a host running the API server
  3. Fetch manifest file https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.3.6/components.yaml
  4. Search and replace amd64 with ppc64le with command: sed -i 's/amd64/ppc64le/g' components.yaml
  5. Start the metric servers with kubectl apply -f components.yaml
@runlevel5
runlevel5 / k8s.md
Last active June 4, 2020 15:39
K8S Short cut

Get pods by selectors

kubectl get pods --selector <key>=<value>

Count pods by selectors

kubectl get pods --selector <key>=<value> --no-headers=true | wc -l

How to taint a node

@runlevel5
runlevel5 / # binutils - 2020-05-26_11-05-42.txt
Created May 26, 2020 15:11
binutils on 3.10.0-1127.el7.ppc64le - Homebrew build logs
Homebrew build logs for binutils on 3.10.0-1127.el7.ppc64le
Build date: 2020-05-26 11:05:42