Skip to content

Instantly share code, notes, and snippets.

View kaxing's full-sized avatar
🌊

Yung kaxing

🌊
View GitHub Profile
@kaxing
kaxing / _filename_convert_to_zh_TW.md
Last active April 28, 2024 05:59
Batch filename conversion to zh_TW from zh_CN 批次檔名轉繁體

The entire script is generated with gpt-4-turbo on 2024-April-28; This script won't work without https://github.com/BYVoid/OpenCC

Usage:

./convert2zhtw.sh .

or append suffix,

@kaxing
kaxing / umbrel-on-lunar.md
Last active June 21, 2023 04:47
Install umbrel on ubuntu 23.04

Install Umbrel on Ubuntu 23.04 lunar

error: externally-managed-environment

Workaround:

Bypass PEP-668,

  1. Avoid the install commands
@kaxing
kaxing / install-python-3.10.x-on-M1-with-asdf.md
Last active September 29, 2022 22:28
Install latest python with asdf on macOS on Apple Silicon

References:

https://qiita.com/que9/items/28a9f7978fd34a620193
https://github.com/pyenv/pyenv/issues/1066#issuecomment-630939869
https://github.com/pyenv/pyenv/issues/2042#issuecomment-1131463276
https://stackoverflow.com/questions/51551557/pyenv-build-failed-installing-python-on-macos

The error:

@kaxing
kaxing / oneclick-script-to-deploy-harden-rke2-on-centos-stream8.sh
Created April 14, 2022 09:04
Almost one-click script to install harden rke2 on centos with selinux and make it a cluster
#!/usr/bin/env bash
# NOTICE: This is terribly written and only tested on EC2
# Make sure the firewall and network-related policies are properly set between the hosts
# Comments and feedback are welcome :)
# Verified with following version combo:
# rke2-selinux-0.9-1.el8.noarch
# libselinux-2.9-5.el8.x86_64
# selinux-policy-3.14.3-68.el8.noarch
# container-selinux-2.170.0-1.module_el8.6.0+954+963caf36.noarch
@kaxing
kaxing / -Very-basic-server-configuration.md
Last active November 11, 2021 14:48
Very Basic Server Preparation

For Ubuntu

$ curl -sSL https://gist.githubusercontent.com/kaxing/a72f526a62378cb60eb17b8c671e9bec/raw/161c9a5bc17c8b3f3151dfaabc6cb6df08267a8a/ubuntu.sh | bash
@kaxing
kaxing / -nextcloud-docker-install.md
Last active October 10, 2022 07:58
Nextcloud on home server with docker

Hardward: x86_64, 2 core CPU, 4GB ram OS: Ubuntu Linux 20.04 LTS

The idea is to set up a file server for sharing files in between small group of people.

On Networking

The server is behind a router from ISP, so I had to configure the NAT Port-Forwarding to the local IP. And since there is no static IP, I also had to use script like ddns-updater.

Installation

@kaxing
kaxing / test-exceed-volume-size.yaml
Last active June 23, 2021 06:43
exceeding volume claim size
# This an example to create Disk Pressure on Kubernetes cluster by overwriting claim volume.
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: longhorn-pvc-33g
spec:
accessModes:
- ReadWriteOnce
storageClassName: longhorn
@kaxing
kaxing / pypi-web-search.md
Last active December 18, 2020 08:14
get the search from the pypi web instead as `pip search` doesn't work for the moment

Due to unfortunete amont of traffic, team python.org decided to disable xmlrpc endpoint, incident report being update here: https://status.python.org/incidents/grk0k7sz6zkp

Also an issue tracking on github: pypa/pip#9292

The error message:

This API has been temporarily disabled due to unmanageable load and will be deprecated in the near future. Please use the Simple or JSON API instead.
@kaxing
kaxing / vbox-and-ssh.md
Created October 12, 2020 06:21
Virtualbox and ssh connection

Making VMs accessible from host network.

| This should work fine with Virtualbox 5.2.42 or later

  • Global Tools > Host Network Manager > Create > vboxnet0

  • On Guest VM Settings > Network > Adapter 2 > Host-Only Adapter: choose vboxnet0

  • Going into the VM and get the IP from 2nd Adapter.

@kaxing
kaxing / Treesheets_osx64.md
Last active June 19, 2020 09:13
Treesheets for MacOS 10.15+ (aka 64-bit binary only) and with English locale

Starting from Catalina only 64-bit will be allowed to run, otherwise you see a warning: image

And compiling Treesheet from source code is a bit tricky. Luckily I found that in the CI worfkflow the daily builds already in 64-bit.

Here is where you can find it. Goto the actions from official repository, and click on the latest successful build, eg: https://github.com/aardappel/treesheets/actions/runs/119194981