Skip to content

Instantly share code, notes, and snippets.

View 631068264's full-sized avatar
🤪
I may be slow to respond.

wyx 631068264

🤪
I may be slow to respond.
View GitHub Profile
@631068264
631068264 / Dockerfile
Created May 16, 2023 02:14
modelscope + kubeflow
# 使用稳定python瘦身版,减少镜像体积
FROM python:3.9.15-slim-buster
# 禁用pip缓存,减少镜像体积
ENV PIP_NO_CACHE_DIR=1
RUN sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list && \
apt update && \
apt-get install -y --no-install-recommends gcc ffmpeg libsm6 libxext6 g++ && \
rm -rf /var/lib/apt/lists/*
@631068264
631068264 / statefulset_master.yaml
Last active November 4, 2021 02:35
mysqlha_helm
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ template "fullname" . }}-master
labels:
app: {{ template "fullname" . }}-master
chart: "{{ template "mysqlha.chart" . }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
@631068264
631068264 / py2
Created December 6, 2018 02:24
python inet_ntoa and inet_aton
def inet_ntoa(n):
import socket, struct
if n:
try:
packed_value = struct.pack('!I', int(n))
ip = socket.inet_ntoa(packed_value)
return ip
except:
return None
return None
@631068264
631068264 / gist:68929298612d8103234e12c4f2985aad
Created April 13, 2017 01:22 — forked from mdbecker/gist:1309633
multiprocess && gevent example
from multiprocessing import Pool as MPool
from time import sleep
import datetime
import multiprocessing
import random
def time_request():
from gevent import monkey; monkey.patch_socket
from jsonrequester import JsonRequester