This commit is contained in:
veypi 2021-12-22 17:10:35 +08:00
parent 564847851b
commit 65e2409fae
18 changed files with 428 additions and 34 deletions

View File

@ -0,0 +1,31 @@
# MyNote
veypi 笔记[^1]
$$
e=mc^2
$$
$$
\max \limits_{a<x<b}\{f(x)\}
$$
$$
\begin{matrix}
1 & x & x^2\\
1 & y & y^2\\
1 & z & z^2\\
\end{matrix}
$$
[
^]:123
[^1]: https://veypi.com

View File

@ -4,4 +4,21 @@
技术和资本对人的异化
及时反馈的高频低质多巴胺
vs
逻辑的美
直接原因:技术刺激人的求知欲和好奇心
根本:高强度的工作和人本身的性格特质
生存价值感来源
- 人与人之间的亲密连接, 被人需要
- 职业活动的成就感 被社会需要
现代社会强迫人专注于实现第二项,当发生动荡,与社会和个人的连接断裂,就陷入无限的孤独。爱情,亲情,友情,事业,任何一项的高质量关系都能建立强烈的幸福感,不能把所有鸡蛋放到一个篮子里,亲人会逝去、爱人也可能会背叛、朋友离散不断,事业也不能一直成功,任何一项悲剧都需要其他方面带来的连接去坚守心灵防线,痛苦是一定的,但终将在其他连接的帮助下度过,并去重建,拥有新的亲人、爱人、朋友、事业。
胶囊人类
害怕拒绝与人与社会建立连接
不要盲目去追求时间效率等等,那是资本需要的,慢一点没关系,考虑对个体对人的内在发展,不要光在技术方面发展,作为一个人,自己的人生追求是什么?
我们究竟想要做什么? 想要度过什么样的人生?

5
book/read.md Normal file
View File

@ -0,0 +1,5 @@
# 读书会
自我读书会
通过读书分享交流建立与他人与自我的连接

View File

@ -59,15 +59,6 @@ reboot # or relogin
```bash
sudo apt install docker.io
sudo systemctl start docker
sudo systemctl enable docker
sudo adduser $USER docker
```
## login && push
```bash

View File

@ -1,5 +1,35 @@
# elasticsearch
## install
- [docker](https://registry.hub.docker.com/_/elasticsearch)
```bash
docker pull elasticsearch:tag
docker network create somenetwork
docker run -d --name es --net somenetwork -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" elasticsearch:tag
docker run -d --name es -p 9200:9200 -p 9300:9300 -e ES_JAVA_OPTS="-Xms512m -Xmx512m" -e "discovery.type=single-node" elasticsearch:7.14.2
# 修改配置
docker exec -it es bash
vi config/elasticsearch.yml
http.cors.enabled: true
http.cors.allow-origin: "*"
network.publish_host: 127.0.0.1
# 可视化
docker run -p 9800:9800 -d --link es:demo --name eshd containerize/elastichd
#docker run -p 1358:1358 -d appbaseio/dejavu
#docker pull mobz/elasticsearch-head:5
#docker run -d -p 9100:9100 mobz/elasticsearch-head:5
```
## goang sdk
```go

14
electron/fpga/note.md Normal file
View File

@ -0,0 +1,14 @@
# FPGA 笔记
### 学习路线
- [参考](https://b23.tv/3ptHBH)
- HDL: verilog/vhdl/systemverilog
- [hdlbits](https://hdlbits.01xz.net/wiki/Main_Page)
- 数电 电路 数字信号处理
- 开发流程rtl设计 仿真验证 逻辑综合 布局布线 时序收敛 硬件测试
-

View File

@ -6,7 +6,7 @@
```bash
docker pull elasticsearch:7.9.0
docker run -d -p 9200:9200 -e ES_JAVA_POTS="-Xms256m -Xmx256m" -e "discovery.type=single-node" --name es elasticsearch:7.9.0
docker run -d --restart=always -p 127.0.0.1:9200:9200 -e ES_JAVA_POTS="-Xms256m -Xmx256m" -e "discovery.type=single-node" --name es elasticsearch:7.9.0
docker run -p 9800:9800 -d --link es:demo --name eshd containerize/elastichd
docker logs es
@ -42,4 +42,4 @@ curl http://127.0.0.1:9200/
# 访问 127.0.0.1:9800 如下图所示, 左上角地址改成demo
```
![image-20200827143540543](https://public.veypi.com/img/screenshot/20200827143546.png)
![image-20200827143540543](https://public.veypi.com/img/screenshot/20200827143546.png)

View File

@ -1,5 +1,9 @@
# centos7 Cobbler
https://blog.csdn.net/qq_36441659/article/details/104965639
https://askubuntu.com/questions/476508/why-ubuntu-server-asks-to-insert-a-cd-rom-when-installed-from-pxe
[TOC]
## 安装
@ -7,7 +11,16 @@
```bash
# cobbler 在epel源中
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum install cobbler xinetd dhcpd
yum install cobbler xinetd dhcp bind cobbler-web debmirror pykickstart fence-agents
systemctl enable cobblerd httpd xinetd dhcpd
systemctl start cobblerd httpd xinetd dhcpd
# 需要关闭seliux和防火墙
vim /etc/selinux/config
systemctl stop firewalld.service
systemctl disable firewalld.service
reboot
```
@ -49,15 +62,7 @@ subnet 192.168.1.0 netmask 255.255.255.0 {
```
```bash
systemctl enable cobbler httpd xinetd
systemctl start cobbler httpd xinetd
# 需要关闭seliux和防火墙
vim /etc/selinux/config
systemctl stop firewalld.service
systemctl disable firewalld.service
reboot
# 检测 会提示一些操作, 根据需要去做
cobbler check
@ -102,8 +107,11 @@ cobbler sync
# http://mirrors.aliyun.com/centos 下载镜像, 下载minimal版方便测试
mkdir /mnt/centos7
mount -t iso9660 -o loop,ro ~/CentOS-7-x86_64-Minimal-2003.iso /mnt/centos7
# 导入
cobbler import --name=centos7 --path=/mnt/centos7
cobbler import --name=u20 --bread=ubuntu --os-version=focal --path=/mnt/u20
cobbler signature update
## profile url http://192.168.10.60/cblr/svc/op/ks/profile/centos7-x86_64
## 访问这个链接可以查看完整版的ks文件 也可以验证ks是否正确
@ -343,6 +351,13 @@ cobbler profile report --name=centos7-x86_64
```
#### ubuntu20-server
```bash
# 需要将该文件作为initrd文件 否则会出现cd
/install/netboot/ubuntu-installer/amd64/initrd.gz
/var/lib/tftpboot/images/u20
```

View File

@ -8,18 +8,20 @@
#!/bin/sh
LANG=""
up_time0=`ip -s link show $1 | grep "TX" -A 1 | sed -n '2p' | awk '{print $1}'`
down_time0=`ip -s link show $1 | grep "RX" -A 1 | sed -n '2p' | awk '{print $1}'`
while true
do
up_time1=`ifconfig $1 | grep "TX packets" | awk '{print $5}'`
down_time1=`ifconfig $1 | grep "RX packets" | awk '{print $5}'`
up_time1=`ip -s link show $1 | grep "TX" -A 1 | sed -n '2p' | awk '{print $1}'`
down_time1=`ip -s link show $1 | grep "RX" -A 1 | sed -n '2p' | awk '{print $1}'`
sleep 1
clear
up_time2=`ifconfig $1 | grep "TX packets" | awk '{print $5}'`
down_time2=`ifconfig $1 | grep "RX packets" | awk '{print $5}'`
up_time=`expr $up_time2 - $up_time1`
down_time=`expr $down_time2 - $down_time1`
up_time=`expr $up_time / 1024`
down_time=`expr $down_time / 1024`
echo 上传速度: $up_time KB/s
echo 下载速度: $down_time KB/s
up_time2=`ip -s link show $1 | grep "TX" -A 1 | sed -n '2p' | awk '{print $1}'`
down_time2=`ip -s link show $1 | grep "RX" -A 1 | sed -n '2p' | awk '{print $1}'`
up_time=`expr $[(up_time2 - up_time1) / 1024]`
down_time=`expr $[(down_time2 - down_time1) / 1024]`
up_time_all=$(expr $[(up_time2 - up_time0) / 1024 / 1024])
down_time_all=$(expr $[(down_time2 - down_time0) / 1024 / 1024])
echo 上传速度: $up_time KB/s $up_time_all MB
echo 下载速度: $down_time KB/s $down_time_all MB
done

View File

@ -6,7 +6,8 @@ sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/i
sh -c "$(curl -fsSL https://public.veypi.com/install_zsh.sh)"
echo 'PROMPT=%m\ $PROMPT' >> ~/.zshrc
echo 'DISABLE_AUTO_UPDATE="true"' >> ~/.zshrc
sed -i '1i\DISABLE_AUTO_UPDATE="true"' ~/.zshrc
chsh -s /bin/zsh
sudo reboot -h now

2
naive/naive.md Normal file
View File

@ -0,0 +1,2 @@
# naive-ui

View File

@ -48,12 +48,15 @@ python tools/build.py keystone --registry docker.local:5000 --push
## deploy
```bash
git clone https://github.com/openstack/kolla.git -b stable/train
git clone https://github.com/openstack/kolla-ansible.git -b stable/train
# stable/train 与ansible<10 版本冲突 有bug
git clone https://github.com/openstack/kolla.git -b 9.0.0
git clone https://github.com/openstack/kolla-ansible.git -b 9.0.0
python3 -m venv ~/kolla_venv
source ~/kolla_venv/bin/activate
# centos7 缺 utf-8 字符集
localedef -v -c -i en_US -f UTF-8 en_US.UTF-8
pip install -U pip
pip install 'ansible<2.10'
pip install ansible
pip install ./kolla
pip install ./kolla-ansible
sudo mkdir -p /etc/kolla
@ -74,9 +77,17 @@ kolla-ansible -i ./all-in-one bootstrap-servers
kolla-ansible -i ./all-in-one prechecks
kolla-ansible -i ./all-in-one deploy
# 测试 连接
ansible -i multinode all -m ping
# multi_node
# bootstrap-servers 主要为安装docker-ce
vim /root/kolla_venv/share/kolla-ansible/ansible/roles/baremetal/defaults/main.yml
# 去掉docker gpg检查 断网使用
docker_yum_gpgcheck: false
enable_docker_repo: false
kolla-ansible -i ./multinode bootstrap-servers
kolla-ansible -i ./multinode prechecks
kolla-ansible -i ./multinode deploy

View File

@ -1,5 +1,8 @@
# 显卡穿透
### https://docs.openstack.org/nova/stein/admin/pci-passthrough.html#:~:text=The%20PCI%20passthrough%20feature%20in,attached%20to%20a%20PCI%20bus.
### https://blog.csdn.net/u012336567/article/details/74743168
https://pve.proxmox.com/wiki/Pci_passthrough

42
verilog/c1.md Normal file
View File

@ -0,0 +1,42 @@
# verilog 环境
### win
```bash
# Quartus
# 参考 https://fpgasoftware.intel.com/static/quick_start_guide/quick_start_guide_21.1_zh-cn.pdf
```
### mac
```bash
git clone https://github.com/steveicarus/iverilog.git
cd iverilog
# yosys综合工具
git clone https://github.com/YosysHQ/yosys.git
cd yosys
brew tap Homebrew/bundle && brew bundle
make
sudo make install
# 显示电路图工具
cd https://gitlab.com/graphviz/graphviz.git
cd graphviz
brew install automake libtool autoconf
./autogen.sh
./configure
# 编译可能需要修改源码 我用的分支stable_release_2.44.0 改了两处 自己可以根据报错去看源码处理
# 一处 lib/sfdpgen/PriorityQueue.c mollc.h 改为 #include <sys/malloc.h>
# cmd/tools/graph_generator.h 添加 extern void makeTetrix(int, edgefn);
make
sudo make install
```

6
verilog/tutrial.md Normal file
View File

@ -0,0 +1,6 @@
# verilog

10
vue/create_npm_package.md Normal file
View File

@ -0,0 +1,10 @@
# 如何去发布一个npm包
## 注册npm账号
- [官网](www.npmjs.com)
- mkdir dir
- npm init

View File

@ -1 +1,59 @@
# 在vue 中使用iconfont
### symbol
- 引入js
<img src="https://public.veypi.com/img/screenshot/20211020152019.png" alt="image-20211020152019051" style="zoom:40%;" />
```html
<script type="text/javascript" src=""></script>
```
- 引入css
```html
<style type="text/css">
.icon {
width: 1em; height: 1em;
vertical-align: -0.15em;
fill: currentColor;
overflow: hidden;
}
</style>
```
```html
<link rel="stylesheet" type="text/css" href="">
```
- 引用icon
```html
<svg class="icon" aria-hidden="true">
<use xlink:href="#icon-xxx"></use>
</svg>
```
### 使用组件 one-icon
```typescript
import OneIcon from '@veypi/one-icon'
// 注意下载下来的js文件放public文件夹里
Vue.use(OneIcon, {href: './icon.js'})
// 或者使用阿里cdn 好处是每次添加icon后不用更新 但是无法离线或内网使用
Vue.use(OneIcon, {href: 'https://at.alicdn.com/t/font*****.js'})
```
### 参考
- [官方文档](https://www.iconfont.cn/help/detail?spm=a313x.7781069.1998910419.d0091c141&helptype=code)

156
vue/vue3.md Normal file
View File

@ -0,0 +1,156 @@
# vue3 typescript vue-router vuex setup
### 最近发现vue3相关库都更新的差不多了尝试学习了新的版本, 使用setup 的确变了很多像ref 、prop面目全非刚开始用还找了很久
## 创建项目
```bash
yarn create vite name --template vue-ts
```
### [vue-router](https://next.router.vuejs.org/zh/installation.html)
```bash
# 安装
npm install vue-router@4
```
```typescript
// vim router/index.ts
import { createRouter, createWebHistory } from 'vue-router'
const router = createRouter({
history: createWebHistory(),
routes: [
{
path: '/',
name: 'home',
component: () => import('../view/file.vue')
},
{
path: '/t',
name: 't',
component: () => import('../view/file.vue')
}
//...
],
})
export default router
```
### [vuex](https://next.vuex.vuejs.org/zh/guide/typescript-support.html)
```bash
# 安装
yarn add vuex@next --save
```
```typescript
// store/index.ts
import { InjectionKey } from 'vue'
import { createStore, useStore as baseUseStore, Store } from 'vuex'
export interface State {
count: number
}
export const key: InjectionKey<Store<State>> = Symbol()
export const store = createStore<State>({
state: {
count: 0
},
mutations: {
increment(state) {
state.count ++
}
},
actions: {
asd(context) {
context.commit('increment')
}
}
})
// 定义自己的 `useStore` 组合式函数
export function useStore () {
return baseUseStore(key)
}
```
### main.ts
```typescript
import {createApp} from 'vue'
import App from './App.vue'
import router from './router'
import {store, key} from './store'
const app = createApp(App)
app.use(router)
app.use(store, key)
app.mount('#app')
```
## 使用技巧
```typescript
// prop vue3 v-module 绑定的事件名改了
// setup
let emits = defineEmits<{
(e: 'update:modelValue', v: boolean): void
}>()
let props = defineProps<{
modelValue: boolean
}>()
function setValue(b: boolean) {
emits('update:modelValue', b)
}
```
```typescript
// slots 中默认插槽
// props 允许为空的写法, 否则会报错
import {computed, useSlots, withDefaults} from 'vue'
const slots = useSlots()
const icon = computed(() => {
// @ts-ignore
if (slots.default) return slots.default()[0].children?.trim()
return ''
})
const props = withDefaults(defineProps<{
color?: string
}>(), {
color: ''
})
```
```typescript
// webstorm 识别路径别名@
// 在tsconfig.json complierOptions 下添加
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
// vite.config.js
resolve: {
// https://vitejs.dev/config/#resolve-alias
alias: {
"@": "/src",
},
},
```