Skip to content

Instantly share code, notes, and snippets.

@MarshalW
MarshalW / stable-diffusion-gtx1650-error.md
Last active December 5, 2023 11:25
stable diffusion 使用 gtx1650 的问题

stable diffusion 使用 gtx1650 的问题

正常的代码:

from diffusers import DiffusionPipeline
import torch

# runwayml/stable-diffusion-v1-5
model_path="/models/stable-diffusion-v1-5"
@MarshalW
MarshalW / ansible-get-cidr-network.md
Last active November 28, 2023 09:09
Ansible 脚本获取 ip 地址的 CIDR 网络表示

Ansible 脚本获取 ip 地址的 CIDR 网络表示

网络地址

形式类似 10.10.100.0/24

- hosts: "{{ host }}"
  gather_facts: false
  tasks:
@MarshalW
MarshalW / terraform-aliyun-dns-record.md
Created November 27, 2023 03:11
Terraform 管理阿里云域名解析记录

Terraform 管理阿里云域名解析记录

使用 Terraform 自动管理域名解析记录,很方便,速度也不慢。

相比之下:

  • 阿里云,如果用 aliyun-cli,速度也不慢,但是需要为自动化编写脚本
  • aliyun-cli 还可以使用 docker 方式使用 - 但是因为加载镜像过程,从本地执行会比较慢
@MarshalW
MarshalW / aliyun-cli-install.md
Last active November 27, 2023 14:47
阿里云命令 aliyun 的安装

阿里云命令 aliyun 的安装

note: 这种使用 docker 的方式,就是启动运行比较慢 - 所以,尽量改为用 terraform 的方式执行了。

阿里云通过命令 aliyun 执行云端资源管理。

为什么用 docker 方式安装

aliyun 命令通过 aliyun configure set [--profile <profileName>] --access-key-id .. 设置访问认证信息。

@MarshalW
MarshalW / chatchat-qwen-14b-int4.md
Created November 22, 2023 04:22
langchain-chatchat 运行 qwen 量化模型的设置

langchain-chatchat 运行 qwen 量化模型的设置

Dockerfile:

FROM nvidia/cuda:12.2.0-devel-ubuntu22.04

# 安装python/pip/git
RUN sed -i s@/archive.ubuntu.com/@/mirrors.tuna.tsinghua.edu.cn/@g /etc/apt/sources.list \
    && apt-get update \
@MarshalW
MarshalW / abuout-git-lfs.md
Last active December 8, 2023 07:18
git lfs 安装和配置

git lfs 使用

# 安装
sudo apt-get install git-lfs -y

# 使用
git lfs install

# 和普通 git 一样使用
@MarshalW
MarshalW / git-proxy-settings.md
Created January 13, 2023 04:10
git proxy 设置

git proxy 设置

# 设置
git config --global http.proxy http://192.168.0.222:8118
git config --global https.proxy http://192.168.0.222:8118

# 查看
git config --global --get http.proxy 
git config --global --get https.proxy 
@MarshalW
MarshalW / fat-cow.md
Created December 31, 2022 03:45
番茄肥牛汤

番茄肥牛汤

步骤:

  • 番茄切小块,金针菇去根部洗净撕成小朵
  • 肥牛卷下锅去掉血沫捞出备用
  • 锅中倒入食用油烧热,再放入蒜末和姜末炒出香味,放入番茄翻炒至出汁
  • 加水至8分满,煮至水沸,1勺生抽、1勺番茄酱和3克盐调味
  • 大火烧开放入金针菇煮2分钟
  • 再放入肥牛卷煮1分钟,加香菜和葱末,即可关火
@MarshalW
MarshalW / youtube-download-cli.md
Created December 13, 2022 03:01
使用命令行下载 youtube 视频

使用命令行下载 youtube 视频

https://github.com/yt-dlp/yt-dlp

# linux 下安装和使用
pip install yt-dlp
yt-dlp https://www.youtube.com/shorts/7gDsV6enHfY