From 65e2409faed6b817007a6ae422fcca95400decaf Mon Sep 17 00:00:00 2001 From: veypi Date: Wed, 22 Dec 2021 17:10:35 +0800 Subject: [PATCH] update --- README.md | 31 +++++++ book/BaoShiQiongMin.md | 17 ++++ book/read.md | 5 ++ docker/docker.md | 9 -- elasticsearch/elasticsearch.md | 30 +++++++ electron/fpga/note.md | 14 +++ es/es.md | 4 +- linux/cobbler.md | 33 +++++-- linux/net.sh | 22 ++--- linux/zsh.md | 3 +- naive/naive.md | 2 + openstack/kolla.md | 17 +++- openstack/passthrough.md | 3 + verilog/c1.md | 42 +++++++++ verilog/tutrial.md | 6 ++ vue/create_npm_package.md | 10 +++ vue/iconfont.md | 58 ++++++++++++ vue/vue3.md | 156 +++++++++++++++++++++++++++++++++ 18 files changed, 428 insertions(+), 34 deletions(-) create mode 100644 book/read.md create mode 100644 electron/fpga/note.md create mode 100644 naive/naive.md create mode 100644 verilog/c1.md create mode 100644 verilog/tutrial.md create mode 100644 vue/create_npm_package.md create mode 100644 vue/vue3.md diff --git a/README.md b/README.md index e69de29..858ca22 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,31 @@ +# MyNote + +veypi 笔记[^1] +$$ +e=mc^2 +$$ + +$$ +\max \limits_{a> ~/.zshrc -echo 'DISABLE_AUTO_UPDATE="true"' >> ~/.zshrc +sed -i '1i\DISABLE_AUTO_UPDATE="true"' ~/.zshrc + chsh -s /bin/zsh sudo reboot -h now diff --git a/naive/naive.md b/naive/naive.md new file mode 100644 index 0000000..c94faf6 --- /dev/null +++ b/naive/naive.md @@ -0,0 +1,2 @@ +# naive-ui + diff --git a/openstack/kolla.md b/openstack/kolla.md index 4fcfc99..2aa8bf4 100644 --- a/openstack/kolla.md +++ b/openstack/kolla.md @@ -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 diff --git a/openstack/passthrough.md b/openstack/passthrough.md index 5cf16d2..f3b0d66 100644 --- a/openstack/passthrough.md +++ b/openstack/passthrough.md @@ -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 diff --git a/verilog/c1.md b/verilog/c1.md new file mode 100644 index 0000000..2ee59b7 --- /dev/null +++ b/verilog/c1.md @@ -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 +# cmd/tools/graph_generator.h 添加 extern void makeTetrix(int, edgefn); +make +sudo make install + +``` + diff --git a/verilog/tutrial.md b/verilog/tutrial.md new file mode 100644 index 0000000..126781d --- /dev/null +++ b/verilog/tutrial.md @@ -0,0 +1,6 @@ +# verilog + + + + + diff --git a/vue/create_npm_package.md b/vue/create_npm_package.md new file mode 100644 index 0000000..4a47484 --- /dev/null +++ b/vue/create_npm_package.md @@ -0,0 +1,10 @@ +# 如何去发布一个npm包 + + + +## 注册npm账号 + + - [官网](www.npmjs.com) + - mkdir dir + - npm init + diff --git a/vue/iconfont.md b/vue/iconfont.md index 784c29d..1416c41 100644 --- a/vue/iconfont.md +++ b/vue/iconfont.md @@ -1 +1,59 @@ # 在vue 中使用iconfont + + + +### symbol + + - 引入js + + image-20211020152019051 + + ```html + + ``` + + + + - 引入css + + ```html + + ``` + + ```html + + ``` + + - 引用icon + + ```html + + ``` + + + +### 使用组件 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) + diff --git a/vue/vue3.md b/vue/vue3.md new file mode 100644 index 0000000..041e26d --- /dev/null +++ b/vue/vue3.md @@ -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> = Symbol() + +export const store = createStore({ + 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", + }, + }, + +```