Skip to content

Instantly share code, notes, and snippets.

View lijiext's full-sized avatar
🎯
Focusing

Li Jie lijiext

🎯
Focusing
View GitHub Profile
@lijiext
lijiext / 20250415-harbor-values.yaml
Created April 15, 2025 07:43
部署harbor的values.yaml
expose:
# Set how to expose the service. Set the type as "ingress", "clusterIP", "nodePort" or "loadBalancer"
# and fill the information in the corresponding section
type: ingress
tls:
# Enable TLS or not.
# Delete the "ssl-redirect" annotations in "expose.ingress.annotations" when TLS is disabled and "expose.type" is "ingress"
# Note: if the "expose.type" is "ingress" and TLS is disabled,
# the port must be included in the command when pulling/pushing images.
# Refer to https://github.com/goharbor/harbor/issues/5291 for details.
@lijiext
lijiext / deploy-cluster.sh
Created November 5, 2024 05:05
使用自动化脚本部署一个完整的HPC(高性能计算)集群
#!/bin/bash
################################################################################
# Script: deploy-cluster.sh
# Description:
# Deploys a complete HPC cluster with:
# - Control node: LDAP, NFS, SLURM controller, slurmrestd
# - Compute node: SLURM compute
# - Login node: User access point
# Including:
@lijiext
lijiext / ssl-toolkit.sh
Created November 3, 2024 11:22
内网证书生成脚本
#!/bin/bash
# SSL证书工具箱
# 版本: 1.0.0
# 功能: 生成根证书、中间证书、多域名证书、IP证书等
###################
# 全局配置
###################
@lijiext
lijiext / format_slurm_output.py
Created October 31, 2024 06:52
format the slurm short output in | seperated format to a table
#!/usr/bin/env python3
import sys
import shutil
import argparse
import textwrap
from typing import List, Tuple, Dict
def get_terminal_size() -> Tuple[int, int]:
"""Get terminal size, fallback to default if not available"""
try:
@lijiext
lijiext / cursor_offline_cli.sh
Created September 30, 2024 01:47
cursor offline download
wget https://cursor.blob.core.windows.net/remote-releases/297991d169fa3a11975c5aa95adc69be73250c70/cli-linux-arm64.tar.gz
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright 1992-2024 Free Software Foundation, Inc.
# shellcheck disable=SC2006,SC2268 # see below for rationale
timestamp='2024-07-27'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@lijiext
lijiext / matrix_multiply.cpp
Created August 23, 2024 06:42
Matrix Multiply Using SYCL
//==============================================================
// Copyright © 2020 Intel Corporation
//
// SPDX-License-Identifier: MIT
// =============================================================
/**
* Matrix_mul multiplies two large matrices both the CPU and the offload device,
* then compares results. If the code executes on both CPU and the offload
* device, the name of the offload device and a success message are displayed.
@lijiext
lijiext / openvscode.sh
Created May 15, 2024 06:45
OpenVSCode Server
wget https://github.com/gitpod-io/openvscode-server/releases/download/openvscode-server-v1.89.1/openvscode-server-v1.89.1-linux-arm64.tar.gz
tar -xvf openvscode-server-v1.89.1-linux-arm64.tar.gz
./openvscode-server-v1.89.1-linux-arm64/bin/openvscode-server
ssh -NfL 3000:localhost:3000 `whomi`@<ip address>
# open localhost:3000 in your browser
@lijiext
lijiext / cloudflare_zlib.sh
Last active May 15, 2024 05:46
build cloudflare zlib
lscpu | grep crc32
sudo apt install -y libzstd1 build-essential git binutils
objdump -d /usr/lib/aarch64-linux-gnu/libz.so.1 | awk -F" " '{print $3}' | grep crc32 | wc -l
mkdir tmp ; pushd tmp
git clone https://github.com/cloudflare/zlib.git
cd zlib && ./configure --prefix=$HOME/opt/apps/tools/zlib
make && make install
popd
@lijiext
lijiext / confirm.sh
Last active May 8, 2024 16:26
confirm function in shell
# Asks the user a yes/no question and waits for a response. Takes the question
# text as its only argument. The user must enter either "y" or "n" to proceed.
confirm()
{
while true; do
read -r -p "$1" RESPONSE
case "$RESPONSE" in
[yY]) return 0 ;;
[nN]) return 1 ;;
*) echo "Please enter y or n"