Skip to content

Instantly share code, notes, and snippets.

@Saigut
Saigut / git-tag-delete-local-and-remote.sh
Created May 12, 2024 11:37 — forked from mobilemind/git-tag-delete-local-and-remote.sh
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@Saigut
Saigut / example.c
Created May 12, 2024 11:37 — forked from plebioda/example.c
libfabric example
#include <rdma/fabric.h>
#include <rdma/fabric.h>
#include <rdma/fi_endpoint.h>
#include <rdma/fi_cm.h>
#include <rdma/fi_errno.h>
#include <rdma/fi_rma.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
@Saigut
Saigut / README.md
Created May 12, 2024 11:36 — forked from owent/README.md
coroutine benckmark

Benchmark Data

2019-09-29 更新一版运行结果,增加 C++20 Coroutine 测试结果

组件(Avg) 协程数:1 切换开销 协程数:1000 创建开销 协程数:1000 切换开销 协程数:30000 创建开销 协程数:30000 切换开销
栈大小(如果可指定) 16 KB 2 MB 2 MB 64 KB 64 KB
C++20 Coroutine - Clang 5 ns 130 ns 6 ns 136 ns 9 ns
C++20 Coroutine - MSVC 10 ns 407 ns 14 ns 369 ns 28 ns
[libcopp][1] 77 ns 4.1 us 105 ns 3.8 us 273 ns
@Saigut
Saigut / client.c
Created May 12, 2024 11:36 — forked from joerns/client.c
libfabric RC Example
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <rdma/fabric.h>
#include <rdma/fi_eq.h>
#include <rdma/fi_endpoint.h>
#include <rdma/fi_cm.h>
#include <rdma/fi_errno.h>
@Saigut
Saigut / 00readme.txt
Created May 12, 2024 11:35 — forked from yankay/00readme.txt
快速 启动一套 kubespray 集群(Ubuntu)
# 安装 kubespray
cd /opt
git clone https://github.com/kubernetes-sigs/kubespray.git
cd kubespray
pip3 install -r requirements.txt -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
# 配置集群
# Copy ``inventory/sample`` as ``inventory/mycluster``
cp -rfp inventory/sample inventory/mycluster
[wtadmin@node1 ~]$ sudo iptables -L -v > ./iptables.txt
[wtadmin@node1 ~]$ cat ./iptables.txt
Chain INPUT (policy ACCEPT 11293 packets, 2036K bytes)
pkts bytes target prot opt in out source destination
11M 10G cali-INPUT all -- any any anywhere anywhere /* cali:Cz_u1IQiXIMmKD4c */
4508 666K ACCEPT udp -- any any anywhere node1 udp dpt:domain
0 0 ACCEPT tcp -- any any anywhere node1 tcp dpt:domain
30M 8349M KUBE-IPVS-FILTER all -- any any anywhere anywhere /* kubernetes ipvs access filter */
30M 8349M KUBE-PROXY-FIREWALL all -- any any anywhere anywhere /* kube-proxy firewall rules */
30M 8349M KUBE-NODE-PORT all -- any any anywhere anywhere /* kubernetes health check rules */
nameOverride: ""
fullnameOverride: ""
tenant: "0"
# -- If this chart is used in "Argocd" with "releaseName" field then
# -- VMServiceScrapes couldn't select the proper services.
# -- For correct working need set value 'argocdReleaseOverride=$ARGOCD_APP_NAME'
argocdReleaseOverride: ""
# -- victoria-metrics-operator dependency chart configuration.
# -- For possible values refer to https://github.com/VictoriaMetrics/helm-charts/tree/master/charts/victoria-metrics-operator#parameters
import os
import platform
from modelscope import AutoModelForCausalLM, AutoTokenizer, GenerationConfig
model_id = 'qwen/Qwen-7B-Chat'
revision = 'v1.0.1'
tokenizer = AutoTokenizer.from_pretrained(model_id, revision=revision, trust_remote_code=True)
# use fp16
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto", revision=revision,
trust_remote_code=True, fp16=True).eval()
# Reference guide of what is Stable Diffusion and how to Prompt

## Introduce
Stable Diffusion is a deep learning model for generating images based on text descriptions and can be applied to inpainting, outpainting, and image-to-image translations guided by text prompts. Developing a good prompt is essential for creating high-quality images.

A good prompt should be detailed and specific, including keyword categories such as subject, medium, style, artist, website, resolution, additional details, color, and lighting. Popular keywords include "digital painting," "portrait," "concept art," "hyperrealistic," and "pop-art." Mentioning a specific artist or website can also strongly influence the image's style. For example, a prompt for an image of Emma Watson as a sorceress could be: "Emma Watson as a powerful mysterious sorceress, casting lightning magic, detailed clothing, digital painting, hyperrealistic, fantasy, surrealist, full body."

Artist names can be used as strong modifiers to create a spec
@Saigut
Saigut / chatgpt-sd.txt
Last active August 3, 2023 14:17
chatgpt stable diffusion 提示词
- Reference guide of what is Stable Diffusion and how to Prompt -
Stable Diffusion is a deep learning model for generating images based on text descriptions and can be applied to inpainting, outpainting, and image-to-image translations guided by text prompts. Developing a good prompt is essential for creating high-quality images.
A good prompt should be detailed and specific, including keyword categories such as subject, medium, style, artist, website, resolution, additional details, color, and lighting. Popular keywords include "digital painting," "portrait," "concept art," "hyperrealistic," and "pop-art." Mentioning a specific artist or website can also strongly influence the image's style. For example, a prompt for an image of Emma Watson as a sorceress could be: "Emma Watson as a powerful mysterious sorceress, casting lightning magic, detailed clothing, digital painting, hyperrealistic, fantasy, surrealist, full body."
Artist names can be used as strong modifiers to create a specific style by blending