Compare commits
14 Commits
7fc8299ad6
...
4400e24dca
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4400e24dca | ||
|
|
1b4a1f419e | ||
|
|
c9306d03b3 | ||
|
|
5b13ae9b02 | ||
|
|
fc46f18e01 | ||
|
|
a489ca84fc | ||
|
|
96595c5f0f | ||
|
|
6273369c68 | ||
|
|
f64a97ecb0 | ||
|
|
bc0cf47785 | ||
|
|
237a91cc4b | ||
|
|
2d56423b62 | ||
|
|
a2888400da | ||
|
|
255cee376a |
161
csdn_markdown.md
161
csdn_markdown.md
@ -1,161 +0,0 @@
|
||||
# 欢迎使用Markdown编辑器写博客
|
||||
|
||||
本Markdown编辑器使用[StackEdit][6]修改而来,用它写博客,将会带来全新的体验哦:
|
||||
|
||||
- **Markdown和扩展Markdown简洁的语法**
|
||||
- **代码块高亮**
|
||||
- **图片链接和图片上传**
|
||||
- ***LaTex*数学公式**
|
||||
- **UML序列图和流程图**
|
||||
- **离线写博客**
|
||||
- **导入导出Markdown文件**
|
||||
- **丰富的快捷键**
|
||||
|
||||
-------------------
|
||||
|
||||
## 快捷键
|
||||
|
||||
- 加粗 `Ctrl + B`
|
||||
- 斜体 `Ctrl + I`
|
||||
- 引用 `Ctrl + Q`
|
||||
- 插入链接 `Ctrl + L`
|
||||
- 插入代码 `Ctrl + K`
|
||||
- 插入图片 `Ctrl + G`
|
||||
- 提升标题 `Ctrl + H`
|
||||
- 有序列表 `Ctrl + O`
|
||||
- 无序列表 `Ctrl + U`
|
||||
- 横线 `Ctrl + R`
|
||||
- 撤销 `Ctrl + Z`
|
||||
- 重做 `Ctrl + Y`
|
||||
|
||||
## Markdown及扩展
|
||||
|
||||
> Markdown 是一种轻量级标记语言,它允许人们使用易读易写的纯文本格式编写文档,然后转换成格式丰富的HTML页面。 —— <a href="https://zh.wikipedia.org/wiki/Markdown" target="_blank"> [ 维基百科 ]
|
||||
|
||||
使用简单的符号标识不同的标题,将某些文字标记为**粗体**或者*斜体*,创建一个[链接](http://www.csdn.net)等,详细语法参考帮助?。
|
||||
|
||||
本编辑器支持 **Markdown Extra** , 扩展了很多好用的功能。具体请参考[Github][2].
|
||||
|
||||
### 表格
|
||||
|
||||
**Markdown Extra** 表格语法:
|
||||
|
||||
项目 | 价格
|
||||
-------- | ---
|
||||
Computer | $1600
|
||||
Phone | $12
|
||||
Pipe | $1
|
||||
|
||||
可以使用冒号来定义对齐方式:
|
||||
|
||||
| 项目 | 价格 | 数量 |
|
||||
| :-------- | --------:| :--: |
|
||||
| Computer | 1600 元 | 5 |
|
||||
| Phone | 12 元 | 12 |
|
||||
| Pipe | 1 元 | 234 |
|
||||
|
||||
###定义列表
|
||||
|
||||
**Markdown Extra** 定义列表语法:
|
||||
项目1
|
||||
项目2
|
||||
: 定义 A
|
||||
: 定义 B
|
||||
|
||||
项目3
|
||||
: 定义 C
|
||||
|
||||
: 定义 D
|
||||
|
||||
> 定义D内容
|
||||
|
||||
### 代码块
|
||||
代码块语法遵循标准markdown代码,例如:
|
||||
``` python
|
||||
@requires_authorization
|
||||
def somefunc(param1='', param2=0):
|
||||
'''A docstring'''
|
||||
if param1 > param2: # interesting
|
||||
print 'Greater'
|
||||
return (param2 - param1 + 1) or None
|
||||
class SomeClass:
|
||||
pass
|
||||
>>> message = '''interpreter
|
||||
... prompt'''
|
||||
```
|
||||
|
||||
###脚注
|
||||
生成一个脚注[^footnote].
|
||||
[^footnote]: 这里是 **脚注** 的 *内容*.
|
||||
|
||||
### 目录
|
||||
用 `[TOC]`来生成目录:
|
||||
|
||||
[TOC]
|
||||
|
||||
### 数学公式
|
||||
使用MathJax渲染*LaTex* 数学公式,详见[math.stackexchange.com][1].
|
||||
|
||||
- 行内公式,数学公式为:$\Gamma(n) = (n-1)!\quad\forall n\in\mathbb N$。
|
||||
- 块级公式:
|
||||
|
||||
$$ x = \dfrac{-b \pm \sqrt{b^2 - 4ac}}{2a} $$
|
||||
|
||||
更多LaTex语法请参考 [这儿][3].
|
||||
|
||||
### UML 图:
|
||||
|
||||
可以渲染序列图:
|
||||
|
||||
```sequence
|
||||
张三->李四: 嘿,小四儿, 写博客了没?
|
||||
Note right of 李四: 李四愣了一下,说:
|
||||
李四-->张三: 忙得吐血,哪有时间写。
|
||||
```
|
||||
|
||||
或者流程图:
|
||||
|
||||
```flow
|
||||
st=>start: 开始
|
||||
e=>end: 结束
|
||||
op=>operation: 我的操作
|
||||
cond=>condition: 确认?
|
||||
|
||||
st->op->cond
|
||||
cond(yes)->e
|
||||
cond(no)->op
|
||||
```
|
||||
|
||||
- 关于 **序列图** 语法,参考 [这儿][4],
|
||||
- 关于 **流程图** 语法,参考 [这儿][5].
|
||||
|
||||
## 离线写博客
|
||||
|
||||
即使用户在没有网络的情况下,也可以通过本编辑器离线写博客(直接在曾经使用过的浏览器中输入[write.blog.csdn.net/mdeditor](http://write.blog.csdn.net/mdeditor)即可。**Markdown编辑器**使用浏览器离线存储将内容保存在本地。
|
||||
|
||||
用户写博客的过程中,内容实时保存在浏览器缓存中,在用户关闭浏览器或者其它异常情况下,内容不会丢失。用户再次打开浏览器时,会显示上次用户正在编辑的没有发表的内容。
|
||||
|
||||
博客发表后,本地缓存将被删除。
|
||||
|
||||
用户可以选择 <i class="icon-disk"></i> 把正在写的博客保存到服务器草稿箱,即使换浏览器或者清除缓存,内容也不会丢失。
|
||||
|
||||
> **注意:**虽然浏览器存储大部分时候都比较可靠,但为了您的数据安全,在联网后,**请务必及时发表或者保存到服务器草稿箱**。
|
||||
|
||||
##浏览器兼容
|
||||
|
||||
1. 目前,本编辑器对Chrome浏览器支持最为完整。建议大家使用较新版本的Chrome。
|
||||
3. IE9以下不支持
|
||||
4. IE9,10,11存在以下问题
|
||||
1. 不支持离线功能
|
||||
1. IE9不支持文件导入导出
|
||||
1. IE10不支持拖拽文件导入
|
||||
|
||||
---------
|
||||
|
||||
[1]: http://math.stackexchange.com/
|
||||
|
||||
[2]: https://github.com/jmcmanus/pagedown-extra "Pagedown Extra"
|
||||
[3]: http://meta.math.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference
|
||||
[4]: http://bramp.github.io/js-sequence-diagrams/
|
||||
[5]: http://adrai.github.io/flowchart.js/
|
||||
[6]: https://github.com/benweet/stackedit
|
||||
@ -38,6 +38,10 @@ docker run -d \
|
||||
-p 8090:80 \
|
||||
--link mymysql:mymysql phpmyadmin/phpmyadmin
|
||||
|
||||
|
||||
docker run --init --name bytebase --publish 8090:8080 bytebase/bytebase
|
||||
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
12
database/victoria.md
Normal file
12
database/victoria.md
Normal file
@ -0,0 +1,12 @@
|
||||
# victoria
|
||||
|
||||
|
||||
```bash
|
||||
|
||||
|
||||
docker run -dit --name=tsdb -v /share/Public/db/ts:/victoria-metrics-data -p 8428:8428 victoriametrics/victoria-metrics -search.latencyOffset=1s
|
||||
|
||||
# http://192.168.6.2:8428/prometheus/api/v1/label/__name__/values
|
||||
curl -d 'foo 3' -X POST 'http://192.168.6.2:8428/api/v1/import/prometheus'
|
||||
curl 'http://192.168.6.2:8428/api/v1/query?query=foo'
|
||||
```
|
||||
@ -24,4 +24,23 @@ docker run -d -p 5000:5000 --restart=always --name docker-registry \
|
||||
-e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt \
|
||||
-e REGISTRY_HTTP_TLS_KEY=/certs/domain.key \
|
||||
registry
|
||||
|
||||
docker run -e REGISTRY_HTTP_HOST=https://dockerlocal:1953 -d \
|
||||
--network host \
|
||||
--name registry \
|
||||
--restart=always \
|
||||
-e REGISTRY_HTTP_ADDR=0.0.0.0:1953 \
|
||||
-e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt \
|
||||
-e REGISTRY_HTTP_TLS_KEY=/certs/domain.key \
|
||||
-v `pwd`/data:/var/lib/registry \
|
||||
-v `pwd`/certs:/certs \
|
||||
registry:2
|
||||
|
||||
docker run -d \
|
||||
--network host \
|
||||
--name registry2 \
|
||||
--restart=always \
|
||||
-e REGISTRY_HTTP_ADDR=0.0.0.0:1953 \
|
||||
-v `pwd`/data:/var/lib/registry \
|
||||
registry:2
|
||||
```
|
||||
|
||||
211
freecad/main.md
Normal file
211
freecad/main.md
Normal file
@ -0,0 +1,211 @@
|
||||
# freecad 二次开发文档
|
||||
|
||||
|
||||
|
||||
## freecad 源代码目录结构
|
||||
|
||||
**src/:**此目录包含 FreeCAD 的核心源代码。
|
||||
|
||||
**src/App:**包含 FreeCAD 的应用程序对象的实现,如文档、事务管理和撤销/重做系统。
|
||||
|
||||
**src/Base:**包含一些基本类和函数,如向量、矩阵和几何实体。
|
||||
|
||||
**src/Main:**包含 FreeCAD 的主程序入口点。
|
||||
|
||||
**src/Mod:**包含 FreeCAD 的各个模块和工作台的实现,如 Part、Sketcher、FEM 等。
|
||||
|
||||
**src/Gui:**包含 FreeCAD 的图形用户界面(GUI)的实现,使用 Qt 框架构建。
|
||||
|
||||
**src/Tools:**包含一些实用工具,如编译和构建脚本。
|
||||
|
||||
**data/**:此目录包含 FreeCAD 的一些资源文件,如图标、模板、样式表等。
|
||||
|
||||
**doc/:**此目录包含 FreeCAD 的开发文档,包括编码规范、开发指南等。
|
||||
|
||||
**ext/:**此目录包含 FreeCAD 依赖的外部库,如 Open CASCADE、Eigen 等
|
||||
|
||||
|
||||
|
||||
## fem步骤
|
||||
|
||||
|
||||
|
||||
1. 创建或导入一个几何模型。
|
||||
2. 转到 FEM 工作台。
|
||||
3. 创建一个分析对象(Analysis Container)。
|
||||
4. 定义材料属性。
|
||||
5. 为模型添加约束,例如固定、力和压力。
|
||||
6. 创建一个网格,将几何体划分为有限元。
|
||||
7. 选择求解器,如 CalculiX、Elmer 或 Z88。
|
||||
8. 运行分析。
|
||||
9. 查看和分析结果。
|
||||
|
||||
|
||||
|
||||
|
||||
## python 自动创建fem分析脚本
|
||||
|
||||
```python
|
||||
#! /usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim:fenc=utf-8
|
||||
#
|
||||
# Copyright © 2023 veypi <i@veypi.com>
|
||||
#
|
||||
# Distributed under terms of the Apache license.
|
||||
"""
|
||||
|
||||
"""
|
||||
|
||||
doc = App.newDocument("Scripted_CalculiX_Cantilever3D")
|
||||
import Part
|
||||
|
||||
box_obj = doc.addObject('Part::Box', 'Box')
|
||||
box_obj.Height = box_obj.Width = 1000
|
||||
box_obj.Length = 8000
|
||||
|
||||
# see how our part looks like
|
||||
import FreeCADGui
|
||||
|
||||
FreeCADGui.ActiveDocument.activeView().viewAxonometric()
|
||||
FreeCADGui.SendMsgToActiveView("ViewFit")
|
||||
|
||||
import ObjectsFem
|
||||
|
||||
# analysis
|
||||
analysis_object = ObjectsFem.makeAnalysis(doc, "Analysis")
|
||||
|
||||
# solver (we gone use the well tested CcxTools solver object)
|
||||
solver_object = ObjectsFem.makeSolverCalculixCcxTools(doc, "CalculiX")
|
||||
solver_object.GeometricalNonlinearity = 'linear'
|
||||
solver_object.ThermoMechSteadyState = True
|
||||
solver_object.MatrixSolverType = 'default'
|
||||
solver_object.IterationsControlParameterTimeUse = False
|
||||
analysis_object.addObject(solver_object)
|
||||
|
||||
# material
|
||||
material_object = ObjectsFem.makeMaterialSolid(doc, "SolidMaterial")
|
||||
mat = material_object.Material
|
||||
mat['Name'] = "Steel-Generic"
|
||||
mat['YoungsModulus'] = "210000 MPa"
|
||||
mat['PoissonRatio'] = "0.30"
|
||||
mat['Density'] = "7900 kg/m^3"
|
||||
material_object.Material = mat
|
||||
analysis_object.addObject(material_object)
|
||||
|
||||
# fixed_constraint
|
||||
fixed_constraint = ObjectsFem.makeConstraintFixed(doc, "FemConstraintFixed")
|
||||
fixed_constraint.References = [(doc.Box, "Face1")]
|
||||
analysis_object.addObject(fixed_constraint)
|
||||
|
||||
# force_constraint
|
||||
force_constraint = ObjectsFem.makeConstraintForce(doc, "FemConstraintForce")
|
||||
force_constraint.References = [(doc.Box, "Face2")]
|
||||
force_constraint.Force = 9000000.0
|
||||
force_constraint.Direction = (doc.Box, ["Edge5"])
|
||||
force_constraint.Reversed = True
|
||||
analysis_object.addObject(force_constraint)
|
||||
|
||||
## fem mesh
|
||||
|
||||
femmesh_obj = ObjectsFem.makeMeshGmsh(doc, box_obj.Name + "_Mesh")
|
||||
femmesh_obj.Part = doc.Box
|
||||
|
||||
doc.recompute()
|
||||
|
||||
from femmesh.gmshtools import GmshTools as gt
|
||||
|
||||
gmsh_mesh = gt(femmesh_obj)
|
||||
error = gmsh_mesh.create_mesh()
|
||||
print(error)
|
||||
|
||||
analysis_object.addObject(femmesh_obj)
|
||||
|
||||
doc.recompute()
|
||||
|
||||
# activating analysis
|
||||
|
||||
import FemGui
|
||||
|
||||
FemGui.setActiveAnalysis(doc.Analysis)
|
||||
|
||||
#from femtools import ccxtools
|
||||
#fea = ccxtools.FemToolsCcx()
|
||||
#fea.purge_results()
|
||||
#fea.run()
|
||||
|
||||
from femtools import ccxtools
|
||||
|
||||
fea = ccxtools.FemToolsCcx()
|
||||
fea.update_objects()
|
||||
fea.setup_working_dir()
|
||||
fea.setup_ccx()
|
||||
message = fea.check_prerequisites()
|
||||
if not message:
|
||||
fea.purge_results()
|
||||
fea.write_inp_file()
|
||||
# on error at inp file writing, the inp file path "" was returned (even if the file was written)
|
||||
# if we would write the inp file anyway, we need to again set it manually
|
||||
# fea.inp_file_name = '/tmp/FEMWB/FEMMeshGmsh.inp'
|
||||
fea.ccx_run()
|
||||
fea.load_results()
|
||||
else:
|
||||
FreeCAD.Console.PrintError(
|
||||
"Houston, we have a problem! {}\n".format(message)) # in report view
|
||||
print("Houston, we have a problem! {}\n".format(
|
||||
message)) # in Python console
|
||||
|
||||
###
|
||||
|
||||
# show resutlt
|
||||
for m in analysis_object.Group:
|
||||
if m.isDerivedFrom('Fem::FemResultObject'):
|
||||
result_object = m
|
||||
break
|
||||
|
||||
femmesh_obj.ViewObject.setNodeDisplacementByVectors(
|
||||
result_object.NodeNumbers, result_object.DisplacementVectors)
|
||||
print(result_object.DisplacementVectors[-1])
|
||||
import time
|
||||
|
||||
femmesh_obj.ViewObject.applyDisplacement(20)
|
||||
import requests
|
||||
|
||||
d = requests.get(url="http://192.168.5.172:8015/file/123")
|
||||
print("|%s|" % (d.text.strip()))
|
||||
# 每秒请求服务器渲染变形程度
|
||||
n = 0
|
||||
data = 0
|
||||
while 1:
|
||||
time.sleep(0.01)
|
||||
d = requests.get(url="http://192.168.5.172:8015/file/123")
|
||||
data = int(d.text.strip())
|
||||
# 更新ui
|
||||
FreeCAD.Gui.updateGui()
|
||||
#print("%s/%s"%(n, data))
|
||||
femmesh_obj.ViewObject.applyDisplacement(n)
|
||||
if data > n:
|
||||
n = n + 1
|
||||
if data < n:
|
||||
n = n - 1
|
||||
|
||||
```
|
||||
|
||||
|
||||
## 添加有限元fem 求解器
|
||||
|
||||
[参考源码](https://github.com/FreeCAD/FreeCAD/compare/a03eb6b9625ba...dfc01ec949525)
|
||||
|
||||
步骤:
|
||||
|
||||
|
||||
[添加mesh导出程序](https://github.com/FreeCAD/FreeCAD/commit/e100971fa0a0c17b5e4906ac540fa31ac0d11766)
|
||||
|
||||
[添加求解器,写入程序,任务程序,约束程序](https://github.com/FreeCAD/FreeCAD/commit/cdcd271b4c97a27431dc28d852f6ed7e171dba67)
|
||||
|
||||
[添加求解器单元测试](https://github.com/FreeCAD/FreeCAD/commit/005c66f4ecc7fb1690a54592a00ec490146b985d)
|
||||
|
||||
[添加文档](https://github.com/FreeCAD/FreeCAD/commit/cfc08b811ff09628b1468e21e9e823587efc799a)
|
||||
|
||||
[添加界面参数](https://github.com/FreeCAD/FreeCAD/commit/dfc01ec949525162c70648ea6d6d93c818907f1f)
|
||||
|
||||
46
light.md
46
light.md
@ -1,46 +0,0 @@
|
||||
# 联系方式
|
||||
- 手机:17888821546
|
||||
- Email:1870499383@qq.com
|
||||
|
||||
# 个人信息
|
||||
|
||||
- 蒋亮亮/男/1995
|
||||
- 本科/北京航空航天大学飞行器质量与可靠性
|
||||
|
||||
- 技术博客:http://blog.csdn.net/light_jiang2016
|
||||
- Github: https://github.com/lightjiang
|
||||
|
||||
---
|
||||
|
||||
# 经历
|
||||
## 北京歌尔泰克科技有限公司 ( 2016.10-201709 )
|
||||
### 机器人任务调度系统
|
||||
- python django tornado vue mongodb redis
|
||||
- 主要负责整体系统架构设计
|
||||
- 开发后台逻辑层,服务层中的消息服务、用户体系和数据层代理
|
||||
- web前端编写
|
||||
- 负责与多个型号机器人系统对接
|
||||
|
||||
### fetch运动底盘研发
|
||||
- python ros c++
|
||||
- 负责开发调试运动底盘ros系统,如导航、避障、建图等,对接调度系统等
|
||||
- 负责部分传感器应用开发
|
||||
|
||||
## 北京擎靖天启科技服务有限公司 ( 2015.9-2016.10 )
|
||||
|
||||
### 互联网+校园”物联移动平台
|
||||
- python django mysql
|
||||
- 负责后台设计,开发用户体系、权限体系、用户行为追踪系统、请求过滤、微信认证
|
||||
- 服务区部署和维护
|
||||
- 分布式爬虫
|
||||
---
|
||||
|
||||
|
||||
# 技能清单
|
||||
以下均为我熟练使用的技能
|
||||
- 主要开发语言 python
|
||||
- 数据库相关:MySQL/redis/mongodb
|
||||
- Web开发:vue/js/html/css
|
||||
- 开放平台:微信应用开发
|
||||
- 分布式系统: ros/rabbitmq
|
||||
|
||||
10
linux/aptcacheng.md
Normal file
10
linux/aptcacheng.md
Normal file
@ -0,0 +1,10 @@
|
||||
# apt cache mirror
|
||||
|
||||
```bash
|
||||
apt-get install apt-cacher-ng
|
||||
systemctl enable apt-cacher-ng
|
||||
service apt-cacher-ng start
|
||||
|
||||
|
||||
#/etc/apt-cacher-ng/acng.conf
|
||||
```
|
||||
14
linux/check_sys.md
Normal file
14
linux/check_sys.md
Normal file
@ -0,0 +1,14 @@
|
||||
# linux 检查 系统资源
|
||||
|
||||
| 命令 | 含义 |
|
||||
| :------------------: | :----------: |
|
||||
| uname -a | 查看内核 |
|
||||
| head -n 1 /etc/issue | 查看操作系统 |
|
||||
| cat /proc/cpuinfo | 查看cpu |
|
||||
| lscpu | 查看cpu |
|
||||
| | |
|
||||
| free -m | 查看mem |
|
||||
| df -h | 查看分区使用 |
|
||||
| du -h | 查看目录大小 |
|
||||
| | |
|
||||
|
||||
35
linux/create_ap.md
Normal file
35
linux/create_ap.md
Normal file
@ -0,0 +1,35 @@
|
||||
# create ap
|
||||
|
||||
### ubuntu netplan
|
||||
|
||||
```bash
|
||||
sudo apt install hostapd
|
||||
sudo systemctl unmask hostapd
|
||||
sudo systemctl enable hostapd
|
||||
sudo vim /etc/hostapd/hostapd.conf
|
||||
|
||||
```
|
||||
```yaml
|
||||
interface=wlan0
|
||||
driver=nl80211
|
||||
hw_mode=g
|
||||
channel=1
|
||||
ieee80211d=1
|
||||
country_code=DE
|
||||
ieee80211n=1
|
||||
wmm_enabled=1
|
||||
macaddr_acl=0
|
||||
auth_algs=1
|
||||
ignore_broadcast_ssid=0
|
||||
wpa=2
|
||||
wpa_key_mgmt=WPA-PSK
|
||||
rsn_pairwise=CCMP
|
||||
ssid=yourSSID
|
||||
wpa_passphrase=yourpassphrase
|
||||
```
|
||||
|
||||
```bash
|
||||
sudo vim /etc/default/hostapd
|
||||
|
||||
# DAEMON_CONF="/etc/hostapd/hostapd.conf"
|
||||
```
|
||||
13
linux/date.sh
Normal file
13
linux/date.sh
Normal file
@ -0,0 +1,13 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# date.sh
|
||||
# Copyright (C) 2023 veypi <i@veypi.com>
|
||||
#
|
||||
# Distributed under terms of the MIT license.
|
||||
#
|
||||
|
||||
|
||||
sudo date -s "$(bash ~/.date.sh 01)"
|
||||
a=$RANDOM
|
||||
a1=$1
|
||||
echo $(printf "202310${a1}T%02d:%02d:%02d" $(($RANDOM%24)) $(($RANDOM%24)) $(($RANDOM%24)) )
|
||||
4
linux/lazygit.md
Normal file
4
linux/lazygit.md
Normal file
@ -0,0 +1,4 @@
|
||||
# lazy git 使用
|
||||
|
||||
https://github.com/jesseduffield/lazygit
|
||||
|
||||
15
linux/lvm.md
Normal file
15
linux/lvm.md
Normal file
@ -0,0 +1,15 @@
|
||||
# lvm
|
||||
|
||||
|
||||
## lvm 扩容
|
||||
|
||||
```bash
|
||||
|
||||
|
||||
sudo lvdisplay
|
||||
sudo pvdisplay
|
||||
sudo lvextend -L +1.5TB /dev/ubuntu-vg/ubuntu-lv
|
||||
sudo resize2fs /dev/ubuntu-vg/ubuntu-lv
|
||||
df -h
|
||||
|
||||
```
|
||||
43
linux/nvidia_driver.md
Normal file
43
linux/nvidia_driver.md
Normal file
@ -0,0 +1,43 @@
|
||||
# ubuntu22 install 4090 dirver
|
||||
|
||||
|
||||
## ubuntu server
|
||||
|
||||
```bash
|
||||
|
||||
sudo apt install nvidia-driver-550-server nvidia-utils-550-server
|
||||
reboot
|
||||
nvidia-smi
|
||||
|
||||
```
|
||||
|
||||
```bash
|
||||
|
||||
sudo apt install pkg-config libglvnd-dev gcc-12 make
|
||||
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 12
|
||||
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 12
|
||||
sudo systemctl set-default multi-user.target
|
||||
sudo reboot -h now
|
||||
sudo ./NVIDIA-Linux-x86_64-535.171.04.run
|
||||
sudo systemctl set-default graphical.target
|
||||
sudo reboot -h now
|
||||
```
|
||||
|
||||
## cuda
|
||||
|
||||
https://developer.nvidia.com/cuda-toolkit-archive
|
||||
|
||||
https://developer.nvidia.com/cuda-12-1-1-download-archive?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=22.04&target_type=deb_local
|
||||
|
||||
```bash
|
||||
|
||||
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pin
|
||||
sudo mv cuda-ubuntu2204.pin /etc/apt/preferences.d/cuda-repository-pin-600
|
||||
wget https://developer.download.nvidia.com/compute/cuda/12.1.1/local_installers/cuda-repo-ubuntu2204-12-1-local_12.1.1-530.30.02-1_amd64.deb
|
||||
sudo dpkg -i cuda-repo-ubuntu2204-12-1-local_12.1.1-530.30.02-1_amd64.deb
|
||||
sudo cp /var/cuda-repo-ubuntu2204-12-1-local/cuda-*-keyring.gpg /usr/share/keyrings/
|
||||
sudo apt update
|
||||
sudo apt -y install cuda
|
||||
|
||||
|
||||
```
|
||||
20
linux/passthrough_4090.md
Normal file
20
linux/passthrough_4090.md
Normal file
@ -0,0 +1,20 @@
|
||||
# 4090直通
|
||||
|
||||
```bash
|
||||
lspci -nn | grep NVIDIA
|
||||
|
||||
10de:2684,10de:22ba
|
||||
|
||||
echo "vfio vfio_iommu_type1 vfio_virqfd vfio_pci ids=10de:2684,10de:22ba" >> /etc/initramfs-tools/modules
|
||||
echo "options vfio-pci ids=10de:2684,10de:22ba" > /etc/modprobe.d/vfio.conf
|
||||
|
||||
echo "options kvm ignore_msrs=1" > /etc/modprobe.d/kvm.conf
|
||||
echo "blacklist nouveau" > /etc/modprobe.d/blacklist-nvidia.conf
|
||||
echo "blacklist nvidiafb" >> /etc/modprobe.d/blacklist-nvidia.conf
|
||||
sed -ri "/^GRUB_CMDLINE_LINUX_DEFAULT=/ s/\"$/ intel_iommu=on vfio-pci.ids=10de:2684,10de:22ba\"/" /etc/default/grub
|
||||
|
||||
update-initramfs -u
|
||||
update-grub
|
||||
reboot -h now
|
||||
|
||||
```
|
||||
71
linux/tmux.md
Normal file
71
linux/tmux.md
Normal file
@ -0,0 +1,71 @@
|
||||
# tmux
|
||||
|
||||
## install
|
||||
|
||||
```bash
|
||||
sudo apt install tmux
|
||||
|
||||
```
|
||||
|
||||
## tlayout
|
||||
|
||||
```bash
|
||||
|
||||
#! /bin/sh
|
||||
#
|
||||
# tenv.sh
|
||||
# Copyright (C) 2023 veypi <i@veypi.com>
|
||||
#
|
||||
# Distributed under terms of the MIT license.
|
||||
#
|
||||
|
||||
|
||||
s=$1
|
||||
tmux new-session -s $s -n f -d
|
||||
# tmux send-keys -t $s 'p' C-m
|
||||
|
||||
tmux split-window -v -p 70 -t $s:1.1
|
||||
tmux split-window -h -p 70 -t $s:1.2
|
||||
tmux split-window -h -p 70 -t $s:1.1
|
||||
tmux attach -t $1
|
||||
|
||||
|
||||
```
|
||||
|
||||
## .tmux.conf
|
||||
|
||||
```bash
|
||||
# ln -s $(pwd)/tmux.conf ~/.tmux.conf
|
||||
|
||||
# 重新绑定prefix
|
||||
unbind C-b
|
||||
set -g prefix 'C-s'
|
||||
|
||||
# 重新加载配置文件
|
||||
bind r source-file ~/.tmux.conf \; display-message "Config reloaded.."
|
||||
|
||||
# 打开鼠标 调整面板 切换面板
|
||||
set-option -g mouse on
|
||||
|
||||
|
||||
|
||||
set -g base-index 1 # 设置窗口的起始下标为1
|
||||
set -g pane-base-index 1 # 设置面板的起始下标为1
|
||||
|
||||
|
||||
unbind '"'
|
||||
bind - splitw -v -c '#{pane_current_path}' # 垂直方向新增面板,默认进入当前目录
|
||||
unbind %
|
||||
bind = splitw -h -c '#{pane_current_path}' # 水平方向新增面板,默认进入当前目录
|
||||
|
||||
|
||||
|
||||
|
||||
set -g status-interval 1 # 状态栏刷新时间
|
||||
set -g status-justify left # 状态栏列表左对齐
|
||||
setw -g monitor-activity on # 非当前窗口有内容更新时在状态栏通知
|
||||
|
||||
set -wg window-status-format " #I #W " # 状态栏窗口名称格式
|
||||
set -wg window-status-current-format " #I:#W#F " # 状态栏当前窗口名称格式(#I:序号,#w:窗口名称,#F:间隔符)
|
||||
set -wg window-status-separator "" # 状态栏窗口名称之间的间隔
|
||||
```
|
||||
@ -3,6 +3,7 @@
|
||||
``` bash
|
||||
sudo apt install -y zsh
|
||||
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
|
||||
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
|
||||
sh -c "$(curl -fsSL https://public.veypi.com/install_zsh.sh)"
|
||||
|
||||
echo 'PROMPT=%m\ $PROMPT' >> ~/.zshrc
|
||||
@ -11,4 +12,9 @@ sed -i '1i\DISABLE_AUTO_UPDATE="true"' ~/.zshrc
|
||||
|
||||
chsh -s /bin/zsh
|
||||
sudo reboot -h now
|
||||
|
||||
|
||||
git clone https://mirrors.tuna.tsinghua.edu.cn/git/ohmyzsh.git
|
||||
cd ohmyzsh/tools
|
||||
REMOTE=https://mirrors.tuna.tsinghua.edu.cn/git/ohmyzsh.git sh install.sh
|
||||
```
|
||||
|
||||
14
mac/latex.md
Normal file
14
mac/latex.md
Normal file
@ -0,0 +1,14 @@
|
||||
# mac latex zathura nvim
|
||||
|
||||
|
||||
### mactex
|
||||
|
||||
|
||||
### [zathura](https://github.com/zegervdv/homebrew-zathura)
|
||||
```bash
|
||||
brew tap zegervdv/zathura
|
||||
brew install zathura
|
||||
brew install zathura-pdf-poppler
|
||||
mkdir -p $(brew --prefix zathura)/lib/zathura
|
||||
ln -s $(brew --prefix zathura-pdf-poppler)/libpdf-poppler.dylib $(brew --prefix zathura)/lib/zathura/libpdf-poppler.dylib
|
||||
```
|
||||
46
mac/phpmyadmin.md
Normal file
46
mac/phpmyadmin.md
Normal file
@ -0,0 +1,46 @@
|
||||
# mac 安装phpmyadmin
|
||||
|
||||
https://www.simplified.guide/macos/apache-php-homebrew-codesign
|
||||
|
||||
从macos12后已经默认不安装php
|
||||
|
||||
```bash
|
||||
brew install php@7.4
|
||||
# 添加环境变量
|
||||
echo 'export PATH="/usr/local/opt/php@7.4/bin:$PATH"' >> ~/.zshrc
|
||||
echo 'export PATH="/usr/local/opt/php@7.4/sbin:$PATH"' >> ~/.zshrc
|
||||
# 查看php版本
|
||||
php -v
|
||||
```
|
||||
|
||||
对phpmodul进行签名
|
||||
|
||||
钥匙串访问->证书助理->创建证书颁发机构
|
||||
|
||||

|
||||
|
||||
返回钥匙串访问的证书列表,信任此证书
|
||||
|
||||

|
||||
|
||||
```bash
|
||||
# 执行签名
|
||||
codesign --sign "php_ca_1" --force --keychain ~/Library/Keychains/login.keychain-db /usr/local/opt/php@7.4/lib/httpd/modules/libphp7.so
|
||||
codesign --sign "php_ca_1" --force --keychain ~/Library/Keychains/login.keychain-db /usr/local/opt/php@7.4/lib/php/20190902/opcache.so
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
修改apache2 配置文件
|
||||
|
||||
```bash
|
||||
sudo vim /etc/apache2/other/php7.conf
|
||||
# 添加
|
||||
LoadModule rewrite_module libexec/apache2/mod_rewrite.so
|
||||
LoadModule php7_module /usr/local/opt/php@7.4/lib/httpd/modules/libphp7.so "phpca"
|
||||
|
||||
# 重启
|
||||
sudo apachectl -k restart
|
||||
```
|
||||
|
||||
10
nats/nats.md
Normal file
10
nats/nats.md
Normal file
@ -0,0 +1,10 @@
|
||||
# nats
|
||||
|
||||
## install
|
||||
|
||||
```bash
|
||||
|
||||
go install github.com/nats-io/nats-server/v2@latest
|
||||
|
||||
go install github.com/nats-io/natscli/nats@latest
|
||||
```
|
||||
@ -2,6 +2,16 @@
|
||||
- refer to https://segmentfault.com/a/1190000007542620
|
||||
|
||||
|
||||
## nvm
|
||||
|
||||
```bash
|
||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
|
||||
nvm list-remote
|
||||
nvm install node
|
||||
npm install --global yarn
|
||||
```
|
||||
|
||||
|
||||
|
||||
### install and update
|
||||
``` bash
|
||||
@ -26,7 +36,7 @@ npm config get registry
|
||||
|
||||
- if old nodejs still exist
|
||||
|
||||
> sudo apt-get purge nodejs
|
||||
> sudo apt purge nodejs
|
||||
|
||||
|
||||
### node && yarn
|
||||
@ -36,9 +46,20 @@ npm config get registry
|
||||
|
||||
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
|
||||
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
|
||||
sudo apt-get update && sudo apt-get install yarn
|
||||
sudo apt update && sudo apt install yarn
|
||||
|
||||
sudo yarn global add n
|
||||
sudo n stable
|
||||
|
||||
```
|
||||
|
||||
|
||||
### nvm
|
||||
|
||||
```bash
|
||||
|
||||
https://github.com/nvm-sh/nvm
|
||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
|
||||
nvm install 20
|
||||
npm install --global yarn
|
||||
```
|
||||
|
||||
7
vue/chrome_debug.md
Normal file
7
vue/chrome_debug.md
Normal file
@ -0,0 +1,7 @@
|
||||
# chrome 调试方法
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
在控制台源代码页 暂停程序, 可以查看函数调用堆栈
|
||||
Loading…
x
Reference in New Issue
Block a user