Docker | Mysql 挂载目录一键部署

创建挂载文件

mkdir -p conf
mkdir -p logs
mkdir -p mysql

编辑配置文件

cd conf/
vi my.cnf

# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA

#
# The MySQL  Server configuration file.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

[mysqld]
pid-file	= /var/run/mysqld/mysqld.pid
socket		= /var/run/mysqld/mysqld.sock
datadir		= /var/lib/mysql
#log-error	= /var/log/mysql/error.log
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0


max_connections = 2000
max_user_connections = 1900
max_connect_errors = 100000
max_allowed_packet = 50M
lower_case_table_names=1
[mysqld]
skip-name-resolve
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION


#保存后退出

启动

docker命令直接启动

……

阅读全文

Svn

SVN 合并

从源svn分支合并到目标svn分支

  1. 在源svn项目下鼠标右键,TortoiseSVN -> Repo-browser, 拿到源项目svn地址
  2. 在目标svn项目下鼠标右键,TortoiseSVN -> Merge ->, 填入源项目svn地址
  3. show log中选中需要合并的版本(commit), 点击merge。
  4. 按照svn的提交流程,把合并好的文件提交上去。
……

阅读全文

GithubAction

Github Token 生成 & 设置

  1. github -> Settings -> Developer Settings -> Personal access tokens 新增 Tokens(classic)
  2. 点击Generate new token
  3. 点击你想使用Action的github仓库 Settings -> Secrets and variables -> Actions -> New respository secret.
  4. 填上名字ACTION_ACCESS_TOKEN和第一步生成的 token,保存

在项目根目录增加文件

.github/workflows/hugo.yml

……

阅读全文

ChatGLM & LangChain

参考: https://www.luckzym.com/posts/e95da08c/#more

环境准备

  • Win11

  • linux 子系统 wsl2

  • Ubuntu22.04子系统

  • Docker for windows

  • ChatGLM 项目模型下载

  • 显卡 4070 12G

  • 内存 16G*2

  • cpu 13600kf

nvidia-docker安装

https://juejin.cn/s/windows%20nvidia-docker%E5%AE%89%E8%A3%85

# Add the package repositories
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \
  sudo apt-key add -
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \
  sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update

# Install nvidia-docker2 and reload the Docker daemon configuration
sudo apt-get install -y nvidia-docker2

需要修改文件 /etc/docker/daemon.json runtimes

$ cat /etc/docker/daemon.json 
{
    "runtimes": {
        "nvidia": {
            "path": "nvidia-container-runtime",
            "runtimeArgs": []
        }
    }
}

我虽然用的是Docker for window,但是是docker运行在ubuntu子系统中。可以在子系统中修改,也可以在Docker for window 中的设置 Docker Engine中修改上述内容。

……

阅读全文

DDNS配置

参考: https://www.sakamoto.blog/synology-nas-cloudflare-ddns/

Cloudflare

  1. 获取 区域 ID
  2. 创建 API 令牌

群晖设置

  1. 开启并登陆群晖NAS终端
  2. 下载 Cloudflare DDNS 脚本 下载 Cloudflare 的 DDNS 脚本文件,官方推荐存放于/sbin/cloudflareddns.sh并赋予执行权限.
# 下载脚本
$ wget https://raw.githubusercontent.com/joshuaavalon/SynologyCloudflareDDNS/master/cloudflareddns.sh -O /sbin/cloudflareddns.sh

# 赋予执行权限
$ chmod +x /sbin/cloudflareddns.sh

手动修改第六行的 proxy=“true” 为 proxy=“false” 避免被 CDN 代理.

……

阅读全文

粒子系统01-概述

参考视频

参考播客

一、两种解决方案

区别Particle System(内置粒子系统)Visual Effect Graph(VFX Graph)
基于XX运行CPUGPU
粒子数量数千数百万
渲染管线支持全部渲染管线不支持内置渲染管线
物理系统可与Unity物理系统交互特定元素交互
创作使用模块化,修改预定义的模块参数节点可视化,节点连线,修改节点参数

二、粒子系统模块概述

……

阅读全文

Netch加速SWITCH

需求

对于有机场的用户,不用再花一份加速器的钱给Switch加速

前提条件

  1. 电脑通过(shadowrocks/v2ray)开启科学上网,使用端口 1080
  2. 电脑局域网IP 192.168.0.103
  3. 允许局域网设备连入

解决过程

  1. switch的代理配置填上 电脑的ip和科学上网的端口: 下载速度可以解决,联机速度无变化(联机不上)
  2. 换其他的代理软件,clash for window, 有一个tun模式,发现是全局代理本机的流量,我需要的是代理局域网的其他设备的整机流量(TCP+UDP)
  3. 通过 clash 加速switch,我找到了一个 clash + pcap2socks 的组合。实际情况是pca2socks模拟了一个虚拟网关和ip,把走这个ip和网关的流量统统转发到代理端口
  4. 最后我发现了一个整合这些功能的软件netch

netch的几种模式

  1. [3] Bypass LAN and China
  • 绕过局域网和中国的模式,这个模式使用了wintun+tun2socks, 在电脑上通过wintun创建了一个虚拟网卡,使用tun2socks让这个虚拟网卡的流量都转发到代理端口1080
  1. 进程模式
  • 直接代理某个软件,比如Steam
  1. [2][pcap2socks]UU(172.24.?.?) Preset
  • 加速器模式,这个就是重点,可以代理switch的tcp和udp流量的模式。
Please set the network of your device which is going to be proxied with the following parameters:
    ┌──────────────────────────┐
    │ IP Address  172.24.1.206 │
    │ Mask         255.255.0.0 │
    │ Gateway     172.24.0.206 │
    │──────────────────────────│
    │ MTU               <=1500 │
    └──────────────────────────┘

switch上把ip,子掩码,网关填上去,然后把DNS填上和网关的地址是一样的就可以, 然后保存,连接成功,连接测试可以看到NAT类型是A了。

……

阅读全文

Netch加速SWITCH

需求

对于有机场的用户,不用再花一份加速器的钱给Switch加速

前提条件

  1. 电脑通过(shadowrocks/v2ray)开启科学上网,使用端口 1080
  2. 电脑局域网IP 192.168.0.103
  3. 允许局域网设备连入

解决过程

  1. switch的代理配置填上 电脑的ip和科学上网的端口: 下载速度可以解决,联机速度无变化(联机不上)
  2. 换其他的代理软件,clash for window, 有一个tun模式,发现是全局代理本机的流量,我需要的是代理局域网的其他设备的整机流量(TCP+UDP)
  3. 通过 clash 加速switch,我找到了一个 clash + pcap2socks 的组合。实际情况是pca2socks模拟了一个虚拟网关和ip,把走这个ip和网关的流量统统转发到代理端口
  4. 最后我发现了一个整合这些功能的软件netch

netch的几种模式

  1. [3] Bypass LAN and China
  • 绕过局域网和中国的模式,这个模式使用了wintun+tun2socks, 在电脑上通过wintun创建了一个虚拟网卡,使用tun2socks让这个虚拟网卡的流量都转发到代理端口1080
  1. 进程模式
  • 直接代理某个软件,比如Steam
  1. [2][pcap2socks]UU(172.24.?.?) Preset
  • 加速器模式,这个就是重点,可以代理switch的tcp和udp流量的模式。
Please set the network of your device which is going to be proxied with the following parameters:
    ┌──────────────────────────┐
    │ IP Address  172.24.1.206 │
    │ Mask         255.255.0.0 │
    │ Gateway     172.24.0.206 │
    │──────────────────────────│
    │ MTU               <=1500 │
    └──────────────────────────┘

switch上把ip,子掩码,网关填上去,然后把DNS填上和网关的地址是一样的就可以, 然后保存,连接成功,连接测试可以看到NAT类型是A了。

……

阅读全文

Gitlab | CI/CD简单实现

CI/CD 流水线 组件组成

  1. stages
  2. job
  3. gitlab runner(可以与gitlab服务器独立, c/s架构. )
--------    --------    --------- 
|stage1| -> |stage2| -> | stage3|          
--------    --------    --------- 

------    ------    -------
|job1|    |job2|    | job3|          
------    ------    ------- 

---------   ---------    --------- 
|runner1|   |runner2| -> |runner3|          
---------   ---------    --------- 
  • pipline: 包含多个stage, 顺序执行
  • stages: 一个stage可以包含多个job,job之间并行
  • jobs: 一个job对应一个runner
  • runner: job的运行环境 可以独立于gitlab,放到其他宿主机上.

gitlab runner 安装

gitlab runner是运行job的环境。需要安装一个可以执行gitlab runner命令的环境.

……

阅读全文