Skip to content

Instantly share code, notes, and snippets.

View zengqingfu1442's full-sized avatar
🏠
Working from home

zengqingfu1442 zengqingfu1442

🏠
Working from home
View GitHub Profile
@zengqingfu1442
zengqingfu1442 / harvester-gpu.md
Created May 1, 2024 15:49 — forked from kralicky/harvester-gpu.md
Harvester GPU Provisioning

Harvester GPU Provisioning

  1. Install Harvester, then SSH into the server.

  2. Edit /boot/grub/grub.cfg as follows:

 set default=0
 set timeout=10
 

Harvester SNAT Problem

Problem Description

Harvester leverages the Kubernetes service to provide the load balancer for the service in the Harvester virtual machines. The backend servers of the load balancer are the <VM IP>:<service port>.

cw-harv:/home/rancher # kubectl get svc
NAME                        TYPE           CLUSTER-IP      EXTERNAL-IP    PORT(S)        AGE
default-nginx-lb-db9bdca5 LoadBalancer 10.43.113.238 80:32586/TCP 4h32m
import collections
import uuid
from typing import Dict
import numpy as np
import tritonclient
import tritonclient.grpc as grpcclient
import tritonclient.utils.shared_memory as shm
ShmHandle = collections.namedtuple(
@zengqingfu1442
zengqingfu1442 / docker-registry-mirrors.md
Created October 31, 2023 12:34 — forked from y0ngb1n/docker-registry-mirrors.md
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized

Docker Hub 镜像加速器

国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。

Dockerized 实践 https://github.com/y0ngb1n/dockerized

配置加速地址

Ubuntu 16.04+、Debian 8+、CentOS 7+

@zengqingfu1442
zengqingfu1442 / Dockerfile.deb_rpm_nginx
Created August 2, 2023 06:54 — forked from ismail0352/Dockerfile.deb_rpm_nginx
Creating your own .deb file repo and host it using Nginx container with "autoindex on;"
FROM ubuntu as ubuntu
RUN apt-get update
RUN apt-get install -y dpkg-dev wget gnupg2 curl
ARG ubuntu_packages="wget htop default-jre-headless apt-transport-https nvidia-container-toolkit cuda-drivers libopengl0 linux-image-extra-virtual omnisci"
WORKDIR /opt/packages/deb
# Nvidia-Docker
@zengqingfu1442
zengqingfu1442 / gitstats.sh
Created February 9, 2023 07:12 — forked from xeoncross/gitstats.sh
Git - calculate how many lines of code were added/changed by someone
# Run this in the project repo from the command-line
# http://stackoverflow.com/a/4593065/99923
git log --shortstat --author "Xeoncross" --since "2 weeks ago" --until "1 week ago" | grep "files changed" | awk '{files+=$1; inserted+=$4; deleted+=$6} END {print "files changed", files, "lines inserted:", inserted, "lines deleted:", deleted}'
@zengqingfu1442
zengqingfu1442 / Structure.md
Created September 29, 2022 08:06 — forked from JeOam/Structure.md
Project Structure for Python (Tornado) Application

Project:

  • project/: A directory named with the project's name which stores the actual Python package
    • __init__py
    • app.py
    • settings.py
    • urls.py
    • models/
      • __init__.py
      • baes.py
  • handlers/
@zengqingfu1442
zengqingfu1442 / thread.py
Created May 29, 2022 04:26 — forked from ruedesign/thread.py
Python thread sample with handling Ctrl-C
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, time, threading, abc
from optparse import OptionParser
def parse_options():
parser = OptionParser()
parser.add_option("-t", action="store", type="int", dest="threadNum", default=1,
help="thread count [1]")
git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
git config --global --unset http.proxy
git config --global --unset https.proxy
npm config delete proxy
@zengqingfu1442
zengqingfu1442 / auto-rebase.sh
Created January 25, 2022 02:35 — forked from pwo3/auto-rebase.sh
auto-rebase.sh
#!/bin/bash
gitlab_base_url=https://gitlab.com/api/v4/projects
opened_merge_requests=$(curl -H "Authorization: Bearer $GITLAB_PERSONAL_TOKEN" $gitlab_base_url/"$PROJECT_ID"/merge_requests?state=opened)
for iid in $(echo "$opened_merge_requests" | jq '.[] | .iid'); do
curl -X PUT -H "Authorization: Bearer $GITLAB_PERSONAL_TOKEN" $gitlab_base_url/"$PROJECT_ID"/merge_requests/"$iid"/rebase
done