3D Printing
3D Printing Models Thingiverse 创想云 https://pinshape.com/ https://fab365.net/ Ender3 S1开箱测评
AIGC
+++ title = ‘AIGC’ tags = [“AI”] draft = false +++ Image Stable Diffusion text_encoder: Stable Diffusion uses CLIP, but other diffusion models may use other encoders such as BERT tokenizer: must match the one used by the text_encoder model scheduler: the scheduling algorithm used to progressively add noise to the image during training unet: the model used to generate the latent representation of the input vae: autoencoder module that we’ll use to decode latent representations into real images Tutorial Generative Modeling by Estimating Gradients of the Data Distribution The Annotated Diffusion Model Stable Diffusion with Diffusers Install conda create --name=ai python=3.10.9 sudo apt install nvidia-cuda-toolkit pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 pip install transformers noglob pip3 install diffusers["torch"] pip install -U xformers Colab How to Use Stable Diffusion to Generate Images Stable diffusion web-ui References ...
AIOPS
AIOPS Concepts XDR(Extended Detection and Response):综合网络、终端、云等层面 EDR(Endpoint Detection and Response):主要关注终端层面的威胁和响应 NDR(Network Detection and Response):主要关注网络层面的威胁和响应 SIEM(Security Information and Event Management) Splunk Elastic SIEM Log Rhythm DXL(Data Exchange Layer):用于安全产品之间通信的协议 SOC(Security Operations Center) IDS(Intrusion Detection System) HIDS (Host-Based Intrusion Detection System) FIM (File Integrity Monitoring) NIDS (Network-Based IDS) Signature-based IDS (Knowledge-based IDS) Anomaly-based IDS NTA(Network Traffic Analysis) DLP(Data Loss Prevention) EDLP(Endpoint-based DLP) NDLP(Network-based DLP) NAC(Network Access Control):网络准入控制,确保只有符合条件的设备才能访问 Projects OpenDXL OpenXDR OpenEDR OpenSOC GrayLog OSSIM Security Onion Apache Matron IDS Snort Suricata Wazuh Rules Syntax OSSEC Log monitoring/analysis Zeek (Bro) Samhain Labs OpenDLP Sigma OpenSearch-Using Security Analysis OpenSearch Neural Search Plugin Tutorial MSTIC: msticpy is a library for InfoSec investigation and hunting in Jupyter Notebooks Anomaly Detection Log-based Log Parser Github - logpai - Drain3 Github - logpai - Logparser Projects Github - Log-based Anomaly Detection with Deep Learning: How Far Are We? Github - logpai - loglizer Researchers Chongqing University - Hongyu Zhang Microsoft Research Asia - Shaohan Huang References Github - Anomaly Detection Learning Resources Github - Awesome Log Analysis Github - AIOps handbook Mechine Learning Libraries Github - PyOD Time series Libraries Github - tslearn DLP Document Classification Articles ...
Apisix
Apisix Install docker install docker run -d --restart unless-stopped \ --network ${DOCKER_NETWORK} \ --name ${DOCKER_APISIX_NAME} \ -p 9080:9080/tcp \ -p 9091:9091/tcp \ -p 9092:9092/tcp \ -p 9180:9180/tcp \ -p 9443:9443/tcp \ -e APISIX_STAND_ALONE=true \ -v ${PWD}/apisix/apisix.yaml:/usr/local/apisix/conf/apisix.yaml:ro \ apache/apisix:${APISIX_VERSION} References APISIX - Getting Started APISIX - Deploy Modes API7 Docs - Configure HTTPS for APISIX APISIX - Centralized Authentication with Apache APISIX and Advanced Tricks APISIX - key-auth Usage Route # create upstream curl "http://127.0.0.1:9180/apisix/admin/upstreams/1" -X PUT -d ' { "type": "roundrobin", "nodes": { "httpbin.org:80": 1 } }' # create route curl "http://127.0.0.1:9180/apisix/admin/routes/1" -X PUT -d ' { "methods": ["GET"], "host": "example.com", "uri": "/anything/*", "upstream_id": "1" }' # route with rate limit curl -i http://127.0.0.1:9180/apisix/admin/routes/1 \ -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d ' { "uri": "/index.html", "plugins": { "limit-count": { "count": 2, "time_window": 60, "rejected_code": 503, "key_type": "var", "key": "remote_addr" } }, "upstream_id": "1" }' Consumer # consumer with rate limit curl http://127.0.0.1:9180/apisix/admin/consumers -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d ' { "username":"consumer1", "plugins":{ "key-auth":{ "key":"auth-one" }, "limit-count":{ "count":2, "time_window":60, "rejected_code":403, "rejected_msg":"Requests are too many, please try again later or upgrade your subscription plan.", "key":"remote_addr" } } }' # consumer with key auth curl http://127.0.0.1:9180/apisix/admin/consumers -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d ' { "username": "jack", "plugins": { "key-auth": { "key": "auth-one" } } }'
Auth
Basic Concepts Cookies 一种用于服务器与浏览器交换数据的方式 服务器响应时通过 Set-Cookie 的 HTTP header 写入浏览器 浏览器每次请求自动在 header 中带上 cookies set cookie 时可以设置过期时间、域名、路径、HttpOnly 等条件,满足条件的请求才会带上该 cookie Session 由于 HTTP 请求是无状态的,需要在多次请求中保持用户状态的话需要额外的数据,这个数据可以是一个随机的字符串(Session ID),这样带有同样 Session ID 的请求就可以被关联为同一个会话 Session ID 一般由服务端生成,并保存在服务端,来对每一次的请求进行关联。与客户端的交互可以用 set cookie 的方式实现 Token 客户端发送请求时携带的凭证,用于表明自己的身份(Authentication) 常见 tokens: 随机字符串:通过服务端生成随机字符串(Session ID),然后通过 Set-Cookie 写入客户端的浏览器作为 token 的形式,每次请求会在 header 中的 cookie 带上该 token/session id JWT:一种按照 JWT 通用协议签名过的信息,base64 解码后为 JSON 格式。由于信息经过了签名,有防篡改的功能。 Online Debugger 示例: { "iss": "example.com", # 表示令牌是由 example.com 这个实体发行的 "sub": "1234567890", # 令牌的主题是用户 ID 为 "1234567890" 的用户 "aud": "https://api.example.com", # 令牌的目标接收方 "exp": 1516239022, # 令牌的过期时间 "nbf": 1516238422, # 令牌的生效时间 "iat": 1516237822, # 令牌的发行时间 # 自定义字段,用于传递用户的权限角色、姓名和电子邮件地址等信息 "role": "admin", "name": "John Doe", # "email": "johndoe@example.com", "custom_data": { "department": "Engineering", "team": "Security" } } OTP (One Time Password) 动态口令,一次有效的验证码机制。最常用的 OTP 为 TOTP(Time-based One-Time Password),通常 30s 一变,服务端和客户端(APP)需提前对齐种子、提前校对时间。在同一时间窗口内,客户端(APP)计算的动态口令(OTP)应与服务端一致,从而通过认证。 ...
Autonomous Vehicles
Definitions 开环 闭环 在环 回灌 PCAP:网络数据包 PCD文件:点云帧 CAN/CANFD: 总线数据包和车载以太网数据包 Tutorials 知乎 - 自动驾驶学习资料合集 Github - Road-To-Autonomous-Driving Birds-eye-view-Perception To Read Data Lake https://www.youtube.com/watch?v=Sguvhvwn8m4&list=PL-gIUf9e9CCtGr_zYdWieJhiqBG_5qSPa https://www.youtube.com/watch?v=MaQQmjtFUK8 https://aws.amazon.com/blogs/architecture/field-notes-building-an-autonomous-driving-and-adas-data-lake-on-aws/ Iceberg https://iceberg.apache.org/spark-quickstart/ AVOps https://learn.microsoft.com/en-us/azure/architecture/example-scenario/automotive/autonomous-vehicle-operations-dataops https://aws.amazon.com/cn/blogs/china/autonomous-driving-data-lake-scene-detection/ https://juicefs.com/zh-cn/blog/user-stories/li-autos-practice-of-migrating-data-from-hdfs-to-juicefs https://cloud.tencent.com/developer/article/2193529 https://www.cnblogs.com/yunqishequ/p/16876242.html https://chejiahao.autohome.com.cn/info/14983089 https://www.slidestalk.com/AWS.User_Group/59655?video https://developer.aliyun.com/article/1103513 https://learn.microsoft.com/zh-cn/azure/architecture/solution-ideas/articles/avops-architecture https://github.com/aws-samples/aws-autonomous-driving-data-lake-ros-bag-visualization-using-rviz https://www.databricks.com/dataaisummit/session/building-data-lakehouse-manage-pbs-autonomous-vehicle-data
Bash Script
References 手册 - Bash Reference Manual 检查工具 - shellcheck Shebang #!/bin/bash # 在 shebang 行中使用 env 命令 #!/usr/bin/env python Variables # 定义变量 var="a string" #等号两边不能有空格 #调用变量 echo $var echo ${var} # `""` suppress expansions except parameter expansion, arithmetic expansion, and command substitution echo "$var" # 双引号会渲染变量,输出`a string` # `''` suppress all expansions echo '$var' # 单引号不会渲染变量,输出`$var` # Arithmetic Expansion echo $((1+1)) # 输出`2` echo $((1.0/2)) # 输出`0.5` # Command Substitution # 执行命令并将输出替换原来内容 `cat some.txt` $( cat some.txt ) # Process Substitution # 执行命令并将输出写到一个临时文件中,并用临时文件名替换原来内容 # 在我们希望返回值通过文件而不是STDIN传递时很有用 diff <(ls foo) <(ls bar) #显示文件夹`foo`和`bar`中文件的区别 # Globbing 通配符 # `?`匹配一个字符,`*`匹配任意个字符 rm foo* # Brace Expansion # 花括号展开 echo Number_{1..5} echo Front-{A,B,C}-Back Positional Paramaters $0:路径 dirname $0:路径名 basename $0:文件名 $1~$9:输入参数 $@: 所有参数,$*:区别是会展开双引号中的参数 $#: 参数个数 $?:上一次退出状态,0为正常,其他为错误 $$: 当前脚本的进程识别码 Logit Expression Logit [[ exp1 && exp2 ]] and [[ exp1 || exp2 ]] or [[ ! exp1 ]] not # do command2 if command1 is sucessful command1 && command2 # do command2 if command1 is unsucessful command1 || command2 Function function func { commands return } # or func () { commands return } # local variable function func { local var var=2 return } # function arguments func () { echo "Parameter #1 is $1" # arguments are refered by position } func "$arg1" "$arg2" # call function with arguments Branching and Looping If x=5 if [[ $x -eq 5 ]]; then echo "x equals 5." elif [[ $x -eq 4 ]]; then echo "x equals 4." else echo "x does not equal 5 or 4." fi Case read -p case $REPLY in 0) echo "zero" ;; 1) echo "one" ;; 2) echo "two" ;; *) echo "other" ;; esac While count=1 while [[ $count -le 5 ]]; do echo $count count=$((count + 1)) done while true; do echo 1 sleep 1 done For for (( i=0; i<5; i=i+1 )); do echo $i done for i in {1..100}; do echo $i done # iterate arguments from the 3rd for i in "${@:3}"; do echo $i done Test test 手册 ...
Blender
Blender 帮助 帮助文档(F1) 界面 菜单栏:视图、选择、添加、网格、顶点、边、面、UV 侧边栏(N):条目、工具、视图、编辑 视图操作 右上角视图导航器 鼠标操作 放大/缩小视角(滚轮) 旋转视角(中键) 拖动视角(SHIFT + 中键) 快捷切换(~ + 数字键) 打开透视(Alt + Z) 四格视图(菜单 => 视图 => 区域 => 切换四格视图) 游标 游标回原点(SHIFT + C) 吸附游标 手动吸附(右键 => 吸附) 自动吸附(磁体 => 顶点吸附模式) 设置原点(右键 => 设置原点) 物体 选择 全选(A) 加/减选(SHIFT + 左键) 反选(CTRL + I) 物体操作 添加(SHIFT + A) 原位复制:(CTRL + C/CTRL + V) 复制并抓取(SHIFT + D) 删除(X) 合并(右键 => 合并):将多个物体合并为一个 拆分(右键 => 拆分):在一个物体中拆分为不同部分 分离(右键 => 分离):拆分为不同物体 BoolTool(侧边栏 => 编辑 => BoolTool) 变换 平移 (G) 例子:沿x轴平移10 m(G + X + 10) 缩放(S) 例子:沿x轴放大到两倍(S + X + 2) 法向缩放(ALT + S) 旋转(R) 例子:沿x轴旋转10度(R + X + 10) 编辑模式 切换编辑模式(TAB) 切换点/线/面选择(1/2/3) 选择 选择:框选、刷选、套索 间隔式弃选 面操作 细分(右键 => 细分) 挤出(E,工具栏 => 挤出选区) 沿各面挤出(ALT+ E) 挤出流形:相当于勾选了融并正交面 内插面(I) 尖分面(右键 => 尖分面):各个顶点到中心点连线 面三角化(右键 => 面三角化):各个顶点连线形成三角形 融并面(右键 => 融并面):将多个面合并成一个面 切割(K,工具栏 => 切割) 切割过程中按SHIFT键吸附中点 切分:整体切分 环切(CTRL + R,工具栏 => 环切) 居中切割(右键) 添加切割数(滚轮) 塌陷(X => 塌陷边线&面):塌陷成一个点 线操作 选择 选择循环边(ALT + 左键,菜单栏 => 选择 => 选择循环 => 循环边) 选择并排边(CTRL + ALT + 左键,菜单栏 => 选择 => 选择循环 => 并排边) 选择循环面(ALT + 左键) 填充面 从边创建面(F,右键 => 从边创建面) 三角填充(ALT + F,右键 => 填充) 栅格填充(菜单栏 => 面 => 栅格填充) 细分(右键 => 细分) 滑移(右键 => 滑移边线):沿着临边滑移 偏移边线并滑移(菜单栏 => 边 => 偏移边线并滑移):用于卡线 桥接循环边(菜单栏 => 边 => 桥接循环边) 两组循环边边数要相等 可以用于打洞 溶并边(右键 => 融并边):将边两侧的面融合 倒角(CTRL + B,工具栏 => 倒角) 鼠标滚轮切换段数 如果倒角不均匀,是因为物体缩放过,需要CTRL + A选"全部变换" 点操作 滑移(SHIFT + V,右键 => 滑移顶点,菜单栏 => 顶点 => 滑移顶点,工具栏 => 滑移顶点):沿临边移动 连接顶点 从顶点创建边(F,菜单栏 => 顶点 => 从顶点创建边):不会分割面 连接顶点路径(J,菜单栏 => 顶点 => 连接顶点路径):会分割面 点合并(M,右键 => 合并顶点) 自动合并(全选 => 右键 => 合并顶点 => 按距离) 溶并顶点(右键 => 融并顶点):将顶点相邻的面融合 点倒角(CTRL + B,工具栏 => 倒角) 平面内点的倒角:结合LoopTools创建圆环(右键 => LoopTools) 衰减编辑:操作会影响周边一定衰减半径内的邻居 修改衰减半径(滚轮) 曲线 贝塞尔曲线 控制柄(V) 自由:自由调节 对齐:左右同步 矢量:直线连接 自动:自动平滑 自由绘制(工具栏 => 自由线) Nurbs路径 曲线倒角 倒角(右侧工作区 => 物体数据属性 => 几何数据 => 倒角) 修改器 倒角修改器 阵列修改器 镜像修改器 布尔修改器 线框修改器 将面收缩成线框 反细分(菜单栏 => 边 => 反细分):菱形细分边 表面细分修改器 卡线:用环切、内插面、倒角来卡线 边线折痕(右键 => 边线折痕):设置边不会被细分 实体化修改器 可以设置厚度转换为实体 曲线修改器 让物体按照曲线的走向变形 晶格修改器 给物体添加一个扭曲空间 形变修改器 几何节点修改器 材质 实用操作 选择点 -> 球形化
Boards
Boards Arduino Nano Pinout 代码为外侧紫色数字 built-in led: 13 ESP8266 Install https://arduino.esp8266.com/stable/package_esp8266com_index.json Pinout 1 2 3 4 5 6 7 8 9 开发板管脚 D0 D1 D2 D3 D4 D5 D6 D7 D8 芯片管脚 16 5 4 0 2 14 12 13 15 电机驱动板:esp8266 motor shield 电机电源(VM):4.5V~36V,可单独供电 控制电源(VIN):4.5V~9V,可单独供电 可以短路 VM 和VIN,使用一个电源(4.5V~9V)同时给电机与控制供电 Board pin NodeMCU GPIO Arduino IDE A power 1 5 or D1 A direction 3 0 or D3 B power 2 4 or D2 B direction 4 2 or D4 definition: pins.h ...
Browser
Firefox Shortcuts Keyboard shortcuts - Perform common Firefox tasks quickly Navigation Back/Forward: cmd-left/right Down/Up a screen: space/shift-space Go to bottom/top of a page: cmd-down/up Reload: cmd-R Zoom in/out/reset: cmd++/-/0 Find: cmd-F or / Find next/previous: cmd-G/cmd-shift-G Find link: ' Search Focus search bar: cmd-K Focus address bar: cmd-L Auto complete address: ctrl-enter Open Result in New Tab: Cmd-Return Open Result in Background Tab: Cmd-Shift-Return Tabs and Windows Close Tab: cmd-W New Tab: cmd-T Close Windows: cmd-shift-W New Window: cmd-N Go to Tab: cmd-1 to 8 Go to Last Tab: cmd-9 Next Tab: Cmd-Option-Right or Ctrl-Tab Previous Tab: Cmd-Option-Left or Ctrl-Shift-Tab Move Tab Left: ctrl-shift-PageUp Move Tab Right: ctrl-shift-PageDown Misc Open History: Cmd-Shift-H Clear History: Cmd-Shift-Del Open Bookmarks Sidebar: Cmd-B Add to Bookmarks: Cmd-D Add All Tabs to Bookmarks: Cmd-Shift-D Open Downloads: Cmd-J Open Add-ons: Cmd-Shift-A Developer Tools: F12 Reader Mode: Cmd-Shift-R 插件 Google Jump to Search Box: / Web Search Navigator Next/Previous Row: j/k Next/Previous Page: l/h SwitchOmega Quick Open: Option-Shift-O