Skip to content

Instantly share code, notes, and snippets.

View leonmax's full-sized avatar

Yangming leonmax

View GitHub Profile
@leonmax
leonmax / oss_auth_code.py
Last active November 14, 2022 04:34
sample to load from oss auth_code and download files recurisvely
import base64
import json
import pathlib
import re
import sys
from urllib.error import URLError
import oss2
OSS_URL_PATTERN = re.compile(
@leonmax
leonmax / import-ali-kubeconfig
Last active November 14, 2022 03:03
import each aliyun ACK cluster into it's own kubeconfig
#!/usr/bin/env bash
CMD=`basename "$0"`
if [ -z $1 ] ; then
echo "Usage:"
echo " $CMD cluster_name [save_to_path]"
echo "To list cluster names:"
echo " aliyun cs DescribeClusters | jq -r '.[].name'"
echo "Dependencies:"
echo " - aliyun-cli"

Implementing gtree & gcd

TL;DR

add the following line to your ~/.bashrc

alias gtree="fd '\.git$' --prune -utd |  tree --fromfile ."

And then you can use gtree to find all repos under current directory. With some extra effort, one can cd into any repo folder with tab completion.

Details

@leonmax
leonmax / fish-shell-bash-complete-function.sh
Created December 10, 2024 10:11 — forked from 3v1n0/fish-shell-bash-complete-function.sh
Use bash completions in Fish Shell
#!/usr/bin/fish
# You can add this to your ~/.config/fish/config.fish
function __fish_complete_bash
set cmd (commandline -cp)
bash -c "source get-bash-completions.sh; get_completions '$cmd'"
end
# Set the tool to use bash completions