Skip to content

Instantly share code, notes, and snippets.

View HernandoR's full-sized avatar

Liu Zhen HernandoR

View GitHub Profile
@HernandoR
HernandoR / mewtant.yaml
Created June 21, 2026 06:01
stash_rules
dns:
nameserver-policy:
'+.mewtant.co': "1.0.0.1"
fake-ip-filter:
- '+.mewtant.co'
- '+.cache.amazonaws.com'
- '+.rds.amazonaws.com'
script:
@HernandoR
HernandoR / mirror_ppa.sh
Last active April 23, 2026 02:18 — forked from gastonfeng/1555826334.txt
PPA 镜像加速
# PPA 镜像加速
# 2018年7月26日 BY : TATERLI
# 这里有USTC的反向代理.
# https://lug.ustc.edu.cn/wiki/mirrors/help/revproxy
# 只要一句话,全替换成USTC加速的PPA.再也不担心了.
# 1
sudo find /etc/apt/sources.list.d/ -type f -name "*.list" -exec  sed  -i.bak -r  's#deb(-src)?\s*http(s)?://ppa.launchpad.net#deb\1 http\2://launchpad.proxy.ustclug.org#ig' {} \;
@HernandoR
HernandoR / conda_func_by_pixi.sh
Created August 6, 2025 01:00
conda-like pixi functions
pixi-activate() {
local name="$1"
local base="$HOME/pixi-envs"
local env="$base/$name"
if [[ -d "$env" && -f "$env/pixi.toml" ]]; then
eval "$(pixi shell-hook --manifest-path $env)"
else
echo "No pixi environment named '$name' found in $base"
return 1
fi
@HernandoR
HernandoR / nv_for_podman.sh
Last active December 5, 2023 14:31
Add nvidia for podman
curl -s -L https://nvidia.github.io/libnvidia-container/stable/rpm/nvidia-container-toolkit.repo | sudo tee /etc/yum.repos.d/nvidia-container-toolkit.repo
sudo yum install -y nvidia-container-toolkit
sudo nvidia-ctk cdi generate --output=/etc/cdi/nvidia.yaml
nvidia-ctk cdi list
sudo nvidia-ctk runtime configure --runtime=docker
# podman example
# podman run --rm --device nvidia.com/gpu=all --security-opt=label=disable ubuntu nvidia-smi -L
# docker example
# docker run --rm -ti --runtime=nvidia -e NVIDIA_VISIBLE_DEVICES=nvidia.com/gpu=all ubuntu nvidia-smi -L
@HernandoR
HernandoR / call_install.sh
Last active December 7, 2023 06:18
Software install
curl -L https://gist.githubusercontent.com/HernandoR/f1d2f0be041c99bf0f7c1d0a53ac1ada/raw/install-temianl-app.sh
curl -L https://gist.githubusercontent.com/HernandoR/f1d2f0be041c99bf0f7c1d0a53ac1ada/raw/install-desktop-app.sh
source ./install-temianl-app.sh
source ./install-desktop-app.sh
# Call the functions
detect_os
install_git
install_homebrew
install_build_essential
# ssh -J lz@Jumpper lz@10.10.10.3 -vvv
OpenSSH_9.0p1, LibreSSL 3.3.6
debug1: Reading configuration data /Users/lz/.ssh/config
debug1: /Users/lz/.ssh/config line 30: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files
debug1: /etc/ssh/ssh_config line 54: Applying options for *
debug2: resolve_canonicalize: hostname 10.10.10.3 is address
debug1: Setting implicit ProxyCommand from ProxyJump: ssh -l lz -vvv -W '[%h]:%p' Jumpper
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/Users/lz/.ssh/known_hosts'
@HernandoR
HernandoR / general_profile.py
Created June 28, 2023 18:30
Cloudlab profile
"""
Ubuntu 22 for arm
ubuntu 20 OSCN for PCC
ubuntu 20 for x86-64
Instructions:
## brief
This profile creates a single node with/without latest cuda and conda installation
anaconda will use install version on date of 2023-01
conda config --prepend channels https://public.dhe.ibm.com/ibmdl/export/pub/software/server/ibm-ai/conda-early-access/ -y
conda create -n ibm-ai -y
# conda activate ibm-ai -y
conda install -n base mamba -c conda-forge -y
mamba install pytorch torchvision cudatoolkit -c https://public.dhe.ibm.com/ibmdl/export/pub/software/server/ibm-ai/conda-early-access/ -y
mamba install opencv -y
export IBM_POWERAI_LICENSE_ACCEPT=yes
conda install powerai -y
channels:
- https://public.dhe.ibm.com/ibmdl/export/pub/software/server/ibm-ai/conda-early-access/linux-ppc64le/
- rocketce
- nvidia
- pytorch
- powerai
- conda-forge
- anaconda
@HernandoR
HernandoR / airflow_from David
Created March 16, 2023 06:53
airflow startup
# Get Airflow Docker Compose file
curl -LfO 'https://airflow.apache.org/docs/apache-airflow/2.2.3/docker-compose.yaml'
# Initialize the Airflow Database
docker-compose up airflow-init
# Run Airflow
docker-compose up
# Ensure that all services are running
docker ps
# Access the web interface
# Login:airflow,Password:airflow