From f72002253edea79c7f669a9da56411198a53d8d1 Mon Sep 17 00:00:00 2001 From: zfunnily Date: Sun, 31 Mar 2024 01:06:22 +0000 Subject: [PATCH] deploy: zfunnily/hugo_blog@a058e7a31801e05f458fc00a71adda77a68033c7 --- 1/01/30/index.html | 2 +- 1/01/blasphemous/index.html | 2 +- 1/01/blood/index.html | 2 +- 2020/08/coredns/index.html | 2 +- 2020/08/dashboard/index.html | 2 +- 2020/08/dockersecret/index.html | 2 +- 2020/08/dockerweb/index.html | 2 +- 2020/08/firstk8s/index.html | 2 +- 2020/08/heapster/index.html | 2 +- 2020/08/ingress/index.html | 2 +- 2020/08/k8sinstall/index.html | 2 +- 2020/08/licode/index.html | 2 +- 2020/08/macffmpeg/index.html | 2 +- 2020/08/nsf/index.html | 2 +- 2020/08/owt-client-javascript/index.html | 2 +- 2020/08/owtservercomplie/index.html | 2 +- 2020/08/prometheusgrafana/index.html | 2 +- 2020/08/pvc/index.html | 2 +- 2020/08/statefulset/index.html | 2 +- 2020/09/ffmpegpicture/index.html | 2 +- 2020/09/ffmpegvideo/index.html | 2 +- 2020/09/ffmpegvideow/index.html | 2 +- 2020/09/libeventimer/index.html | 2 +- .../index.html" | 2 +- .../index.html" | 2 +- .../10/vimplus\345\277\253\346\215\267\351\224\256/index.html" | 2 +- .../index.html" | 2 +- .../index.html" | 2 +- .../index.html" | 2 +- .../index.html" | 2 +- "2020/11/OpenResty\345\210\235\346\216\242/index.html" | 2 +- .../index.html" | 2 +- .../index.html" | 2 +- 2020/11/glibcnotfound/index.html | 2 +- 2020/11/go-builds/index.html | 2 +- 2020/11/lastbattlelogin/index.html | 2 +- 2020/11/lastbattleone/index.html | 2 +- 2020/11/lastbattleserver/index.html | 2 +- .../index.html" | 2 +- .../index.html" | 2 +- 2020/12/ccnet/index.html | 2 +- 2020/12/ccnetone/index.html | 2 +- 2020/12/cinnamon3.0/index.html | 2 +- 2020/12/gocolly/index.html | 2 +- 2020/12/grpc/index.html | 2 +- 2020/12/iomodels/index.html | 2 +- 2020/12/reserve/index.html | 2 +- 2020/12/syncmutex/index.html | 2 +- 2020/12/tcp/index.html | 2 +- 2021/01/attandintel/index.html | 2 +- 2021/01/cgostruct/index.html | 2 +- 2021/01/chararray/index.html | 2 +- 2021/01/goslience/index.html | 2 +- 2021/01/lastbattle/index.html | 2 +- 2021/01/pbempty/index.html | 2 +- 2021/01/sds/index.html | 2 +- 2021/01/skynetecho/index.html | 2 +- 2021/01/skynetprotobuf/index.html | 2 +- 2021/01/vscodedebugredis/index.html | 2 +- 2021/01/vscoderedis/index.html | 2 +- 2021/01/ziplist/index.html | 2 +- 2021/02/JWT/index.html | 2 +- 2021/02/chicken/index.html | 2 +- 2021/02/compilation/index.html | 2 +- 2021/02/dynamic/index.html | 2 +- 2021/02/timer/index.html | 2 +- 2021/03/atoianditoa/index.html | 2 +- 2021/03/coroutineone/index.html | 2 +- 2021/03/coroutinetwo/index.html | 2 +- 2021/03/gamexian/index.html | 2 +- 2021/03/gomod/index.html | 2 +- 2021/03/sort/index.html | 2 +- 2021/04/hugo/index.html | 2 +- 2021/05/lua_next/index.html | 2 +- 2021/05/settopandpop/index.html | 2 +- 2021/06/distribute/index.html | 2 +- 2021/06/goredis/index.html | 2 +- 2021/08/except/index.html | 2 +- 2021/08/ugui/index.html | 2 +- 2021/09/move/index.html | 2 +- 2021/09/music/index.html | 2 +- 2021/09/screen/index.html | 2 +- 2021/09/transform/index.html | 2 +- 2021/09/upgradegcc/index.html | 2 +- 2021/09/vimchange/index.html | 2 +- 2021/10/blogmigration/index.html | 2 +- 2021/10/four/index.html | 2 +- 2021/10/gop2pone/index.html | 2 +- 2021/10/gop2pthree/index.html | 2 +- 2021/10/gop2ptwo/index.html | 2 +- 2021/10/shell/index.html | 2 +- 2021/10/skynetone/index.html | 2 +- 2021/10/skynetthree/index.html | 2 +- 2021/10/skynettwo/index.html | 2 +- 2021/11/gop2pfour/index.html | 2 +- 2021/11/randomquotes/index.html | 2 +- 2021/11/webrtcdesk/index.html | 2 +- 2021/11/webrtcpeerconnection/index.html | 2 +- 2021/12/astar/index.html | 2 +- 2021/12/dark/index.html | 2 +- 2021/12/music/index.html | 2 +- 2021/12/nginx/index.html | 2 +- 2021/12/openresty-upload/index.html | 2 +- 2021/12/shortcodes/index.html | 2 +- 2022/02/jwt/index.html | 2 +- 2022/02/san/index.html | 2 +- 2022/03/afk/index.html | 2 +- 2022/03/blog/index.html | 2 +- 2022/03/http/index.html | 2 +- 2022/03/https/index.html | 2 +- 2022/03/reload/index.html | 2 +- 2022/03/timer/index.html | 2 +- 2022/03/timerskynet/index.html | 2 +- 2022/04/cginc/index.html | 2 +- 2022/04/graphics/index.html | 2 +- 2022/04/shader01/index.html | 2 +- 2022/04/shaderbase/index.html | 2 +- 2022/04/shaderfunc/index.html | 2 +- 2022/04/shaderhelloworld/index.html | 2 +- 2022/04/shadermathematic/index.html | 2 +- 2022/04/shaderrenderpipline/index.html | 2 +- 2022/05/baidu/index.html | 2 +- 2022/05/geometry/index.html | 2 +- 2022/05/refraction/index.html | 2 +- 2022/05/shaderalpha/index.html | 2 +- 2022/05/shaderbase/index.html | 2 +- 2022/05/shaderlighting/index.html | 2 +- 2022/06/cicd/index.html | 2 +- 2022/10/netch/index.html | 2 +- 2023/05/particlesystem01/index.html | 2 +- 2023/10/DDNS/index.html | 2 +- 2023/11/30/index.html | 2 +- 2023/11/chatglm/index.html | 2 +- 2023/11/gitaction/index.html | 2 +- 2023/11/mysql/index.html | 2 +- 2023/11/python/index.html | 2 +- 2023/11/svn/index.html | 2 +- 2023/11/wsl/index.html | 2 +- 2023/11/wsl2/index.html | 2 +- 2023/12/30/index.html | 2 +- 2024/02/02/index.html | 2 +- categories/AI/index.xml | 2 +- categories/IT.Linux/index.xml | 2 +- categories/IT/index.xml | 2 +- categories/NAS/index.xml | 2 +- "categories/SVN\345\220\210\345\271\266/index.xml" | 2 +- categories/index.xml | 2 +- .../\345\215\232\345\256\242\350\256\260\344\272\213/index.xml" | 2 +- .../index.xml" | 2 +- "categories/\346\270\270\346\210\217/index.xml" | 2 +- "categories/\347\247\221\346\231\256/index.xml" | 2 +- "categories/\347\274\226\347\250\213.C/index.xml" | 2 +- "categories/\347\274\226\347\250\213.Golang/index.xml" | 2 +- "categories/\347\274\226\347\250\213.Lua/index.xml" | 2 +- "categories/\347\274\226\347\250\213.P2P/index.xml" | 2 +- "categories/\347\274\226\347\250\213.Unity3D/index.xml" | 2 +- "categories/\347\274\226\347\250\213.UnityShader/index.xml" | 2 +- .../index.xml" | 2 +- .../index.xml" | 2 +- .../index.xml" | 2 +- .../index.xml" | 2 +- .../index.xml" | 2 +- .../index.xml" | 2 +- .../index.xml" | 2 +- "categories/\347\274\226\347\250\213/index.xml" | 2 +- .../\350\207\252\345\212\250\351\203\250\347\275\262/index.xml" | 2 +- "categories/\350\275\254\350\275\275/index.xml" | 2 +- .../index.xml" | 2 +- "categories/\351\232\217\347\254\224/index.xml" | 2 +- english/index.xml | 2 +- index.xml | 2 +- post/index.xml | 2 +- sitemap.xml | 2 +- tags/URP/index.xml | 2 +- tags/cpu/index.xml | 2 +- tags/docker/index.xml | 2 +- tags/except/index.xml | 2 +- tags/ffmpeg/index.xml | 2 +- tags/gcc/index.xml | 2 +- tags/glibc/index.xml | 2 +- tags/hugo/index.xml | 2 +- tags/index.xml | 2 +- tags/k8s/index.xml | 2 +- tags/music/index.xml | 2 +- tags/nginx/index.xml | 2 +- tags/nsf/index.xml | 2 +- tags/p2p/index.xml | 2 +- tags/randomquotes/index.xml | 2 +- tags/redis/index.xml | 2 +- tags/rsync/index.xml | 2 +- tags/screen/index.xml | 2 +- tags/shader/index.xml | 2 +- .../index.xml" | 2 +- tags/shortcodes/index.xml | 2 +- tags/skynet/index.xml | 2 +- tags/vim/index.xml | 2 +- tags/weekly/index.xml | 2 +- tags/year/index.xml | 2 +- .../\345\255\246\344\271\240\347\254\224\350\256\260/index.xml" | 2 +- "tags/\345\256\232\346\227\266\345\231\250/index.xml" | 2 +- "tags/\346\212\275\345\215\241/index.xml" | 2 +- .../\350\257\273\344\271\246\347\254\224\350\256\260/index.xml" | 2 +- .../\351\225\277\345\256\211\345\215\201\346\227\245/index.xml" | 2 +- thinking/index.xml | 2 +- 204 files changed, 204 insertions(+), 204 deletions(-) diff --git a/1/01/30/index.html b/1/01/30/index.html index 6cd9c951a..a41382c39 100644 --- a/1/01/30/index.html +++ b/1/01/30/index.html @@ -6,7 +6,7 @@ 搜索

文章目录


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/1/01/blasphemous/index.html b/1/01/blasphemous/index.html index 00d737b91..1ce093a47 100644 --- a/1/01/blasphemous/index.html +++ b/1/01/blasphemous/index.html @@ -8,7 +8,7 @@ 游戏设计.地图设计 游戏设计.类银河恶魔城

地图设计

  1. 非线性结构: 游戏的地图是非线性的,允许玩家在一个庞大的世界中自由探索。玩家可以决定选择不同的路径和区域,解锁新的能力以访问之前无法到达的地方。
  2. 多样化的区域: 地图中包含了多个主题区域,每个区域都有独特的视觉风格和环境。这些区域包括神秘的教堂、黑暗的地牢、森林和其他充满挑战的场所。
  3. 高度垂直设计: 地图不仅横向广阔,还在垂直方向上具有深度。有很多爬升和下降的区域,需要玩家运用角色的移动技能来穿越不同高度的层次。
  4. 互联的快速旅行点: 游戏中设计了一些互联的快速旅行点,方便玩家在地图之间快速移动。这有助于减轻地图探索的复杂性,并允许玩家更轻松地返回之前的区域。
  5. 隐藏通道和谜题: 地图中隐藏着许多秘密通道和解谜元素。玩家需要发现这些隐藏区域,可能需要通过击败强大的敌人或解决环境谜题来解锁。
  6. Boss战区域: 游戏中的Boss战通常在独特的区域进行,这些区域设计得非常引人注目,并与敌人和环境元素相结合,为战斗增添了戏剧性和挑战性。
  7. 视觉和音频元素: 地图的设计与游戏的音乐和音效相互呼应,营造出一种独特的氛围,增强了玩家的沉浸感。

非线性结构

  1. 核心机制和能力解锁: 设计一个游戏中的核心机制,例如玩家通过时间的推移解锁新的能力或技能。这些能力可以包括双跳、爬墙、远程攻击等,使得玩家可以进入之前无法到达的区域。
  2. 多路径和分支: 在地图中设计多个路径和分支,允许玩家自由选择前进的方向。每个路径可以通往不同的区域或目标,增加了游戏的多样性和回放价值。
  3. 隐藏区域和秘密通道: 在地图中添加隐藏的区域和秘密通道,需要玩家发现和解锁。这些通道可以连接不同的地区,提供额外的探索和奖励。
  4. 有条件的区域: 设计需要特定能力或道具才能进入的区域。这样的设计鼓励玩家不断解锁新的能力,同时增加了地图的深度。
  5. 快速旅行点: 为玩家提供一些快速旅行点,使他们能够迅速在地图之间移动。这有助于减轻非线性地图可能带来的探索疲劳。
  6. 区域之间的联系: 考虑设计一些区域之间的联系,例如隐藏的通道、电梯或传送门。这样的设计增加了地图的一体感,使玩家能够更自由地穿越整个游戏世界。
  7. 任务和剧情分支: 在地图上添加各种任务和剧情分支,玩家的选择可以影响故事情节的发展和最终目标。这样的设计使得玩家在游戏中能够塑造他们的经验。
  8. 平衡和引导: 尽管是非线性的,但地图仍然需要一些平衡,以确保玩家可以平滑地进行探索而不会感到迷失。同时,使用环境元素、标志和视觉引导来引导玩家前进。

多样化的区域

  1. 主题设置: 每个区域都可以有独特的主题,例如森林、沼泽、城堡、沙漠、冰雪地带等。每个主题都应该展现出不同的视觉特点,包括颜色、纹理、植被等。
  2. 地形和地貌: 区域的地形和地貌应该与其主题相匹配。例如,在森林区域可能有大量的树木、溪流和草地,而在沙漠区域可能有沙丘和岩石。
  3. 环境元素: 添加各种各样的环境元素,如风、雨、雪、阳光等,以增强每个区域的氛围。这些元素可以影响玩家的感官体验。
  4. 生物多样性: 在每个区域中加入各种各样的生物和怪物。这不仅使得区域更具挑战性,而且增加了生动感。每个生物应该适应其所在区域的生态系统。
  5. 建筑和结构: 包括不同类型的建筑和结构,如城堡、洞穴、庙宇、村庄等。这些建筑可以提供不同的战斗和探索体验。
  6. 天空和天气: 区域的天空和天气状况可以对氛围产生深远影响。在设计时考虑添加日夜变化、云层和不同的天气效果。
  7. 音乐和声效: 为每个区域选择适合主题的音乐和声效。音乐可以加强区域的氛围,声效可以模拟环境和生物的声音。
  8. 特殊地标: 在每个区域中加入一些特殊的地标或标志性建筑,使玩家容易辨认区域,并为其增加独特性。
  9. 变化和转变: 在游戏进行中,考虑通过故事情节或玩家的行为引起区域的变化。例如,可能发生季节变化、天灾、建筑被摧毁等。
  10. 与主线故事的关联: 每个区域都应该与游戏的主线故事有一定的关联,这样玩家在探索过程中能够获得更多关于游戏世界的信息。

高度垂直设计

  1. 多层次结构: 将地图分为多个层次,每个层次具有不同的高度。这可以通过楼梯、电梯、梯子等结构实现。
  2. 崖壁和悬崖: 在地图中加入崖壁和悬崖,使玩家需要小心横穿,或者使用特殊能力来攀爬下降。
  3. 飞行和滑翔: 提供一些区域,玩家可以通过飞行或滑翔来穿越,从而到达不同高度的位置。这可以通过飞行道具、羽翼等方式实现。
  4. 爬墙和攀爬: 设计一些可爬升的墙壁或结构,使玩家能够在垂直方向上移动。这可以是一种能力,或者是一种可以通过游戏中的道具获得的技能。
  5. 水平平台和悬挂结构: 在高度垂直的地图中,加入水平的平台和悬挂结构,使玩家需要在不同高度上进行水平移动。
  6. 垂直挑战: 设计一些垂直挑战,例如攀登高塔、跳跃悬崖,以测试玩家的技能和反应速度。
  7. 地下和高空区域: 在地图中加入地下洞穴或高空平台,使玩家在不同的地理环境中进行垂直探索。
  8. 视觉提示: 使用视觉元素来引导玩家,以便他们了解不同高度之间的连接和路径。
  9. 互通性和交叉点: 创建一些高度上的交叉点,使玩家可以在不同的层次之间轻松切换。这可以增加地图的互通性和流动性。
  10. 敌人和战斗设计: 在高度垂直设计中,敌人和战斗元素也应该考虑垂直方向。设计一些敌人可能在高处攻击,或者玩家需要从高处攻击的场景,以增加战斗的复杂性。

互联的快速旅行点

  1. 地图布局和连接性: 在地图设计中,确定主要城镇、关键地标或其他中心位置,然后在这些位置安置快速旅行点。这些点应该容易找到,并且在地图中形成一种连通性。
  2. 传送门或传送站: 使用传送门、传送站或其他类似的机制来实现快速旅行。这些点可以是城市的传送门、特殊建筑物内的传送站或者其他具有代表性的地标。
  3. 解锁机制: 考虑在游戏中的某个时刻或通过特定的任务或活动解锁快速旅行点。这鼓励玩家探索并完成游戏中的各种挑战。
  4. 有限但足够: 快速旅行点的数量应该足够,使得玩家感到方便,但又不能太多,以免影响游戏的探索感。考虑在游戏开始时只有一两个点,随着玩家的进展逐渐解锁更多。
  5. 交互式地图界面: 提供一个交互式的地图界面,使玩家可以轻松选择目标地点。这可以是一个虚拟地图,玩家可以在上面点击选择目的地。
  6. 可视标志: 让快速旅行点在游戏中容易识别。这可以通过在地图上标记特殊的图标、光效或其他视觉元素来实现。
  7. 快速动画和加载: 使快速旅行的过程迅速而顺畅,通过添加快速的动画和短时间的加载屏幕来确保玩家不会感到不耐烦。
  8. 与故事情节的整合: 将快速旅行点的位置与游戏的故事情节整合在一起,这样玩家在使用这些点的时候会感到更加自然和有意义。
  9. 玩家的自主选择: 让玩家有一定的自主选择权,例如让他们能够选择快速旅行到哪个地点,而不是强制性地将他们送到一个特定的位置。

隐藏通道和谜题

隐藏通道

  1. 虚拟墙壁或隐形门: 在某些墙壁上设计虚拟或隐形的门,通过特定的操作或使用特殊能力才能发现。
  2. 可推动的物体: 在地图中放置一些物体,玩家可以推动它们以暴露隐藏的通道。
  3. 光影效果: 使用光影效果来暗示隐藏通道的位置。这可以包括透过墙壁的微弱光亮、暗示出口位置的亮点等。
  4. 可互动的画: 设计一些可互动的画,玩家通过与其互动或者触发一些条件后,画会移开,显示出隐藏的通道。
  5. 音效提示: 使用音效来引导玩家找到隐藏通道的位置。可能有一些微弱的声音或者风声,提示玩家附近可能有隐藏通道。
  6. 图腾或标记: 在地图上放置一些图腾、标记或符号,暗示玩家在这附近可能有隐藏通道。

谜题

  1. 物品组合: 玩家需要收集和组合不同的物品,以解锁通往新区域的谜题。
  2. 机关操作: 设计一些机关,玩家需要在地图上找到并操作这些机关,以打开封闭的门或者激活其他机制。
  3. 密码和序列: 创建需要输入密码或按照特定序列行动的谜题,可能涉及到找到线索或解锁密室来获取相关信息。
  4. 光影和投影: 利用光影和投影效果,设计需要正确对齐或投射影子的谜题。
  5. 时间压力: 在谜题中引入时间元素,玩家需要在有限时间内完成一系列动作或任务。
  6. 数字和符号: 使用数字、符号或密码等元素,让玩家通过解谜或者收集线索来解锁谜题。
  7. 平衡和重量: 利用平衡和重量要素,设计需要平衡或者使用物品的谜题。
  8. 音乐和音符: 利用音乐元素,设计需要演奏音符或按照音符序列行动的谜题。
  9. 多层次结构: 利用地图的多层次结构,设计需要在不同层次之间切换或者使用特殊能力的谜题。
  10. 环境互动: 让玩家能够与环境互动,例如改变水位、开启瀑布等,以解锁隐藏区域。

Boss战区域

  1. 独特的环境设计: 为Boss战区域创建一个独特的环境,与游戏的主题和Boss的背景故事相契合。可以考虑使用特殊的纹理、光影效果、颜色和音效来营造战斗氛围。
  2. 互动元素: 在Boss战场景中加入一些互动元素,使玩家能够利用环境来躲避攻击或者获取优势。这可以包括可破坏的障碍物、可用于躲避的区域等。
  3. 地形变化: 设计战斗区域中的地形变化,例如高低起伏、平台、楼梯等,以增加战斗的多样性和策略性。
  4. 环境交互: 利用Boss战场景的环境元素,例如岩石、树木、水池等,使它们能够影响Boss的攻击或提供玩家额外的机会。
  5. Boss特殊能力: 考虑在Boss战区域中引入一些特殊的能力或机制,使得Boss能够与环境互动,提高战斗的复杂性。
  6. 战斗阶段变化: 设计Boss战斗的多个阶段,每个阶段可能伴随着战场环境的变化,为玩家带来新的挑战和策略。
  7. 引导元素: 在Boss战区域中使用引导元素,帮助玩家理解Boss的攻击模式和区域布局。这可以通过视觉标志、动画或者游戏提示来实现。
  8. 战斗流畅性: 确保Boss战场景的流畅性,避免过于复杂的布局,以保证玩家能够专注于战斗而不被环境阻碍。
  9. 音乐和音效: 使用适当的音乐和音效来强化Boss战斗的氛围。这包括Boss的音效、战斗音乐以及环境音效。
  10. 战斗挑战性: 确保Boss战斗区域的设计能够提供足够的挑战,但也要避免过度的困难,以确保玩家能够有机会学习Boss的模式并取得胜利。

视觉和音频元素

视觉元素

  1. 独特的艺术风格: 开发游戏时选择一个独特而令人印象深刻的艺术风格。这可以是像素艺术、卡通风格、写实主义等,与游戏的主题和氛围相契合。
  2. 色彩搭配: 使用恰当的色彩搭配来传达情感和主题。不同颜色可以引起玩家的不同情绪,例如红色可能与紧张和充满活力相关。
  3. 动画和效果: 添加动画和视觉效果,以增强游戏的动感和吸引力。这可能包括粒子效果、光影变化、运动效果等。
  4. 照明设计: 精心设计游戏中的照明效果,以创建战斗、悬念或安静的氛围。照明可以直接影响玩家的感知和体验。
  5. 视角切换: 利用不同的视角来呈现不同的场景。例如,切换到第一人称视角可以增强玩家的沉浸感,而俯视视角则有助于展示全局地图。
  6. 图标和标志: 使用清晰和易识别的图标和标志来表示物品、任务或特殊区域。这有助于玩家迅速理解并参与游戏。
  7. 环境交互: 在游戏中添加可以互动的环境元素,如摧毁物体、打开门、改变天气等。这可以使玩家感到他们对游戏世界的影响。

音频元素:

  1. 游戏音乐: 为游戏选择合适的音乐,以传达情感、主题和氛围。背景音乐可以在不同场景中变化,增强玩家的感知。
  2. 音效效果: 添加高质量的音效效果,使玩家能够听到并感受到游戏中的各种动作和事件。例如,脚步声、武器声音、环境音效等。
  3. 立体声和方向性音效: 利用立体声和方向性音效来模拟声音的方向和距离。这有助于提高玩家的沉浸感和空间感。
  4. 语音演绎: 在需要时使用语音演绎来表达角色的情感和故事情节。好的语音演绎可以使角色更具深度和个性。
  5. 情境音效: 根据游戏场景的需要,添加特定的情境音效,如风声、水流声、动物叫声等。这可以创造出更真实和生动的环境。
  6. 音频反馈: 通过音频反馈来确认玩家的行动或者在游戏中取得的进展。这可以包括获得奖励的音效、任务完成的音效等。
  7. 动态音频调整: 根据游戏情节和玩家行为动态调整音频。例如,在紧张的战斗场景中增加音量,或者在安静的探险时减小音量。
  8. 音频提示: 使用音频提示引导玩家,例如通过特定音效表示隐藏通道的位置,或者通过音频线索提示即将到来的敌人。

参考

来自chatgpt

--完--


See Also


See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/1/01/blood/index.html b/1/01/blood/index.html index 0bb207672..bbb9cc098 100644 --- a/1/01/blood/index.html +++ b/1/01/blood/index.html @@ -6,7 +6,7 @@ 搜索

文章目录

血污boos

《血污:夜之仪式》

BOSS一/猎魔斩月

  1. 挑衅 + 招架
  2. 飞镖
  3. 横砍
  4. 劈砍
  5. 冲刺 + 横砍
  6. 跳起来 + 劈砍
  7. 跳起来 + 上挑
  8. 跳起来 + 上挑 + 劈砍
  9. 钩锁 + 劈砍
  10. 刀刃,火焰附魔 + 上面的轮回

影分身

格莫瑞

最终boss

没有后续boss的分析

  1. 地图设计的很好, 探索的乐趣更多
  2. 数值有点崩坏,拿到高数值的attack可以直接当莽夫
  3. 只有在打斩月的时候才有点乐趣,那会还没拿到高攻击力的武器

问题:

  1. 为什么只有第一个boss才感觉到乐趣
  2. 怎样让玩家感受到能力的成长的同时也能体会到打boss的乐趣。

打到后面 同类型怪物体型增大,血量增加,无趣。

没有二周目的想法

血瓶要足够。

  1. 观察boss AI 或翻滚躲技能来满满磨boss的血量。
  2. 满地图的逛,升级自身的数值(或者装备),再来打boss。

--完--


See Also


See Also


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2020/08/dashboard/index.html b/2020/08/dashboard/index.html index 217ec469d..934a7dd0a 100644 --- a/2020/08/dashboard/index.html +++ b/2020/08/dashboard/index.html @@ -79,7 +79,7 @@

如果过程中提示存在或者需要删除,只需要kubectl delete -f 相应的yaml文件即可。

获取token

按照官网提示的获取token方法:

$ sudo kubectl -n kubernetes-dashboard describe secret $(kubectl -n kubernetes-dashboard get secret | grep admin-user | awk '{print $1}')
 

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2020/08/dockersecret/index.html b/2020/08/dockersecret/index.html index 083c2e9a5..f38fe1732 100644 --- a/2020/08/dockersecret/index.html +++ b/2020/08/dockersecret/index.html @@ -51,7 +51,7 @@ sudo openssl rand -writerand .rnd

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2020/08/dockerweb/index.html b/2020/08/dockerweb/index.html index a8fee624e..9a3d1efa9 100644 --- a/2020/08/dockerweb/index.html +++ b/2020/08/dockerweb/index.html @@ -12,7 +12,7 @@ docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data -v /public:/public portainer/portainer:linux-arm64-1.20.2

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2020/08/firstk8s/index.html b/2020/08/firstk8s/index.html index 11d735a17..84b98c758 100644 --- a/2020/08/firstk8s/index.html +++ b/2020/08/firstk8s/index.html @@ -55,7 +55,7 @@ targetPort: 8080

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2020/08/heapster/index.html b/2020/08/heapster/index.html index d00d0f65a..15175afc3 100644 --- a/2020/08/heapster/index.html +++ b/2020/08/heapster/index.html @@ -91,7 +91,7 @@

执行生成命令:

$ sudo kubectl create -f heapster-rbac.yaml
 

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2020/08/ingress/index.html b/2020/08/ingress/index.html index 520bdc3ba..d12db0e84 100644 --- a/2020/08/ingress/index.html +++ b/2020/08/ingress/index.html @@ -122,7 +122,7 @@

创建service对象

kubectl  apply node.yaml
 

这样就可以通过节点 ip:32002来访问nginx或者是通过域名来访问啦

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2020/08/k8sinstall/index.html b/2020/08/k8sinstall/index.html index ec0e54887..4efa8bb18 100644 --- a/2020/08/k8sinstall/index.html +++ b/2020/08/k8sinstall/index.html @@ -168,7 +168,7 @@

清空init配置,需要在删除的节点上执行

kubeadm reset
 

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2020/08/licode/index.html b/2020/08/licode/index.html index db321c7a4..f6a7c0379 100644 --- a/2020/08/licode/index.html +++ b/2020/08/licode/index.html @@ -46,7 +46,7 @@ 在安装的浏览器的应用图标右键->属性,在弹出框中的快捷方式选项下的目标属性后加入 --unsafely-treat-insecure-origin-as-secure="http://example ,其中example为你的访问地址,记得和前边的内容中间有空格隔开,然后点击右下角的应用和确定按钮,重启浏览器就可以了
20200525223320521.png

--完--


See Also


See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2020/08/macffmpeg/index.html b/2020/08/macffmpeg/index.html index 7d9351c6e..2c1d2f33b 100644 --- a/2020/08/macffmpeg/index.html +++ b/2020/08/macffmpeg/index.html @@ -44,7 +44,7 @@

参数"Capture screen 0"指定了输入设备,我们也可以将桌面图像带上鼠标一起录制下来,加上参数-capture_cursor

ffmpeg -f avfoundation -capture-cursor 1 -i "Capture screen 0" -r:v 30 screen.mp4
 

然后播放screen.mp4验证。ffplay screen.mp4

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2020/08/nsf/index.html b/2020/08/nsf/index.html index ed31e5d29..368623980 100644 --- a/2020/08/nsf/index.html +++ b/2020/08/nsf/index.html @@ -43,7 +43,7 @@ mount -t nfs hostname(orIP):/directory /mount/point

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2020/08/owt-client-javascript/index.html b/2020/08/owt-client-javascript/index.html index 3cae05086..566b01e9e 100644 --- a/2020/08/owt-client-javascript/index.html +++ b/2020/08/owt-client-javascript/index.html @@ -147,7 +147,7 @@ }

至此,owt-server的获取房间,创建token,推本地流和拉会议室的所有流的流程就完成了。

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2020/08/owtservercomplie/index.html b/2020/08/owtservercomplie/index.html index 9672a1ea0..3adf44bf8 100644 --- a/2020/08/owtservercomplie/index.html +++ b/2020/08/owtservercomplie/index.html @@ -64,7 +64,7 @@ apt-get install libglib2.0-dev

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2020/08/prometheusgrafana/index.html b/2020/08/prometheusgrafana/index.html index 5ead3b0e6..7e4f081b6 100644 --- a/2020/08/prometheusgrafana/index.html +++ b/2020/08/prometheusgrafana/index.html @@ -129,7 +129,7 @@ mount -t nfs hostname(orIP):/directory /mount/point

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2020/08/pvc/index.html b/2020/08/pvc/index.html index ff213d36a..54af992e9 100644 --- a/2020/08/pvc/index.html +++ b/2020/08/pvc/index.html @@ -156,7 +156,7 @@

通过系统帮助信息,我们可以获取patch的简要使用说明:

patch: 使用 strategic merge patch 更新一个资源的 field(s)
 

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2020/08/statefulset/index.html b/2020/08/statefulset/index.html index b66518a5a..444b769da 100644 --- a/2020/08/statefulset/index.html +++ b/2020/08/statefulset/index.html @@ -230,7 +230,7 @@

修改web-0 的nodeport 端口号

kubectl edit  service web-0 -n sy-platform-demo
 

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2020/09/ffmpegpicture/index.html b/2020/09/ffmpegpicture/index.html index d96f858ba..dce33466f 100644 --- a/2020/09/ffmpegpicture/index.html +++ b/2020/09/ffmpegpicture/index.html @@ -23,7 +23,7 @@

直播视频流的多宫格展现形式将 input 更改为直播流地址即可

简单明了,1.2.3.4.mp4为文件路径,out.MP4为输出文件路径,通过nullsrc创建overlay画布,画布大小640:480, 使用[0:v][1:v][2:v][3:v]将输入的4个视频流去除,分别进行缩放处理,然后基于nullsrc生成的画布进行视频平铺,命令中自定义upperleft,upperright,lowerleft,lowerright进行不同位置平铺。

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2020/09/ffmpegvideo/index.html b/2020/09/ffmpegvideo/index.html index 31b183729..eef766dab 100644 --- a/2020/09/ffmpegvideo/index.html +++ b/2020/09/ffmpegvideo/index.html @@ -21,7 +21,7 @@

将透明水印加入到视频中效果会更好一点,当只有纯色背景的logo,可以考虑使用movie 与colorkey滤镜配合做成半透明的效果:

ffmpeg -i input.mp4 -vf  "movie=logo.png, colorkey=black:1.0:1.0 [wm]; [in][wm]overlay=30:10[out]" colorkey.mp4
 

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2020/09/ffmpegvideow/index.html b/2020/09/ffmpegvideow/index.html index 475b18dd3..c3e11bdb8 100644 --- a/2020/09/ffmpegvideow/index.html +++ b/2020/09/ffmpegvideow/index.html @@ -36,7 +36,7 @@

使用gdigrab采集某个窗口

ffmpeg -f gdigrab -framerate 6 -i title="TTR-TEST: ~/DetectAV/src/LiveDetect - Xshell 6" gdi.mp4
 

该窗口是我用spy++抓的

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2020/09/libeventimer/index.html b/2020/09/libeventimer/index.html index c01098080..92af22eea 100644 --- a/2020/09/libeventimer/index.html +++ b/2020/09/libeventimer/index.html @@ -61,7 +61,7 @@ }

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git "a/2020/10/CPU\347\232\204\346\240\270\344\270\216\347\272\277\347\250\213-4\346\240\2708\347\272\277\347\250\213/index.html" "b/2020/10/CPU\347\232\204\346\240\270\344\270\216\347\272\277\347\250\213-4\346\240\2708\347\272\277\347\250\213/index.html" index 334f814dc..a5d369d3b 100644 --- "a/2020/10/CPU\347\232\204\346\240\270\344\270\216\347\272\277\347\250\213-4\346\240\2708\347\272\277\347\250\213/index.html" +++ "b/2020/10/CPU\347\232\204\346\240\270\344\270\216\347\272\277\347\250\213-4\346\240\2708\347\272\277\347\250\213/index.html" @@ -19,7 +19,7 @@

3.逻辑cpu数:简单来说,它可使处理器中的1颗内核,如2颗内核那样在操作系统中发挥作用。

$ cat /proc/cpuinfo | grep 'cpu cores' | wc -l
 

这样一来,操作系统可使用的执行资源扩大了一倍,大幅提高了系统的整体性能,此时逻辑cpu=物理CPU个数×每颗核数x2。

总核数 = 物理CPU个数 × 每颗物理CPU的核数。总逻辑CPU数 = 物理CPU个数 ×每颗物理CPU的核数 × 超线程数。

所以这算双核的。

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git "a/2020/10/linux\347\263\273\347\273\237\345\210\240\351\231\244\345\244\247\351\207\217\346\226\207\344\273\266\346\214\207\344\273\244--rsync/index.html" "b/2020/10/linux\347\263\273\347\273\237\345\210\240\351\231\244\345\244\247\351\207\217\346\226\207\344\273\266\346\214\207\344\273\244--rsync/index.html" index 8e2879920..7a859358c 100644 --- "a/2020/10/linux\347\263\273\347\273\237\345\210\240\351\231\244\345\244\247\351\207\217\346\226\207\344\273\266\346\214\207\344\273\244--rsync/index.html" +++ "b/2020/10/linux\347\263\273\347\273\237\345\210\240\351\231\244\345\244\247\351\207\217\346\226\207\344\273\266\346\214\207\344\273\244--rsync/index.html" @@ -25,7 +25,7 @@

用rsync清空文件

$ rsync-a --delete-before --progress --stats /root/blank.txt /root/nohup.out
 

为什么rsync能够快速删除大文件?

1)rm命令大量调用了lstat64和unlink,可以推测删除每个文件前都从文件系统中做过一次lstat操作。过程:正式删除工作的第一阶段,需要通过getdirentries64调用,分批读取目录(每次大约为4K),在内存中建立rm的文件列表;第二阶段,lstat64确定所有文件的状态;第三阶段,通过unlink执行实际删除。这三个阶段都有比较多的系统调用和文件系统操作。

2)rsync所做的系统调用很少:没有针对单个文件做lstat和unlink操作。命令执行前期,rsync开启了一片共享内存,通过mmap方式加载目录信息。只做目录同步,不需要针对单个文件做unlink。

rm的上下文切换比较多,会造成System CPU占用较多——对于文件系统的操作,简单增加并发数并不总能提升操作速度。

总结:频繁做减法不如直接从头来过

把文件系统的目录与书籍的目录做类比,rm删除内容时,将目录的每一个条目逐个删除(unlink),需要循环重复操作很多次;rsync删除内容时,建立好新的空目录,替换掉老目录,基本没开销。

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git "a/2020/10/vimplus\345\277\253\346\215\267\351\224\256/index.html" "b/2020/10/vimplus\345\277\253\346\215\267\351\224\256/index.html" index 6f1aa8dc1..690b2042f 100644 --- "a/2020/10/vimplus\345\277\253\346\215\267\351\224\256/index.html" +++ "b/2020/10/vimplus\345\277\253\346\215\267\351\224\256/index.html" @@ -284,7 +284,7 @@ |<leader><leader>u|更新插件 |<leader><leader>c|删除插件

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git "a/2020/10/\344\275\277\347\224\250vim\346\211\223\351\200\240\347\274\226C-IDE/index.html" "b/2020/10/\344\275\277\347\224\250vim\346\211\223\351\200\240\347\274\226C-IDE/index.html" index ef7d8f996..e5ad9798d 100644 --- "a/2020/10/\344\275\277\347\224\250vim\346\211\223\351\200\240\347\274\226C-IDE/index.html" +++ "b/2020/10/\344\275\277\347\224\250vim\346\211\223\351\200\240\347\274\226C-IDE/index.html" @@ -31,7 +31,7 @@

ubuntu16.04 更新安装vimplus不成功

需要安装 gnupg

sudo apt install --only-upgrade gnupg
 

使用vim打开项目,C++头文件找不到

vimplus安装完毕之后,~目录下将会生成两个隐藏文件分别是.vimrc和.ycm_extra_conf.py,其中.vimrc是vim的配置文件,.ycm_extra_conf.py是ycm插件的配置文件,当你需要创建一个project时,需要将.ycm_extra_conf.py拷贝到project的顶层目录,通过修改该配置文件里面的flags变量来添加你的第三方库路径。

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git "a/2020/10/\345\244\247\351\207\217TIME_WAIT\345\257\271\347\272\277\344\270\212\344\270\232\345\212\241\347\232\204\345\275\261\345\223\215/index.html" "b/2020/10/\345\244\247\351\207\217TIME_WAIT\345\257\271\347\272\277\344\270\212\344\270\232\345\212\241\347\232\204\345\275\261\345\223\215/index.html" index f0eb4b42a..49a31f60c 100644 --- "a/2020/10/\345\244\247\351\207\217TIME_WAIT\345\257\271\347\272\277\344\270\212\344\270\232\345\212\241\347\232\204\345\275\261\345\223\215/index.html" +++ "b/2020/10/\345\244\247\351\207\217TIME_WAIT\345\257\271\347\272\277\344\270\212\344\270\232\345\212\241\347\232\204\345\275\261\345\223\215/index.html" @@ -7,7 +7,7 @@ 编程 编程.网络编程

TCP的三次握手和四次挥手

8bdf9b9537f30646bf95dafe476884b2.png

TIME_WAIT概述

TIME_WAIT 状态:

  • TCP 连接中,主动关闭连接的一方出现的状态;(收到 FIN 命令,进入 TIME_WAIT 状态,并返回 ACK 命令)
  • 保持 2 个 MSL
    时间,即,4 分钟 ;(MSL 为 2 分钟)

TCP 连接建立后,「主动关闭连接」的一端,收到对方的 FIN 请求后,发送 ACK 响应,会处于 time_wait 状态;

在高并发的场景下,TIME_WAIT 连接存在,属于正常现象。

线上场景中,持续的高并发场景

  • 一部分 TIME_WAIT 连接被回收,但新的 TIME_WAIT 连接产生;
  • 一些极端情况下,会出现大量TIME_WAIT 连接。

大量的TIME_WAIT状态TCP连接,有什么业务上的影响

  • TCP 连接中,「主动发起关闭连接」的一端,会进入 time_wait 状态 - time_wait 状态,默认会持续 2 MSL
    (报文的最大生存时间),一般是 2x2 mins - time_wait 状态下,TCP 连接占用的端口,无法被再次使用 - 每一个 time_wait 状态,都会占用一个「本地端口」,上限为 65535
    (16 bit,2 Byte); - 当大量的连接处于 time_wait
    时,新建立 TCP 连接会出错,address already in use : connect 异常

TCP 本地端口数量,上限为 65535 (6.5w),这是因为 TCP 头部使用 16 bit ,存储「端口号」,因此约束上限为 65535

现实场景

  • 服务器端,一般设置:不允许「主动关闭连接」,但 HTTP 请求中,http 头部 connection 参数,可能设置为 close,则,服务端处理完请求会主动关闭 TCP 连接
    。现在浏览器中, HTTP 请求 connection
    参数,一般都设置为 keep-alive - Nginx 反向代理场景中,可能出现大量短链接,服务器端,可能存在

问题分析

大量的TIME_WAIT状态TCP连接存在,其本质原因是什么?

  • 大量短链接存在- 特别是http请求中,如果connection头部取值被设置为close时,基本都由【服务端】发起主动关闭连接,而TCP四次挥手关闭连接机制中,为了保证ACK重发和丢弃延迟数据,设置TIME_WAIT为2倍的MSL(报文存活最大时间)

解决TIME_WAIT的办法

解决上述 time_wait
状态大量存在,导致新连接创建失败的问题,一般解决办法:
1、客户端,HTTP 请求的头部,connection 设置为 keep-alive,保持存活一段时间:现在的浏览器,一般都这么进行了
2、服务器端

  • 允许 time_wait
    状态的 socket 被重用 - 缩减 time_wait
    时间,设置为 1 MSL
    (即,2 mins)

几个核心问题

TIME_WAIT是「服务器端」的状态?or 「客户端」的状态?

  • RE:time_wait 是「主动关闭 TCP 连接」一方的状态,可能是「客服端」的,也可能是「服务器端」的 - 一般情况下,都是「客户端」所处的状态;「服务器端」一般设置「不主动关闭连接」

服务器在对外服务时,是「客户端」发起的断开连接?还是「服务器」发起的断开连接?

  • 正常情况下,都是「客户端」发起的断开连接 - 「服务器」一般设置为「不主动关闭连接」,服务器通常执行「被动关闭」 - 但 HTTP 请求中,http 头部 connection 参数,可能设置为 close,则,服务端处理完请求会主动关闭 TCP 连接

关于 HTTP 请求中,设置的主动关闭 TCP 连接的机制:TIME_WAIT的是主动断开方才会出现的,所以主动断开方是服务端?

  • 是的。在HTTP1.1协议中,有个 Connection 头,Connection有两个值,close和keep-alive,这个头就相当于客户端告诉服务端,服务端你执行完成请求之后,是关闭连接还是保持连接,保持连接就意味着在保持连接期间,只能由客户端主动断开连接。还有一个keep-alive的头,设置的值就代表了服务端保持连接保持多久。 - HTTP默认的Connection值为close,那么就意味着关闭请求的一方几乎都会是由服务端这边发起的。那么这个服务端产生TIME_WAIT过多的情况就很正常了。 - 虽然HTTP默认Connection值为close,但是,现在的浏览器发送请求的时候一般都会设置Connection为keep-alive了。所以,也有人说,现在没有必要通过调整参数来使TIME_WAIT降低了。

为什么需要time_wait

  • 可靠的实现 TCP 全双工连接的终止:四次挥手关闭 TCP 连接过程中,最后的 ACK 是由「主动关闭连接」的一端发出的,如果这个 ACK 丢失,则,对方会重发 FIN 请求,因此,在「主动关闭连接」的一段,需要维护一个 time_wait 状态,处理对方重发的 FIN 请求; - 处理延迟到达的报文:由于路由器可能抖动,TCP 报文会延迟到达,为了避免「延迟到达的 TCP 报文」被误认为是「新 TCP 连接」的数据,则,需要在允许新创建 TCP 连接之前,保持一个不可用的状态,等待所有延迟报文的消失,一般设置为 2 倍的 MSL(报文的最大生存时间),解决「延迟达到的 TCP 报文」问题;

--完--


See Also


See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git "a/2020/11/Docker\345\256\271\345\231\250\351\200\200\345\207\272\347\240\201\350\257\246\350\247\243/index.html" "b/2020/11/Docker\345\256\271\345\231\250\351\200\200\345\207\272\347\240\201\350\257\246\350\247\243/index.html" index 60b37d969..94432311b 100644 --- "a/2020/11/Docker\345\256\271\345\231\250\351\200\200\345\207\272\347\240\201\350\257\246\350\247\243/index.html" +++ "b/2020/11/Docker\345\256\271\345\231\250\351\200\200\345\207\272\347\240\201\350\257\246\350\247\243/index.html" @@ -9,7 +9,7 @@

常见退出码

Exit Code 0

  • 退出代码0表示特定容器没有附加前台进程。
  • 该退出代码是所有其他后续退出代码的例外。
  • 这不一定意味着发生了不好的事情。如果开发人员想要在容器完成其工作后自动停止其容器,则使用此退出代码。

Exit Code 1

  • 程序错误,或者Dockerfile中引用不存在的文件,如 entrypoint中引用了错误的包
  • 程序错误可以很简单,例如“除以0”,也可以很复杂,比如空引用或者其他程序 crash

Exit Code 137

  • 此状态码一般是因为 pod 中容器内存达到了它的资源限制(resources.limits),一般是内存溢出(OOM),CPU达到限制只需要不分时间片给程序就可以。因为限制资源是通过 linux 的 cgroup 实现的,所以 cgroup 会将此容器强制杀掉,类似于kill -9
  • 还可能是宿主机本身资源不够用了(OOM),内核会选取一些进程杀掉来释放内存
  • 不管是 cgroup 限制杀掉进程还是因为节点机器本身资源不够导致进程死掉,都可以从系统日志中找到记录(journalctl -k)

Exit Code 139

  • 表明容器收到了SIGSEGV信号,无效的内存引用,对应kill -11
  • 一般是代码有问题,或者 docker 的基础镜像有问题

Exit Code 143

  • 表明容器收到了SIGTERM信号,终端关闭,对应kill -15
  • 一般对应docker stop 命令
  • 有时docker stop也会导致Exit Code 137。发生在与代码无法处理SIGTERM的情况下,docker进程等待十秒钟然后发出SIGKILL强制退出。

不常用的一些 Exit Code

  • Exit Code 126: 权限问题或命令不可执行
  • Exit Code 127: Shell脚本中可能出现错字且字符无法识别的情况
  • Exit Code 1 或 255:因为很多程序员写异常退出时习惯用 exit(1) 或 exit(-1),-1 会根据转换规则转成 255。这个一般是自定义 code,要看具体逻辑。

退出状态码的区间

  • 必须在 0-255 之间,0 表示正常退出- 外界将程序中断退出,状态码在 129-255- 程序自身异常退出,状态码一般在 1-128- 假如写代码指定的退出状态码时不在 0-255 之间,例如: exit(-1),这时会自动做一个转换,最终呈现的状态码还是会在 0-255 之间。我们把状态码记为 code,当指定的退出时状态码为负数,那么转换公式如下:256 – (|code| % 256) 参考链接: https://imroc.io/posts/kubernetes/analysis-exitcode/

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git "a/2020/11/Golang-\345\210\251\347\224\250\346\214\207\351\222\210\350\277\233\350\241\214\346\225\260\346\215\256\350\275\254\346\215\242/index.html" "b/2020/11/Golang-\345\210\251\347\224\250\346\214\207\351\222\210\350\277\233\350\241\214\346\225\260\346\215\256\350\275\254\346\215\242/index.html" index 2be84124c..934014c92 100644 --- "a/2020/11/Golang-\345\210\251\347\224\250\346\214\207\351\222\210\350\277\233\350\241\214\346\225\260\346\215\256\350\275\254\346\215\242/index.html" +++ "b/2020/11/Golang-\345\210\251\347\224\250\346\214\207\351\222\210\350\277\233\350\241\214\346\225\260\346\215\256\350\275\254\346\215\242/index.html" @@ -79,7 +79,7 @@ }

参考:https://studygolang.com/articles/2909

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git "a/2020/11/OpenResty\345\210\235\346\216\242/index.html" "b/2020/11/OpenResty\345\210\235\346\216\242/index.html" index 5566a9c3a..627c5bdc1 100644 --- "a/2020/11/OpenResty\345\210\235\346\216\242/index.html" +++ "b/2020/11/OpenResty\345\210\235\346\216\242/index.html" @@ -99,7 +99,7 @@

也可以在header_filter阶段赋值header

ngx.header.content_type="application/json;charset=utf8"
 

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git "a/2020/11/cgo\344\275\277\347\224\250libevent\345\272\223\345\256\236\347\216\260\344\270\200\344\270\252\345\256\232\346\227\266\345\231\250/index.html" "b/2020/11/cgo\344\275\277\347\224\250libevent\345\272\223\345\256\236\347\216\260\344\270\200\344\270\252\345\256\232\346\227\266\345\231\250/index.html" index 0a2768887..dfa554f3e 100644 --- "a/2020/11/cgo\344\275\277\347\224\250libevent\345\272\223\345\256\236\347\216\260\344\270\200\344\270\252\345\256\232\346\227\266\345\231\250/index.html" +++ "b/2020/11/cgo\344\275\277\347\224\250libevent\345\272\223\345\256\236\347\216\260\344\270\200\344\270\252\345\256\232\346\227\266\345\231\250/index.html" @@ -196,7 +196,7 @@ C.ev_set_timer()

Go和C互相调用指针

参考链接:https://blog.csdn.net/weixin_34055787/article/details/88883037

参考链接:https://chai2010.cn/advanced-go-programming-book/ch2-cgo/ch2-07-memory.html

Go调用C Code时,Go传递给C Code的Go指针所指的Go Memory中不能包含任何指向Go Memory的Pointer。

C调用的Go函数不能返回指向Go分配的内存的指针。

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git "a/2020/11/cgo\347\232\204\347\256\200\345\215\225\344\275\277\347\224\250/index.html" "b/2020/11/cgo\347\232\204\347\256\200\345\215\225\344\275\277\347\224\250/index.html" index c8b88acb0..b48196e1f 100644 --- "a/2020/11/cgo\347\232\204\347\256\200\345\215\225\344\275\277\347\224\250/index.html" +++ "b/2020/11/cgo\347\232\204\347\256\200\345\215\225\344\275\277\347\224\250/index.html" @@ -152,7 +152,7 @@ hello world!

可以看到main函数和SayHello函数在统一个Goroutine里执行

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2020/11/glibcnotfound/index.html b/2020/11/glibcnotfound/index.html index a61082430..600e01df6 100644 --- a/2020/11/glibcnotfound/index.html +++ b/2020/11/glibcnotfound/index.html @@ -45,7 +45,7 @@

把变量中的多余的 去掉再重新赋值给LD_LIBRARY_PATH即可

$ export LD_LIBRARY_PATH=
 

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2020/11/go-builds/index.html b/2020/11/go-builds/index.html index da320b933..50d2f8a75 100644 --- a/2020/11/go-builds/index.html +++ b/2020/11/go-builds/index.html @@ -32,7 +32,7 @@ // +build cgo

更多还有 ignore 指令来忽略使用这个文件,更多可以查看官方文档

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2020/11/lastbattlelogin/index.html b/2020/11/lastbattlelogin/index.html index 98761732d..b91cc26a1 100644 --- a/2020/11/lastbattlelogin/index.html +++ b/2020/11/lastbattlelogin/index.html @@ -189,7 +189,7 @@ }

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2020/11/lastbattleone/index.html b/2020/11/lastbattleone/index.html index da6fed29c..224dd5bc6 100644 --- a/2020/11/lastbattleone/index.html +++ b/2020/11/lastbattleone/index.html @@ -20,7 +20,7 @@

也就是第一个服务器的ip地址,之后重启登录服务器即可

配置数据库的文件
Server\Bin\x64\Release\CSConfig\DBConfig.xml

Server\Bin\x64\Release\LGCfg\DBConfig.xml

启动服务器

Server\Bin\x64\Release\start.bat
 

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2020/11/lastbattleserver/index.html b/2020/11/lastbattleserver/index.html index c35cc0bec..c9d178d2e 100644 --- a/2020/11/lastbattleserver/index.html +++ b/2020/11/lastbattleserver/index.html @@ -19,7 +19,7 @@ |MySql||游戏数据库|用于持久化游戏及玩家数据|1|统一数据存储 |Remote||游戏远程控制端|用于输入gm命令等远程控制|n|根据实际需求配置

登录流程:

  • ①②:客户端发送消息AskLogin到LS,LS根据客户端登录类型生成相应的url,通过消息队列m_SDKCallbackQueue发送给子线程调用url来获取登录验证结果,子线程将url返回结果通过消息队列m_DBCallbackQueue发送给主线程,根据返回结果将BS列表发送给客户端。ps:这块需要了解boost库和liburl库的基本用法- ③④:客户端收到LS返回的BS服务器列表后,选择其中一台BS发送消息 eMsgToBSFromGC_OneClientLogin ,BS收到该消息后会向LS发消息 eMsgToLSFromBC_OneClinetLoginCheck 来进行身份验证,验证通过后会返回给 BS一个eMsgToBSFromLS_OneClinetLoginCheckRet 消息, BS给该玩家生成一个唯一token并将玩家token信息根据负载均衡策略发送 eMsgToGSFromBS_OneUserLoginToken消息 给目前负载较小的GS来进行登记,登记成功后GS返回其ip和端口等信息 发送 eMsgToBSFromGS_OneUserLoginTokenRet 到BS,进而发送给客户端。- :客户端收到GS的ip和端口等信息后,发送登录消息给GS,GS校验token成功后会将登录信息转发给CS,游戏玩家数据实际是在CS上加载并创建玩家实体。到此,玩家登录完成,后续玩家在CS和SS上的操作消息都会通过GS作为中间桥梁和客户端通讯。

--完--


See Also


See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git "a/2020/11/\344\275\277\347\224\250Lumberjack-zap\350\277\233\350\241\214\346\227\245\345\277\227\345\210\207\345\211\262\345\275\222\346\241\243/index.html" "b/2020/11/\344\275\277\347\224\250Lumberjack-zap\350\277\233\350\241\214\346\227\245\345\277\227\345\210\207\345\211\262\345\275\222\346\241\243/index.html" index 7a6e67a39..5278dc3b8 100644 --- "a/2020/11/\344\275\277\347\224\250Lumberjack-zap\350\277\233\350\241\214\346\227\245\345\277\227\345\210\207\345\211\262\345\275\222\346\241\243/index.html" +++ "b/2020/11/\344\275\277\347\224\250Lumberjack-zap\350\277\233\350\241\214\346\227\245\345\277\227\345\210\207\345\211\262\345\275\222\346\241\243/index.html" @@ -76,7 +76,7 @@ }

同时,可以在main函数中循环记录日志,测试日志文件是否会自动切割和归档(日志文件每1MB会切割并且在当前目录下最多保存5个备份)。

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git "a/2020/11/\344\275\277\347\224\250OpenResty\345\201\232\344\270\200\344\270\252postman\345\260\217\345\267\245\345\205\267/index.html" "b/2020/11/\344\275\277\347\224\250OpenResty\345\201\232\344\270\200\344\270\252postman\345\260\217\345\267\245\345\205\267/index.html" index d7a0c3264..54212b8a0 100644 --- "a/2020/11/\344\275\277\347\224\250OpenResty\345\201\232\344\270\200\344\270\252postman\345\260\217\345\267\245\345\205\267/index.html" +++ "b/2020/11/\344\275\277\347\224\250OpenResty\345\201\232\344\270\200\344\270\252postman\345\260\217\345\267\245\345\205\267/index.html" @@ -179,7 +179,7 @@

入口文件mvc.lua开头加上下面的内容:

ngx.say("<br/>")
 

项目地址

https://github.com/diycat1024/OpenRestyPostman

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2020/12/ccnet/index.html b/2020/12/ccnet/index.html index f53b7fbdf..d902aa20e 100644 --- a/2020/12/ccnet/index.html +++ b/2020/12/ccnet/index.html @@ -29,7 +29,7 @@

修改example中的EchoServer.cc代码:

server_.setNumThreads(4); //设置线程数量
 

详细代码请参考:github: https://github.com/zfunnily/ccnet

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2020/12/ccnetone/index.html b/2020/12/ccnetone/index.html index 7c8e0f803..c2c6781cd 100644 --- a/2020/12/ccnetone/index.html +++ b/2020/12/ccnetone/index.html @@ -11,7 +11,7 @@ $ git checkout 70d5269d81af53c95ec080f20c294ed8e6ba4a55

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2020/12/cinnamon3.0/index.html b/2020/12/cinnamon3.0/index.html index 9ee90ee98..b32f35794 100644 --- a/2020/12/cinnamon3.0/index.html +++ b/2020/12/cinnamon3.0/index.html @@ -9,7 +9,7 @@ $ sudo apt update && sudo apt install cinnamon

下载的大小大概是 150 MB(如果我没记错的话)。这其中提供的 Nemo(Cinnamon 的文件管理器,基于 Nautilus)和 Cinnamon 控制中心。这些东西提供了一个更加接近于 Linux Mint 的感觉。

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2020/12/gocolly/index.html b/2020/12/gocolly/index.html index 6366232c1..0a973f890 100644 --- a/2020/12/gocolly/index.html +++ b/2020/12/gocolly/index.html @@ -138,7 +138,7 @@ }

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2020/12/grpc/index.html b/2020/12/grpc/index.html index 2e185fd1a..161f9fc1b 100644 --- a/2020/12/grpc/index.html +++ b/2020/12/grpc/index.html @@ -121,7 +121,7 @@ }

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2020/12/iomodels/index.html b/2020/12/iomodels/index.html index 1568d9bc0..1ca87b87e 100644 --- a/2020/12/iomodels/index.html +++ b/2020/12/iomodels/index.html @@ -12,7 +12,7 @@ 2.内核空间复制回用户进程缓冲区阶段

一般来讲:阻塞IO模型、非阻塞IO模型、IO复用模型(select/poll/epoll)、信号驱动IO模型都属于同步IO,因为阶段2是阻塞的(尽管时间很短)。只有异步IO模型是符合POSIX异步IO操作含义的,不管在阶段1还是阶段2都可以干别的事。

ps:以上图片均截自UNIX网络编程卷1。

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2020/12/reserve/index.html b/2020/12/reserve/index.html index 9585adbaf..f12cc445d 100644 --- a/2020/12/reserve/index.html +++ b/2020/12/reserve/index.html @@ -10,7 +10,7 @@
void resize (size_type n, value_type val);
 

resize函数重新分配大小,改变容器的大小,并且创建对象

  • 当n小于当前size()值时候,vector首先会减少size()值 保存前n个元素,然后将超出n的元素删除(remove and destroy)
  • 当n大于当前size()值时候,vector会插入相应数量的元素 使得size()值达到n,并对这些元素进行初始化,如果调用上面的第二个resize函数,指定val,vector会用val来初始化这些新插入的元素

当n大于capacity()值的时候,会自动分配重新分配内存存储空间。

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2020/12/syncmutex/index.html b/2020/12/syncmutex/index.html index 475198758..1529702c8 100644 --- a/2020/12/syncmutex/index.html +++ b/2020/12/syncmutex/index.html @@ -148,7 +148,7 @@

看到最后结果输出的是:

start, counts: 1000
 

说明拷贝锁的指针,相当于持有了同一把锁。

总结

  • sync.Mutex是传值,如果copy结构体可能能会导致死锁,sync.MutexnoCopy的。;- 我认为可以将* sync.Mutex视为简单指针。如果你想要使用它,您应该声明并初始化它,但是如果使用sync.Mutex,它已经被初始化。- 我认为需要声明为指针 *sync.Mutex,它们总是传递要使用的可变指针,因为传递struct会复制,但是如果使用指针,您需要传递的只是一个指针。 (我的意思是,不需要花费副本)。

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2020/12/tcp/index.html b/2020/12/tcp/index.html index e663a1c2a..1e80ff8e5 100644 --- a/2020/12/tcp/index.html +++ b/2020/12/tcp/index.html @@ -184,7 +184,7 @@ }

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/01/attandintel/index.html b/2021/01/attandintel/index.html index 839628719..4b95b080d 100644 --- a/2021/01/attandintel/index.html +++ b/2021/01/attandintel/index.html @@ -89,7 +89,7 @@ intel64 Display instruction in Intel64 ISA

汇编学习地址:http://c.biancheng.net/view/3463.html

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/01/cgostruct/index.html b/2021/01/cgostruct/index.html index 331069d8f..42869d071 100644 --- a/2021/01/cgostruct/index.html +++ b/2021/01/cgostruct/index.html @@ -111,7 +111,7 @@ i: 9, p.name: name:9, p.age: 9

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/01/chararray/index.html b/2021/01/chararray/index.html index cfb9a04f5..b1df86b2e 100644 --- a/2021/01/chararray/index.html +++ b/2021/01/chararray/index.html @@ -43,7 +43,7 @@ t_char2: 9, d.a: 0x7ffd906865a0, d.b: 0xa000000000004006

总结:

  • struct t_char1中空数组没有分配内存,sizeof©-sizeof(a) = 1-1=0; struct t_char2中指针的内存占用了八字节 。
  • 通过观察得到,在struct t_char1中, 空数组虽然不占用内存,但是可以获取结构体尾部的地址。
  • 在结构体中更推荐使用char[]

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/01/goslience/index.html b/2021/01/goslience/index.html index 2d1eb8a7b..c1ab31d14 100644 --- a/2021/01/goslience/index.html +++ b/2021/01/goslience/index.html @@ -132,7 +132,7 @@ }

参考文章:https://chai2010.cn/advanced-go-programming-book/ch2-cgo/ch2-03-cgo-types.html

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/01/lastbattle/index.html b/2021/01/lastbattle/index.html index 8a26bc21a..6c1f76891 100644 --- a/2021/01/lastbattle/index.html +++ b/2021/01/lastbattle/index.html @@ -130,7 +130,7 @@ }

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/01/pbempty/index.html b/2021/01/pbempty/index.html index ec571ff01..b7021b32a 100644 --- a/2021/01/pbempty/index.html +++ b/2021/01/pbempty/index.html @@ -16,7 +16,7 @@

以golang语言为例子,在go中对应的函数为:

func (s *service) emptyfunction(ctx context.Context, g *google_protobuf.Empty) (*google_protobuf.Empty, error) {<!-- -->}
 

到此,空请求和空返回的grpc就完成了。

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/01/sds/index.html b/2021/01/sds/index.html index 922470437..535675068 100644 --- a/2021/01/sds/index.html +++ b/2021/01/sds/index.html @@ -105,7 +105,7 @@ }

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/01/skynetecho/index.html b/2021/01/skynetecho/index.html index 2862789d7..9a05852ea 100644 --- a/2021/01/skynetecho/index.html +++ b/2021/01/skynetecho/index.html @@ -159,7 +159,7 @@ main()

这是我入门skynet框架写的一个小demo,到这里就结束了,希望能对刚接触skynet的同学有所帮助。对了,skynet是使用actor作为通信模型,了解了actor之后可以更好的理解skynet。

参考连接:https://blog.csdn.net/119365374/article/details/77790653

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/01/skynetprotobuf/index.html b/2021/01/skynetprotobuf/index.html index bd2a2ffd2..29474ed42 100644 --- a/2021/01/skynetprotobuf/index.html +++ b/2021/01/skynetprotobuf/index.html @@ -75,7 +75,7 @@ local decodedata = gctols.decode(encodedata)

这里要注意的是,.proto文件中成员变量区分大小写,在解码得到的table数据,在获取对应的key数据时需要大小写对应。在编码table数据时,对应的key也要大小对应,不然编码不通过。比如上面的Sessionid这个key

使用lua-protobuf的细节请参考官方github:

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/01/vscodedebugredis/index.html b/2021/01/vscodedebugredis/index.html index c0cfce988..2d159e133 100644 --- a/2021/01/vscodedebugredis/index.html +++ b/2021/01/vscodedebugredis/index.html @@ -73,7 +73,7 @@ }

这样配置了之后可以按F5直接编译运行调试啦。

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/01/vscoderedis/index.html b/2021/01/vscoderedis/index.html index b5015113e..253d0ccd3 100644 --- a/2021/01/vscoderedis/index.html +++ b/2021/01/vscoderedis/index.html @@ -12,7 +12,7 @@

也可以用下面的表达式:

*(char*)key@10
 

ps: 10表示数组长度

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/01/ziplist/index.html b/2021/01/ziplist/index.html index 8e3a495d9..763936197 100644 --- a/2021/01/ziplist/index.html +++ b/2021/01/ziplist/index.html @@ -48,7 +48,7 @@ "ziplist"

哈希键里面包含的所有键和值都是小整数值或者短字符串

ps: 以上截图来自《Redis设计与实现一书》

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/02/JWT/index.html b/2021/02/JWT/index.html index 7d98ca9f2..b3dd65ea0 100644 --- a/2021/02/JWT/index.html +++ b/2021/02/JWT/index.html @@ -171,7 +171,7 @@ test is success

第二种方法是请求login接口生成token,参数 name='', pwd='', 生成token后再按照上述方法,请求test接口

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/02/chicken/index.html b/2021/02/chicken/index.html index f27408b90..39cedc6d2 100644 --- a/2021/02/chicken/index.html +++ b/2021/02/chicken/index.html @@ -34,7 +34,7 @@ 小鸡:84只,母鸡:4只,公鸡:12只

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/02/compilation/index.html b/2021/02/compilation/index.html index d9efc374e..27eeb8b7f 100644 --- a/2021/02/compilation/index.html +++ b/2021/02/compilation/index.html @@ -109,7 +109,7 @@ 第六个参数:R9

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/02/dynamic/index.html b/2021/02/dynamic/index.html index 06da24dab..24fa26556 100644 --- a/2021/02/dynamic/index.html +++ b/2021/02/dynamic/index.html @@ -54,7 +54,7 @@ [C]: in
  1. 在C中则使用extern来修饰函数luaopen_snpccfg, 引用书中的话:
  • extern是计算机语言中的一个关键字,可置于变量或者函数前,以表示变量或者函数的定义在别的文件中。提示编译器遇到此变量或函数时,在其它模块中寻找其定义,另外,extern也可用来进行链接指定。
  • extern 后面修饰的只能是一个全局变量。

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/02/timer/index.html b/2021/02/timer/index.html index c6d644e3e..321a50c65 100644 --- a/2021/02/timer/index.html +++ b/2021/02/timer/index.html @@ -64,7 +64,7 @@ }

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/03/atoianditoa/index.html b/2021/03/atoianditoa/index.html index ebaa16365..fd79f45b7 100644 --- a/2021/03/atoianditoa/index.html +++ b/2021/03/atoianditoa/index.html @@ -86,7 +86,7 @@ str: 123456

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/03/coroutineone/index.html b/2021/03/coroutineone/index.html index beaf7d840..ac78afdd8 100644 --- a/2021/03/coroutineone/index.html +++ b/2021/03/coroutineone/index.html @@ -123,7 +123,7 @@ finally return

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/03/coroutinetwo/index.html b/2021/03/coroutinetwo/index.html index d7a2eaa50..ebf9f1fb5 100644 --- a/2021/03/coroutinetwo/index.html +++ b/2021/03/coroutinetwo/index.html @@ -122,7 +122,7 @@

主要步骤

  • 调用_save_stack函数,把协程指针和运行时栈底地址作为参数
  • char dummy = 0; 声明一个变量,然后取地址,这个地址就是此时栈顶的地址。 要理解这段代码,要理解的几个点:
    1. uncontext的使用,C->ctx.uc_stack.ss_sp = S->stack;C->ctx.uc_stack.ss_size = STACK_SIZE;这两段代码分配了此时协程可以使用的空间大小。 S->stack+STAACK_SIZE是栈底,S->stack是栈顶。
    2. 栈有先入后出的特性
    3. 栈的地址是从高到地分配的。
    4. char dummy = 0; 是一个分配在栈空间上的数据。此时 变量dummy的地址&dummy是协程的栈空间的栈顶地址。栈底地址-栈顶地址=top-&dummy,表示的是该协程所占用的空间大小。
  • memcpy(C->stack, &dummy, C->size), 保存栈的数据到 C->stack -> C->stack + C->size
  • 修改协程的状态为COROUTINE_SUSPEND, 设置此时运行的协程id-1,挂起协程;
  • 保存当前的contextC->ctx, 切换当前的contextS->main。此时回到了 标记2,见上文。这样就形成了闭环,直到mainfunc运行完毕,协程退出。

至此,coroutine的整体流程就说完了。

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/03/gamexian/index.html b/2021/03/gamexian/index.html index 394481838..202b9c108 100644 --- a/2021/03/gamexian/index.html +++ b/2021/03/gamexian/index.html @@ -32,7 +32,7 @@

运行sdlpal

编译出可执行文件sdlpal.exe,运行发现需要资源文件。
下载资源文件

git clone https://github.com.cnpmjs.org/paldn/sdlpal.git  DATA
 

资源文件在DATA/Data目录下,运行程序,需要指定资源文件。

sdlpal配置文件和可执行文件在同级目录:sdlpal.cfg

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/03/gomod/index.html b/2021/03/gomod/index.html index 80874c561..18282cd25 100644 --- a/2021/03/gomod/index.html +++ b/2021/03/gomod/index.html @@ -16,7 +16,7 @@ $ go get --insecure xxxx

go get --insecure xxxx中的xxxx 表示仓库地址

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/03/sort/index.html b/2021/03/sort/index.html index 29993619f..69cded63e 100644 --- a/2021/03/sort/index.html +++ b/2021/03/sort/index.html @@ -137,7 +137,7 @@ }

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/04/hugo/index.html b/2021/04/hugo/index.html index cf1c82164..ea23d3777 100644 --- a/2021/04/hugo/index.html +++ b/2021/04/hugo/index.html @@ -75,7 +75,7 @@

其实一般不会出现0001的情况,如果出现了,经检查文件中是否有格式不正确的地方,比如,我检查了下,我public/目录下生成了 1/01/except/index.html, 所以我检查了下我的 except.md文件,然后发现,文件头部少了 ---, 无意中删除了一行,补上后,执行hugo指令,重新生成 public文件,则发现没有这些文件,并且归档路径下也没有0001了。

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/05/lua_next/index.html b/2021/05/lua_next/index.html index 58269f639..829f7a3a7 100644 --- a/2021/05/lua_next/index.html +++ b/2021/05/lua_next/index.html @@ -62,7 +62,7 @@ }

lua_next(L, -2) 这个函数的工作过程是:

  1. 先从栈顶弹出一个 key
  2. 从栈指定位置的 table 里取下一对 key-value,先将 key 入栈,再将 value 入栈
  3. 如果第 2 步成功则返回非 0 值,否则返回 0,并且不向栈中压入任何值, 第 2 步中从 table 里取出"下一对 key-value“是相对于第 1 步中弹出的 key 的。table 里第一对 key-value 的前面没有数据,所以先用 lua_pushnil() 压入一个 nil 充当初始 key

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/05/settopandpop/index.html b/2021/05/settopandpop/index.html index fa0fb6acc..9b9e844c0 100644 --- a/2021/05/settopandpop/index.html +++ b/2021/05/settopandpop/index.html @@ -55,7 +55,7 @@ LUA_API int lua_gettop (lua_State *L)

参考链接:http://www.daileinote.com/computer/lua/17

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/06/distribute/index.html b/2021/06/distribute/index.html index e76c9108b..c81438c4c 100644 --- a/2021/06/distribute/index.html +++ b/2021/06/distribute/index.html @@ -113,7 +113,7 @@ }

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/06/goredis/index.html b/2021/06/goredis/index.html index e335c9f7b..16a9787ba 100644 --- a/2021/06/goredis/index.html +++ b/2021/06/goredis/index.html @@ -112,7 +112,7 @@ }

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/08/except/index.html b/2021/08/except/index.html index 3991300df..51a1cc554 100644 --- a/2021/08/except/index.html +++ b/2021/08/except/index.html @@ -27,7 +27,7 @@ expect eof

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/08/ugui/index.html b/2021/08/ugui/index.html index bdbd91304..a04ed82cc 100644 --- a/2021/08/ugui/index.html +++ b/2021/08/ugui/index.html @@ -153,7 +153,7 @@

Raw Image

Raw Image 组件是一个显示纹理贴图的组件,常用于与 RenderTexture 结合使用,映射相机画面 与 Image 组件的区别是:

  1. Image 显示Sprite 精灵图片;
  2. Raw Image 可以显示任何纹理贴图。( 如:Texture 、Render Texture )

Raw Image 属性

UnityHierarchy 面板上右键–>UI–>Raw Image

  • Texture 用于显示的纹理贴图的引用
  • Color 图片的颜色
  • Material 渲染图像的材质
  • Raycast Target 能否接收到射线检测
  • UV Rect 控制 UI 矩形内的图像偏移和大小

Texture Import Setting —— 图片导入设置

Canvas

Scroll View

Slider

Scrollbar

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/09/move/index.html b/2021/09/move/index.html index 8aa7348d9..aabe575f8 100644 --- a/2021/09/move/index.html +++ b/2021/09/move/index.html @@ -260,7 +260,7 @@ }

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/09/music/index.html b/2021/09/music/index.html index da75a8bc8..936db822b 100644 --- a/2021/09/music/index.html +++ b/2021/09/music/index.html @@ -7,7 +7,7 @@ 编程

介绍一个可以免费听音乐的方法

环境

  • docker
  • mac

安装

$ docker run -d -p 264:264 -p 9000:9000 -v $dir_name:/var/www/html/cache --name music oldiy/music-player-docker
 

$dir_name 是 你自己宿主机的目录。可以自定义

访问:127.0.0.1:264

就可以放心使用, 同事推荐的,贼好用。

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/09/screen/index.html b/2021/09/screen/index.html index cd9c387a1..def83cf0e 100644 --- a/2021/09/screen/index.html +++ b/2021/09/screen/index.html @@ -19,7 +19,7 @@

终止会话

  • ctrl + D
  • exit

help

如果要使用screen的所有功能可以参考手册。

$ screen -help
 

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/09/transform/index.html b/2021/09/transform/index.html index 32ba48f0f..75b16eb68 100644 --- a/2021/09/transform/index.html +++ b/2021/09/transform/index.html @@ -32,7 +32,7 @@ (2)public static Quaternion Euler(float x, float y, float z);

功能说明:此方法用于返回欧拉角Vector3(x,y,z)对应的四元数Quaternion实例。

四元数Quaternion(qx,qy,qz,qw)与其欧拉角eulerAngles(ex,ey,ez)之间的对应关系如下。

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/09/upgradegcc/index.html b/2021/09/upgradegcc/index.html index 46371597c..89a5ca657 100644 --- a/2021/09/upgradegcc/index.html +++ b/2021/09/upgradegcc/index.html @@ -20,7 +20,7 @@ $ make -j4 && make install

编译时间有点长,请耐心等待

说明

gcc 编译配置参数说明:

  • –enable-languages: 指定 gcc 能编译哪些语言的文件,每种语言用逗号分隔, 例如 c,c++,Java
  • –disable-multilib: 默认gcc 能在32位系统上将代码编译成64位程序,或者在64位系统上编译成32位程序,如果加上这个编译选项则表示关闭这个gcc的交叉编译功能。

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/09/vimchange/index.html b/2021/09/vimchange/index.html index 705dac7ae..f18cba0b8 100644 --- a/2021/09/vimchange/index.html +++ b/2021/09/vimchange/index.html @@ -29,7 +29,7 @@ "vim.autoSwitchInputMethod.switchIMCmd": "/usr/local/bin/im-select {im}"

settings.json 参数解析:

参数解析
vim.autoSwitchInputMethod.enable控制是否自动切换
vim.autoSwitchInputMethod.defaultIM默认的输入法,其实就是在Normal模式下需要输入法
vim.autoSwitchInputMethod.obtainIMCmd获得当前输入法的命令
vim.autoSwitchInputMethod.switchIMCmd切换输入法的命令,{im}代表要切换到输入法名,其实就是设置的defaultIM

至此 vscode vim 自动切换输入法就完成了。

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/10/blogmigration/index.html b/2021/10/blogmigration/index.html index 1a6c40d55..d4c081414 100644 --- a/2021/10/blogmigration/index.html +++ b/2021/10/blogmigration/index.html @@ -38,7 +38,7 @@ w.write(html)

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/10/four/index.html b/2021/10/four/index.html index 868596338..7198dc5fe 100644 --- a/2021/10/four/index.html +++ b/2021/10/four/index.html @@ -115,7 +115,7 @@

消息处理过程

  • 从全局消息中取出次级消息队列
  • 根据次级消息队列找到对应的服务上下文
  • 遍历出次级消息队列的消息,并进行处理,调用dispatch_message函数
  • 然后dispatch_message调用回调函数,这个回调函数是在skynet.lua中,服务启动的时候调用c.callback设置的,于是我们就看到最后服务消息的处理逻辑是在服务启动的时候设置的skynet.dispatch_message(...)中。

总结

看到整个消息流转,其实不难看出skynet的架构,

  1. 每个服务对应一个次级消息队列,然后每个服务所发送的消息全塞给这个消息队列。
  2. thread_work线程从全局消息队列中取出一个次级消息队列,然后就可以处理对应服务和对应的消息了。处理消息的逻辑在skynet.dispatch_message(...).

下图是skynet作为服务器,收到socket消息,并进行处理的整个过程,这个与上面内部的消息流转其实原理一样。都是把消息放到消息队列中,然后work线程从全局消息队列中取消息进行处理。

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/10/gop2pone/index.html b/2021/10/gop2pone/index.html index e1b6768a8..82c130f26 100644 --- a/2021/10/gop2pone/index.html +++ b/2021/10/gop2pone/index.html @@ -111,7 +111,7 @@

被连接方别名为B, 连接方别名为A 从代码上看,节点A所做的事情:

  1. A创建host
  2. 解析B的地址,获得B的host.ID
  3. 把B的地址添加到A的host中
  4. 用A的host创建一个新的数据流,其中参数为B的host.ID,和B监听的协议 “/chat/1.0.0”, 根据生成的数据流,创建读写协程, 可以在协程里进行逻辑处理

总结

作为节点A和节点B, 使用libp2p库进行p2p通讯的步骤如下:

  1. 双方需要创建各自的host
  2. 被连接方的节点B需要设置协议ID,并设置数据流的回调handle, 这个回调handle中有读写协程
  3. 连接方的节点A需要知道B的地址,并解析B的地址
  4. 把节点B的地址添加到节点A的host
  5. 节点A使用节点B的host.ID和B监听的协议"/chat/1.0.0"创建一个新的数据流, 创建读写协程
  6. 这样节点A和B就能通讯了

作为发送方比接收方多了第4步, 把节点B的地址添加到节点A的host

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/10/gop2pthree/index.html b/2021/10/gop2pthree/index.html index 21cebed53..a61fa8823 100644 --- a/2021/10/gop2pthree/index.html +++ b/2021/10/gop2pthree/index.html @@ -431,7 +431,7 @@

再启动B窗,连上relay服务

$ ./chat -relay
 

这样A和B两个节点就可以通过relay服务进行数据传输了。 下篇文章,改造relay服务,relay服务交换节点信息后,使节点间可以进行p2p传输,传输数据不通过relay服务。 详细代码

未完待续…

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/10/gop2ptwo/index.html b/2021/10/gop2ptwo/index.html index 74ed05547..6fa2dacce 100644 --- a/2021/10/gop2ptwo/index.html +++ b/2021/10/gop2ptwo/index.html @@ -138,7 +138,7 @@ log.Printf("read reply: %q\n", out)

编译运行代码,可以看到,在两个终端下,发送方的任何消息接收方都会一模一样的返回回来。

改造doEcho函数,我是参考例子multipro,

  1. doEcho数据回调handler,在函数doEcho读取数据流里的数据,然后通过数据流里的RemotePeer和协议ID新建一个数据流
  2. 然后发送数据,这样会触发另一个节点(终端)的协议绑定回调doEcho
  3. 这样就不会出现echo示例中的,发送端节点B绑定了协议回调,但是并没有触发这个协议回调。

总结

使用libp2p库让两个节点进行p2p通信一共分为如下几个步骤,以节点B为例子

  1. 创建host (监听端口)
  2. 设置协议ID="/echo/1.0.0",并设置数据流的回调handle, 这个回调handle中有读写协程,等待连接
  3. 节点B需要知道节点A的地址,并解析A的地址
  4. 把节点A的地址添加到节点B的host
  5. 节点B使用节点A的host.ID和节点A监听的协议"/echo/1.0.0"创建一个新的数据流 , 节点B可以通过这个数据流和A进行通信

作为发送方比接收方多了第4步, 把节点A的地址添加到节点B的host

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/10/shell/index.html b/2021/10/shell/index.html index 9ea3023b1..2f34aa4a7 100644 --- a/2021/10/shell/index.html +++ b/2021/10/shell/index.html @@ -77,7 +77,7 @@ 返回一个管道该管道会在Cmd中的命令被启动后连接到其标准错误

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/10/skynetone/index.html b/2021/10/skynetone/index.html index c9e563a7d..fdca57d15 100644 --- a/2021/10/skynetone/index.html +++ b/2021/10/skynetone/index.html @@ -16,7 +16,7 @@ config.profile = optboolean("profile", 1);

从上述代码可以看到,配置都已经加载到变量struct skynet_config config;中了。

初始化

  1. 初始化skynet_context管理模块, skynet_handle_init(config->harbor);;
  2. 初始化static struct global_queue *Q消息队列, skynet_mq_init();;
  3. 初始化static struct modules * M管理模块, skynet_module_init(config->module_path);;
  4. 初始化定时器, skynet_timer_init();;

启动C服务

  1. 启动logger日志服务, struct skynet_context *ctx = skynet_context_new(config->logservice, config->logger);;
  2. 启动 snlua服务, ``;
  3. 通过snlua服务启动boostrap服务, bootstrap(ctx, config->bootstrap);;
  4. 启动线程:
  • 监听线程,检测线程是否阻塞。 create_thread(&pid[0], thread_monitor, m);;
  • 启动定时器线程。create_thread(&pid[1], thread_timer, m);;
  • 启动socket线程。create_thread(&pid[2], thread_socket, m);
  • 启动工作线程,用于lua服务消息的调度。create_thread(&pid[i+3], thread_worker, &wp[i]);;

启动lua服务

默认启动的lua服务,在boostrap.lua文件中可以看到都是通过snlua服务启动的。

  • 启动launch服务。
  • 启动cdummy
  • 启动cmaster
  • 启动cslave

总结

本文简单讲述了skynet的启动流程,使用了那些数据结构,以及启了那些C服务和lua服务。后续将会讲解这些基础的数据结构和怎么启动C服务和lua服务。

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/10/skynetthree/index.html b/2021/10/skynetthree/index.html index e45332ffa..b9dcde0ca 100644 --- a/2021/10/skynetthree/index.html +++ b/2021/10/skynetthree/index.html @@ -162,7 +162,7 @@ end
  • 这样就能解释为为什么skynet.newservice是阻塞的了。
  • 同理skynet.call是阻塞的.

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/10/skynettwo/index.html b/2021/10/skynettwo/index.html index 83a0de187..5e6c98fa0 100644 --- a/2021/10/skynettwo/index.html +++ b/2021/10/skynettwo/index.html @@ -114,7 +114,7 @@ };

消息通过函数struct message_queue * skynet_context_message_dispatch(struct skynet_monitor *sm, struct message_queue *q, int weight)来处理,处理过程如下:

  1. 从全局消息队列中取出一个次级消息队列, skynet_globalmq_pop();;
  2. 通过次级消息队列中的handle变量来获取对应服务的上下文, struct skynet_context * ctx = skynet_handle_grab(handle);;
  3. 调用回调函数,dispatch_message(ctx, &msg);

总结

本文从数据结构的层面,讲述了一个C服务的启动,以及消息的处理流程。

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/11/gop2pfour/index.html b/2021/11/gop2pfour/index.html index b371a8713..b9679c273 100644 --- a/2021/11/gop2pfour/index.html +++ b/2021/11/gop2pfour/index.html @@ -198,7 +198,7 @@ }

用go-libp2p进行p2p传输的流程就理清楚了。我只贴了改动和新增的代码, 详细代码

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/11/randomquotes/index.html b/2021/11/randomquotes/index.html index 76e55d514..7c3fdb1e3 100644 --- a/2021/11/randomquotes/index.html +++ b/2021/11/randomquotes/index.html @@ -42,7 +42,7 @@ ]

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/11/webrtcdesk/index.html b/2021/11/webrtcdesk/index.html index 5b78f58eb..845ff71c3 100644 --- a/2021/11/webrtcdesk/index.html +++ b/2021/11/webrtcdesk/index.html @@ -236,7 +236,7 @@ };

参考: https://blog.csdn.net/weixin_29405665/article/details/107320004

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/11/webrtcpeerconnection/index.html b/2021/11/webrtcpeerconnection/index.html index 0ed4a22a7..c6a88683d 100644 --- a/2021/11/webrtcpeerconnection/index.html +++ b/2021/11/webrtcpeerconnection/index.html @@ -60,7 +60,7 @@ // observer function OnIceCandidate. Send these candidates to the remote peer.

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/12/astar/index.html b/2021/12/astar/index.html index 04e3fae76..bd303a908 100644 --- a/2021/12/astar/index.html +++ b/2021/12/astar/index.html @@ -188,7 +188,7 @@ end.....

参考连接:https://blog.csdn.net/u012234115/article/details/47152137

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/12/dark/index.html b/2021/12/dark/index.html index f5478a83b..05ceb9f67 100644 --- a/2021/12/dark/index.html +++ b/2021/12/dark/index.html @@ -46,7 +46,7 @@
<span class="darkmode-ignore">😬<span>
 

翻译 & 详情参考: https://darkmodejs.learn.uno

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/12/music/index.html b/2021/12/music/index.html index 1191f7fee..5952cd7d7 100644 --- a/2021/12/music/index.html +++ b/2021/12/music/index.html @@ -23,7 +23,7 @@ </meting-js>

  • server: 音乐平台, netease, tencent, kugou, xiami, baidu
  • id: song id / playlist id / album id / search keyword
  • type: id类型, song, playlist, album, search, artist
  • loop: 播放模式,values: ‘all’, ‘one’, ’none’
  • mini: enable mini mode
  • fixed: enable fixed mode

可以右键另存为APlayer.min.css, APlayer.min.js, Meting.min.js网站本地文件。

播放网站本地音乐文件

该js插件可以播放网站本地音乐

具体参数请参考: https://github.com/metowolf/MetingJS

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/12/nginx/index.html b/2021/12/nginx/index.html index adc156c8d..f83220293 100644 --- a/2021/12/nginx/index.html +++ b/2021/12/nginx/index.html @@ -78,7 +78,7 @@ }

  • http公共部分的配置我隐去了,参考上面静态网站配置
  • pc.com和h5.com两个域名都解析在同一个ip上(也就是网站部署所在的服务器ip)
  • 不同域名,配置同样的listen, nginx允许这样配置
  • 在各自的server下配置location /, 反向代理到对应的端口上
    • 8081端口,是pc网站
    • 8082端口,是h5网站
  • 访问pc.com, 实际上会访问http://127.0.0.1:8081
  • 访问h5.com, 实际上会访问http://127.0.0.1:8082

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/12/openresty-upload/index.html b/2021/12/openresty-upload/index.html index 89b578da4..a8fef0bd4 100644 --- a/2021/12/openresty-upload/index.html +++ b/2021/12/openresty-upload/index.html @@ -91,7 +91,7 @@

更改目录权限命令

chmod -R 755 目录名称
 

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2021/12/shortcodes/index.html b/2021/12/shortcodes/index.html index 1b4d5c3f4..676f3b771 100644 --- a/2021/12/shortcodes/index.html +++ b/2021/12/shortcodes/index.html @@ -56,7 +56,7 @@ {{< bilibili id=BV1CP4y1H7SB >}}

参考

hugo的shortcodes功能详情参考

detials标签的使用参考

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2022/02/jwt/index.html b/2022/02/jwt/index.html index df9d92422..185cf91c8 100644 --- a/2022/02/jwt/index.html +++ b/2022/02/jwt/index.html @@ -281,7 +281,7 @@

SAN证书生成参考: SAN

关于grpc和认证相关的一些想法

我们在开发过程中往往更复杂, 下面是优化过程

  1. grpc + tls + token验证 + 自定义认证
  • tls: 目的是为了加密协议传输通道
  • token认证:是为了能从token中获取用户信息,保障用户信息安全。服务器不用存储会话信息,减少内存。但是每次接口请求都增加了token解析操作。
  • 自定义认证:客户端服务器约定固定的参数, 客户端每次请求都会带上,服务器做验证(有token认证后,自定义认证没有必要了,个人观点)
  1. 在拦截器中统一身份token验证, 这样做的目的是减少代码冗余,但是这样没法传递信息给接口,直到我发现了context.WithValue()
  • 服务器收到信息,解析token, 得到用户的唯一标识uid(这是客户端在创建token的时候加进去的)
  • 然后使用context.WithValue("uid", uid), 把uid放到上下文中,传递给SayHello(ctx context.Context, empty *emptypb.Empty) (*pb.HelloWorld, error) 可以通过 ctx.Value("uid").(string) 取出来。这样做逻辑处理的时候就知道是哪位用户在处理。

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2022/02/san/index.html b/2022/02/san/index.html index 031d15d95..515814e4d 100644 --- a/2022/02/san/index.html +++ b/2022/02/san/index.html @@ -117,7 +117,7 @@ }

注意 creds, err := credentials.NewClientTLSFromFile("keys/server.pem", "servername")这里的servernaem参数要与证书申请的一致

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2022/03/afk/index.html b/2022/03/afk/index.html index efd777a29..f058501c8 100644 --- a/2022/03/afk/index.html +++ b/2022/03/afk/index.html @@ -9,7 +9,7 @@ 一旦水位值到达了一定的量玩家的下一次抽卡就必定100%出现稀有卡片,当抽到了稀有卡后水位值就会清空重新开始 水位的设定值都是一个上下浮动的数。比如说水位到达100,玩家下一次强化或抽卡必定成功,但是这个成功水位值有时候可能在90-110之间上下随机浮动

保底

同一卡池3次十连必有一紫, 抽到紫后重新计算 同一卡池每三十抽比出紫 的次数

种族: 种族卡池概率是共享的,即使切换了种族也不会重新计算抽卡次数

友情点: 没有保底机制

心愿单

在酒馆中抽到精英英雄时,会有更高的几率获得心愿单中的英雄(获得精英英雄的总概率不变)

2700钻石 十连抽

普通十连抽

3000钻石 十连抽

选择一张卡,当抽到紫卡则替换成选择的卡

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2022/03/blog/index.html b/2022/03/blog/index.html index 9674b8c13..a28067c75 100644 --- a/2022/03/blog/index.html +++ b/2022/03/blog/index.html @@ -7,7 +7,7 @@ 博客记事

vps选择

最近关注了一个vps推广网站。价格合适,于是买了一个128元/年的云服务器。既可以用来做代理,又可以搭建个人博客 配置是2G/1M/40G(运存/带宽/硬盘)

使用技术

  • nginx: 静态博客
  • v2ray: 代理
  • https + nginx
  • freenome: 域名
  • DNS解析
  • git: 拉去github静态博客

总结

整套流程走下来放在自己购买的服务器上才有这个网站属于自己的感觉, 有种满足感。之前部署在gitpage上的博客不准备撤销。这样两个域名都可以访问我的博客

--完--


See Also


See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2022/03/http/index.html b/2022/03/http/index.html index 1bdaf7c63..a32aafc9d 100644 --- a/2022/03/http/index.html +++ b/2022/03/http/index.html @@ -101,7 +101,7 @@ }

  • 逻辑处理只用写在HttpAction的成员函数中
  • 不用一个一个手动的把路由和函数进行绑定。

至此,一个结合gin框架的注解路由就写好了。

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2022/03/https/index.html b/2022/03/https/index.html index 872da4514..a07816bf8 100644 --- a/2022/03/https/index.html +++ b/2022/03/https/index.html @@ -84,7 +84,7 @@

忽略证书过期时间,直接重置证书时间

$ certbot renew --force-renewal
 

参考

nginx+https

linux定时任务

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2022/03/reload/index.html b/2022/03/reload/index.html index a6edced0c..2a39b7025 100644 --- a/2022/03/reload/index.html +++ b/2022/03/reload/index.html @@ -95,7 +95,7 @@

注意的点

  1. plugin插件必须在main包下

  2. golang文件会检测plugin.so文件是否已经加载。

    • 解决办法1: 可以使用不同的文件名
    • 解决办法2: 编译插件时可以指定编译参数 -ldflags -pluginpath="plugin/hot-1" (不推荐)
  3. 怎么做到不修改plugin.so文件名字。

    • 解决办法: 每次新插件的生成新的文件名。然后使用软连接连接到固定的 plugin.so 上。可以参考Makefile文件的make reall
$ rm -rf plugin.so && ln -s $(pname) plugin.so
 
  1. golang的plugin只支持linux & macosx系统。

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2022/03/timer/index.html b/2022/03/timer/index.html index 9b7a3acc3..f5c70f15a 100644 --- a/2022/03/timer/index.html +++ b/2022/03/timer/index.html @@ -723,7 +723,7 @@ }

总结

传统时间轮的问题

  1. 当时间跨度较大的时候,提升单层时间轮的tick可以减少空转次数,但是会导致时间精度较低.

层级时间轮

  1. 层级时间轮既可以避免精度降低,又避免了指针空转的次数。
  2. 上文中可以看到,使用单协程来调度 + 协程池的方式来处理业务
  3. 应使用单例,全局化一个定时器

什么时候使用层级定时器

  1. 当时间跨度很大的时候

还有什么问题

  1. 当任务较少的时候,可以看到,虽然是单协程调度,但是避免不了指针空转的情况。 需求是那种可以知道任务快过期了抛出来给定时器。

参考

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2022/03/timerskynet/index.html b/2022/03/timerskynet/index.html index dce9a7f6e..31c466471 100644 --- a/2022/03/timerskynet/index.html +++ b/2022/03/timerskynet/index.html @@ -432,7 +432,7 @@ }

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2022/04/cginc/index.html b/2022/04/cginc/index.html index 1088a949c..c9c4b08f3 100644 --- a/2022/04/cginc/index.html +++ b/2022/04/cginc/index.html @@ -51,7 +51,7 @@ }

--完--


See Also

没有标签

See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2022/04/graphics/index.html b/2022/04/graphics/index.html index f2caaf709..cd6cfdfce 100644 --- a/2022/04/graphics/index.html +++ b/2022/04/graphics/index.html @@ -18,7 +18,7 @@

Perspective Projection(需要二刷)

Lecture 5: Rasterization 1 (Triangles)

--完--


See Also


See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2022/04/shader01/index.html b/2022/04/shader01/index.html index 7e5d605f7..72a16491e 100644 --- a/2022/04/shader01/index.html +++ b/2022/04/shader01/index.html @@ -143,7 +143,7 @@ 语法如下:

Pass { [Name and Tags] [RenderSetup] }
 

参考

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2022/04/shaderbase/index.html b/2022/04/shaderbase/index.html index 04d995f64..ba179ac31 100644 --- a/2022/04/shaderbase/index.html +++ b/2022/04/shaderbase/index.html @@ -126,7 +126,7 @@

  • 固定函数着色器的代码被定义在Pass 语义块中
  • 需要完全使用ShaderLab的语法(即使用ShaderLab的渲染设置命令)来编写,而非使用Cg/HLSL。
  • 在Unity 5.2中,所有固定函数着色器都会在背后被Unity编译成对应的顶点/片元着色器,因此真正意义上的固定函数着色器已经不存在了

选择哪种形式

  • 除非你有非常明确的需求必须要使用固定函数着色器,例如需要在非常旧的设备上运行你的游戏(这些设备非常少见),否则请使用可编程管线的着色器,即表面着色器或顶点/片元着色器
  • 如果你想和各种光源打交道,你可能更喜欢使用表面着色器,但需要小心它在移动平台的性能表现。
  • 如果你需要使用的光照数目非常少,例如只有一个平行光,那么使用顶点/片元着色器是一个更好的选择。 最重要的是,如果你有很多自定义的渲染效果,那么请选择顶点/片元着色器

Unity Shader != 真正的Shader

在Unity里,Unity Shader实际上指的就是一个ShaderLab文件——硬盘上以.shader 作为文件后缀的一种文件

在Unity Shader(或者说是ShaderLab文件)里,我们可以做的事情远多于一个传统意义上的Shader:

  • 在传统的Shader中,我们仅可以编写特定类型的Shader,例如顶点着色器、片元着色器等。而在Unity Shader中,我们可以在同一个文件里同时包含需要的顶点着色器和片元着色器代码。
  • 在传统的Shader中,我们无法设置一些渲染设置,例如是否开启混合、深度测试等,这些是开发者在另外的代码中自行设置的。而在Unity Shader中,我们通过一行特定的指令就可以完成这些设置。
  • 在传统的Shader中,我们需要编写冗长的代码来设置着色器的输入和输出,要小心地处理这些输入输出的位置对应关系等。而在Unity Shader中,我们只需要在特定语句块中声明一些属性,就可以依靠材质来方便地改变这些属性。而且对于模型自带的数据(如顶点位置、纹理坐标、法线等),Unity Shader也提供了直接访问的方法,不需要开发者自行编码来传给着色器。

Unity Shader的缺点:

  • 由于Unity Shader的高度封装性,我们可以编写的Shader类型和语法都被限制了
  • 对于一些类型的Shader,例如曲面细分着色器(Tessellation Shader)、几何着色器(Geometry Shader)等,Unity的支持就相对差一些
  • 一些高级的Shader语法Unity Shader也不支持

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2022/04/shaderfunc/index.html b/2022/04/shaderfunc/index.html index 0a3c318f6..fa8e2889b 100644 --- a/2022/04/shaderfunc/index.html +++ b/2022/04/shaderfunc/index.html @@ -7,7 +7,7 @@ 编程 编程.UnityShader

数学函数

cg/hlsl函数功能描述
dot(A,B)点积, 点积结果为标量,主要用于求向量的夹角或b向量在a向量上的投影
cross(A,B)叉积, 叉积结果为向量,结果与这两个向量组成的平面垂直。主要用于3D图形学
mul(M, N)矩阵M和矩阵N的积
mul(M, v)矩阵M和列向量v的积
mul(v, M)行向量v和矩阵M的积
abs(x)
saturate(x)把x限制到[0,1]之间
clamp(x,a,b)把x限制到[a,b]之间
TRANSFORM_TEXo.uv = TRANSFORM_TEX(v.texcoord,_MainTex);
等价于: o.uv = v.texcoord.xy * _MainTex_ST.xy + _MainTex_ST.zw;
_MainTex_ST.xy中是tiling _MainTex_ST.zw中是offset
sqrt(x)求x的平方根,,x必须大于0
rsqrt(x)x的平方根的倒数,x必须大于0
all(x)如果输入参数均不为0,则返回ture; 否则返回flase。&&运算
any(x)输入参数只要有其中一个不为0,则返回true。
lerp(a, b, w)计算(1-w)a + b*w 。即在下限a和上限b之间进行插值,w表示权值。注意,如果a和b是向量,则权值w必须是标量或者等长的向量。
lerp(a, b, w)官方解释: float lerp(float a, float b, float w) { return a + w*(b-a);}
MyExplain: float lerp(float a, float b, float w) { return a(1-w) + b * w; }

一个混合公式,他们俗称插值, 只不过w相当于以第二个参数为源,第一个参数为目标。 直白点,就是把b向a上混合
ceil(x)对x向上取整。
floor(x)对x向下取整。
round(x)返回四舍五入值。
step(a, x)如果x< a,返回0;否则,返回1
sign(x)如果x大于0,返回1;如果小于0,返回-1;否则返回0;
exp(x)计算e^x,e=2.71828
exp2(x)计算2^x
fmod(x,y)返回x/y的余数。如果y为0,结果不可预料。
modf(x, out ip)把x分解成整数和分数两部分,每部分都和x有着相同的符号,整数部分被保存在ip中,分数部分由函数返回
max(a, b)比较两个标量或等长向量元素,返回最大值。
min(a,b)比较两个标量或等长向量元素,返回最小值。
determinant(m)计算矩阵的行列式因子。
transpose(M)矩阵M的转置矩阵
degrees(x)函数将弧度值转换为角度值
radians(x)函数将角度值转换为弧度值
log(x)计算ln(x)的值,x必须大于0
log2(x)计算log2^x的值,x必须大于0
log10(x)计算log10^x的值,x必须大于0
frac(x)返回标量或矢量的小数
frexp(x, out i)将浮点数x分解为尾数和指数,即, 返回m,并将指数存入i中;如果x为0,则尾数和指数都返回0
isfinite(x)判断标量或者向量中的每个数据是否是有限数,如果是返回true;否则返回false;
isinf(x)判断标量或者向量中的每个数据是否是无限,如果是返回true;否则返回false;
isnan(x)判断标量或者向量中的每个数据是否是非数据(not-a-number NaN),如果是返回true;否则返回false;
lit(NdotL, NdotH, m)N表示法向量。L表示入射光向量。H表示半角向量。m表示高光向量。函数计算环境光,散射光,镜面光的贡献,返回四元向量: X表示环境光的贡献,总是1;Y表示散射光的贡献,如果N.L<0,则为0,否则为N.L; Z表示镜面光的贡献,如果N.L<0或者N.H<0,则为0;否则为(N.H)^m;W始终为1
noise(x)根据它的参数类型,这个函数可以是一元、二元或三元噪音函数。返回的值在0和1之间,并且通常与给定的输入值一样
ldexp(x, n)计算x*(2^n)的值
smoothstep(min, max, x)x位于min和max之间,若x=min,返回0;若x=max,返回1;若x在两者之间,按下列公式返回数据:-2*((x-min)/(max-min))^3+3*((x-min)/(max-min))^2
sin(x)返回弧度x的正弦值,返回值范围为[-1,1]
cos(x)返回弧度x的余弦值。返回值范围为[-1,1]
tan(x)计算x正切值
asin(x)反正弦函数,输入参数取值区间为[-1,1],返回角度值范围为[-π/2,π/2]
acos(x)反余切函数,输入参数范围为[-1,1], 返回[0,π]区间的角度值
atan(x)反正切函数
sinh(x)计算x的双曲正弦
cosh(x)计算x的双曲余弦值。
tanh(x)计算x的双曲线切线
sincos(float x, out s, out c)同时计算x的sin值和cos值,其中s=sin(x),c=cos(x)。该函数比分别运算要快很多!

几何函数

cg/hlsl函数功能描述
normalize(v)返回v向量的单位向量
reflect(I, N)根据入射光纤方向I和表面法向量N计算反射向量,仅对三元向量有效
length(v)返回v向量的模,即sqrt(dot(v,v))
distance(pt1, pt2)两点之间的欧几里德距离
faceforward(N,I,Ng)如果dot(I,Ng)<0,返回N;否则返回-N。
refract(I,N,eta)根据入射光线方向I,表面法向量N和折射相对系数eta,计算折射向量。如果对给定的eta,I和N之间的角度太大,返回(0,0,0)。只对三元向量有效

纹理映射函数

cg/hlsl函数功能描述
tex1D(sampler1D tex, float s)一维纹理查询
tex1D(sampler1D tex, float s, float dsdx, float dsdy)使用导数值(derivatives)查询一维纹理
Tex1D(sampler1D tex, float2 sz)一维纹理查询,并进行深度值比较
Tex1D(sampler1D tex, float2 sz, float dsdx,float dsdy)使用导数值查询一维纹理, 并进行深度值比较
Tex1Dproj(sampler1D tex, float2 sq)一维投影纹理查询
Tex1Dproj(sampler1D tex, float3 szq)一维投影纹理查询,并比较深度值
Tex2D(sampler2D tex, float2 s)二维纹理查询
Tex2D(sampler2D tex, float2 s, float2 dsdx, float2 dsdy)使用导数值查询二维纹理
Tex2D(sampler2D tex, float3 sz)二维纹理查询,并进行深度值比较
Tex2D(sampler2D tex, float3 sz, float2 dsdx,float2 dsdy)使用导数值查询二维纹理,并进行深度值比较
Tex2Dproj(sampler2D tex, float3 sq)二维投影纹理查询
Tex2Dproj(sampler2D tex, float4 szq)二维投影纹理查询,并进行深度值比较
texRECT(samplerRECT tex, float2 s)二维非投影矩形纹理查询(OpenGL独有)
texRECT (samplerRECT tex, float3 sz, float2 dsdx,float2 dsdy)二维非投影使用导数的矩形纹理查询(OpenGL独有)
texRECT (samplerRECT tex, float3 sz)二维非投影深度比较矩形纹理查询(OpenGL独有)
texRECT (samplerRECT tex, float3 sz, float2 dsdx,float2 dsdy)二维非投影深度比较并使用导数的矩形纹理查询(OpenGL独有)
texRECT proj(samplerRECT tex, float3 sq)二维投影矩形纹理查询(OpenGL独有)
texRECT proj(samplerRECT tex, float3 szq)二维投影矩形纹理深度比较查询(OpenGL独有)
Tex3D(sampler3D tex, float s)三维纹理查询
Tex3D(sampler3D tex, float3 s, float3 dsdx, float3 dsdy)结合导数值查询三维纹理
Tex3Dproj(sampler3D tex, float4 szq)查询三维投影纹理,并进行深度值比较
texCUBE(samplerCUBE tex, float3 s)查询立方体纹理
texCUBE (samplerCUBE tex, float3 s, float3 dsdx, float3 dsdy)结合导数值查询立方体纹理
texCUBEproj (samplerCUBE tex, float4 sq)查询投影立方体纹理

--完--


See Also


See Also

没有标签

最近文章

随想

分类

标签

Cpu Docker diff --git a/2022/04/shaderhelloworld/index.html b/2022/04/shaderhelloworld/index.html index 3b84fc516..04571be66 100644 --- a/2022/04/shaderhelloworld/index.html +++ b/2022/04/shaderhelloworld/index.html @@ -111,7 +111,7 @@

  1. 声明并加入一个显示名称为Bump的贴图,用于放置法线图

  2. 为了能够在CG程序中使用这张贴图,必须加入一个sample,希望你还记得~

  3. 获取Bump的uv信息作为输入

  4. 从法线图中提取法线信息,并将其赋予相应点的输出的Normal属性。UnpackNormal是定义在UnityCG.cginc文件中的方法,这个文件中包含了一系列常用的CG变量以及方法。UnpackNormal接受一个fixed4的输入,并将其转换为所对应的法线值(fixed3)。在解包得到这个值之后,将其赋给输出的Normal,就可以参与到光线运算中完成接下来的渲染工作了。

  5. 更改顶点模型。

  • #pragma surface surf CustomDiffuse vertex:vert
  • 对应的函数是 void vert(inout appdata_full v)

关联材质与自己写的shader,作为初学者,我一度找不到关联材质与shader的地方, 下图是我做的笔记,方便后来人快速找到关联地:

总结

跟着教程走完整个流程, 当调整Snow Level这个参数的大小,石头上的雪景也跟着变换时,心里是非常有成就感的,这就是shader的魅力,感谢作者提供的教程。 下面我准备系统性的学习shader + 计算机图形学,从《Unity Shader入门精要》开始

到时候再回过头来看看这篇笔记中我不理解的点。比如光照模型、shader的编程语法问题和顶点着色器和表面着色器的区别。

学习参考

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2022/04/shadermathematic/index.html b/2022/04/shadermathematic/index.html index 68b5825c8..dd378b97b 100644 --- a/2022/04/shadermathematic/index.html +++ b/2022/04/shadermathematic/index.html @@ -52,7 +52,7 @@

对于行矩阵和列矩阵来说,我们可以使用转置操作来转换行列矩阵

转置矩阵常用的性质

  • 性质一:矩阵转置的转置等于原矩阵。
  • 性质二:矩阵串接的转置,等于反向串接各个矩阵的转置。

逆矩阵 TODO

逆矩阵 (inverse matrix) 大概是本书讲到的关于矩阵最复杂的一种操作了。不是所有的矩阵都有逆矩阵,第一个前提就是,该矩阵必须是一个方阵。

正交矩阵

正交是矩阵的一种属性。如果一个方阵M 和它的转置矩阵的乘积是单位矩阵的话,我们就说这个矩阵是正交的 (orthogonal)

  • 矩阵的每一行,即c 1 、c 2 和c 3 是单位矢量,因为只有这样它们与自己的点积才能是1;
  • 矩阵的每一行,即c 1 、c 2 和c 3 之间互相垂直,因为只有这样它们之间的点积才能是0。

上述两条结论对矩阵的每一列同样适用,因为如果M 是正交矩阵的话,M^T 也会是正交矩阵。

矩阵的几何意义: 变换

什么是变换

变换 (transform) ,指的是我们把一些数据,如点、方向矢量甚至是颜色等,通过某种方式进行转换的过程

坐标空间

法线变换

Unity内置变换

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2022/04/shaderrenderpipline/index.html b/2022/04/shaderrenderpipline/index.html index 9c6ccbb8f..8a6721b69 100644 --- a/2022/04/shaderrenderpipline/index.html +++ b/2022/04/shaderrenderpipline/index.html @@ -15,7 +15,7 @@ 在讲原因之前,先做一个实验。
  • 创建10000个小文件,每个文件的大小为1kB, 然后把它们从一个文件夹复制到另一个文件夹。
  • 单独创建一个文件,大小为10MB,然后把它从一个文件夹复制到另外一个文件夹。

对比这两次操作发现,虽然文件总大小是一致的,文件数量多的一方所需要花费的时间更长。原因在于每个复制动作都要很多额外的操作,例如分配内存、创建各种元数据等。

渲染过程虽然跟上面的实验不同,但是有类似的地方。

  • 在每次调用Draw Call之前,CPU需要向GPU发送很多内容,包括数据、状态和命令等
  • 一旦CPU完成了这些准备工作,GPU就可以开始本次的渲染
  • GPU的渲染能力是很强的,渲染200个还是2 000个三角网格通常没有什么区别,因此渲染速度往往快于CPU提交命令的速度。

如果Draw Call的数量太多,CPU就会把大量时间花费在提交Draw Call上,造成CPU的过载

批处理

解决CPU过载的方法有很多,书中讨论的是批处理

  • 提交大量的Draw Call造成CPU瓶颈,CPU把时间花在提交Draw Call上了,那么一个很显然优化的方法是把Draw Call 先合并再提交
  • 批处理技术更加适合于那些静态的物体,例如不会移动的大地、石头等,对于这些静态物体我们只需要合并一次即可

减少Draw Call的开销

  • 避免使用大量很小的网格, 当不可避免使用小网格时,考虑是否可以合并它们。
  • 避免使用过多的材质,尽量在不同的网格之间共用同一个材质。

什么是固定渲染管线

固定函数的流水线(Fixed-Function Pipeline) ,也简称为固定管线,通常是指在较旧的GPU上实现的渲染流水线。

  • 这种流水线只给开发者提供一些配置操作,但开发者没有对流水线阶段的完全控制权。
  • 固定渲染管线是只可配置的管线

进化到现在,看到有许多可编程的流水线阶段,比如顶点着色器、片元着色器,这些可编程的着色器阶段可以说是GPU进化最重要的贡献

  • 在GPU发展的过程中,为了继续提供固定管线的接口抽象,一些显卡驱动的开发者们使用了更加通用的着色架构,即使用可编程的管线来模拟固定管线
  • OpenGL 2.0在没有真正的固定管线的硬件支持下,依靠系统的可编程管线功能来模仿固定管线的处理过程
  • OpenGL 3.0是最后既支持可编程管线又完全支持固定管线编程接口的版本,在OpenGL 3.2中,Core Profile就完全移除了固定管线的概念。

什么是Shader

  • GPU流水线上一些可高度编程的阶段,而由着色器编译出来的最终代码是会在GPU上运行的(对于固定管线的渲染来说,着色器有时等同于一些特定的渲染设置);
  • 有一些特定类型的着色器,如顶点着色器、片元着色器等;
  • 依靠着色器我们可以控制流水线中的渲染细节,例如用顶点着色器来进行顶点变换以及传递数据,用片元着色器来进行逐像素的渲染。

总结

  • 渲染流水线的概念几乎贯穿全文
  • Shader编程其实就是在GPU流水线上一些可高度编程的阶段

参考

《Unity Shader入门精要》

--完--


See Also


See Also

最近文章

随想

分类

标签

Cpu Docker diff --git a/2022/05/baidu/index.html b/2022/05/baidu/index.html index cfbffbfd0..069c3ca8a 100644 --- a/2022/05/baidu/index.html +++ b/2022/05/baidu/index.html @@ -11,7 +11,7 @@

  • 然后到aria2.exe所在目录,右键运行cmd黑窗体,执行命令下载命令:

  • aria2c "https://d.pcs.baidu.com/file/3880b7adak647ec42ca8aec1c13631da?fid=1271847445-250528-373982952796171&rt=pr&sign=FDtAER-DCb740ccc5511e5e8fedcff06b081203-tBWHrm%2Bd0hfZqkEtvEVVP6chmMM%3D&expires=8h&chkbd=0&chkv=0&dp-logid=3278883060372832463&dp-callid=0&dstime=1652779150&r=192156788&origin_appid=&file_type=0" --out "hdzs_66795.zip" --header "User-Agent: pan.baidu.com" --header "Cookie: BDUSS=Hg2dXJwcDdUZk81RDdHaTNnRkdLczNzdWNSRmlvdzhjb1c1Zlo5bHExWmN4S1ZpSVFBQUFBJCQAAAAAAAAAAAEAAACUS8rKu-6xprfJueoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFw3fd"
     

    参考

    --完--


    See Also


    See Also

    没有标签

    最近文章

    随想

    分类

    标签

    Cpu Docker diff --git a/2022/05/geometry/index.html b/2022/05/geometry/index.html index 405057a1e..ed7fab06d 100644 --- a/2022/05/geometry/index.html +++ b/2022/05/geometry/index.html @@ -8,7 +8,7 @@ 编程.UnityShader

    问题

    MAC平台几何着色器不生效

    解决步骤

    1. unity shaderlab 怎么设置以至于支持几何着色器
    2. 找原因,设置 编译目标级别,#pragma target 4.0, 不管用
    3. 看到一句话,Unity 在 Metal 图形上支持曲面细分着色器,但 Metal 不支持几何着色器
    4. 找到mac和ios平台使用的是Metal标准的图形api
    5. 遂查询是否有其他的图形 API, 发现 mac和ios还支持 OpenGL
    6. 在Unity中编写的Shader最终会根据不同的平台来编绎成不同的着色器语言,官方的建议是用Cg/HLSL来编写,当然也可以使用GLSL,主要是因为Cg/HLSL有更好的跨平台性,更倾向于使用Cg/HLSL来编写Shader程序。
    7. Shader编程语言
    • 基于OpenGL的OpenGL Shading Language,简称GLSL。
    • 基于DirectX的High Level Shading Language,简称HLSL。
    • 还有NVIDIA公司的C for Graphic,简称Cg语言。
    1. URP 通用渲染管线使用HLSL
    2. unity是否可以指定 graphics API
    3. 打开 Player 设置(菜单:Edit > Project Settings,然后选择 Player 类别)。 导航到 Other Settings 并确保选中 Auto Graphics API

    参考链接

    --完--


    See Also


    See Also

    没有标签

    最近文章

    随想

    分类

    标签

    Cpu Docker diff --git a/2022/05/refraction/index.html b/2022/05/refraction/index.html index 268ad0aaf..3d7bdfb3c 100644 --- a/2022/05/refraction/index.html +++ b/2022/05/refraction/index.html @@ -184,7 +184,7 @@ }

    参考

    --完--


    See Also


    See Also

    最近文章

    随想

    分类

    标签

    Cpu Docker diff --git a/2022/05/shaderalpha/index.html b/2022/05/shaderalpha/index.html index fd8f03f5a..661687bef 100644 --- a/2022/05/shaderalpha/index.html +++ b/2022/05/shaderalpha/index.html @@ -193,7 +193,7 @@ 在三个盒子的例子里,我一直都在强调“默认”两个字。那么默认是什么呢,就是Zwrite On + Ztest On。Zwrite就两种情况(On或者Off)。

    而对于Ztest来说,条件就要丰富得多得多。Ztest的条件总共有如下几种: Less (当物体的这个像素的Z值小于当前摄像机在这个像素上的Z值,则通过Ztest)

    LEqual(条件变为小于等于)

    Greater(条件变为大于)

    GEqual(条件变为大于等于)

    Equal(条件变为相等)

    NotEqual(条件变为不相等)

    Always(Ztest永远通过)

    Never(Ztest永远不通过)

    Off(等同于 ZTest Always)

    On(等同于ZTest LEqual)

    Stencil (copy)

    我们假定Stencil也有一个值叫Ref值。那么Stencil的用法也实在是看着眼熟:获取Ref值->测试(比较)Ref值->写入新的Ref值(如果通过测试)。

    说到底这俩玩意儿的区别,就是在第一步,获取当前物体在这个像素上的这个变量。

    Z值是根据像素到摄像机的距离算出来的,不会因为你的个人意愿而改变;S值是你可以随便填的(是的随便填,想写几就写几,范围0-255)。

    这样一来Stencil可以帮助你突破Ztest所带来的限制,用更灵(jian)活(dan)便(cu)捷(bao)的方式来控制渲染效果。

    Ref就是写入这个像素的Ref值,正如我之前提到的想写几就写几完全看心情(所以我一直都认为叫Stencil Buffer模板缓冲实在是有点唬人的感觉。改成“看哪个数字顺眼就用哪个数字比大小”更贴切一些)。

    Com是进行Test的条件,当你看到一大堆Less\LEqual\Greater\GEqual\Equal\NotEqual\Always\Never这样的字眼儿,是不是感到非常的眼熟?这一步比较的过程和Ztest完全一样。

    Pass和Zwrite简直就是一个妈生出的俩个孩儿。区别就是这个小哥比他兄弟花样儿多点。Zwrite无非就是写入或者不写入(On or Off)。Pass甚至还可以控制如何写入(虽然大多数情况下可能用不到)。

    引用

    ztest: https://zhuanlan.zhihu.com/p/28557283

    --完--


    See Also


    See Also

    最近文章

    随想

    分类

    标签

    Cpu Docker diff --git a/2022/05/shaderbase/index.html b/2022/05/shaderbase/index.html index 5f567197e..5bf233888 100644 --- a/2022/05/shaderbase/index.html +++ b/2022/05/shaderbase/index.html @@ -65,7 +65,7 @@ }

    Shader的语义差异

    • 使用SV_POSITION 来描述顶点着色器输出的顶点位置。一些Shader使用了POSITION 语义,但这些Shader无法在索尼PS4平台上或使用了细分着色器的情况下正常工作。
    • 使用SV_Target 来描述片元着色器的输出颜色。一些Shader使用了COLOR或者COLOR0 语义,同样的,这些Shader无法在索尼PS4上正常工作。

    Shader整洁之道

    Cg/HLSL中3种精度的数值类型

    类 型精 度
    float最高精度的浮点值。通常使用32位来存储
    half中等精度的浮点值。通常使用16位来存储,精度范围是−60 000~+60 000
    fixed最低精度的浮点值。通常使用11位来存储,精度范围是−2.0~+2.0
    • 大多数pc的GPU,以上精度是等价的。
    • 移动平台GPU,是不一致的
    • fixed只在一些较旧的移动设备上有效,在大多数现代移动设备GPU,fixed=half

    规范语法

    思维导图

    --完--


    See Also


    See Also

    最近文章

    随想

    分类

    标签

    Cpu Docker diff --git a/2022/05/shaderlighting/index.html b/2022/05/shaderlighting/index.html index beedf1adc..dd9baf843 100644 --- a/2022/05/shaderlighting/index.html +++ b/2022/05/shaderlighting/index.html @@ -10,7 +10,7 @@

    Cg提供了计算反射方向的函数reflect

    • 函数 :reflect(i, n)
    • 参数 :i,入射方向;n,法线方向。可以是float、float2、float3等类型。
    • 描述 :当给定入射方向i和法线方向n时,reflect函数可以返回反射方向。图6.9给出了参数和返回值之间的关系。

    使用Unity内置的函数

    UnityCG.cginc中一些常用的帮助函数

    函 数 名描 述
    float3 WorldSpaceViewDir (float4 v)输入一个模型空间中的顶点位置,返回世界空间中从该点到摄像机的观察方向。内部实现使用了UnityWorldSpaceViewDir函数
    float3 UnityWorldSpaceViewDir (float4 v)输入一个世界空间中的顶点位置,返回世界空间中从该点到摄像机的观察方向
    float3 ObjSpaceViewDir (float4 v)输入一个模型空间中的顶点位置,返回模型空间中从该点到摄像机的观察方向
    float3 WorldSpaceLightDir (float4 v)仅可用于前向渲染中 。输入一个模型空间中的顶点位置,返回世界空间中从该点到光源的光照方向。内部实现使用了UnityWorldSpaceLightDir函数。没有被归一化
    float3 UnityWorldSpaceLightDir (float4 v)仅可用于前向渲染中 。输入一个世界空间中的顶点位置,返回世界空间中从该点到光源的光照方向。没有被归一化
    float3 ObjSpaceLightDir (float4 v)仅可用于前向渲染中 。输入一个模型空间中的顶点位置,返回模型空间中从该点到光源的光照方向。没有被归一化
    float3 UnityObjectToWorldNormal (float3 norm)把法线方向从模型空间转换到世界空间中
    float3 UnityObjectToWorldDir (float3 dir)把方向矢量从模型空间变换到世界空间中

    扩展

    漫反射: https://blog.csdn.net/puppet_master?type=blog 高光反射: https://blog.csdn.net/puppet_master/article/details/53428885?spm=1001.2014.3001.5502

    思维导图

    --完--


    See Also


    See Also

    最近文章

    随想

    分类

    标签

    Cpu Docker diff --git a/2022/06/cicd/index.html b/2022/06/cicd/index.html index 9d036e03c..e4c99b704 100644 --- a/2022/06/cicd/index.html +++ b/2022/06/cicd/index.html @@ -165,7 +165,7 @@ - chmod 644 ~/.ssh/known_hosts

    --完--


    See Also

    没有标签

    See Also

    没有标签

    最近文章

    随想

    分类

    标签

    Cpu Docker diff --git a/2022/10/netch/index.html b/2022/10/netch/index.html index fa34aed86..cf6d03a39 100644 --- a/2022/10/netch/index.html +++ b/2022/10/netch/index.html @@ -15,7 +15,7 @@

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

    注意,使用加速器模式前,应当注意该节点的延迟是否在300ms以下(或者跟低,我玩马车8可以,玩喷喷3就需要更低的延迟,我没试过),NAT类型是否是NAT: 1 或者 NAT: 2, 否则请更换节点,NAT如果是noUDP则表示该节点不支持UDP协议

    --完--


    See Also

    没有标签

    See Also

    没有标签

    最近文章

    随想

    分类

    标签

    Cpu Docker diff --git a/2023/05/particlesystem01/index.html b/2023/05/particlesystem01/index.html index ab4434398..571b47fe3 100644 --- a/2023/05/particlesystem01/index.html +++ b/2023/05/particlesystem01/index.html @@ -6,7 +6,7 @@ 搜索

    文章目录

    粒子系统01-概述

    参考视频

    参考播客

    一、两种解决方案

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

    二、粒子系统模块概述

    Main控制粒子初始状态,全局状态
    Emission控制粒子的发射速率、时间、波次
    Shape定义发射粒子体积的形状
    Velocity over Lifetime控制粒子在其生命周期内的速度
    Limit Velocity over Lifetime在其生命周期内限制粒子的速度
    Inherit Velocity控制粒子的速度如何随时间推移而受到其父对象移动的影响
    Force over Lifetime通关此模块中指定的力来对粒子产生影响
    Color over Lifetime指定粒子的颜色和透明度在其生命周期中如何变化
    Color by Speed设置粒子的颜色根据粒子速度(每秒的距离单位)变化
    Size over Lifetime控制粒子在其生命周期内的大小
    Size By Speed设置粒子的大小根据粒子(每秒的距离单位)速度变化
    Rotation over Lifetime控制粒子在其生命周期内的旋转
    Rotation by Speed设置粒子的旋转根据粒子(每秒的距离单位)速度变化
    External Forces修改力场对系统发射的粒子的影响
    Noise为粒子添加湍流
    Collision控制粒子如何与场景中其他游戏对象发生碰撞
    Triggers控制粒子的触发
    Sub Emitters在某粒子生命周期的阶段创建附加粒子发射器
    Texture Sheet Animation控制动画帧进行播放
    Lights控制粒子的实时光照
    Trails控制粒子的尾迹(拖尾)
    Custom Data在Editor 中定义要附加到粒子的自定义数据格式
    Renderer设置粒子的图像火网格如何被其他粒子变换、着色和绘制

    --完--


    See Also


    See Also


    See Also


    See Also

    最近文章

    随想

    分类

    标签

    Cpu Docker diff --git a/2023/11/30/index.html b/2023/11/30/index.html index 534146a75..6b692def8 100644 --- a/2023/11/30/index.html +++ b/2023/11/30/index.html @@ -8,7 +8,7 @@ 《血污:夜之仪式》未完 《LOL》玩了两个周末

    其他

    组装了一个台机器, 配置单如下

    • 七彩虹 4070
    • cpu 13600kf + b760m
    • 内存金百达 16*2
    • 电源 750W

    --完--


    See Also


    See Also

    没有标签

    最近文章

    随想

    分类

    标签

    Cpu Docker diff --git a/2023/11/chatglm/index.html b/2023/11/chatglm/index.html index 92bb5dd05..01a7bbb5d 100644 --- a/2023/11/chatglm/index.html +++ b/2023/11/chatglm/index.html @@ -64,7 +64,7 @@
    1. 按照以下命令启动项目
    $ python startup.py -a
     

    总结

    1. 现阶段openai gpt4出来了,而且有一个gpt builder可以使用,可以用自己的知识库打造一个专业机器人,更方便快捷而且不占用自己的硬件。
    2. 花了一个星期研究和部署,暂时结束,后续有时间再研究。

    --完--


    See Also


    See Also

    最近文章

    随想

    分类

    标签

    Cpu Docker diff --git a/2023/11/gitaction/index.html b/2023/11/gitaction/index.html index 82e647b28..02367372c 100644 --- a/2023/11/gitaction/index.html +++ b/2023/11/gitaction/index.html @@ -40,7 +40,7 @@ publish_branch: main # 发布到哪个branch

    token 和 personal_token 使用的是变量,这个遍历会读取你在github的action上配置的ACTION_ACCESS_TOKEN的值。

    参考

    https://lucumt.info/post/hugo/using-github-action-to-auto-build-deploy/

    --完--


    See Also

    没有标签

    See Also

    没有标签

    最近文章

    随想

    分类

    标签

    Cpu Docker diff --git a/2023/11/mysql/index.html b/2023/11/mysql/index.html index b17d17ee0..d30017f0f 100644 --- a/2023/11/mysql/index.html +++ b/2023/11/mysql/index.html @@ -69,7 +69,7 @@
    $ docker-compose -f docker-compose.yml up -d
     

    --完--


    See Also

    没有标签

    See Also

    没有标签

    最近文章

    随想

    分类

    标签

    Cpu Docker diff --git a/2023/11/python/index.html b/2023/11/python/index.html index 9492a260d..d229072da 100644 --- a/2023/11/python/index.html +++ b/2023/11/python/index.html @@ -25,7 +25,7 @@ $ source ~/.bash_profile

    如果是在 docker 容器中则需要在~/.bashrc 中写入source ~/.bash_profile, 然后 执行source ~/.bashrc, 提交容器成新镜像后才生效。

    --完--


    See Also

    没有标签

    See Also

    没有标签

    最近文章

    随想

    分类

    标签

    Cpu Docker diff --git a/2023/11/svn/index.html b/2023/11/svn/index.html index 2048a9a59..233285d74 100644 --- a/2023/11/svn/index.html +++ b/2023/11/svn/index.html @@ -6,7 +6,7 @@ 搜索

    文章目录

    Svn

    SVN 合并

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

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

    --完--


    See Also


    See Also


    See Also


    See Also

    没有标签

    最近文章

    随想

    分类

    标签

    Cpu Docker diff --git a/2023/11/wsl2/index.html b/2023/11/wsl2/index.html index 3f848e731..670ad8a3b 100644 --- a/2023/11/wsl2/index.html +++ b/2023/11/wsl2/index.html @@ -44,7 +44,7 @@

    我使用镜像模式之后wsl2的ip虽然跟宿主机一样了,但是使用宿主机网卡ip一直访问不到wsl2的端口,只能通过127.0.0.1访问,最后在这个帖子下的一个评论找到了

    hostAddressLoopback=true  
     

    这个参数是 (Ryzon M1)(https://www.zhihu.com/people/ryzen-m1) 提供的,感谢!!

    官方文档: https://learn.microsoft.com/zh-cn/windows/wsl/wsl-config#experimental-configuration-settings

    --完--


    See Also

    没有标签

    See Also

    没有标签

    最近文章

    随想

    分类

    标签

    Cpu Docker diff --git a/2023/12/30/index.html b/2023/12/30/index.html index a49ca275c..45c7e0500 100644 --- a/2023/12/30/index.html +++ b/2023/12/30/index.html @@ -6,7 +6,7 @@ 搜索

    文章目录

    12月

    学习

    • 银河城地图 搭建
    • ue5 paper2d

    书籍

    《游戏设计艺术》

    电影

    《复仇者联盟》4

    游戏

    • 《血污:夜之仪式》
    • 《LOL》
    • 《神之亵渎》 23小时

    番&剧

    其他

    --完--


    See Also


    See Also

    文章目录


    See Also

    最近文章

    随想

    分类

    标签

    Cpu Docker diff --git a/categories/AI/index.xml b/categories/AI/index.xml index 4f5cc67a5..13aa99cff 100644 --- a/categories/AI/index.xml +++ b/categories/AI/index.xml @@ -1 +1 @@ -AI on Zzz记忆https://zfunnily.github.io/categories/AI/Recent content in AI on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000ChatGLM & LangChainhttps://zfunnily.github.io/2023/11/chatglm/Fri, 10 Nov 2023 11:21:34 +0800https://zfunnily.github.io/2023/11/chatglm/参考: 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 \ No newline at end of file +AI on Zzz记忆https://zfunnily.github.io/categories/AI/Recent content in AI on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000ChatGLM & LangChainhttps://zfunnily.github.io/2023/11/chatglm/Fri, 10 Nov 2023 11:21:34 +0800https://zfunnily.github.io/2023/11/chatglm/参考: 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 \ No newline at end of file diff --git a/categories/IT.Linux/index.xml b/categories/IT.Linux/index.xml index 2b02c2f9e..5e5448897 100644 --- a/categories/IT.Linux/index.xml +++ b/categories/IT.Linux/index.xml @@ -1 +1 @@ -IT.Linux on Zzz记忆https://zfunnily.github.io/categories/IT.Linux/Recent content in IT.Linux on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000Vim | 切换模式/输入法https://zfunnily.github.io/2021/09/vimchange/Tue, 07 Sep 2021 10:46:58 +0800https://zfunnily.github.io/2021/09/vimchange/vim 在退出输入模式的时候切换为原来的输入法 在敲代码的时候使用我们使用的英文,当遇到问题,我们需要搜索引擎的时候需要中文输入法,这个时候,自动切换输入法可以帮助我们节省手动切换输入法的时间。 跟编辑器结合,Linux | Screenhttps://zfunnily.github.io/2021/09/screen/Tue, 07 Sep 2021 10:02:16 +0800https://zfunnily.github.io/2021/09/screen/screen命令 screen 是一个非常有用的命令。应用场景: 单个 SSH 会话中使用多个 shell 窗口(会话)的能力 服务器开发,一个单独运行进程的窗口。可以避免单独再开一个窗口。 &hellip; screen使用 创建一个窗口 $ screen -S name 执行自己需Centos7.2 | gcc4.8升级为4.9https://zfunnily.github.io/2021/09/upgradegcc/Wed, 01 Sep 2021 18:13:41 +0800https://zfunnily.github.io/2021/09/upgradegcc/环境 CentOS 7.2.1511 Docker 我是用 docker 拉取镜像 CentOS 7.2.1511, 利用容器来作为我的开发环境。有条件的也可以用虚拟机或者实体机器。原理都一样。 $ docker $ yum update &amp;&amp; yum install gcc gcc-c++ make zlib-devel.x86_6 下载依赖包 升级 gcc, 下载安装包下载依赖。 $ wget http://ftp.gnu.org/gnu/gcc/gcc-4.9.3/gcc-4.9.3.tar.bz2 $ tar xfv gcc-4.9.3.tar.bz2 &amp;&amp; cd gcc-4.9.3 $ ./contrib/download_prerequisites 如果Shell | Except 使用https://zfunnily.github.io/2021/08/except/Mon, 30 Aug 2021 17:13:33 +0800https://zfunnily.github.io/2021/08/except/Except 参数 spawn 交互程序开始后面跟命令或者指定程序 expect 获取匹配信息匹配成功则执行expect后面的程序动作 send exp_send 用于发送指定的字符串信息 exp_continue 在expect中多次匹配就需要用到 send_user 用来打印输出 相当于shell中的echUbuntu16.04.6 | 安装Cinnamon3.0https://zfunnily.github.io/2020/12/cinnamon3.0/Tue, 01 Dec 2020 15:43:58 +0000https://zfunnily.github.io/2020/12/cinnamon3.0/概述 Cinnamon[1]是Linux Mint[2]的默认桌面环境。不同于 Ubuntu 的 Unity 桌面环境,Cinnamon 是一个更加传统而优雅的桌面环境,其带有底部面板和应用菜单。由于 Cinnamon 桌面以及它类 Windows 的用户界面,许多Ubuntu | version `GLIBC_2.27‘ not found错误https://zfunnily.github.io/2020/11/glibcnotfound/Sat, 28 Nov 2020 15:03:04 +0000https://zfunnily.github.io/2020/11/glibcnotfound/version `GLIBC_2.27’ not found错误 执行strings /lib/x86_64-linux-gnu/libc.so.6 | grep GLIBC_ 结果显示如下: GLIBC_2.2.5 GLIBC_2.2.6 GLIBC_2.3 GLIBC_2.3.2 GLIBC_2.3.3 GLIBC_2.3.4 GLIBC_2.4 GLIBC_2.5 GLIBC_2.6 GLIBC_2.7 GLIBC_2.8 GLIBC_2.9 GLIBC_2.10 GLIBC_2.11 GLIBC_2.12 GLIBC_2.13 GLIBC_2.14 GLIBC_2.15 GLIBC_2.16 GLIBC_2.17 GLIBC_2.18 GLIBC_2.22 GLIBC_2.23 GLIBC_2.24 GLIBC_PRIVATE 去清华开源站点下载glibc: https://mirrors.tuna.tsinghua.edu.cn/gnu/libc/ 下载好文件后解压 $ tar -zxvf glibc-2.27.tar.gz 进入 glibc-2.27 目录,Vim | vimplus快捷键https://zfunnily.github.io/2020/10/vimplus%E5%BF%AB%E6%8D%B7%E9%94%AE/Wed, 28 Oct 2020 09:14:28 +0000https://zfunnily.github.io/2020/10/vimplus%E5%BF%AB%E6%8D%B7%E9%94%AE/插件相关 |快捷键|说明 |&mdash;&mdash; |,|Leader Key |&lt;leader&gt;n|打开 / 关闭代码资源管理器 |&lt;leader&gt;t|打开 / 关闭函数列表 |&lt;leader&gt;a|.h .cpp 文件切换 |&lt;leader&gt;u|转到函数声明 |&Vim | 打造编C++IDEhttps://zfunnily.github.io/2020/10/%E4%BD%BF%E7%94%A8vim%E6%89%93%E9%80%A0%E7%BC%96C-IDE/Wed, 28 Oct 2020 09:11:32 +0000https://zfunnily.github.io/2020/10/%E4%BD%BF%E7%94%A8vim%E6%89%93%E9%80%A0%E7%BC%96C-IDE/使用 vimplus 打造C++ IDE GitHub: https://github.com/chxuan/vimplus 支持平台: macos/linux 安装vimplus // 原来的链接, 国内速度较慢 $ git clone https://github.com/chxuan/vimplus.git ~/.vimplus // github修改为镜像的链接 $ git clone --depth=1 https://github.com.cnpmjs.org/chxuan/vimplus.git ~/.vimplus $ cd ~/.vimplus //不加sudo $ ./install.sh 设置Nerd Font 为防止vimpluLinux | 删除大量文件指令--rsynchttps://zfunnily.github.io/2020/10/linux%E7%B3%BB%E7%BB%9F%E5%88%A0%E9%99%A4%E5%A4%A7%E9%87%8F%E6%96%87%E4%BB%B6%E6%8C%87%E4%BB%A4--rsync/Tue, 13 Oct 2020 16:29:34 +0000https://zfunnily.github.io/2020/10/linux%E7%B3%BB%E7%BB%9F%E5%88%A0%E9%99%A4%E5%A4%A7%E9%87%8F%E6%96%87%E4%BB%B6%E6%8C%87%E4%BB%A4--rsync/rsync的安装 rsync安装,有些系统默认安装有该命令 ubuntu系统 sudo apt-get install rsync centos系统 sudo yum install rsync rsync参数详解 rsync提供了一些跟删除有关的参数 rsync --help | grep delete -del an alias for --delete-during --delete delete extraneous files from destination dirs --delete-before receiver deletes beforeLinux | nsf服务的搭建和使用https://zfunnily.github.io/2020/08/nsf/Fri, 14 Aug 2020 17:17:54 +0000https://zfunnily.github.io/2020/08/nsf/搭建nsf服务 sudo apt install nfs-kernel-server 默认情况下,在Ubuntu 18.04上,NFS版本2是禁用的。版本3和版本4已启用。您可以通过运行以下cat命令来验证: sudo cat /proc/fs/nfsd/versions 写入 exports cat /etc/exports sudo echo /nfs/prometheus/data/ 192.168.84.75/24(rw,no_root_squash,no_all_squash,sync) &gt;&gt; /etc/exports sudo echo /nfs/prometheus/data/ 192.168.84.75/24(rw,no_root_squash,no_all_squash,sync) &gt;&gt; /etc/exports 可以设定的参数主要 \ No newline at end of file +IT.Linux on Zzz记忆https://zfunnily.github.io/categories/IT.Linux/Recent content in IT.Linux on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000Vim | 切换模式/输入法https://zfunnily.github.io/2021/09/vimchange/Tue, 07 Sep 2021 10:46:58 +0800https://zfunnily.github.io/2021/09/vimchange/vim 在退出输入模式的时候切换为原来的输入法 在敲代码的时候使用我们使用的英文,当遇到问题,我们需要搜索引擎的时候需要中文输入法,这个时候,自动切换输入法可以帮助我们节省手动切换输入法的时间。 跟编辑器结合,Linux | Screenhttps://zfunnily.github.io/2021/09/screen/Tue, 07 Sep 2021 10:02:16 +0800https://zfunnily.github.io/2021/09/screen/screen命令 screen 是一个非常有用的命令。应用场景: 单个 SSH 会话中使用多个 shell 窗口(会话)的能力 服务器开发,一个单独运行进程的窗口。可以避免单独再开一个窗口。 &hellip; screen使用 创建一个窗口 $ screen -S name 执行自己需Centos7.2 | gcc4.8升级为4.9https://zfunnily.github.io/2021/09/upgradegcc/Wed, 01 Sep 2021 18:13:41 +0800https://zfunnily.github.io/2021/09/upgradegcc/环境 CentOS 7.2.1511 Docker 我是用 docker 拉取镜像 CentOS 7.2.1511, 利用容器来作为我的开发环境。有条件的也可以用虚拟机或者实体机器。原理都一样。 $ docker $ yum update &amp;&amp; yum install gcc gcc-c++ make zlib-devel.x86_6 下载依赖包 升级 gcc, 下载安装包下载依赖。 $ wget http://ftp.gnu.org/gnu/gcc/gcc-4.9.3/gcc-4.9.3.tar.bz2 $ tar xfv gcc-4.9.3.tar.bz2 &amp;&amp; cd gcc-4.9.3 $ ./contrib/download_prerequisites 如果Shell | Except 使用https://zfunnily.github.io/2021/08/except/Mon, 30 Aug 2021 17:13:33 +0800https://zfunnily.github.io/2021/08/except/Except 参数 spawn 交互程序开始后面跟命令或者指定程序 expect 获取匹配信息匹配成功则执行expect后面的程序动作 send exp_send 用于发送指定的字符串信息 exp_continue 在expect中多次匹配就需要用到 send_user 用来打印输出 相当于shell中的echUbuntu16.04.6 | 安装Cinnamon3.0https://zfunnily.github.io/2020/12/cinnamon3.0/Tue, 01 Dec 2020 15:43:58 +0000https://zfunnily.github.io/2020/12/cinnamon3.0/概述 Cinnamon[1]是Linux Mint[2]的默认桌面环境。不同于 Ubuntu 的 Unity 桌面环境,Cinnamon 是一个更加传统而优雅的桌面环境,其带有底部面板和应用菜单。由于 Cinnamon 桌面以及它类 Windows 的用户界面,许多Ubuntu | version `GLIBC_2.27‘ not found错误https://zfunnily.github.io/2020/11/glibcnotfound/Sat, 28 Nov 2020 15:03:04 +0000https://zfunnily.github.io/2020/11/glibcnotfound/version `GLIBC_2.27’ not found错误 执行strings /lib/x86_64-linux-gnu/libc.so.6 | grep GLIBC_ 结果显示如下: GLIBC_2.2.5 GLIBC_2.2.6 GLIBC_2.3 GLIBC_2.3.2 GLIBC_2.3.3 GLIBC_2.3.4 GLIBC_2.4 GLIBC_2.5 GLIBC_2.6 GLIBC_2.7 GLIBC_2.8 GLIBC_2.9 GLIBC_2.10 GLIBC_2.11 GLIBC_2.12 GLIBC_2.13 GLIBC_2.14 GLIBC_2.15 GLIBC_2.16 GLIBC_2.17 GLIBC_2.18 GLIBC_2.22 GLIBC_2.23 GLIBC_2.24 GLIBC_PRIVATE 去清华开源站点下载glibc: https://mirrors.tuna.tsinghua.edu.cn/gnu/libc/ 下载好文件后解压 $ tar -zxvf glibc-2.27.tar.gz 进入 glibc-2.27 目录,Vim | vimplus快捷键https://zfunnily.github.io/2020/10/vimplus%E5%BF%AB%E6%8D%B7%E9%94%AE/Wed, 28 Oct 2020 09:14:28 +0000https://zfunnily.github.io/2020/10/vimplus%E5%BF%AB%E6%8D%B7%E9%94%AE/插件相关 |快捷键|说明 |&mdash;&mdash; |,|Leader Key |&lt;leader&gt;n|打开 / 关闭代码资源管理器 |&lt;leader&gt;t|打开 / 关闭函数列表 |&lt;leader&gt;a|.h .cpp 文件切换 |&lt;leader&gt;u|转到函数声明 |&Vim | 打造编C++IDEhttps://zfunnily.github.io/2020/10/%E4%BD%BF%E7%94%A8vim%E6%89%93%E9%80%A0%E7%BC%96C-IDE/Wed, 28 Oct 2020 09:11:32 +0000https://zfunnily.github.io/2020/10/%E4%BD%BF%E7%94%A8vim%E6%89%93%E9%80%A0%E7%BC%96C-IDE/使用 vimplus 打造C++ IDE GitHub: https://github.com/chxuan/vimplus 支持平台: macos/linux 安装vimplus // 原来的链接, 国内速度较慢 $ git clone https://github.com/chxuan/vimplus.git ~/.vimplus // github修改为镜像的链接 $ git clone --depth=1 https://github.com.cnpmjs.org/chxuan/vimplus.git ~/.vimplus $ cd ~/.vimplus //不加sudo $ ./install.sh 设置Nerd Font 为防止vimpluLinux | 删除大量文件指令--rsynchttps://zfunnily.github.io/2020/10/linux%E7%B3%BB%E7%BB%9F%E5%88%A0%E9%99%A4%E5%A4%A7%E9%87%8F%E6%96%87%E4%BB%B6%E6%8C%87%E4%BB%A4--rsync/Tue, 13 Oct 2020 16:29:34 +0000https://zfunnily.github.io/2020/10/linux%E7%B3%BB%E7%BB%9F%E5%88%A0%E9%99%A4%E5%A4%A7%E9%87%8F%E6%96%87%E4%BB%B6%E6%8C%87%E4%BB%A4--rsync/rsync的安装 rsync安装,有些系统默认安装有该命令 ubuntu系统 sudo apt-get install rsync centos系统 sudo yum install rsync rsync参数详解 rsync提供了一些跟删除有关的参数 rsync --help | grep delete -del an alias for --delete-during --delete delete extraneous files from destination dirs --delete-before receiver deletes beforeLinux | nsf服务的搭建和使用https://zfunnily.github.io/2020/08/nsf/Fri, 14 Aug 2020 17:17:54 +0000https://zfunnily.github.io/2020/08/nsf/搭建nsf服务 sudo apt install nfs-kernel-server 默认情况下,在Ubuntu 18.04上,NFS版本2是禁用的。版本3和版本4已启用。您可以通过运行以下cat命令来验证: sudo cat /proc/fs/nfsd/versions 写入 exports cat /etc/exports sudo echo /nfs/prometheus/data/ 192.168.84.75/24(rw,no_root_squash,no_all_squash,sync) &gt;&gt; /etc/exports sudo echo /nfs/prometheus/data/ 192.168.84.75/24(rw,no_root_squash,no_all_squash,sync) &gt;&gt; /etc/exports 可以设定的参数主要 \ No newline at end of file diff --git a/categories/IT/index.xml b/categories/IT/index.xml index c85bb61b7..d0476837b 100644 --- a/categories/IT/index.xml +++ b/categories/IT/index.xml @@ -1 +1 @@ -IT on Zzz记忆https://zfunnily.github.io/categories/IT/Recent content in IT on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000百度网盘不限速 | Aria2篇https://zfunnily.github.io/2022/05/baidu/Tue, 17 May 2022 16:40:59 +0800https://zfunnily.github.io/2022/05/baidu/环境 win10 chrome 油猴插件 aria2 Aria2 对于不想折腾的有懒人包. 实际上包里含有的是aria2软件和aria2 GUI。 下载链接如下: 懒人下载包 AriaNg Aria2 百度网盘简易下载助手 安装油猴脚本: 百度网盘简易下载助手 安装好上述脚本之后,可百度网盘不限速 | Aria2篇https://zfunnily.github.io/2022/05/baidu/Tue, 17 May 2022 16:40:59 +0800https://zfunnily.github.io/2022/05/baidu/环境 win10 chrome 油猴插件 aria2 Aria2 对于不想折腾的有懒人包. 实际上包里含有的是aria2软件和aria2 GUI。 下载链接如下: 懒人下载包 AriaNg Aria2 百度网盘简易下载助手 安装油猴脚本: 百度网盘简易下载助手 安装好上述脚本之后,可Vim | 切换模式/输入法https://zfunnily.github.io/2021/09/vimchange/Tue, 07 Sep 2021 10:46:58 +0800https://zfunnily.github.io/2021/09/vimchange/vim 在退出输入模式的时候切换为原来的输入法 在敲代码的时候使用我们使用的英文,当遇到问题,我们需要搜索引擎的时候需要中文输入法,这个时候,自动切换输入法可以帮助我们节省手动切换输入法的时间。 跟编辑器结合,Linux | Screenhttps://zfunnily.github.io/2021/09/screen/Tue, 07 Sep 2021 10:02:16 +0800https://zfunnily.github.io/2021/09/screen/screen命令 screen 是一个非常有用的命令。应用场景: 单个 SSH 会话中使用多个 shell 窗口(会话)的能力 服务器开发,一个单独运行进程的窗口。可以避免单独再开一个窗口。 &hellip; screen使用 创建一个窗口 $ screen -S name 执行自己需Centos7.2 | gcc4.8升级为4.9https://zfunnily.github.io/2021/09/upgradegcc/Wed, 01 Sep 2021 18:13:41 +0800https://zfunnily.github.io/2021/09/upgradegcc/环境 CentOS 7.2.1511 Docker 我是用 docker 拉取镜像 CentOS 7.2.1511, 利用容器来作为我的开发环境。有条件的也可以用虚拟机或者实体机器。原理都一样。 $ docker $ yum update &amp;&amp; yum install gcc gcc-c++ make zlib-devel.x86_6 下载依赖包 升级 gcc, 下载安装包下载依赖。 $ wget http://ftp.gnu.org/gnu/gcc/gcc-4.9.3/gcc-4.9.3.tar.bz2 $ tar xfv gcc-4.9.3.tar.bz2 &amp;&amp; cd gcc-4.9.3 $ ./contrib/download_prerequisites 如果Shell | Except 使用https://zfunnily.github.io/2021/08/except/Mon, 30 Aug 2021 17:13:33 +0800https://zfunnily.github.io/2021/08/except/Except 参数 spawn 交互程序开始后面跟命令或者指定程序 expect 获取匹配信息匹配成功则执行expect后面的程序动作 send exp_send 用于发送指定的字符串信息 exp_continue 在expect中多次匹配就需要用到 send_user 用来打印输出 相当于shell中的echUbuntu16.04.6 | 安装Cinnamon3.0https://zfunnily.github.io/2020/12/cinnamon3.0/Tue, 01 Dec 2020 15:43:58 +0000https://zfunnily.github.io/2020/12/cinnamon3.0/概述 Cinnamon[1]是Linux Mint[2]的默认桌面环境。不同于 Ubuntu 的 Unity 桌面环境,Cinnamon 是一个更加传统而优雅的桌面环境,其带有底部面板和应用菜单。由于 Cinnamon 桌面以及它类 Windows 的用户界面,许多Ubuntu | version `GLIBC_2.27‘ not found错误https://zfunnily.github.io/2020/11/glibcnotfound/Sat, 28 Nov 2020 15:03:04 +0000https://zfunnily.github.io/2020/11/glibcnotfound/version `GLIBC_2.27’ not found错误 执行strings /lib/x86_64-linux-gnu/libc.so.6 | grep GLIBC_ 结果显示如下: GLIBC_2.2.5 GLIBC_2.2.6 GLIBC_2.3 GLIBC_2.3.2 GLIBC_2.3.3 GLIBC_2.3.4 GLIBC_2.4 GLIBC_2.5 GLIBC_2.6 GLIBC_2.7 GLIBC_2.8 GLIBC_2.9 GLIBC_2.10 GLIBC_2.11 GLIBC_2.12 GLIBC_2.13 GLIBC_2.14 GLIBC_2.15 GLIBC_2.16 GLIBC_2.17 GLIBC_2.18 GLIBC_2.22 GLIBC_2.23 GLIBC_2.24 GLIBC_PRIVATE 去清华开源站点下载glibc: https://mirrors.tuna.tsinghua.edu.cn/gnu/libc/ 下载好文件后解压 $ tar -zxvf glibc-2.27.tar.gz 进入 glibc-2.27 目录,Vim | vimplus快捷键https://zfunnily.github.io/2020/10/vimplus%E5%BF%AB%E6%8D%B7%E9%94%AE/Wed, 28 Oct 2020 09:14:28 +0000https://zfunnily.github.io/2020/10/vimplus%E5%BF%AB%E6%8D%B7%E9%94%AE/插件相关 |快捷键|说明 |&mdash;&mdash; |,|Leader Key |&lt;leader&gt;n|打开 / 关闭代码资源管理器 |&lt;leader&gt;t|打开 / 关闭函数列表 |&lt;leader&gt;a|.h .cpp 文件切换 |&lt;leader&gt;u|转到函数声明 |&Vim | 打造编C++IDEhttps://zfunnily.github.io/2020/10/%E4%BD%BF%E7%94%A8vim%E6%89%93%E9%80%A0%E7%BC%96C-IDE/Wed, 28 Oct 2020 09:11:32 +0000https://zfunnily.github.io/2020/10/%E4%BD%BF%E7%94%A8vim%E6%89%93%E9%80%A0%E7%BC%96C-IDE/使用 vimplus 打造C++ IDE GitHub: https://github.com/chxuan/vimplus 支持平台: macos/linux 安装vimplus // 原来的链接, 国内速度较慢 $ git clone https://github.com/chxuan/vimplus.git ~/.vimplus // github修改为镜像的链接 $ git clone --depth=1 https://github.com.cnpmjs.org/chxuan/vimplus.git ~/.vimplus $ cd ~/.vimplus //不加sudo $ ./install.sh 设置Nerd Font 为防止vimpluLinux | 删除大量文件指令--rsynchttps://zfunnily.github.io/2020/10/linux%E7%B3%BB%E7%BB%9F%E5%88%A0%E9%99%A4%E5%A4%A7%E9%87%8F%E6%96%87%E4%BB%B6%E6%8C%87%E4%BB%A4--rsync/Tue, 13 Oct 2020 16:29:34 +0000https://zfunnily.github.io/2020/10/linux%E7%B3%BB%E7%BB%9F%E5%88%A0%E9%99%A4%E5%A4%A7%E9%87%8F%E6%96%87%E4%BB%B6%E6%8C%87%E4%BB%A4--rsync/rsync的安装 rsync安装,有些系统默认安装有该命令 ubuntu系统 sudo apt-get install rsync centos系统 sudo yum install rsync rsync参数详解 rsync提供了一些跟删除有关的参数 rsync --help | grep delete -del an alias for --delete-during --delete delete extraneous files from destination dirs --delete-before receiver deletes beforeLinux | nsf服务的搭建和使用https://zfunnily.github.io/2020/08/nsf/Fri, 14 Aug 2020 17:17:54 +0000https://zfunnily.github.io/2020/08/nsf/搭建nsf服务 sudo apt install nfs-kernel-server 默认情况下,在Ubuntu 18.04上,NFS版本2是禁用的。版本3和版本4已启用。您可以通过运行以下cat命令来验证: sudo cat /proc/fs/nfsd/versions 写入 exports cat /etc/exports sudo echo /nfs/prometheus/data/ 192.168.84.75/24(rw,no_root_squash,no_all_squash,sync) &gt;&gt; /etc/exports sudo echo /nfs/prometheus/data/ 192.168.84.75/24(rw,no_root_squash,no_all_squash,sync) &gt;&gt; /etc/exports 可以设定的参数主要 \ No newline at end of file +IT on Zzz记忆https://zfunnily.github.io/categories/IT/Recent content in IT on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000百度网盘不限速 | Aria2篇https://zfunnily.github.io/2022/05/baidu/Tue, 17 May 2022 16:40:59 +0800https://zfunnily.github.io/2022/05/baidu/环境 win10 chrome 油猴插件 aria2 Aria2 对于不想折腾的有懒人包. 实际上包里含有的是aria2软件和aria2 GUI。 下载链接如下: 懒人下载包 AriaNg Aria2 百度网盘简易下载助手 安装油猴脚本: 百度网盘简易下载助手 安装好上述脚本之后,可百度网盘不限速 | Aria2篇https://zfunnily.github.io/2022/05/baidu/Tue, 17 May 2022 16:40:59 +0800https://zfunnily.github.io/2022/05/baidu/环境 win10 chrome 油猴插件 aria2 Aria2 对于不想折腾的有懒人包. 实际上包里含有的是aria2软件和aria2 GUI。 下载链接如下: 懒人下载包 AriaNg Aria2 百度网盘简易下载助手 安装油猴脚本: 百度网盘简易下载助手 安装好上述脚本之后,可Vim | 切换模式/输入法https://zfunnily.github.io/2021/09/vimchange/Tue, 07 Sep 2021 10:46:58 +0800https://zfunnily.github.io/2021/09/vimchange/vim 在退出输入模式的时候切换为原来的输入法 在敲代码的时候使用我们使用的英文,当遇到问题,我们需要搜索引擎的时候需要中文输入法,这个时候,自动切换输入法可以帮助我们节省手动切换输入法的时间。 跟编辑器结合,Linux | Screenhttps://zfunnily.github.io/2021/09/screen/Tue, 07 Sep 2021 10:02:16 +0800https://zfunnily.github.io/2021/09/screen/screen命令 screen 是一个非常有用的命令。应用场景: 单个 SSH 会话中使用多个 shell 窗口(会话)的能力 服务器开发,一个单独运行进程的窗口。可以避免单独再开一个窗口。 &hellip; screen使用 创建一个窗口 $ screen -S name 执行自己需Centos7.2 | gcc4.8升级为4.9https://zfunnily.github.io/2021/09/upgradegcc/Wed, 01 Sep 2021 18:13:41 +0800https://zfunnily.github.io/2021/09/upgradegcc/环境 CentOS 7.2.1511 Docker 我是用 docker 拉取镜像 CentOS 7.2.1511, 利用容器来作为我的开发环境。有条件的也可以用虚拟机或者实体机器。原理都一样。 $ docker $ yum update &amp;&amp; yum install gcc gcc-c++ make zlib-devel.x86_6 下载依赖包 升级 gcc, 下载安装包下载依赖。 $ wget http://ftp.gnu.org/gnu/gcc/gcc-4.9.3/gcc-4.9.3.tar.bz2 $ tar xfv gcc-4.9.3.tar.bz2 &amp;&amp; cd gcc-4.9.3 $ ./contrib/download_prerequisites 如果Shell | Except 使用https://zfunnily.github.io/2021/08/except/Mon, 30 Aug 2021 17:13:33 +0800https://zfunnily.github.io/2021/08/except/Except 参数 spawn 交互程序开始后面跟命令或者指定程序 expect 获取匹配信息匹配成功则执行expect后面的程序动作 send exp_send 用于发送指定的字符串信息 exp_continue 在expect中多次匹配就需要用到 send_user 用来打印输出 相当于shell中的echUbuntu16.04.6 | 安装Cinnamon3.0https://zfunnily.github.io/2020/12/cinnamon3.0/Tue, 01 Dec 2020 15:43:58 +0000https://zfunnily.github.io/2020/12/cinnamon3.0/概述 Cinnamon[1]是Linux Mint[2]的默认桌面环境。不同于 Ubuntu 的 Unity 桌面环境,Cinnamon 是一个更加传统而优雅的桌面环境,其带有底部面板和应用菜单。由于 Cinnamon 桌面以及它类 Windows 的用户界面,许多Ubuntu | version `GLIBC_2.27‘ not found错误https://zfunnily.github.io/2020/11/glibcnotfound/Sat, 28 Nov 2020 15:03:04 +0000https://zfunnily.github.io/2020/11/glibcnotfound/version `GLIBC_2.27’ not found错误 执行strings /lib/x86_64-linux-gnu/libc.so.6 | grep GLIBC_ 结果显示如下: GLIBC_2.2.5 GLIBC_2.2.6 GLIBC_2.3 GLIBC_2.3.2 GLIBC_2.3.3 GLIBC_2.3.4 GLIBC_2.4 GLIBC_2.5 GLIBC_2.6 GLIBC_2.7 GLIBC_2.8 GLIBC_2.9 GLIBC_2.10 GLIBC_2.11 GLIBC_2.12 GLIBC_2.13 GLIBC_2.14 GLIBC_2.15 GLIBC_2.16 GLIBC_2.17 GLIBC_2.18 GLIBC_2.22 GLIBC_2.23 GLIBC_2.24 GLIBC_PRIVATE 去清华开源站点下载glibc: https://mirrors.tuna.tsinghua.edu.cn/gnu/libc/ 下载好文件后解压 $ tar -zxvf glibc-2.27.tar.gz 进入 glibc-2.27 目录,Vim | vimplus快捷键https://zfunnily.github.io/2020/10/vimplus%E5%BF%AB%E6%8D%B7%E9%94%AE/Wed, 28 Oct 2020 09:14:28 +0000https://zfunnily.github.io/2020/10/vimplus%E5%BF%AB%E6%8D%B7%E9%94%AE/插件相关 |快捷键|说明 |&mdash;&mdash; |,|Leader Key |&lt;leader&gt;n|打开 / 关闭代码资源管理器 |&lt;leader&gt;t|打开 / 关闭函数列表 |&lt;leader&gt;a|.h .cpp 文件切换 |&lt;leader&gt;u|转到函数声明 |&Vim | 打造编C++IDEhttps://zfunnily.github.io/2020/10/%E4%BD%BF%E7%94%A8vim%E6%89%93%E9%80%A0%E7%BC%96C-IDE/Wed, 28 Oct 2020 09:11:32 +0000https://zfunnily.github.io/2020/10/%E4%BD%BF%E7%94%A8vim%E6%89%93%E9%80%A0%E7%BC%96C-IDE/使用 vimplus 打造C++ IDE GitHub: https://github.com/chxuan/vimplus 支持平台: macos/linux 安装vimplus // 原来的链接, 国内速度较慢 $ git clone https://github.com/chxuan/vimplus.git ~/.vimplus // github修改为镜像的链接 $ git clone --depth=1 https://github.com.cnpmjs.org/chxuan/vimplus.git ~/.vimplus $ cd ~/.vimplus //不加sudo $ ./install.sh 设置Nerd Font 为防止vimpluLinux | 删除大量文件指令--rsynchttps://zfunnily.github.io/2020/10/linux%E7%B3%BB%E7%BB%9F%E5%88%A0%E9%99%A4%E5%A4%A7%E9%87%8F%E6%96%87%E4%BB%B6%E6%8C%87%E4%BB%A4--rsync/Tue, 13 Oct 2020 16:29:34 +0000https://zfunnily.github.io/2020/10/linux%E7%B3%BB%E7%BB%9F%E5%88%A0%E9%99%A4%E5%A4%A7%E9%87%8F%E6%96%87%E4%BB%B6%E6%8C%87%E4%BB%A4--rsync/rsync的安装 rsync安装,有些系统默认安装有该命令 ubuntu系统 sudo apt-get install rsync centos系统 sudo yum install rsync rsync参数详解 rsync提供了一些跟删除有关的参数 rsync --help | grep delete -del an alias for --delete-during --delete delete extraneous files from destination dirs --delete-before receiver deletes beforeLinux | nsf服务的搭建和使用https://zfunnily.github.io/2020/08/nsf/Fri, 14 Aug 2020 17:17:54 +0000https://zfunnily.github.io/2020/08/nsf/搭建nsf服务 sudo apt install nfs-kernel-server 默认情况下,在Ubuntu 18.04上,NFS版本2是禁用的。版本3和版本4已启用。您可以通过运行以下cat命令来验证: sudo cat /proc/fs/nfsd/versions 写入 exports cat /etc/exports sudo echo /nfs/prometheus/data/ 192.168.84.75/24(rw,no_root_squash,no_all_squash,sync) &gt;&gt; /etc/exports sudo echo /nfs/prometheus/data/ 192.168.84.75/24(rw,no_root_squash,no_all_squash,sync) &gt;&gt; /etc/exports 可以设定的参数主要 \ No newline at end of file diff --git a/categories/NAS/index.xml b/categories/NAS/index.xml index c8f99aa56..a55359d2b 100644 --- a/categories/NAS/index.xml +++ b/categories/NAS/index.xml @@ -1 +1 @@ -NAS on Zzz记忆https://zfunnily.github.io/categories/NAS/Recent content in NAS on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000DDNS配置https://zfunnily.github.io/2023/10/DDNS/Mon, 30 Oct 2023 11:21:34 +0800https://zfunnily.github.io/2023/10/DDNS/参考: https://www.sakamoto.blog/synology-nas-cloudflare-ddns/ Cloudflare 获取 区域 ID 创建 API 令牌 群晖设置 开启并登陆群晖NAS终端 下载 Cloudflare DDNS 脚本 下载 Cloudflare 的 DDNS 脚本文件,官方推荐存放于/sbin/cloudflareddns.sh并赋予执行权限. # 下载脚本 $ wget https://raw.githubusercontent.com/joshuaavalon/SynologyCloudflareDDNS/master/cloudflareddns.sh -O /sbin/cloudflareddns.sh # 赋予执行 \ No newline at end of file +NAS on Zzz记忆https://zfunnily.github.io/categories/NAS/Recent content in NAS on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000DDNS配置https://zfunnily.github.io/2023/10/DDNS/Mon, 30 Oct 2023 11:21:34 +0800https://zfunnily.github.io/2023/10/DDNS/参考: https://www.sakamoto.blog/synology-nas-cloudflare-ddns/ Cloudflare 获取 区域 ID 创建 API 令牌 群晖设置 开启并登陆群晖NAS终端 下载 Cloudflare DDNS 脚本 下载 Cloudflare 的 DDNS 脚本文件,官方推荐存放于/sbin/cloudflareddns.sh并赋予执行权限. # 下载脚本 $ wget https://raw.githubusercontent.com/joshuaavalon/SynologyCloudflareDDNS/master/cloudflareddns.sh -O /sbin/cloudflareddns.sh # 赋予执行 \ No newline at end of file diff --git "a/categories/SVN\345\220\210\345\271\266/index.xml" "b/categories/SVN\345\220\210\345\271\266/index.xml" index 8af4787b4..ca3fe699d 100644 --- "a/categories/SVN\345\220\210\345\271\266/index.xml" +++ "b/categories/SVN\345\220\210\345\271\266/index.xml" @@ -1 +1 @@ -SVN合并 on Zzz记忆https://zfunnily.github.io/categories/SVN%E5%90%88%E5%B9%B6/Recent content in SVN合并 on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000Svnhttps://zfunnily.github.io/2023/11/svn/Tue, 14 Nov 2023 16:46:02 +0800https://zfunnily.github.io/2023/11/svn/SVN 合并 从源svn分支合并到目标svn分支 在源svn项目下鼠标右键,TortoiseSVN -&gt; Repo-browser, 拿到源项目svn地址 在目标svn项目下鼠标右键,TortoiseSVN -&gt; Merge -&gt;, 填入源项目svn地址 在show l \ No newline at end of file +SVN合并 on Zzz记忆https://zfunnily.github.io/categories/SVN%E5%90%88%E5%B9%B6/Recent content in SVN合并 on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000Svnhttps://zfunnily.github.io/2023/11/svn/Tue, 14 Nov 2023 16:46:02 +0800https://zfunnily.github.io/2023/11/svn/SVN 合并 从源svn分支合并到目标svn分支 在源svn项目下鼠标右键,TortoiseSVN -&gt; Repo-browser, 拿到源项目svn地址 在目标svn项目下鼠标右键,TortoiseSVN -&gt; Merge -&gt;, 填入源项目svn地址 在show l \ No newline at end of file diff --git a/categories/index.xml b/categories/index.xml index a20a7aa76..8bbe3fb50 100644 --- a/categories/index.xml +++ b/categories/index.xml @@ -1 +1 @@ -Categories on Zzz记忆https://zfunnily.github.io/categories/Recent content in Categories on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000总结,总结.月https://zfunnily.github.io/categories/%E6%80%BB%E7%BB%93%E6%80%BB%E7%BB%93.%E6%9C%88/Tue, 27 Feb 2024 15:45:00 +0800https://zfunnily.github.io/categories/%E6%80%BB%E7%BB%93%E6%80%BB%E7%BB%93.%E6%9C%88/自动部署https://zfunnily.github.io/categories/%E8%87%AA%E5%8A%A8%E9%83%A8%E7%BD%B2/Fri, 17 Nov 2023 15:45:00 +0800https://zfunnily.github.io/categories/%E8%87%AA%E5%8A%A8%E9%83%A8%E7%BD%B2/编程.编译https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E7%BC%96%E8%AF%91/Thu, 16 Nov 2023 15:39:01 +0800https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E7%BC%96%E8%AF%91/SVN合并https://zfunnily.github.io/categories/SVN%E5%90%88%E5%B9%B6/Tue, 14 Nov 2023 16:46:02 +0800https://zfunnily.github.io/categories/SVN%E5%90%88%E5%B9%B6/AIhttps://zfunnily.github.io/categories/AI/Fri, 10 Nov 2023 11:21:34 +0800https://zfunnily.github.io/categories/AI/NAShttps://zfunnily.github.io/categories/NAS/Mon, 30 Oct 2023 11:21:34 +0800https://zfunnily.github.io/categories/NAS/编程.Unity粒子系统https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.Unity%E7%B2%92%E5%AD%90%E7%B3%BB%E7%BB%9F/Wed, 24 May 2023 11:21:34 +0800https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.Unity%E7%B2%92%E5%AD%90%E7%B3%BB%E7%BB%9F/游戏https://zfunnily.github.io/categories/%E6%B8%B8%E6%88%8F/Thu, 27 Oct 2022 10:09:44 +0800https://zfunnily.github.io/categories/%E6%B8%B8%E6%88%8F/IThttps://zfunnily.github.io/categories/IT/Tue, 17 May 2022 16:40:59 +0800https://zfunnily.github.io/categories/IT/编程https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B/Tue, 17 May 2022 11:30:48 +0800https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B/编程.UnityShaderhttps://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.UnityShader/Tue, 17 May 2022 11:30:48 +0800https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.UnityShader/编程.图形学入门https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E5%9B%BE%E5%BD%A2%E5%AD%A6%E5%85%A5%E9%97%A8/Mon, 04 Apr 2022 21:48:09 +0800https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E5%9B%BE%E5%BD%A2%E5%AD%A6%E5%85%A5%E9%97%A8/编程.游戏开发https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E6%B8%B8%E6%88%8F%E5%BC%80%E5%8F%91/Wed, 30 Mar 2022 10:50:11 +0800https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E6%B8%B8%E6%88%8F%E5%BC%80%E5%8F%91/随笔https://zfunnily.github.io/categories/%E9%9A%8F%E7%AC%94/Wed, 09 Mar 2022 12:03:36 +0800https://zfunnily.github.io/categories/%E9%9A%8F%E7%AC%94/随笔.摘抄https://zfunnily.github.io/categories/%E9%9A%8F%E7%AC%94.%E6%91%98%E6%8A%84/Wed, 09 Mar 2022 12:03:36 +0800https://zfunnily.github.io/categories/%E9%9A%8F%E7%AC%94.%E6%91%98%E6%8A%84/博客记事https://zfunnily.github.io/categories/%E5%8D%9A%E5%AE%A2%E8%AE%B0%E4%BA%8B/Thu, 03 Mar 2022 12:04:58 +0800https://zfunnily.github.io/categories/%E5%8D%9A%E5%AE%A2%E8%AE%B0%E4%BA%8B/编程.Golanghttps://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.Golang/Wed, 02 Mar 2022 14:51:22 +0800https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.Golang/转载https://zfunnily.github.io/categories/%E8%BD%AC%E8%BD%BD/Thu, 06 Jan 2022 11:32:56 +0800https://zfunnily.github.io/categories/%E8%BD%AC%E8%BD%BD/编程.Luahttps://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.Lua/Thu, 23 Dec 2021 16:37:44 +0800https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.Lua/编程.音视频https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E9%9F%B3%E8%A7%86%E9%A2%91/Mon, 15 Nov 2021 11:23:24 +0800https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E9%9F%B3%E8%A7%86%E9%A2%91/编程.P2Phttps://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.P2P/Sun, 07 Nov 2021 15:49:46 +0800https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.P2P/编程.Unity3Dhttps://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.Unity3D/Tue, 07 Sep 2021 15:55:59 +0800https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.Unity3D/IT.Linuxhttps://zfunnily.github.io/categories/IT.Linux/Tue, 07 Sep 2021 10:46:58 +0800https://zfunnily.github.io/categories/IT.Linux/编程.Chttps://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.C/Tue, 23 Mar 2021 10:13:31 +0000https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.C/编程.汇编https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E6%B1%87%E7%BC%96/Mon, 01 Feb 2021 14:40:51 +0000https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E6%B1%87%E7%BC%96/编程.网络编程https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E7%BD%91%E7%BB%9C%E7%BC%96%E7%A8%8B/Wed, 30 Dec 2020 09:19:41 +0000https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E7%BD%91%E7%BB%9C%E7%BC%96%E7%A8%8B/科普https://zfunnily.github.io/categories/%E7%A7%91%E6%99%AE/Mon, 12 Oct 2020 16:29:34 +0000https://zfunnily.github.io/categories/%E7%A7%91%E6%99%AE/游戏,游戏.bosshttps://zfunnily.github.io/categories/%E6%B8%B8%E6%88%8F%E6%B8%B8%E6%88%8F.boss/Mon, 01 Jan 0001 00:00:00 +0000https://zfunnily.github.io/categories/%E6%B8%B8%E6%88%8F%E6%B8%B8%E6%88%8F.boss/游戏设计https://zfunnily.github.io/categories/%E6%B8%B8%E6%88%8F%E8%AE%BE%E8%AE%A1/Mon, 01 Jan 0001 00:00:00 +0000https://zfunnily.github.io/categories/%E6%B8%B8%E6%88%8F%E8%AE%BE%E8%AE%A1/游戏设计.地图设计https://zfunnily.github.io/categories/%E6%B8%B8%E6%88%8F%E8%AE%BE%E8%AE%A1.%E5%9C%B0%E5%9B%BE%E8%AE%BE%E8%AE%A1/Mon, 01 Jan 0001 00:00:00 +0000https://zfunnily.github.io/categories/%E6%B8%B8%E6%88%8F%E8%AE%BE%E8%AE%A1.%E5%9C%B0%E5%9B%BE%E8%AE%BE%E8%AE%A1/游戏设计.类银河恶魔城https://zfunnily.github.io/categories/%E6%B8%B8%E6%88%8F%E8%AE%BE%E8%AE%A1.%E7%B1%BB%E9%93%B6%E6%B2%B3%E6%81%B6%E9%AD%94%E5%9F%8E/Mon, 01 Jan 0001 00:00:00 +0000https://zfunnily.github.io/categories/%E6%B8%B8%E6%88%8F%E8%AE%BE%E8%AE%A1.%E7%B1%BB%E9%93%B6%E6%B2%B3%E6%81%B6%E9%AD%94%E5%9F%8E/ \ No newline at end of file +Categories on Zzz记忆https://zfunnily.github.io/categories/Recent content in Categories on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000总结,总结.月https://zfunnily.github.io/categories/%E6%80%BB%E7%BB%93%E6%80%BB%E7%BB%93.%E6%9C%88/Tue, 27 Feb 2024 15:45:00 +0800https://zfunnily.github.io/categories/%E6%80%BB%E7%BB%93%E6%80%BB%E7%BB%93.%E6%9C%88/自动部署https://zfunnily.github.io/categories/%E8%87%AA%E5%8A%A8%E9%83%A8%E7%BD%B2/Fri, 17 Nov 2023 15:45:00 +0800https://zfunnily.github.io/categories/%E8%87%AA%E5%8A%A8%E9%83%A8%E7%BD%B2/编程.编译https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E7%BC%96%E8%AF%91/Thu, 16 Nov 2023 15:39:01 +0800https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E7%BC%96%E8%AF%91/SVN合并https://zfunnily.github.io/categories/SVN%E5%90%88%E5%B9%B6/Tue, 14 Nov 2023 16:46:02 +0800https://zfunnily.github.io/categories/SVN%E5%90%88%E5%B9%B6/AIhttps://zfunnily.github.io/categories/AI/Fri, 10 Nov 2023 11:21:34 +0800https://zfunnily.github.io/categories/AI/NAShttps://zfunnily.github.io/categories/NAS/Mon, 30 Oct 2023 11:21:34 +0800https://zfunnily.github.io/categories/NAS/编程.Unity粒子系统https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.Unity%E7%B2%92%E5%AD%90%E7%B3%BB%E7%BB%9F/Wed, 24 May 2023 11:21:34 +0800https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.Unity%E7%B2%92%E5%AD%90%E7%B3%BB%E7%BB%9F/游戏https://zfunnily.github.io/categories/%E6%B8%B8%E6%88%8F/Thu, 27 Oct 2022 10:09:44 +0800https://zfunnily.github.io/categories/%E6%B8%B8%E6%88%8F/IThttps://zfunnily.github.io/categories/IT/Tue, 17 May 2022 16:40:59 +0800https://zfunnily.github.io/categories/IT/编程https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B/Tue, 17 May 2022 11:30:48 +0800https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B/编程.UnityShaderhttps://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.UnityShader/Tue, 17 May 2022 11:30:48 +0800https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.UnityShader/编程.图形学入门https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E5%9B%BE%E5%BD%A2%E5%AD%A6%E5%85%A5%E9%97%A8/Mon, 04 Apr 2022 21:48:09 +0800https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E5%9B%BE%E5%BD%A2%E5%AD%A6%E5%85%A5%E9%97%A8/编程.游戏开发https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E6%B8%B8%E6%88%8F%E5%BC%80%E5%8F%91/Wed, 30 Mar 2022 10:50:11 +0800https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E6%B8%B8%E6%88%8F%E5%BC%80%E5%8F%91/随笔https://zfunnily.github.io/categories/%E9%9A%8F%E7%AC%94/Wed, 09 Mar 2022 12:03:36 +0800https://zfunnily.github.io/categories/%E9%9A%8F%E7%AC%94/随笔.摘抄https://zfunnily.github.io/categories/%E9%9A%8F%E7%AC%94.%E6%91%98%E6%8A%84/Wed, 09 Mar 2022 12:03:36 +0800https://zfunnily.github.io/categories/%E9%9A%8F%E7%AC%94.%E6%91%98%E6%8A%84/博客记事https://zfunnily.github.io/categories/%E5%8D%9A%E5%AE%A2%E8%AE%B0%E4%BA%8B/Thu, 03 Mar 2022 12:04:58 +0800https://zfunnily.github.io/categories/%E5%8D%9A%E5%AE%A2%E8%AE%B0%E4%BA%8B/编程.Golanghttps://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.Golang/Wed, 02 Mar 2022 14:51:22 +0800https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.Golang/转载https://zfunnily.github.io/categories/%E8%BD%AC%E8%BD%BD/Thu, 06 Jan 2022 11:32:56 +0800https://zfunnily.github.io/categories/%E8%BD%AC%E8%BD%BD/编程.Luahttps://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.Lua/Thu, 23 Dec 2021 16:37:44 +0800https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.Lua/编程.音视频https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E9%9F%B3%E8%A7%86%E9%A2%91/Mon, 15 Nov 2021 11:23:24 +0800https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E9%9F%B3%E8%A7%86%E9%A2%91/编程.P2Phttps://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.P2P/Sun, 07 Nov 2021 15:49:46 +0800https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.P2P/编程.Unity3Dhttps://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.Unity3D/Tue, 07 Sep 2021 15:55:59 +0800https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.Unity3D/IT.Linuxhttps://zfunnily.github.io/categories/IT.Linux/Tue, 07 Sep 2021 10:46:58 +0800https://zfunnily.github.io/categories/IT.Linux/编程.Chttps://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.C/Tue, 23 Mar 2021 10:13:31 +0000https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.C/编程.汇编https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E6%B1%87%E7%BC%96/Mon, 01 Feb 2021 14:40:51 +0000https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E6%B1%87%E7%BC%96/编程.网络编程https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E7%BD%91%E7%BB%9C%E7%BC%96%E7%A8%8B/Wed, 30 Dec 2020 09:19:41 +0000https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E7%BD%91%E7%BB%9C%E7%BC%96%E7%A8%8B/科普https://zfunnily.github.io/categories/%E7%A7%91%E6%99%AE/Mon, 12 Oct 2020 16:29:34 +0000https://zfunnily.github.io/categories/%E7%A7%91%E6%99%AE/游戏,游戏.bosshttps://zfunnily.github.io/categories/%E6%B8%B8%E6%88%8F%E6%B8%B8%E6%88%8F.boss/Mon, 01 Jan 0001 00:00:00 +0000https://zfunnily.github.io/categories/%E6%B8%B8%E6%88%8F%E6%B8%B8%E6%88%8F.boss/游戏设计https://zfunnily.github.io/categories/%E6%B8%B8%E6%88%8F%E8%AE%BE%E8%AE%A1/Mon, 01 Jan 0001 00:00:00 +0000https://zfunnily.github.io/categories/%E6%B8%B8%E6%88%8F%E8%AE%BE%E8%AE%A1/游戏设计.地图设计https://zfunnily.github.io/categories/%E6%B8%B8%E6%88%8F%E8%AE%BE%E8%AE%A1.%E5%9C%B0%E5%9B%BE%E8%AE%BE%E8%AE%A1/Mon, 01 Jan 0001 00:00:00 +0000https://zfunnily.github.io/categories/%E6%B8%B8%E6%88%8F%E8%AE%BE%E8%AE%A1.%E5%9C%B0%E5%9B%BE%E8%AE%BE%E8%AE%A1/游戏设计.类银河恶魔城https://zfunnily.github.io/categories/%E6%B8%B8%E6%88%8F%E8%AE%BE%E8%AE%A1.%E7%B1%BB%E9%93%B6%E6%B2%B3%E6%81%B6%E9%AD%94%E5%9F%8E/Mon, 01 Jan 0001 00:00:00 +0000https://zfunnily.github.io/categories/%E6%B8%B8%E6%88%8F%E8%AE%BE%E8%AE%A1.%E7%B1%BB%E9%93%B6%E6%B2%B3%E6%81%B6%E9%AD%94%E5%9F%8E/ \ No newline at end of file diff --git "a/categories/\345\215\232\345\256\242\350\256\260\344\272\213/index.xml" "b/categories/\345\215\232\345\256\242\350\256\260\344\272\213/index.xml" index a950b1d12..e55a7d965 100644 --- "a/categories/\345\215\232\345\256\242\350\256\260\344\272\213/index.xml" +++ "b/categories/\345\215\232\345\256\242\350\256\260\344\272\213/index.xml" @@ -1 +1 @@ -博客记事 on Zzz记忆https://zfunnily.github.io/categories/%E5%8D%9A%E5%AE%A2%E8%AE%B0%E4%BA%8B/Recent content in 博客记事 on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000利用云服务器搭建个人博客https://zfunnily.github.io/2022/03/blog/Thu, 03 Mar 2022 12:04:58 +0800https://zfunnily.github.io/2022/03/blog/vps选择 最近关注了一个vps推广网站。价格合适,于是买了一个128元/年的云服务器。既可以用来做代理,又可以搭建个人博客 配置是2G/1M/40G(运存/带宽/硬盘) 使用技术 nginx: 静态博客 v2ray: 代理 https + nginx freenome: 域利用云服务器搭建个人博客https://zfunnily.github.io/2022/03/blog/Thu, 03 Mar 2022 12:04:58 +0800https://zfunnily.github.io/2022/03/blog/vps选择 最近关注了一个vps推广网站。价格合适,于是买了一个128元/年的云服务器。既可以用来做代理,又可以搭建个人博客 配置是2G/1M/40G(运存/带宽/硬盘) 使用技术 nginx: 静态博客 v2ray: 代理 https + nginx freenome: 域Blog | 代码显示/隐藏https://zfunnily.github.io/2021/12/shortcodes/Wed, 29 Dec 2021 13:50:28 +0800https://zfunnily.github.io/2021/12/shortcodes/缘由 最近在写技术博客时,引入的代码太多,影响观感。 在尽力减少代码量,还是有些不可或缺的代码,代码量很惊人,已经占满整个屏幕. 因为个人博客是使用hugo生成的静态博客,我刚开始想的使用原生的js和cssBlog | 音乐播放器https://zfunnily.github.io/2021/12/music/Tue, 21 Dec 2021 16:55:23 +0800https://zfunnily.github.io/2021/12/music/概述 今天给我的个人博客加了个暗模式,这样可以在晚上阅读博客的时候不伤害眼睛。突然想到如果在阅读博客的时候可以听听音乐就更好了。 于是在github上找到了一个开源的项目MetingJS,看最后一次comBlog | 网站暗模式https://zfunnily.github.io/2021/12/dark/Tue, 21 Dec 2021 11:05:00 +0800https://zfunnily.github.io/2021/12/dark/Wordpress 如果你的网站是wordpress,则可以参考以Darkmode.js为基础的插件: blackout-darkmode-widget darkmode Nuxt.js 如果你正在使用Nuxt.js,则可以使用下面的模块 nuxtjs-darkmode-js-module 快速使用 使用Darkmode.js给网站快速部署上暗/浅色Blog | 随机名人名言https://zfunnily.github.io/2021/11/randomquotes/Fri, 05 Nov 2021 15:50:16 +0800https://zfunnily.github.io/2021/11/randomquotes/本文目的 我的个人博客已经搭建好了,使用的hugo+飞雪的主题。我看到有些博客上有些随机的名人名言,但是这个主题没有。遂自己写一个。 根据飞雪的主题自定义 飞雪主题的github: https://github.com/flysnow-org/maupassant-hugo 复制主题里的文件themBlog | 新的开始https://zfunnily.github.io/2021/10/blogmigration/Fri, 22 Oct 2021 19:01:20 +0800https://zfunnily.github.io/2021/10/blogmigration/迁移博客 我是从18年开始写一些东西,先写在看云笔记上,后面东西越来越多。写出来的东西比较零散. 20年下半年入职新公司,开始在csdn上写博客,今年我准备尝试使用个人博客,hugo和gitPage结合部Hugohttps://zfunnily.github.io/2021/04/hugo/Sat, 17 Apr 2021 00:00:00 +0000https://zfunnily.github.io/2021/04/hugo/hugo 我用过的静态博客有hexo、jekyll和hugo,对比起来,hugo虽然没有hexo那样丰富的插件和主题,但是hugo生成文章的速度更快。我是一名go语言爱好者,而hugo是go语言开发的, jek \ No newline at end of file +博客记事 on Zzz记忆https://zfunnily.github.io/categories/%E5%8D%9A%E5%AE%A2%E8%AE%B0%E4%BA%8B/Recent content in 博客记事 on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000利用云服务器搭建个人博客https://zfunnily.github.io/2022/03/blog/Thu, 03 Mar 2022 12:04:58 +0800https://zfunnily.github.io/2022/03/blog/vps选择 最近关注了一个vps推广网站。价格合适,于是买了一个128元/年的云服务器。既可以用来做代理,又可以搭建个人博客 配置是2G/1M/40G(运存/带宽/硬盘) 使用技术 nginx: 静态博客 v2ray: 代理 https + nginx freenome: 域利用云服务器搭建个人博客https://zfunnily.github.io/2022/03/blog/Thu, 03 Mar 2022 12:04:58 +0800https://zfunnily.github.io/2022/03/blog/vps选择 最近关注了一个vps推广网站。价格合适,于是买了一个128元/年的云服务器。既可以用来做代理,又可以搭建个人博客 配置是2G/1M/40G(运存/带宽/硬盘) 使用技术 nginx: 静态博客 v2ray: 代理 https + nginx freenome: 域Blog | 代码显示/隐藏https://zfunnily.github.io/2021/12/shortcodes/Wed, 29 Dec 2021 13:50:28 +0800https://zfunnily.github.io/2021/12/shortcodes/缘由 最近在写技术博客时,引入的代码太多,影响观感。 在尽力减少代码量,还是有些不可或缺的代码,代码量很惊人,已经占满整个屏幕. 因为个人博客是使用hugo生成的静态博客,我刚开始想的使用原生的js和cssBlog | 音乐播放器https://zfunnily.github.io/2021/12/music/Tue, 21 Dec 2021 16:55:23 +0800https://zfunnily.github.io/2021/12/music/概述 今天给我的个人博客加了个暗模式,这样可以在晚上阅读博客的时候不伤害眼睛。突然想到如果在阅读博客的时候可以听听音乐就更好了。 于是在github上找到了一个开源的项目MetingJS,看最后一次comBlog | 网站暗模式https://zfunnily.github.io/2021/12/dark/Tue, 21 Dec 2021 11:05:00 +0800https://zfunnily.github.io/2021/12/dark/Wordpress 如果你的网站是wordpress,则可以参考以Darkmode.js为基础的插件: blackout-darkmode-widget darkmode Nuxt.js 如果你正在使用Nuxt.js,则可以使用下面的模块 nuxtjs-darkmode-js-module 快速使用 使用Darkmode.js给网站快速部署上暗/浅色Blog | 随机名人名言https://zfunnily.github.io/2021/11/randomquotes/Fri, 05 Nov 2021 15:50:16 +0800https://zfunnily.github.io/2021/11/randomquotes/本文目的 我的个人博客已经搭建好了,使用的hugo+飞雪的主题。我看到有些博客上有些随机的名人名言,但是这个主题没有。遂自己写一个。 根据飞雪的主题自定义 飞雪主题的github: https://github.com/flysnow-org/maupassant-hugo 复制主题里的文件themBlog | 新的开始https://zfunnily.github.io/2021/10/blogmigration/Fri, 22 Oct 2021 19:01:20 +0800https://zfunnily.github.io/2021/10/blogmigration/迁移博客 我是从18年开始写一些东西,先写在看云笔记上,后面东西越来越多。写出来的东西比较零散. 20年下半年入职新公司,开始在csdn上写博客,今年我准备尝试使用个人博客,hugo和gitPage结合部Hugohttps://zfunnily.github.io/2021/04/hugo/Sat, 17 Apr 2021 00:00:00 +0000https://zfunnily.github.io/2021/04/hugo/hugo 我用过的静态博客有hexo、jekyll和hugo,对比起来,hugo虽然没有hexo那样丰富的插件和主题,但是hugo生成文章的速度更快。我是一名go语言爱好者,而hugo是go语言开发的, jek \ No newline at end of file diff --git "a/categories/\346\200\273\347\273\223\346\200\273\347\273\223.\346\234\210/index.xml" "b/categories/\346\200\273\347\273\223\346\200\273\347\273\223.\346\234\210/index.xml" index e282b9d2f..ff1b4711c 100644 --- "a/categories/\346\200\273\347\273\223\346\200\273\347\273\223.\346\234\210/index.xml" +++ "b/categories/\346\200\273\347\273\223\346\200\273\347\273\223.\346\234\210/index.xml" @@ -1 +1 @@ -总结,总结.月 on Zzz记忆https://zfunnily.github.io/categories/%E6%80%BB%E7%BB%93%E6%80%BB%E7%BB%93.%E6%9C%88/Recent content in 总结,总结.月 on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +00002024-2月https://zfunnily.github.io/2024/02/02/Tue, 27 Feb 2024 15:45:00 +0800https://zfunnily.github.io/2024/02/02/学习 书籍 电影 游戏 《Lies of P》 《Dark Soul》重制版 番&amp;剧 《绝命毒师》第一季/第二季 其他12月https://zfunnily.github.io/2023/12/30/Sat, 30 Dec 2023 15:45:00 +0800https://zfunnily.github.io/2023/12/30/学习 银河城地图 搭建 ue5 paper2d 书籍 《游戏设计艺术》 电影 《复仇者联盟》4 游戏 《血污:夜之仪式》 《LOL》 《神之亵渎》 23小时 番&amp;剧 其他11月https://zfunnily.github.io/2023/11/30/Thu, 30 Nov 2023 15:45:00 +0800https://zfunnily.github.io/2023/11/30/学习 chatglm + langchain 知识库 docker搭建 ue5 paper2d的使用 wsl 子系统研究, win11 镜像模式. 电视剧 《繁城之下》 番剧 《反叛的鲁路修》 一季、二季 书籍 《置身事内》 电影 《复仇者联盟》3 游戏 《马里奥惊奇》已完结 《血污:夜之2024-01月https://zfunnily.github.io/1/01/30/Mon, 01 Jan 0001 00:00:00 +0000https://zfunnily.github.io/1/01/30/学习 书籍 电影 游戏 《艾尔登法环》 《Dark Soul》3 《LOL》 番&amp;剧 其他 \ No newline at end of file +总结,总结.月 on Zzz记忆https://zfunnily.github.io/categories/%E6%80%BB%E7%BB%93%E6%80%BB%E7%BB%93.%E6%9C%88/Recent content in 总结,总结.月 on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +00002024-2月https://zfunnily.github.io/2024/02/02/Tue, 27 Feb 2024 15:45:00 +0800https://zfunnily.github.io/2024/02/02/学习 书籍 电影 游戏 《Lies of P》 《Dark Soul》重制版 番&amp;剧 《绝命毒师》第一季/第二季 其他12月https://zfunnily.github.io/2023/12/30/Sat, 30 Dec 2023 15:45:00 +0800https://zfunnily.github.io/2023/12/30/学习 银河城地图 搭建 ue5 paper2d 书籍 《游戏设计艺术》 电影 《复仇者联盟》4 游戏 《血污:夜之仪式》 《LOL》 《神之亵渎》 23小时 番&amp;剧 其他11月https://zfunnily.github.io/2023/11/30/Thu, 30 Nov 2023 15:45:00 +0800https://zfunnily.github.io/2023/11/30/学习 chatglm + langchain 知识库 docker搭建 ue5 paper2d的使用 wsl 子系统研究, win11 镜像模式. 电视剧 《繁城之下》 番剧 《反叛的鲁路修》 一季、二季 书籍 《置身事内》 电影 《复仇者联盟》3 游戏 《马里奥惊奇》已完结 《血污:夜之2024-01月https://zfunnily.github.io/1/01/30/Mon, 01 Jan 0001 00:00:00 +0000https://zfunnily.github.io/1/01/30/学习 书籍 电影 游戏 《艾尔登法环》 《Dark Soul》3 《LOL》 番&amp;剧 其他 \ No newline at end of file diff --git "a/categories/\346\270\270\346\210\217/index.xml" "b/categories/\346\270\270\346\210\217/index.xml" index e9bd282f2..ccf96c8ed 100644 --- "a/categories/\346\270\270\346\210\217/index.xml" +++ "b/categories/\346\270\270\346\210\217/index.xml" @@ -1 +1 @@ -游戏 on Zzz记忆https://zfunnily.github.io/categories/%E6%B8%B8%E6%88%8F/Recent content in 游戏 on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000Netch加速SWITCHhttps://zfunnily.github.io/2022/10/netch/Thu, 27 Oct 2022 10:09:44 +0800https://zfunnily.github.io/2022/10/netch/需求 对于有机场的用户,不用再花一份加速器的钱给Switch加速 前提条件 电脑通过(shadowrocks/v2ray)开启科学上网,使用端口 1080 电脑局域网IP 192.168.0.103 允许局域网设备连入 解决过程 switch的代理Netch加速SWITCHhttps://zfunnily.github.io/2022/10/netch/Thu, 27 Oct 2022 10:09:44 +0800https://zfunnily.github.io/2022/10/netch/需求 对于有机场的用户,不用再花一份加速器的钱给Switch加速 前提条件 电脑通过(shadowrocks/v2ray)开启科学上网,使用端口 1080 电脑局域网IP 192.168.0.103 允许局域网设备连入 解决过程 switch的代理 \ No newline at end of file +游戏 on Zzz记忆https://zfunnily.github.io/categories/%E6%B8%B8%E6%88%8F/Recent content in 游戏 on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000Netch加速SWITCHhttps://zfunnily.github.io/2022/10/netch/Thu, 27 Oct 2022 10:09:44 +0800https://zfunnily.github.io/2022/10/netch/需求 对于有机场的用户,不用再花一份加速器的钱给Switch加速 前提条件 电脑通过(shadowrocks/v2ray)开启科学上网,使用端口 1080 电脑局域网IP 192.168.0.103 允许局域网设备连入 解决过程 switch的代理Netch加速SWITCHhttps://zfunnily.github.io/2022/10/netch/Thu, 27 Oct 2022 10:09:44 +0800https://zfunnily.github.io/2022/10/netch/需求 对于有机场的用户,不用再花一份加速器的钱给Switch加速 前提条件 电脑通过(shadowrocks/v2ray)开启科学上网,使用端口 1080 电脑局域网IP 192.168.0.103 允许局域网设备连入 解决过程 switch的代理 \ No newline at end of file diff --git "a/categories/\347\247\221\346\231\256/index.xml" "b/categories/\347\247\221\346\231\256/index.xml" index 1deaeb04a..280501c7b 100644 --- "a/categories/\347\247\221\346\231\256/index.xml" +++ "b/categories/\347\247\221\346\231\256/index.xml" @@ -1 +1 @@ -科普 on Zzz记忆https://zfunnily.github.io/categories/%E7%A7%91%E6%99%AE/Recent content in 科普 on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000CPU的核与线程-4核8线程https://zfunnily.github.io/2020/10/CPU%E7%9A%84%E6%A0%B8%E4%B8%8E%E7%BA%BF%E7%A8%8B-4%E6%A0%B88%E7%BA%BF%E7%A8%8B/Mon, 12 Oct 2020 16:29:34 +0000https://zfunnily.github.io/2020/10/CPU%E7%9A%84%E6%A0%B8%E4%B8%8E%E7%BA%BF%E7%A8%8B-4%E6%A0%B88%E7%BA%BF%E7%A8%8B/查看cpu信息 $ cat /proc/cpuinfo 物理CPU 物理CPU就是计算机上实际配置的CPU个数。 在linux上可以打开cat /proc/cpuinfo 来查看,其中的physical id就是每个物理CPU的ID,能找到几个physical id就代表 \ No newline at end of file +科普 on Zzz记忆https://zfunnily.github.io/categories/%E7%A7%91%E6%99%AE/Recent content in 科普 on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000CPU的核与线程-4核8线程https://zfunnily.github.io/2020/10/CPU%E7%9A%84%E6%A0%B8%E4%B8%8E%E7%BA%BF%E7%A8%8B-4%E6%A0%B88%E7%BA%BF%E7%A8%8B/Mon, 12 Oct 2020 16:29:34 +0000https://zfunnily.github.io/2020/10/CPU%E7%9A%84%E6%A0%B8%E4%B8%8E%E7%BA%BF%E7%A8%8B-4%E6%A0%B88%E7%BA%BF%E7%A8%8B/查看cpu信息 $ cat /proc/cpuinfo 物理CPU 物理CPU就是计算机上实际配置的CPU个数。 在linux上可以打开cat /proc/cpuinfo 来查看,其中的physical id就是每个物理CPU的ID,能找到几个physical id就代表 \ No newline at end of file diff --git "a/categories/\347\274\226\347\250\213.C/index.xml" "b/categories/\347\274\226\347\250\213.C/index.xml" index 8af54971e..46d18f88c 100644 --- "a/categories/\347\274\226\347\250\213.C/index.xml" +++ "b/categories/\347\274\226\347\250\213.C/index.xml" @@ -1 +1 @@ -编程.C on Zzz记忆https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.C/Recent content in 编程.C on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000八个基础排序https://zfunnily.github.io/2021/03/sort/Tue, 23 Mar 2021 10:13:31 +0000https://zfunnily.github.io/2021/03/sort/sort排序 std::sort( )函数是库函数提供的排序函数,必须包括头文件#include &lt;algorithm&gt;,它使用的排序方法是类似于快排的方法,时间复杂度为n*log2(n) Sort函数有三个参数:实现atoi和itoa函数https://zfunnily.github.io/2021/03/atoianditoa/Wed, 17 Mar 2021 16:43:20 +0000https://zfunnily.github.io/2021/03/atoianditoa/题目1: 把字符串转化为整数 有整数字符串,&quot;13579&quot;, 和 &quot;246810&quot;. 请写一个函数把这两个字符串转化为整数 步骤: 先判断正负 遍历字符串,转换字符为整数 //atoi.cc #include &lt;stdio.h&gt; int my_atoi(char *str) { bool bmin = false; int result = 0; //先判断正协程解析二 | 云风的coroutinehttps://zfunnily.github.io/2021/03/coroutinetwo/Wed, 10 Mar 2021 11:11:47 +0000https://zfunnily.github.io/2021/03/coroutinetwo/概述 云风的coroutine是通过ucontext来控制程序运行时上下文的,我们来根据该库提供的几个接口,和一个demo来解释协程的运行原理。如果不了解ucontext的,建议先了解ucontxt 环境协程解析一 | ucontexthttps://zfunnily.github.io/2021/03/coroutineone/Tue, 09 Mar 2021 09:43:00 +0000https://zfunnily.github.io/2021/03/coroutineone/概述 最近在研究协程的实现原理,看了云风的coroutine和腾讯的开源库libco后,原来要实现一个协程库也没那么难。我先来讲讲云风的coroutine库。他使用的是 uncontext来保存程序运行上struct中使用char[]https://zfunnily.github.io/2021/01/chararray/Tue, 05 Jan 2021 15:45:36 +0000https://zfunnily.github.io/2021/01/chararray/缘由 最近在看redis的源码,刚开始看sds,看到这块代码 struct __attribute__ ((__packed__)) sdshdr5 { unsigned char flags; /* 3 lsb of type, and 5 msb of string length */ char buf[]; }; 好奇为什么使用 char buf[],而不用char *buf,找到答案记录一下。 struct中的char*CCnet | 单线程reactor演变为多线程https://zfunnily.github.io/2020/12/ccnet/Wed, 30 Dec 2020 09:19:41 +0000https://zfunnily.github.io/2020/12/ccnet/ccnet从单线程演变为多线程 ccnet现状: epoll linux平台 事件循环 单线程 reactor 监听和新连接的事件都在主线程中 单线程的ccnet ccnet的单线程的角色: EventLoop: 整个事件循环。 EPollPoller: 负责事件的收集。 ChannelCCnet | 一个reactor单线程网络库https://zfunnily.github.io/2020/12/ccnetone/Sun, 27 Dec 2020 18:41:25 +0000https://zfunnily.github.io/2020/12/ccnetone/缘由 最近在研究陈硕的网络库muduo,是一个基于reactor架构的网络库。我对网络库的感觉是易用,但是内容庞大,依赖颇多。比如boost网络库里面的一些语法让人生畏。关于reactor和proactC++ | vector中的resize()函数 VS reserve()函数https://zfunnily.github.io/2020/12/reserve/Fri, 25 Dec 2020 11:04:29 +0000https://zfunnily.github.io/2020/12/reserve/reserve void reserve (size_type n); reserver函数用来给vector预分配存储区大小,即capacity的值 ,但是没有给这段内存进行初始化。reserve 的参数n是推荐预分配内存的大小,实际分配的可能等于或大于这个值,即Libevent | 定时器https://zfunnily.github.io/2020/09/libeventimer/Wed, 16 Sep 2020 23:20:28 +0000https://zfunnily.github.io/2020/09/libeventimer/libevent 实现定时器流程 首先初始化libevent库,并保存返回的指针 struct event_base * base = event_init(); 实际上这一步相当于初始化一个Reactor实例;在初始化libevent后,就可以注册事件了。 初始化事件event,设置回调函 \ No newline at end of file +编程.C on Zzz记忆https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.C/Recent content in 编程.C on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000八个基础排序https://zfunnily.github.io/2021/03/sort/Tue, 23 Mar 2021 10:13:31 +0000https://zfunnily.github.io/2021/03/sort/sort排序 std::sort( )函数是库函数提供的排序函数,必须包括头文件#include &lt;algorithm&gt;,它使用的排序方法是类似于快排的方法,时间复杂度为n*log2(n) Sort函数有三个参数:实现atoi和itoa函数https://zfunnily.github.io/2021/03/atoianditoa/Wed, 17 Mar 2021 16:43:20 +0000https://zfunnily.github.io/2021/03/atoianditoa/题目1: 把字符串转化为整数 有整数字符串,&quot;13579&quot;, 和 &quot;246810&quot;. 请写一个函数把这两个字符串转化为整数 步骤: 先判断正负 遍历字符串,转换字符为整数 //atoi.cc #include &lt;stdio.h&gt; int my_atoi(char *str) { bool bmin = false; int result = 0; //先判断正协程解析二 | 云风的coroutinehttps://zfunnily.github.io/2021/03/coroutinetwo/Wed, 10 Mar 2021 11:11:47 +0000https://zfunnily.github.io/2021/03/coroutinetwo/概述 云风的coroutine是通过ucontext来控制程序运行时上下文的,我们来根据该库提供的几个接口,和一个demo来解释协程的运行原理。如果不了解ucontext的,建议先了解ucontxt 环境协程解析一 | ucontexthttps://zfunnily.github.io/2021/03/coroutineone/Tue, 09 Mar 2021 09:43:00 +0000https://zfunnily.github.io/2021/03/coroutineone/概述 最近在研究协程的实现原理,看了云风的coroutine和腾讯的开源库libco后,原来要实现一个协程库也没那么难。我先来讲讲云风的coroutine库。他使用的是 uncontext来保存程序运行上struct中使用char[]https://zfunnily.github.io/2021/01/chararray/Tue, 05 Jan 2021 15:45:36 +0000https://zfunnily.github.io/2021/01/chararray/缘由 最近在看redis的源码,刚开始看sds,看到这块代码 struct __attribute__ ((__packed__)) sdshdr5 { unsigned char flags; /* 3 lsb of type, and 5 msb of string length */ char buf[]; }; 好奇为什么使用 char buf[],而不用char *buf,找到答案记录一下。 struct中的char*CCnet | 单线程reactor演变为多线程https://zfunnily.github.io/2020/12/ccnet/Wed, 30 Dec 2020 09:19:41 +0000https://zfunnily.github.io/2020/12/ccnet/ccnet从单线程演变为多线程 ccnet现状: epoll linux平台 事件循环 单线程 reactor 监听和新连接的事件都在主线程中 单线程的ccnet ccnet的单线程的角色: EventLoop: 整个事件循环。 EPollPoller: 负责事件的收集。 ChannelCCnet | 一个reactor单线程网络库https://zfunnily.github.io/2020/12/ccnetone/Sun, 27 Dec 2020 18:41:25 +0000https://zfunnily.github.io/2020/12/ccnetone/缘由 最近在研究陈硕的网络库muduo,是一个基于reactor架构的网络库。我对网络库的感觉是易用,但是内容庞大,依赖颇多。比如boost网络库里面的一些语法让人生畏。关于reactor和proactC++ | vector中的resize()函数 VS reserve()函数https://zfunnily.github.io/2020/12/reserve/Fri, 25 Dec 2020 11:04:29 +0000https://zfunnily.github.io/2020/12/reserve/reserve void reserve (size_type n); reserver函数用来给vector预分配存储区大小,即capacity的值 ,但是没有给这段内存进行初始化。reserve 的参数n是推荐预分配内存的大小,实际分配的可能等于或大于这个值,即Libevent | 定时器https://zfunnily.github.io/2020/09/libeventimer/Wed, 16 Sep 2020 23:20:28 +0000https://zfunnily.github.io/2020/09/libeventimer/libevent 实现定时器流程 首先初始化libevent库,并保存返回的指针 struct event_base * base = event_init(); 实际上这一步相当于初始化一个Reactor实例;在初始化libevent后,就可以注册事件了。 初始化事件event,设置回调函 \ No newline at end of file diff --git "a/categories/\347\274\226\347\250\213.Golang/index.xml" "b/categories/\347\274\226\347\250\213.Golang/index.xml" index b14008928..75bbb3c38 100644 --- "a/categories/\347\274\226\347\250\213.Golang/index.xml" +++ "b/categories/\347\274\226\347\250\213.Golang/index.xml" @@ -1 +1 @@ -编程.Golang on Zzz记忆https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.Golang/Recent content in 编程.Golang on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000Golang | http注解路由https://zfunnily.github.io/2022/03/http/Wed, 02 Mar 2022 14:51:22 +0800https://zfunnily.github.io/2022/03/http/Http服务器 Golang有一个很强大的官方http库了,使用上很方便。也有一些很强大的三方http框架, 比如gin,beego等等。 自以为,框架在提供便利,提升开发效率的同时,也限制了我们的想象力。Golang | http注解路由https://zfunnily.github.io/2022/03/http/Wed, 02 Mar 2022 14:51:22 +0800https://zfunnily.github.io/2022/03/http/Http服务器 Golang有一个很强大的官方http库了,使用上很方便。也有一些很强大的三方http框架, 比如gin,beego等等。 自以为,框架在提供便利,提升开发效率的同时,也限制了我们的想象力。Goang | Plugin插件热更https://zfunnily.github.io/2022/03/reload/Tue, 01 Mar 2022 11:33:22 +0800https://zfunnily.github.io/2022/03/reload/热更新 动态脚本更新 (php) 短链接无状态服务器热更 (http) 长连接有状态,数据跟逻辑分离 golang Plugin热更 (.so 动态库更新) &mdash;-逻辑热更 长连接有状态,在运维层面, 利用容器部署热更(docker, k8s) 服务不接受新Goang | Plugin插件热更https://zfunnily.github.io/2022/03/reload/Tue, 01 Mar 2022 11:33:22 +0800https://zfunnily.github.io/2022/03/reload/热更新 动态脚本更新 (php) 短链接无状态服务器热更 (http) 长连接有状态,数据跟逻辑分离 golang Plugin热更 (.so 动态库更新) &mdash;-逻辑热更 长连接有状态,在运维层面, 利用容器部署热更(docker, k8s) 服务不接受新Grpc | Token认证和自定义认证https://zfunnily.github.io/2022/02/jwt/Tue, 22 Feb 2022 15:39:30 +0800https://zfunnily.github.io/2022/02/jwt/概述 现在有个需求,需要在grpc的拦截器中,通过token进行身份认证。如果认证不通过则返回错误; 认证通过,则放行; TLS是用作加密通讯通道的,与该需求无关。 Token认证 具体流程 客户端通过账号密码登Grpc | Token认证和自定义认证https://zfunnily.github.io/2022/02/jwt/Tue, 22 Feb 2022 15:39:30 +0800https://zfunnily.github.io/2022/02/jwt/概述 现在有个需求,需要在grpc的拦截器中,通过token进行身份认证。如果认证不通过则返回错误; 认证通过,则放行; TLS是用作加密通讯通道的,与该需求无关。 Token认证 具体流程 客户端通过账号密码登Grpc | 通过SSL/TLS建立安全连接https://zfunnily.github.io/2022/02/san/Tue, 22 Feb 2022 14:22:41 +0800https://zfunnily.github.io/2022/02/san/使用golang的grpc库作为例子 grpc使用TLS建立安全连接需要有SAN证书, go 1.15 版本开始废弃 CommonName。 什么是SAN证书 SAN(Subject Alternative Name) 是 SSL 标准 x509 中定义的一个扩展。使用了 SAN 字段的 SSL 证书,可以扩Grpc | 通过SSL/TLS建立安全连接https://zfunnily.github.io/2022/02/san/Tue, 22 Feb 2022 14:22:41 +0800https://zfunnily.github.io/2022/02/san/使用golang的grpc库作为例子 grpc使用TLS建立安全连接需要有SAN证书, go 1.15 版本开始废弃 CommonName。 什么是SAN证书 SAN(Subject Alternative Name) 是 SSL 标准 x509 中定义的一个扩展。使用了 SAN 字段的 SSL 证书,可以扩Golang | 调用带有后台进程shell脚本可能会被挂起https://zfunnily.github.io/2021/10/shell/Wed, 13 Oct 2021 17:15:45 +0800https://zfunnily.github.io/2021/10/shell/起因 今天用Golang写一个调用外部shell脚本的程序,使用 exec.Command方法,这段脚本代码中包含了一个后台任务语句。 结果发生了一个问题:cmd.Output 始终不会返回,一直挂起。导致我Golang | redis实现分布式锁https://zfunnily.github.io/2021/06/distribute/Thu, 03 Jun 2021 16:12:21 +0000https://zfunnily.github.io/2021/06/distribute/概述 网上有很多Golang操作redis的例子,我使用github.com/gomodule/redigo/redis包写一个关于redis分布式锁的问题。 redis分布式锁 锁需要的几个组件 获取锁- 删Golang | redishttps://zfunnily.github.io/2021/06/goredis/Thu, 03 Jun 2021 15:57:14 +0800https://zfunnily.github.io/2021/06/goredis/概述 网上有很多golang操作redis的例子,我使用github.com/gomodule/redigo/redis包写一个关于redis分布式锁的问题。 redis分布式锁 锁需要的几个组件 获取锁 删除Golang | gomod拉取私有仓库https://zfunnily.github.io/2021/03/gomod/Tue, 23 Mar 2021 16:10:02 +0000https://zfunnily.github.io/2021/03/gomod/概述 在使用go mod的过程中,依赖的包往往是第三方库,当我们自定义一个包并且放在github.com私有仓库时候,按照原来的方法则会有如下问题。 get &#34;gitlab.com/xxx/zz&#34;: found meta tag get.metaImport{Prefix:&#34;gitlab.com/xxx/zz&#34;, VCS:&#34;git&#34;, RepoRoot:&#34;https://gitlab.com/xxx/zz.git&#34;} at //gitlab.com/xxx/zz?go-get=1 verifying gitlab.com/xxx/zz@v0.0.1: gitlab.com/xxx/zz@v0.0.1: reading https://sum.golang.org/lookup/gitlab.com/xxx/zz@v0.0.1: 410 Gone 这个错误是因为新版本gGolang | 定时器https://zfunnily.github.io/2021/02/timer/Thu, 25 Feb 2021 16:02:13 +0000https://zfunnily.github.io/2021/02/timer/概述 golang有三种方式实现定时器: ticker timer select Ticker 通过 time.NewTicker(d)的方式实现定时器 d := time.Duration(time.Second * 2) t1 := time.NewTicker(d) defer t1.Stop() go func() { for { &lt;- t1.C fmt.Println(&#34;NewTicker...&#34;) } }() Timer 通过 time.NewTimer(d)的方式实现定时器 t2 := time.NewTimer(d)Golang | JWT身份认证https://zfunnily.github.io/2021/02/JWT/Wed, 24 Feb 2021 14:22:04 +0000https://zfunnily.github.io/2021/02/JWT/概述 最近要在http接口上加一个token认证,但是接口很多,有没有一个省时省力的办法来解决。token的使用流程是: 用户使用帐号密码登陆到服务器1. 服务器验证登陆成功,根据帐号密码生成token。把Protobuf | 请求参数为空的案例https://zfunnily.github.io/2021/01/pbempty/Fri, 22 Jan 2021 16:41:16 +0000https://zfunnily.github.io/2021/01/pbempty/参数为空的grpc请求怎么定义 google protobuf已经提供了空参数 //empty.proto message Empty {&lt;!-- --&gt;} 使用方法,在proto文件中导入empty.proto, 定义一个请求参数和返回值为空的函数emptyfunction, 函数名字Golang | C数组转化为Golang的切片类型https://zfunnily.github.io/2021/01/goslience/Fri, 22 Jan 2021 15:56:40 +0000https://zfunnily.github.io/2021/01/goslience/概述 最近在巩固cgo的基础知识,在网上看到一篇Go和C之间 字符串数组、切片类型转换的文章,让我想到我之前写的一篇在go中遍历C结构体数组的文章,让我有新的方法来解决之前的问题,把C的数组转化为Go的切Cgo | 遍历C结构体数组https://zfunnily.github.io/2021/01/cgostruct/Mon, 11 Jan 2021 17:18:35 +0000https://zfunnily.github.io/2021/01/cgostruct/缘由 现在有个应用场景,我们要在go中获取C结构体数组中的值。在C语言中,对于结构体数组,我们可以利用指针的偏移量来获取我们想要的值的位置。在go中我们怎么使用C指针和偏移量进行运算呢?下面的文字中C指Golang | sync.Mutex详解https://zfunnily.github.io/2020/12/syncmutex/Tue, 29 Dec 2020 13:17:18 +0000https://zfunnily.github.io/2020/12/syncmutex/概述 自己做的一个golang项目需要优化,优化方向是减少gpu内存的使用。同一个模型被重复加载多次,使用更多的gpu内存,也增加 sync.Mutex的使用。 优化的方向是: 减少代码量的改动- 减少gpu内Golang | 用gocolly登录B站https://zfunnily.github.io/2020/12/gocolly/Sun, 13 Dec 2020 14:51:53 +0000https://zfunnily.github.io/2020/12/gocolly/概述 gocolly是golang语言开发的爬虫包,通过gocolly来进行模拟网站的登录, 目标已经确立,开始行动。 下载 $ go get -u github.com/gocolly/colly 获取cookie 登录网站:https://www.bilibili.coProtobuf | 沾包问题https://zfunnily.github.io/2020/12/tcp/Sun, 13 Dec 2020 10:22:38 +0000https://zfunnily.github.io/2020/12/tcp/缘由 最近在研究一款游戏的源码。发现里面的通信协议是protobuf定义的,但还是自己定义了协议头部,类似 head + body。先解析头部里所存储的整个包的数据长度,然后再解析包剩余的数据,这样做的目的是为了防Grpc | 概述https://zfunnily.github.io/2020/12/grpc/Sun, 13 Dec 2020 09:10:42 +0000https://zfunnily.github.io/2020/12/grpc/OverView gRPC是由Google主导开发的RPC框架,使用HTTP/2协议并用ProtoBuf作为序列化工具。其客户端提供Objective-C、Java接口,服务器侧则有Java、Golang、C++等接Cgo | 使用libevent库实现一个定时器https://zfunnily.github.io/2020/11/cgo%E4%BD%BF%E7%94%A8libevent%E5%BA%93%E5%AE%9E%E7%8E%B0%E4%B8%80%E4%B8%AA%E5%AE%9A%E6%97%B6%E5%99%A8/Fri, 13 Nov 2020 16:40:42 +0000https://zfunnily.github.io/2020/11/cgo%E4%BD%BF%E7%94%A8libevent%E5%BA%93%E5%AE%9E%E7%8E%B0%E4%B8%80%E4%B8%AA%E5%AE%9A%E6%97%B6%E5%99%A8/使用libevent库作为例子 下载 &amp; 编译 &amp; 安装libevent $ git clone https://github.com.cnpmjs.org/libevent/libevent.git $ cd libevent &amp;&amp; mkdir build &amp;&amp; cd build $ cmake .. $ make libevent实现的定时器 // main.cpp #include &#34;event.h&#34; struct event ev; struct timeval tv; void time_cb(evutil_socket_t fd, short event, void *argc) { printf(&#34;timer wakeup\n&#34;); event_add(&amp;ev, &amp;tv); // reschedule timer } int main() { struct event_base *base = event_base_new(); tv.tv_sec = 2;Golang | 利用指针进行数据转换https://zfunnily.github.io/2020/11/Golang-%E5%88%A9%E7%94%A8%E6%8C%87%E9%92%88%E8%BF%9B%E8%A1%8C%E6%95%B0%E6%8D%AE%E8%BD%AC%E6%8D%A2/Thu, 12 Nov 2020 17:19:07 +0000https://zfunnily.github.io/2020/11/Golang-%E5%88%A9%E7%94%A8%E6%8C%87%E9%92%88%E8%BF%9B%E8%A1%8C%E6%95%B0%E6%8D%AE%E8%BD%AC%E6%8D%A2/概述 在Go语言中,Slice本质是什么呢?是一个reflect.SliceHeader结构体和这个结构体中Data字段所指向的内存。String本质是什么呢?是一个reflect.StringHeadGolang | buildshttps://zfunnily.github.io/2020/11/go-builds/Thu, 12 Nov 2020 17:15:17 +0000https://zfunnily.github.io/2020/11/go-builds/概述 通常我们会给每个产品环境设置不同的配置,比如 redis 要在开发环境就连接 localhost:6379,测试环境可能连接某一个主机的 redis。 如果放在 go 里面是否可行?因为 go 是编译二进制包,也没有动态加载这Cgo | 简单使用https://zfunnily.github.io/2020/11/cgo%E7%9A%84%E7%AE%80%E5%8D%95%E4%BD%BF%E7%94%A8/Thu, 05 Nov 2020 09:45:23 +0000https://zfunnily.github.io/2020/11/cgo%E7%9A%84%E7%AE%80%E5%8D%95%E4%BD%BF%E7%94%A8/使用自己的C函数 文件名:testC.go package main /* #include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; void c_print(char *str) { printf(&#34;%s\n&#34;, str); } */ import &#34;C&#34; //import “C” 必须单起一行,并且紧跟在注释行之后 import &#34;unsafe&#34; func main() { s := &#34;Hello Cgo&#34; cs := C.CString(s) //字符串映射 C.c_print(cs) //调用C函数 defer C.free(unsafe.Pointer(cs)) //释放内存 } 说明: 1、gGolang | 使用Lumberjack+zap进行日志切割归档https://zfunnily.github.io/2020/11/%E4%BD%BF%E7%94%A8Lumberjack-zap%E8%BF%9B%E8%A1%8C%E6%97%A5%E5%BF%97%E5%88%87%E5%89%B2%E5%BD%92%E6%A1%A3/Wed, 04 Nov 2020 12:44:03 +0000https://zfunnily.github.io/2020/11/%E4%BD%BF%E7%94%A8Lumberjack-zap%E8%BF%9B%E8%A1%8C%E6%97%A5%E5%BF%97%E5%88%87%E5%89%B2%E5%BD%92%E6%A1%A3/使用Lumberjack+zap进行日志切割归档 为了添加日志切割归档功能,我们将使用第三方库Lumberjack来实现。 安装 执行下面的命令安装Lumberjack go get -u github.com/natefinch/lumberjack zap logger中加入Lumbe \ No newline at end of file +编程.Golang on Zzz记忆https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.Golang/Recent content in 编程.Golang on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000Golang | http注解路由https://zfunnily.github.io/2022/03/http/Wed, 02 Mar 2022 14:51:22 +0800https://zfunnily.github.io/2022/03/http/Http服务器 Golang有一个很强大的官方http库了,使用上很方便。也有一些很强大的三方http框架, 比如gin,beego等等。 自以为,框架在提供便利,提升开发效率的同时,也限制了我们的想象力。Golang | http注解路由https://zfunnily.github.io/2022/03/http/Wed, 02 Mar 2022 14:51:22 +0800https://zfunnily.github.io/2022/03/http/Http服务器 Golang有一个很强大的官方http库了,使用上很方便。也有一些很强大的三方http框架, 比如gin,beego等等。 自以为,框架在提供便利,提升开发效率的同时,也限制了我们的想象力。Goang | Plugin插件热更https://zfunnily.github.io/2022/03/reload/Tue, 01 Mar 2022 11:33:22 +0800https://zfunnily.github.io/2022/03/reload/热更新 动态脚本更新 (php) 短链接无状态服务器热更 (http) 长连接有状态,数据跟逻辑分离 golang Plugin热更 (.so 动态库更新) &mdash;-逻辑热更 长连接有状态,在运维层面, 利用容器部署热更(docker, k8s) 服务不接受新Goang | Plugin插件热更https://zfunnily.github.io/2022/03/reload/Tue, 01 Mar 2022 11:33:22 +0800https://zfunnily.github.io/2022/03/reload/热更新 动态脚本更新 (php) 短链接无状态服务器热更 (http) 长连接有状态,数据跟逻辑分离 golang Plugin热更 (.so 动态库更新) &mdash;-逻辑热更 长连接有状态,在运维层面, 利用容器部署热更(docker, k8s) 服务不接受新Grpc | Token认证和自定义认证https://zfunnily.github.io/2022/02/jwt/Tue, 22 Feb 2022 15:39:30 +0800https://zfunnily.github.io/2022/02/jwt/概述 现在有个需求,需要在grpc的拦截器中,通过token进行身份认证。如果认证不通过则返回错误; 认证通过,则放行; TLS是用作加密通讯通道的,与该需求无关。 Token认证 具体流程 客户端通过账号密码登Grpc | Token认证和自定义认证https://zfunnily.github.io/2022/02/jwt/Tue, 22 Feb 2022 15:39:30 +0800https://zfunnily.github.io/2022/02/jwt/概述 现在有个需求,需要在grpc的拦截器中,通过token进行身份认证。如果认证不通过则返回错误; 认证通过,则放行; TLS是用作加密通讯通道的,与该需求无关。 Token认证 具体流程 客户端通过账号密码登Grpc | 通过SSL/TLS建立安全连接https://zfunnily.github.io/2022/02/san/Tue, 22 Feb 2022 14:22:41 +0800https://zfunnily.github.io/2022/02/san/使用golang的grpc库作为例子 grpc使用TLS建立安全连接需要有SAN证书, go 1.15 版本开始废弃 CommonName。 什么是SAN证书 SAN(Subject Alternative Name) 是 SSL 标准 x509 中定义的一个扩展。使用了 SAN 字段的 SSL 证书,可以扩Grpc | 通过SSL/TLS建立安全连接https://zfunnily.github.io/2022/02/san/Tue, 22 Feb 2022 14:22:41 +0800https://zfunnily.github.io/2022/02/san/使用golang的grpc库作为例子 grpc使用TLS建立安全连接需要有SAN证书, go 1.15 版本开始废弃 CommonName。 什么是SAN证书 SAN(Subject Alternative Name) 是 SSL 标准 x509 中定义的一个扩展。使用了 SAN 字段的 SSL 证书,可以扩Golang | 调用带有后台进程shell脚本可能会被挂起https://zfunnily.github.io/2021/10/shell/Wed, 13 Oct 2021 17:15:45 +0800https://zfunnily.github.io/2021/10/shell/起因 今天用Golang写一个调用外部shell脚本的程序,使用 exec.Command方法,这段脚本代码中包含了一个后台任务语句。 结果发生了一个问题:cmd.Output 始终不会返回,一直挂起。导致我Golang | redis实现分布式锁https://zfunnily.github.io/2021/06/distribute/Thu, 03 Jun 2021 16:12:21 +0000https://zfunnily.github.io/2021/06/distribute/概述 网上有很多Golang操作redis的例子,我使用github.com/gomodule/redigo/redis包写一个关于redis分布式锁的问题。 redis分布式锁 锁需要的几个组件 获取锁- 删Golang | redishttps://zfunnily.github.io/2021/06/goredis/Thu, 03 Jun 2021 15:57:14 +0800https://zfunnily.github.io/2021/06/goredis/概述 网上有很多golang操作redis的例子,我使用github.com/gomodule/redigo/redis包写一个关于redis分布式锁的问题。 redis分布式锁 锁需要的几个组件 获取锁 删除Golang | gomod拉取私有仓库https://zfunnily.github.io/2021/03/gomod/Tue, 23 Mar 2021 16:10:02 +0000https://zfunnily.github.io/2021/03/gomod/概述 在使用go mod的过程中,依赖的包往往是第三方库,当我们自定义一个包并且放在github.com私有仓库时候,按照原来的方法则会有如下问题。 get &#34;gitlab.com/xxx/zz&#34;: found meta tag get.metaImport{Prefix:&#34;gitlab.com/xxx/zz&#34;, VCS:&#34;git&#34;, RepoRoot:&#34;https://gitlab.com/xxx/zz.git&#34;} at //gitlab.com/xxx/zz?go-get=1 verifying gitlab.com/xxx/zz@v0.0.1: gitlab.com/xxx/zz@v0.0.1: reading https://sum.golang.org/lookup/gitlab.com/xxx/zz@v0.0.1: 410 Gone 这个错误是因为新版本gGolang | 定时器https://zfunnily.github.io/2021/02/timer/Thu, 25 Feb 2021 16:02:13 +0000https://zfunnily.github.io/2021/02/timer/概述 golang有三种方式实现定时器: ticker timer select Ticker 通过 time.NewTicker(d)的方式实现定时器 d := time.Duration(time.Second * 2) t1 := time.NewTicker(d) defer t1.Stop() go func() { for { &lt;- t1.C fmt.Println(&#34;NewTicker...&#34;) } }() Timer 通过 time.NewTimer(d)的方式实现定时器 t2 := time.NewTimer(d)Golang | JWT身份认证https://zfunnily.github.io/2021/02/JWT/Wed, 24 Feb 2021 14:22:04 +0000https://zfunnily.github.io/2021/02/JWT/概述 最近要在http接口上加一个token认证,但是接口很多,有没有一个省时省力的办法来解决。token的使用流程是: 用户使用帐号密码登陆到服务器1. 服务器验证登陆成功,根据帐号密码生成token。把Protobuf | 请求参数为空的案例https://zfunnily.github.io/2021/01/pbempty/Fri, 22 Jan 2021 16:41:16 +0000https://zfunnily.github.io/2021/01/pbempty/参数为空的grpc请求怎么定义 google protobuf已经提供了空参数 //empty.proto message Empty {&lt;!-- --&gt;} 使用方法,在proto文件中导入empty.proto, 定义一个请求参数和返回值为空的函数emptyfunction, 函数名字Golang | C数组转化为Golang的切片类型https://zfunnily.github.io/2021/01/goslience/Fri, 22 Jan 2021 15:56:40 +0000https://zfunnily.github.io/2021/01/goslience/概述 最近在巩固cgo的基础知识,在网上看到一篇Go和C之间 字符串数组、切片类型转换的文章,让我想到我之前写的一篇在go中遍历C结构体数组的文章,让我有新的方法来解决之前的问题,把C的数组转化为Go的切Cgo | 遍历C结构体数组https://zfunnily.github.io/2021/01/cgostruct/Mon, 11 Jan 2021 17:18:35 +0000https://zfunnily.github.io/2021/01/cgostruct/缘由 现在有个应用场景,我们要在go中获取C结构体数组中的值。在C语言中,对于结构体数组,我们可以利用指针的偏移量来获取我们想要的值的位置。在go中我们怎么使用C指针和偏移量进行运算呢?下面的文字中C指Golang | sync.Mutex详解https://zfunnily.github.io/2020/12/syncmutex/Tue, 29 Dec 2020 13:17:18 +0000https://zfunnily.github.io/2020/12/syncmutex/概述 自己做的一个golang项目需要优化,优化方向是减少gpu内存的使用。同一个模型被重复加载多次,使用更多的gpu内存,也增加 sync.Mutex的使用。 优化的方向是: 减少代码量的改动- 减少gpu内Golang | 用gocolly登录B站https://zfunnily.github.io/2020/12/gocolly/Sun, 13 Dec 2020 14:51:53 +0000https://zfunnily.github.io/2020/12/gocolly/概述 gocolly是golang语言开发的爬虫包,通过gocolly来进行模拟网站的登录, 目标已经确立,开始行动。 下载 $ go get -u github.com/gocolly/colly 获取cookie 登录网站:https://www.bilibili.coProtobuf | 沾包问题https://zfunnily.github.io/2020/12/tcp/Sun, 13 Dec 2020 10:22:38 +0000https://zfunnily.github.io/2020/12/tcp/缘由 最近在研究一款游戏的源码。发现里面的通信协议是protobuf定义的,但还是自己定义了协议头部,类似 head + body。先解析头部里所存储的整个包的数据长度,然后再解析包剩余的数据,这样做的目的是为了防Grpc | 概述https://zfunnily.github.io/2020/12/grpc/Sun, 13 Dec 2020 09:10:42 +0000https://zfunnily.github.io/2020/12/grpc/OverView gRPC是由Google主导开发的RPC框架,使用HTTP/2协议并用ProtoBuf作为序列化工具。其客户端提供Objective-C、Java接口,服务器侧则有Java、Golang、C++等接Cgo | 使用libevent库实现一个定时器https://zfunnily.github.io/2020/11/cgo%E4%BD%BF%E7%94%A8libevent%E5%BA%93%E5%AE%9E%E7%8E%B0%E4%B8%80%E4%B8%AA%E5%AE%9A%E6%97%B6%E5%99%A8/Fri, 13 Nov 2020 16:40:42 +0000https://zfunnily.github.io/2020/11/cgo%E4%BD%BF%E7%94%A8libevent%E5%BA%93%E5%AE%9E%E7%8E%B0%E4%B8%80%E4%B8%AA%E5%AE%9A%E6%97%B6%E5%99%A8/使用libevent库作为例子 下载 &amp; 编译 &amp; 安装libevent $ git clone https://github.com.cnpmjs.org/libevent/libevent.git $ cd libevent &amp;&amp; mkdir build &amp;&amp; cd build $ cmake .. $ make libevent实现的定时器 // main.cpp #include &#34;event.h&#34; struct event ev; struct timeval tv; void time_cb(evutil_socket_t fd, short event, void *argc) { printf(&#34;timer wakeup\n&#34;); event_add(&amp;ev, &amp;tv); // reschedule timer } int main() { struct event_base *base = event_base_new(); tv.tv_sec = 2;Golang | 利用指针进行数据转换https://zfunnily.github.io/2020/11/Golang-%E5%88%A9%E7%94%A8%E6%8C%87%E9%92%88%E8%BF%9B%E8%A1%8C%E6%95%B0%E6%8D%AE%E8%BD%AC%E6%8D%A2/Thu, 12 Nov 2020 17:19:07 +0000https://zfunnily.github.io/2020/11/Golang-%E5%88%A9%E7%94%A8%E6%8C%87%E9%92%88%E8%BF%9B%E8%A1%8C%E6%95%B0%E6%8D%AE%E8%BD%AC%E6%8D%A2/概述 在Go语言中,Slice本质是什么呢?是一个reflect.SliceHeader结构体和这个结构体中Data字段所指向的内存。String本质是什么呢?是一个reflect.StringHeadGolang | buildshttps://zfunnily.github.io/2020/11/go-builds/Thu, 12 Nov 2020 17:15:17 +0000https://zfunnily.github.io/2020/11/go-builds/概述 通常我们会给每个产品环境设置不同的配置,比如 redis 要在开发环境就连接 localhost:6379,测试环境可能连接某一个主机的 redis。 如果放在 go 里面是否可行?因为 go 是编译二进制包,也没有动态加载这Cgo | 简单使用https://zfunnily.github.io/2020/11/cgo%E7%9A%84%E7%AE%80%E5%8D%95%E4%BD%BF%E7%94%A8/Thu, 05 Nov 2020 09:45:23 +0000https://zfunnily.github.io/2020/11/cgo%E7%9A%84%E7%AE%80%E5%8D%95%E4%BD%BF%E7%94%A8/使用自己的C函数 文件名:testC.go package main /* #include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; void c_print(char *str) { printf(&#34;%s\n&#34;, str); } */ import &#34;C&#34; //import “C” 必须单起一行,并且紧跟在注释行之后 import &#34;unsafe&#34; func main() { s := &#34;Hello Cgo&#34; cs := C.CString(s) //字符串映射 C.c_print(cs) //调用C函数 defer C.free(unsafe.Pointer(cs)) //释放内存 } 说明: 1、gGolang | 使用Lumberjack+zap进行日志切割归档https://zfunnily.github.io/2020/11/%E4%BD%BF%E7%94%A8Lumberjack-zap%E8%BF%9B%E8%A1%8C%E6%97%A5%E5%BF%97%E5%88%87%E5%89%B2%E5%BD%92%E6%A1%A3/Wed, 04 Nov 2020 12:44:03 +0000https://zfunnily.github.io/2020/11/%E4%BD%BF%E7%94%A8Lumberjack-zap%E8%BF%9B%E8%A1%8C%E6%97%A5%E5%BF%97%E5%88%87%E5%89%B2%E5%BD%92%E6%A1%A3/使用Lumberjack+zap进行日志切割归档 为了添加日志切割归档功能,我们将使用第三方库Lumberjack来实现。 安装 执行下面的命令安装Lumberjack go get -u github.com/natefinch/lumberjack zap logger中加入Lumbe \ No newline at end of file diff --git "a/categories/\347\274\226\347\250\213.Lua/index.xml" "b/categories/\347\274\226\347\250\213.Lua/index.xml" index b3f92c728..291bb022e 100644 --- "a/categories/\347\274\226\347\250\213.Lua/index.xml" +++ "b/categories/\347\274\226\347\250\213.Lua/index.xml" @@ -1 +1 @@ -编程.Lua on Zzz记忆https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.Lua/Recent content in 编程.Lua on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000A*算法 | Lua版本https://zfunnily.github.io/2021/12/astar/Thu, 23 Dec 2021 16:37:44 +0800https://zfunnily.github.io/2021/12/astar/A*算法思路 寻路步骤 从起点A开始, 把它作为待处理的方格存入一个&quot;开启列表&quot;, 开启列表就是一个等待检查方格的列表. 寻找起点A周围可以到达的方格, 将它们放入&quot;开启列表&quoLua | next的使用https://zfunnily.github.io/2021/05/lua_next/Mon, 10 May 2021 16:39:50 +0800https://zfunnily.github.io/2021/05/lua_next/lua_next lua_next(L,index):先把 表(lua栈 index所指的表), 的当前索引弹出,再把table 当前索引的值弹出,也就是先弹出 table的索引,再弹出table索引的值 举例: local t = { [&#34;a&#34;] = 1, [&#34;b&#34;]Lua | APIhttps://zfunnily.github.io/2021/05/settopandpop/Mon, 10 May 2021 15:57:03 +0800https://zfunnily.github.io/2021/05/settopandpop/lua_pop和lua_settop lua_settop 我们直接来看lua_settop,文档解释 /* 设置栈的高度,如果之前的栈顶比新设置的更高,那么高出来的元素会被丢弃,反之压入nil来补足大小 假设栈里有2个元素。 如果Lua | 解决百元买鸡的问题https://zfunnily.github.io/2021/02/chicken/Wed, 24 Feb 2021 17:51:46 +0000https://zfunnily.github.io/2021/02/chicken/问题 编写lua程序求解百鸡百钱问题。公鸡5元一只,母鸡3元一只,小鸡一元3只,问100元钱买100只鸡,可买公鸡、母鸡、小鸡各多少只? 代码 ----------------------------------------------------------------------------- --公鸡5元一只,母鸡3元一只,小鸡一元3只,问100元钱买Lua | 调用C/C++的动态库https://zfunnily.github.io/2021/02/dynamic/Sat, 20 Feb 2021 11:11:51 +0000https://zfunnily.github.io/2021/02/dynamic/概述 最近在学习 云风的skynet库,想自定义一个模块,目标是使用lua调用C/C++所编写的库。 当我们需要在Lua里面调用c/c++函数时,所有的函数都必须满足以下函数签名: typedef int (*lua_CFunction) (lua_State *L); 换句话说,所有的 \ No newline at end of file +编程.Lua on Zzz记忆https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.Lua/Recent content in 编程.Lua on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000A*算法 | Lua版本https://zfunnily.github.io/2021/12/astar/Thu, 23 Dec 2021 16:37:44 +0800https://zfunnily.github.io/2021/12/astar/A*算法思路 寻路步骤 从起点A开始, 把它作为待处理的方格存入一个&quot;开启列表&quot;, 开启列表就是一个等待检查方格的列表. 寻找起点A周围可以到达的方格, 将它们放入&quot;开启列表&quoLua | next的使用https://zfunnily.github.io/2021/05/lua_next/Mon, 10 May 2021 16:39:50 +0800https://zfunnily.github.io/2021/05/lua_next/lua_next lua_next(L,index):先把 表(lua栈 index所指的表), 的当前索引弹出,再把table 当前索引的值弹出,也就是先弹出 table的索引,再弹出table索引的值 举例: local t = { [&#34;a&#34;] = 1, [&#34;b&#34;]Lua | APIhttps://zfunnily.github.io/2021/05/settopandpop/Mon, 10 May 2021 15:57:03 +0800https://zfunnily.github.io/2021/05/settopandpop/lua_pop和lua_settop lua_settop 我们直接来看lua_settop,文档解释 /* 设置栈的高度,如果之前的栈顶比新设置的更高,那么高出来的元素会被丢弃,反之压入nil来补足大小 假设栈里有2个元素。 如果Lua | 解决百元买鸡的问题https://zfunnily.github.io/2021/02/chicken/Wed, 24 Feb 2021 17:51:46 +0000https://zfunnily.github.io/2021/02/chicken/问题 编写lua程序求解百鸡百钱问题。公鸡5元一只,母鸡3元一只,小鸡一元3只,问100元钱买100只鸡,可买公鸡、母鸡、小鸡各多少只? 代码 ----------------------------------------------------------------------------- --公鸡5元一只,母鸡3元一只,小鸡一元3只,问100元钱买Lua | 调用C/C++的动态库https://zfunnily.github.io/2021/02/dynamic/Sat, 20 Feb 2021 11:11:51 +0000https://zfunnily.github.io/2021/02/dynamic/概述 最近在学习 云风的skynet库,想自定义一个模块,目标是使用lua调用C/C++所编写的库。 当我们需要在Lua里面调用c/c++函数时,所有的函数都必须满足以下函数签名: typedef int (*lua_CFunction) (lua_State *L); 换句话说,所有的 \ No newline at end of file diff --git "a/categories/\347\274\226\347\250\213.P2P/index.xml" "b/categories/\347\274\226\347\250\213.P2P/index.xml" index 954b7304b..2b2793537 100644 --- "a/categories/\347\274\226\347\250\213.P2P/index.xml" +++ "b/categories/\347\274\226\347\250\213.P2P/index.xml" @@ -1 +1 @@ -编程.P2P on Zzz记忆https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.P2P/Recent content in 编程.P2P on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000Go-libp2p四 | 穿透NAThttps://zfunnily.github.io/2021/11/gop2pfour/Sun, 07 Nov 2021 15:49:46 +0800https://zfunnily.github.io/2021/11/gop2pfour/本文目的 上文Go-libp2p三 | relay例子已经分析过relay例子,并解释了两个节点如果通过中继服务进行通信。本文改造relay例子 并让这个服务做如下两件事: 交换两个节点的在交换机上的信息,帮助Go-libp2p三 | relay例子https://zfunnily.github.io/2021/10/gop2pthree/Sun, 31 Oct 2021 10:13:40 +0800https://zfunnily.github.io/2021/10/gop2pthree/我想做什么 chat和echo两个例子,说明了两个节点之间的通信需要两节点在同一个局域网内,或者有一个节点有公网。 如果我两个节点分别在两个NAT下面, 都在各自的局域网内,则需要有一个中继服务,这个服务做Go-libp2p二 | echo例子https://zfunnily.github.io/2021/10/gop2ptwo/Fri, 29 Oct 2021 11:15:42 +0800https://zfunnily.github.io/2021/10/gop2ptwo/go-libp2p的echo例子分析 进入目录go-libp2p/examples/echo/, 编译 go build 先看README.md, 可以了解到使用echo的方式: 终端B $ ./echo -l 3001 2021/10/28 11:25:33 I am /ip4/127.0.0.1/tcp/3001/p2p/QmTu8sxDi3fSjz9ZMvkAj3qA9YAoGskroEnyLz2ZvfTBhX 2021/10/28 11:25:33 listening for connections 2021/10/28 11:25:33 Now run &#34;./echoGo-libp2p一 | chat例子https://zfunnily.github.io/2021/10/gop2pone/Thu, 28 Oct 2021 14:40:02 +0800https://zfunnily.github.io/2021/10/gop2pone/代码下载 git clone https://github.com/libp2p/go-libp2p.git chat实例分析 进入目录go-libp2p/examples/chat/, 编译 go build 先看README.md, 可以了解到使用chat的方式 在节点 B $ ./chat -sp 3001 2021/10/28 11:01:25 Run &#39;./chat -d /ip4/127.0.0.1/tcp/3001/p2p/QmXgEXt4CiqmVmDhPPQnyVkoj3Bsx3Nggq57PPsk5tLNTs&#39; on another console. 2021/10/28 11:01:25 You can replace 127.0.0.1 with public IP \ No newline at end of file +编程.P2P on Zzz记忆https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.P2P/Recent content in 编程.P2P on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000Go-libp2p四 | 穿透NAThttps://zfunnily.github.io/2021/11/gop2pfour/Sun, 07 Nov 2021 15:49:46 +0800https://zfunnily.github.io/2021/11/gop2pfour/本文目的 上文Go-libp2p三 | relay例子已经分析过relay例子,并解释了两个节点如果通过中继服务进行通信。本文改造relay例子 并让这个服务做如下两件事: 交换两个节点的在交换机上的信息,帮助Go-libp2p三 | relay例子https://zfunnily.github.io/2021/10/gop2pthree/Sun, 31 Oct 2021 10:13:40 +0800https://zfunnily.github.io/2021/10/gop2pthree/我想做什么 chat和echo两个例子,说明了两个节点之间的通信需要两节点在同一个局域网内,或者有一个节点有公网。 如果我两个节点分别在两个NAT下面, 都在各自的局域网内,则需要有一个中继服务,这个服务做Go-libp2p二 | echo例子https://zfunnily.github.io/2021/10/gop2ptwo/Fri, 29 Oct 2021 11:15:42 +0800https://zfunnily.github.io/2021/10/gop2ptwo/go-libp2p的echo例子分析 进入目录go-libp2p/examples/echo/, 编译 go build 先看README.md, 可以了解到使用echo的方式: 终端B $ ./echo -l 3001 2021/10/28 11:25:33 I am /ip4/127.0.0.1/tcp/3001/p2p/QmTu8sxDi3fSjz9ZMvkAj3qA9YAoGskroEnyLz2ZvfTBhX 2021/10/28 11:25:33 listening for connections 2021/10/28 11:25:33 Now run &#34;./echoGo-libp2p一 | chat例子https://zfunnily.github.io/2021/10/gop2pone/Thu, 28 Oct 2021 14:40:02 +0800https://zfunnily.github.io/2021/10/gop2pone/代码下载 git clone https://github.com/libp2p/go-libp2p.git chat实例分析 进入目录go-libp2p/examples/chat/, 编译 go build 先看README.md, 可以了解到使用chat的方式 在节点 B $ ./chat -sp 3001 2021/10/28 11:01:25 Run &#39;./chat -d /ip4/127.0.0.1/tcp/3001/p2p/QmXgEXt4CiqmVmDhPPQnyVkoj3Bsx3Nggq57PPsk5tLNTs&#39; on another console. 2021/10/28 11:01:25 You can replace 127.0.0.1 with public IP \ No newline at end of file diff --git "a/categories/\347\274\226\347\250\213.Unity3D/index.xml" "b/categories/\347\274\226\347\250\213.Unity3D/index.xml" index 66a934a04..019442272 100644 --- "a/categories/\347\274\226\347\250\213.Unity3D/index.xml" +++ "b/categories/\347\274\226\347\250\213.Unity3D/index.xml" @@ -1 +1 @@ -编程.Unity3D on Zzz记忆https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.Unity3D/Recent content in 编程.Unity3D on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000Unity3D | Transform类https://zfunnily.github.io/2021/09/transform/Tue, 07 Sep 2021 15:55:59 +0800https://zfunnily.github.io/2021/09/transform/Transform类 在unity中,把transform类理解为,transform类是在每个对象生成时自动附加的一个类。在Unity的视图中,点击Hierarchy中的对象,就可以在InspectoUnity3D | UGUIhttps://zfunnily.github.io/2021/08/ugui/Fri, 20 Aug 2021 14:15:41 +0800https://zfunnily.github.io/2021/08/ugui/Text Text的属性 在 Unity 的 Hierarchy 面板上右键–&gt;UI–&gt;Text, 在 Inspector 面板上查看属性 属性 功能 Text 需要显示的文本 Font 显示文本的字体 如:微软雅黑,宋体等 Font Style 显示文本的样式,有普通,粗体,斜体,粗体和斜体四种 \ No newline at end of file +编程.Unity3D on Zzz记忆https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.Unity3D/Recent content in 编程.Unity3D on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000Unity3D | Transform类https://zfunnily.github.io/2021/09/transform/Tue, 07 Sep 2021 15:55:59 +0800https://zfunnily.github.io/2021/09/transform/Transform类 在unity中,把transform类理解为,transform类是在每个对象生成时自动附加的一个类。在Unity的视图中,点击Hierarchy中的对象,就可以在InspectoUnity3D | UGUIhttps://zfunnily.github.io/2021/08/ugui/Fri, 20 Aug 2021 14:15:41 +0800https://zfunnily.github.io/2021/08/ugui/Text Text的属性 在 Unity 的 Hierarchy 面板上右键–&gt;UI–&gt;Text, 在 Inspector 面板上查看属性 属性 功能 Text 需要显示的文本 Font 显示文本的字体 如:微软雅黑,宋体等 Font Style 显示文本的样式,有普通,粗体,斜体,粗体和斜体四种 \ No newline at end of file diff --git "a/categories/\347\274\226\347\250\213.UnityShader/index.xml" "b/categories/\347\274\226\347\250\213.UnityShader/index.xml" index d13282ba2..201b6765c 100644 --- "a/categories/\347\274\226\347\250\213.UnityShader/index.xml" +++ "b/categories/\347\274\226\347\250\213.UnityShader/index.xml" @@ -1 +1 @@ -编程.UnityShader on Zzz记忆https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.UnityShader/Recent content in 编程.UnityShader on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000URP 不透明/半透明物体的折射https://zfunnily.github.io/2022/05/refraction/Tue, 17 May 2022 11:30:48 +0800https://zfunnily.github.io/2022/05/refraction/折射 应用场景 水池 玻璃 热空气(热扭曲) GrabPass + CubeMap 《Unity3D Shader入门精要》第十章介绍了,模拟实现折射效果有两种 使用cubemap: 我认为太麻烦.需要的贴图太多。也没有找到其他合适的使用场景,遂搁URP 不透明/半透明物体的折射https://zfunnily.github.io/2022/05/refraction/Tue, 17 May 2022 11:30:48 +0800https://zfunnily.github.io/2022/05/refraction/折射 应用场景 水池 玻璃 热空气(热扭曲) GrabPass + CubeMap 《Unity3D Shader入门精要》第十章介绍了,模拟实现折射效果有两种 使用cubemap: 我认为太麻烦.需要的贴图太多。也没有找到其他合适的使用场景,遂搁《Unity Shader入门精要》第八章笔记 | 透明度https://zfunnily.github.io/2022/05/shaderalpha/Sat, 07 May 2022 17:17:18 +0800https://zfunnily.github.io/2022/05/shaderalpha/渲染顺序 名称 队列索引号 描 述 Background 1000 这个渲染队列会在任何其他队列之前被渲染,我们通常使用该队列来渲染那些需要绘制在背景上的物体 Geometry 2000 默认的渲染队列,大多数物体都使用这个队列。不透明物体使用这个队列 AlphaTest 2450 需要透明《Unity Shader入门精要》第八章笔记 | 透明度https://zfunnily.github.io/2022/05/shaderalpha/Sat, 07 May 2022 17:17:18 +0800https://zfunnily.github.io/2022/05/shaderalpha/渲染顺序 名称 队列索引号 描 述 Background 1000 这个渲染队列会在任何其他队列之前被渲染,我们通常使用该队列来渲染那些需要绘制在背景上的物体 Geometry 2000 默认的渲染队列,大多数物体都使用这个队列。不透明物体使用这个队列 AlphaTest 2450 需要透明《Unity Shader入门精要》第六章笔记 | 基础光照https://zfunnily.github.io/2022/05/shaderlighting/Sat, 07 May 2022 16:22:40 +0800https://zfunnily.github.io/2022/05/shaderlighting/我们是如何看到这个世界的 光源: 在光学里,我们使用辐照度 (irradiance) 来量化光 物体的吸收和散射: 光线由光源发射出来后,就会与一些物体相交 着色: 根据材质属性(如漫反射属性等)、光源信息(如光源方《Unity Shader入门精要》第六章笔记 | 基础光照https://zfunnily.github.io/2022/05/shaderlighting/Sat, 07 May 2022 16:22:40 +0800https://zfunnily.github.io/2022/05/shaderlighting/我们是如何看到这个世界的 光源: 在光学里,我们使用辐照度 (irradiance) 来量化光 物体的吸收和散射: 光线由光源发射出来后,就会与一些物体相交 着色: 根据材质属性(如漫反射属性等)、光源信息(如光源方《Unity Shader入门精要》第五章笔记 | 开始shader练习https://zfunnily.github.io/2022/05/shaderbase/Sat, 07 May 2022 10:22:33 +0800https://zfunnily.github.io/2022/05/shaderbase/一个简单的顶点/片元着色器 代码 Shader &#34;Unity Shaders Book/Chapter 5/Simple Shader&#34; { Properties { // 声明一个Color类型的属性 _Color (&#34;Color Tint&#34;, Color) = (1.0,1.0,1.0,1.0) } SubShader { Pass { CGPROGRAM #pragma vertex vert #pragma fragment frag // 在Cg代码中,我们需要定义一个与属性名称和类型都匹配的变量 fixed4 _Color; // 使用一个结构体来定义《Unity Shader入门精要》第五章笔记 | 开始shader练习https://zfunnily.github.io/2022/05/shaderbase/Sat, 07 May 2022 10:22:33 +0800https://zfunnily.github.io/2022/05/shaderbase/一个简单的顶点/片元着色器 代码 Shader &#34;Unity Shaders Book/Chapter 5/Simple Shader&#34; { Properties { // 声明一个Color类型的属性 _Color (&#34;Color Tint&#34;, Color) = (1.0,1.0,1.0,1.0) } SubShader { Pass { CGPROGRAM #pragma vertex vert #pragma fragment frag // 在Cg代码中,我们需要定义一个与属性名称和类型都匹配的变量 fixed4 _Color; // 使用一个结构体来定义MAC平台几何着色器不生效https://zfunnily.github.io/2022/05/geometry/Thu, 05 May 2022 16:49:29 +0800https://zfunnily.github.io/2022/05/geometry/问题 MAC平台几何着色器不生效 解决步骤 unity shaderlab 怎么设置以至于支持几何着色器 找原因,设置 编译目标级别,#pragma target 4.0, 不管用 看到一句话,Unity 在 Metal 图形上支持曲面细分着色器,但 Metal 不支持几何着色器 找到maMAC平台几何着色器不生效https://zfunnily.github.io/2022/05/geometry/Thu, 05 May 2022 16:49:29 +0800https://zfunnily.github.io/2022/05/geometry/问题 MAC平台几何着色器不生效 解决步骤 unity shaderlab 怎么设置以至于支持几何着色器 找原因,设置 编译目标级别,#pragma target 4.0, 不管用 看到一句话,Unity 在 Metal 图形上支持曲面细分着色器,但 Metal 不支持几何着色器 找到maShaderLab常用函数https://zfunnily.github.io/2022/04/shaderfunc/Wed, 20 Apr 2022 15:41:29 +0800https://zfunnily.github.io/2022/04/shaderfunc/数学函数 cg/hlsl函数 功能描述 dot(A,B) 点积, 点积结果为标量,主要用于求向量的夹角或b向量在a向量上的投影 cross(A,B) 叉积, 叉积结果为向量,结果与这两个向量组成的平面垂直。主要用于3D图形学 mul(M, N) 矩阵M和矩阵N的积 mul(M,ShaderLab常用函数https://zfunnily.github.io/2022/04/shaderfunc/Wed, 20 Apr 2022 15:41:29 +0800https://zfunnily.github.io/2022/04/shaderfunc/数学函数 cg/hlsl函数 功能描述 dot(A,B) 点积, 点积结果为标量,主要用于求向量的夹角或b向量在a向量上的投影 cross(A,B) 叉积, 叉积结果为向量,结果与这两个向量组成的平面垂直。主要用于3D图形学 mul(M, N) 矩阵M和矩阵N的积 mul(M,UnityCG.cginc中常用函数https://zfunnily.github.io/2022/04/cginc/Wed, 20 Apr 2022 15:35:49 +0800https://zfunnily.github.io/2022/04/cginc/摄像机方向 WorldSpaceViewDir 输入一个模型空间中的顶点坐标 -&gt; 输出(世界空间)从这个点到摄像机的观察方向; WorldSpaceViewDir // 内部实现也是用UnityWorldSpaceViewDir // Computes world space view direction, from object space position // *Legacy* Please use UnityWorldSpaceViewDir instead inline float3 WorldSpaceViewDir( in float4 localPos ) { float3 worldPosUnityCG.cginc中常用函数https://zfunnily.github.io/2022/04/cginc/Wed, 20 Apr 2022 15:35:49 +0800https://zfunnily.github.io/2022/04/cginc/摄像机方向 WorldSpaceViewDir 输入一个模型空间中的顶点坐标 -&gt; 输出(世界空间)从这个点到摄像机的观察方向; WorldSpaceViewDir // 内部实现也是用UnityWorldSpaceViewDir // Computes world space view direction, from object space position // *Legacy* Please use UnityWorldSpaceViewDir instead inline float3 WorldSpaceViewDir( in float4 localPos ) { float3 worldPos《Unity Shader入门精要》第四章笔记 | 学习Shader所需的数学基础https://zfunnily.github.io/2022/04/shadermathematic/Sun, 10 Apr 2022 15:42:33 +0800https://zfunnily.github.io/2022/04/shadermathematic/概述 在学习Shader的过程中,我们最常使用的就是矢量和矩阵(即数学的分支之一——线性代数)。 笛卡儿坐标系 我们使用数学绝大部分都是为了计算位置、距离和角度等变量。而这些计算大部分都是在笛卡儿坐标系 (C《Unity Shader入门精要》第四章笔记 | 学习Shader所需的数学基础https://zfunnily.github.io/2022/04/shadermathematic/Sun, 10 Apr 2022 15:42:33 +0800https://zfunnily.github.io/2022/04/shadermathematic/概述 在学习Shader的过程中,我们最常使用的就是矢量和矩阵(即数学的分支之一——线性代数)。 笛卡儿坐标系 我们使用数学绝大部分都是为了计算位置、距离和角度等变量。而这些计算大部分都是在笛卡儿坐标系 (C《Unity Shader入门精要》第三章笔记| UnityShader基础https://zfunnily.github.io/2022/04/shaderbase/Sun, 10 Apr 2022 14:51:19 +0800https://zfunnily.github.io/2022/04/shaderbase/材质 在Unity中我们需要配合使用材质 (Material) 和Unity Shader才能达到需要的效果。一个最常见的流程是 创建一个材质;活着导入一个材质 创建一个Unity Shader,并把它赋给上一步中《Unity Shader入门精要》第三章笔记| UnityShader基础https://zfunnily.github.io/2022/04/shaderbase/Sun, 10 Apr 2022 14:51:19 +0800https://zfunnily.github.io/2022/04/shaderbase/材质 在Unity中我们需要配合使用材质 (Material) 和Unity Shader才能达到需要的效果。一个最常见的流程是 创建一个材质;活着导入一个材质 创建一个Unity Shader,并把它赋给上一步中《Unity Shader入门精要》第二章笔记 | 渲染流水线https://zfunnily.github.io/2022/04/shaderrenderpipline/Sat, 09 Apr 2022 11:55:55 +0800https://zfunnily.github.io/2022/04/shaderrenderpipline/渲染流水线 Render-Time Rendering, Third Edition》一书中将一个渲染流程分成3个阶段:应用阶段(Application Stage) 、几何阶段(Geometry Stage) 、光栅化阶段(Rasterizer Stage) 。 应《Unity Shader入门精要》第二章笔记 | 渲染流水线https://zfunnily.github.io/2022/04/shaderrenderpipline/Sat, 09 Apr 2022 11:55:55 +0800https://zfunnily.github.io/2022/04/shaderrenderpipline/渲染流水线 Render-Time Rendering, Third Edition》一书中将一个渲染流程分成3个阶段:应用阶段(Application Stage) 、几何阶段(Geometry Stage) 、光栅化阶段(Rasterizer Stage) 。 应shader初尝试 | 给石头覆盖一层雪景(Hello World)https://zfunnily.github.io/2022/04/shaderhelloworld/Sat, 09 Apr 2022 10:34:56 +0800https://zfunnily.github.io/2022/04/shaderhelloworld/给石头覆盖一层雪景 资源准备 石头模型 Unity2021.2.3f1c1 Mac &amp; Windows 在Unity中创建一个项目,导入石头模型,下面就开始利用shader给石头做一个雪景覆盖. 实现效果 未覆盖雪景的样子 覆盖了雪景的样子 开始代码 我在代码中标注了1,shader初尝试 | 给石头覆盖一层雪景(Hello World)https://zfunnily.github.io/2022/04/shaderhelloworld/Sat, 09 Apr 2022 10:34:56 +0800https://zfunnily.github.io/2022/04/shaderhelloworld/给石头覆盖一层雪景 资源准备 石头模型 Unity2021.2.3f1c1 Mac &amp; Windows 在Unity中创建一个项目,导入石头模型,下面就开始利用shader给石头做一个雪景覆盖. 实现效果 未覆盖雪景的样子 覆盖了雪景的样子 开始代码 我在代码中标注了1,UnityShader基本概念https://zfunnily.github.io/2022/04/shader01/Wed, 06 Apr 2022 11:54:02 +0800https://zfunnily.github.io/2022/04/shader01/何为shader shader中文翻译为着色器,其实是一种用来渲染图形的技术,我们可以通过shader编程,来自定义显卡渲染画面的算法,显示我们所期望的结果。 shader种类 顶点着色器: 处理每个顶点,将UnityShader基本概念https://zfunnily.github.io/2022/04/shader01/Wed, 06 Apr 2022 11:54:02 +0800https://zfunnily.github.io/2022/04/shader01/何为shader shader中文翻译为着色器,其实是一种用来渲染图形的技术,我们可以通过shader编程,来自定义显卡渲染画面的算法,显示我们所期望的结果。 shader种类 顶点着色器: 处理每个顶点,将 \ No newline at end of file +编程.UnityShader on Zzz记忆https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.UnityShader/Recent content in 编程.UnityShader on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000URP 不透明/半透明物体的折射https://zfunnily.github.io/2022/05/refraction/Tue, 17 May 2022 11:30:48 +0800https://zfunnily.github.io/2022/05/refraction/折射 应用场景 水池 玻璃 热空气(热扭曲) GrabPass + CubeMap 《Unity3D Shader入门精要》第十章介绍了,模拟实现折射效果有两种 使用cubemap: 我认为太麻烦.需要的贴图太多。也没有找到其他合适的使用场景,遂搁URP 不透明/半透明物体的折射https://zfunnily.github.io/2022/05/refraction/Tue, 17 May 2022 11:30:48 +0800https://zfunnily.github.io/2022/05/refraction/折射 应用场景 水池 玻璃 热空气(热扭曲) GrabPass + CubeMap 《Unity3D Shader入门精要》第十章介绍了,模拟实现折射效果有两种 使用cubemap: 我认为太麻烦.需要的贴图太多。也没有找到其他合适的使用场景,遂搁《Unity Shader入门精要》第八章笔记 | 透明度https://zfunnily.github.io/2022/05/shaderalpha/Sat, 07 May 2022 17:17:18 +0800https://zfunnily.github.io/2022/05/shaderalpha/渲染顺序 名称 队列索引号 描 述 Background 1000 这个渲染队列会在任何其他队列之前被渲染,我们通常使用该队列来渲染那些需要绘制在背景上的物体 Geometry 2000 默认的渲染队列,大多数物体都使用这个队列。不透明物体使用这个队列 AlphaTest 2450 需要透明《Unity Shader入门精要》第八章笔记 | 透明度https://zfunnily.github.io/2022/05/shaderalpha/Sat, 07 May 2022 17:17:18 +0800https://zfunnily.github.io/2022/05/shaderalpha/渲染顺序 名称 队列索引号 描 述 Background 1000 这个渲染队列会在任何其他队列之前被渲染,我们通常使用该队列来渲染那些需要绘制在背景上的物体 Geometry 2000 默认的渲染队列,大多数物体都使用这个队列。不透明物体使用这个队列 AlphaTest 2450 需要透明《Unity Shader入门精要》第六章笔记 | 基础光照https://zfunnily.github.io/2022/05/shaderlighting/Sat, 07 May 2022 16:22:40 +0800https://zfunnily.github.io/2022/05/shaderlighting/我们是如何看到这个世界的 光源: 在光学里,我们使用辐照度 (irradiance) 来量化光 物体的吸收和散射: 光线由光源发射出来后,就会与一些物体相交 着色: 根据材质属性(如漫反射属性等)、光源信息(如光源方《Unity Shader入门精要》第六章笔记 | 基础光照https://zfunnily.github.io/2022/05/shaderlighting/Sat, 07 May 2022 16:22:40 +0800https://zfunnily.github.io/2022/05/shaderlighting/我们是如何看到这个世界的 光源: 在光学里,我们使用辐照度 (irradiance) 来量化光 物体的吸收和散射: 光线由光源发射出来后,就会与一些物体相交 着色: 根据材质属性(如漫反射属性等)、光源信息(如光源方《Unity Shader入门精要》第五章笔记 | 开始shader练习https://zfunnily.github.io/2022/05/shaderbase/Sat, 07 May 2022 10:22:33 +0800https://zfunnily.github.io/2022/05/shaderbase/一个简单的顶点/片元着色器 代码 Shader &#34;Unity Shaders Book/Chapter 5/Simple Shader&#34; { Properties { // 声明一个Color类型的属性 _Color (&#34;Color Tint&#34;, Color) = (1.0,1.0,1.0,1.0) } SubShader { Pass { CGPROGRAM #pragma vertex vert #pragma fragment frag // 在Cg代码中,我们需要定义一个与属性名称和类型都匹配的变量 fixed4 _Color; // 使用一个结构体来定义《Unity Shader入门精要》第五章笔记 | 开始shader练习https://zfunnily.github.io/2022/05/shaderbase/Sat, 07 May 2022 10:22:33 +0800https://zfunnily.github.io/2022/05/shaderbase/一个简单的顶点/片元着色器 代码 Shader &#34;Unity Shaders Book/Chapter 5/Simple Shader&#34; { Properties { // 声明一个Color类型的属性 _Color (&#34;Color Tint&#34;, Color) = (1.0,1.0,1.0,1.0) } SubShader { Pass { CGPROGRAM #pragma vertex vert #pragma fragment frag // 在Cg代码中,我们需要定义一个与属性名称和类型都匹配的变量 fixed4 _Color; // 使用一个结构体来定义MAC平台几何着色器不生效https://zfunnily.github.io/2022/05/geometry/Thu, 05 May 2022 16:49:29 +0800https://zfunnily.github.io/2022/05/geometry/问题 MAC平台几何着色器不生效 解决步骤 unity shaderlab 怎么设置以至于支持几何着色器 找原因,设置 编译目标级别,#pragma target 4.0, 不管用 看到一句话,Unity 在 Metal 图形上支持曲面细分着色器,但 Metal 不支持几何着色器 找到maMAC平台几何着色器不生效https://zfunnily.github.io/2022/05/geometry/Thu, 05 May 2022 16:49:29 +0800https://zfunnily.github.io/2022/05/geometry/问题 MAC平台几何着色器不生效 解决步骤 unity shaderlab 怎么设置以至于支持几何着色器 找原因,设置 编译目标级别,#pragma target 4.0, 不管用 看到一句话,Unity 在 Metal 图形上支持曲面细分着色器,但 Metal 不支持几何着色器 找到maShaderLab常用函数https://zfunnily.github.io/2022/04/shaderfunc/Wed, 20 Apr 2022 15:41:29 +0800https://zfunnily.github.io/2022/04/shaderfunc/数学函数 cg/hlsl函数 功能描述 dot(A,B) 点积, 点积结果为标量,主要用于求向量的夹角或b向量在a向量上的投影 cross(A,B) 叉积, 叉积结果为向量,结果与这两个向量组成的平面垂直。主要用于3D图形学 mul(M, N) 矩阵M和矩阵N的积 mul(M,ShaderLab常用函数https://zfunnily.github.io/2022/04/shaderfunc/Wed, 20 Apr 2022 15:41:29 +0800https://zfunnily.github.io/2022/04/shaderfunc/数学函数 cg/hlsl函数 功能描述 dot(A,B) 点积, 点积结果为标量,主要用于求向量的夹角或b向量在a向量上的投影 cross(A,B) 叉积, 叉积结果为向量,结果与这两个向量组成的平面垂直。主要用于3D图形学 mul(M, N) 矩阵M和矩阵N的积 mul(M,UnityCG.cginc中常用函数https://zfunnily.github.io/2022/04/cginc/Wed, 20 Apr 2022 15:35:49 +0800https://zfunnily.github.io/2022/04/cginc/摄像机方向 WorldSpaceViewDir 输入一个模型空间中的顶点坐标 -&gt; 输出(世界空间)从这个点到摄像机的观察方向; WorldSpaceViewDir // 内部实现也是用UnityWorldSpaceViewDir // Computes world space view direction, from object space position // *Legacy* Please use UnityWorldSpaceViewDir instead inline float3 WorldSpaceViewDir( in float4 localPos ) { float3 worldPosUnityCG.cginc中常用函数https://zfunnily.github.io/2022/04/cginc/Wed, 20 Apr 2022 15:35:49 +0800https://zfunnily.github.io/2022/04/cginc/摄像机方向 WorldSpaceViewDir 输入一个模型空间中的顶点坐标 -&gt; 输出(世界空间)从这个点到摄像机的观察方向; WorldSpaceViewDir // 内部实现也是用UnityWorldSpaceViewDir // Computes world space view direction, from object space position // *Legacy* Please use UnityWorldSpaceViewDir instead inline float3 WorldSpaceViewDir( in float4 localPos ) { float3 worldPos《Unity Shader入门精要》第四章笔记 | 学习Shader所需的数学基础https://zfunnily.github.io/2022/04/shadermathematic/Sun, 10 Apr 2022 15:42:33 +0800https://zfunnily.github.io/2022/04/shadermathematic/概述 在学习Shader的过程中,我们最常使用的就是矢量和矩阵(即数学的分支之一——线性代数)。 笛卡儿坐标系 我们使用数学绝大部分都是为了计算位置、距离和角度等变量。而这些计算大部分都是在笛卡儿坐标系 (C《Unity Shader入门精要》第四章笔记 | 学习Shader所需的数学基础https://zfunnily.github.io/2022/04/shadermathematic/Sun, 10 Apr 2022 15:42:33 +0800https://zfunnily.github.io/2022/04/shadermathematic/概述 在学习Shader的过程中,我们最常使用的就是矢量和矩阵(即数学的分支之一——线性代数)。 笛卡儿坐标系 我们使用数学绝大部分都是为了计算位置、距离和角度等变量。而这些计算大部分都是在笛卡儿坐标系 (C《Unity Shader入门精要》第三章笔记| UnityShader基础https://zfunnily.github.io/2022/04/shaderbase/Sun, 10 Apr 2022 14:51:19 +0800https://zfunnily.github.io/2022/04/shaderbase/材质 在Unity中我们需要配合使用材质 (Material) 和Unity Shader才能达到需要的效果。一个最常见的流程是 创建一个材质;活着导入一个材质 创建一个Unity Shader,并把它赋给上一步中《Unity Shader入门精要》第三章笔记| UnityShader基础https://zfunnily.github.io/2022/04/shaderbase/Sun, 10 Apr 2022 14:51:19 +0800https://zfunnily.github.io/2022/04/shaderbase/材质 在Unity中我们需要配合使用材质 (Material) 和Unity Shader才能达到需要的效果。一个最常见的流程是 创建一个材质;活着导入一个材质 创建一个Unity Shader,并把它赋给上一步中《Unity Shader入门精要》第二章笔记 | 渲染流水线https://zfunnily.github.io/2022/04/shaderrenderpipline/Sat, 09 Apr 2022 11:55:55 +0800https://zfunnily.github.io/2022/04/shaderrenderpipline/渲染流水线 Render-Time Rendering, Third Edition》一书中将一个渲染流程分成3个阶段:应用阶段(Application Stage) 、几何阶段(Geometry Stage) 、光栅化阶段(Rasterizer Stage) 。 应《Unity Shader入门精要》第二章笔记 | 渲染流水线https://zfunnily.github.io/2022/04/shaderrenderpipline/Sat, 09 Apr 2022 11:55:55 +0800https://zfunnily.github.io/2022/04/shaderrenderpipline/渲染流水线 Render-Time Rendering, Third Edition》一书中将一个渲染流程分成3个阶段:应用阶段(Application Stage) 、几何阶段(Geometry Stage) 、光栅化阶段(Rasterizer Stage) 。 应shader初尝试 | 给石头覆盖一层雪景(Hello World)https://zfunnily.github.io/2022/04/shaderhelloworld/Sat, 09 Apr 2022 10:34:56 +0800https://zfunnily.github.io/2022/04/shaderhelloworld/给石头覆盖一层雪景 资源准备 石头模型 Unity2021.2.3f1c1 Mac &amp; Windows 在Unity中创建一个项目,导入石头模型,下面就开始利用shader给石头做一个雪景覆盖. 实现效果 未覆盖雪景的样子 覆盖了雪景的样子 开始代码 我在代码中标注了1,shader初尝试 | 给石头覆盖一层雪景(Hello World)https://zfunnily.github.io/2022/04/shaderhelloworld/Sat, 09 Apr 2022 10:34:56 +0800https://zfunnily.github.io/2022/04/shaderhelloworld/给石头覆盖一层雪景 资源准备 石头模型 Unity2021.2.3f1c1 Mac &amp; Windows 在Unity中创建一个项目,导入石头模型,下面就开始利用shader给石头做一个雪景覆盖. 实现效果 未覆盖雪景的样子 覆盖了雪景的样子 开始代码 我在代码中标注了1,UnityShader基本概念https://zfunnily.github.io/2022/04/shader01/Wed, 06 Apr 2022 11:54:02 +0800https://zfunnily.github.io/2022/04/shader01/何为shader shader中文翻译为着色器,其实是一种用来渲染图形的技术,我们可以通过shader编程,来自定义显卡渲染画面的算法,显示我们所期望的结果。 shader种类 顶点着色器: 处理每个顶点,将UnityShader基本概念https://zfunnily.github.io/2022/04/shader01/Wed, 06 Apr 2022 11:54:02 +0800https://zfunnily.github.io/2022/04/shader01/何为shader shader中文翻译为着色器,其实是一种用来渲染图形的技术,我们可以通过shader编程,来自定义显卡渲染画面的算法,显示我们所期望的结果。 shader种类 顶点着色器: 处理每个顶点,将 \ No newline at end of file diff --git "a/categories/\347\274\226\347\250\213.Unity\347\262\222\345\255\220\347\263\273\347\273\237/index.xml" "b/categories/\347\274\226\347\250\213.Unity\347\262\222\345\255\220\347\263\273\347\273\237/index.xml" index 847c75372..f023981d2 100644 --- "a/categories/\347\274\226\347\250\213.Unity\347\262\222\345\255\220\347\263\273\347\273\237/index.xml" +++ "b/categories/\347\274\226\347\250\213.Unity\347\262\222\345\255\220\347\263\273\347\273\237/index.xml" @@ -1 +1 @@ -编程.Unity粒子系统 on Zzz记忆https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.Unity%E7%B2%92%E5%AD%90%E7%B3%BB%E7%BB%9F/Recent content in 编程.Unity粒子系统 on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000粒子系统01-概述https://zfunnily.github.io/2023/05/particlesystem01/Wed, 24 May 2023 11:21:34 +0800https://zfunnily.github.io/2023/05/particlesystem01/参考视频 参考播客 一、两种解决方案 区别 Particle System(内置粒子系统) Visual Effect Graph(VFX Graph) 基于XX运行 CPU GPU 粒子数量 数千 数百万 渲染管线 支持全部渲染管线 不支持内置渲染管线 物理系统 可与Unity物理系统交互 特定元素交互 创作 \ No newline at end of file +编程.Unity粒子系统 on Zzz记忆https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.Unity%E7%B2%92%E5%AD%90%E7%B3%BB%E7%BB%9F/Recent content in 编程.Unity粒子系统 on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000粒子系统01-概述https://zfunnily.github.io/2023/05/particlesystem01/Wed, 24 May 2023 11:21:34 +0800https://zfunnily.github.io/2023/05/particlesystem01/参考视频 参考播客 一、两种解决方案 区别 Particle System(内置粒子系统) Visual Effect Graph(VFX Graph) 基于XX运行 CPU GPU 粒子数量 数千 数百万 渲染管线 支持全部渲染管线 不支持内置渲染管线 物理系统 可与Unity物理系统交互 特定元素交互 创作 \ No newline at end of file diff --git "a/categories/\347\274\226\347\250\213.\345\233\276\345\275\242\345\255\246\345\205\245\351\227\250/index.xml" "b/categories/\347\274\226\347\250\213.\345\233\276\345\275\242\345\255\246\345\205\245\351\227\250/index.xml" index 26a265ac1..84261e02d 100644 --- "a/categories/\347\274\226\347\250\213.\345\233\276\345\275\242\345\255\246\345\205\245\351\227\250/index.xml" +++ "b/categories/\347\274\226\347\250\213.\345\233\276\345\275\242\345\255\246\345\205\245\351\227\250/index.xml" @@ -1 +1 @@ -编程.图形学入门 on Zzz记忆https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E5%9B%BE%E5%BD%A2%E5%AD%A6%E5%85%A5%E9%97%A8/Recent content in 编程.图形学入门 on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000Graphicshttps://zfunnily.github.io/2022/04/graphics/Mon, 04 Apr 2022 21:48:09 +0800https://zfunnily.github.io/2022/04/graphics/Last Lecture What is Computer Graphics? Why study Computer Graphics? Course Topics Course Logistics Graphics&rsquo;s Dependencies Basic mathematics Liner algebra, calculus, statistics. Basic physics Optics, Mechanics Misc Signal processing Numerical analysis 线性代数 Dot(scalar) Product Cross (vector) Product 向量之间的乘积不符合交换定律。 Cross product: Properties 右手螺旋定则 Cross product: Cartesian Formula Cross product in Graphics 判断左右 判断内外 判断向量b在向量a的左边 右手螺旋法则 向量Graphicshttps://zfunnily.github.io/2022/04/graphics/Mon, 04 Apr 2022 21:48:09 +0800https://zfunnily.github.io/2022/04/graphics/Last Lecture What is Computer Graphics? Why study Computer Graphics? Course Topics Course Logistics Graphics&rsquo;s Dependencies Basic mathematics Liner algebra, calculus, statistics. Basic physics Optics, Mechanics Misc Signal processing Numerical analysis 线性代数 Dot(scalar) Product Cross (vector) Product 向量之间的乘积不符合交换定律。 Cross product: Properties 右手螺旋定则 Cross product: Cartesian Formula Cross product in Graphics 判断左右 判断内外 判断向量b在向量a的左边 右手螺旋法则 向量 \ No newline at end of file +编程.图形学入门 on Zzz记忆https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E5%9B%BE%E5%BD%A2%E5%AD%A6%E5%85%A5%E9%97%A8/Recent content in 编程.图形学入门 on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000Graphicshttps://zfunnily.github.io/2022/04/graphics/Mon, 04 Apr 2022 21:48:09 +0800https://zfunnily.github.io/2022/04/graphics/Last Lecture What is Computer Graphics? Why study Computer Graphics? Course Topics Course Logistics Graphics&rsquo;s Dependencies Basic mathematics Liner algebra, calculus, statistics. Basic physics Optics, Mechanics Misc Signal processing Numerical analysis 线性代数 Dot(scalar) Product Cross (vector) Product 向量之间的乘积不符合交换定律。 Cross product: Properties 右手螺旋定则 Cross product: Cartesian Formula Cross product in Graphics 判断左右 判断内外 判断向量b在向量a的左边 右手螺旋法则 向量Graphicshttps://zfunnily.github.io/2022/04/graphics/Mon, 04 Apr 2022 21:48:09 +0800https://zfunnily.github.io/2022/04/graphics/Last Lecture What is Computer Graphics? Why study Computer Graphics? Course Topics Course Logistics Graphics&rsquo;s Dependencies Basic mathematics Liner algebra, calculus, statistics. Basic physics Optics, Mechanics Misc Signal processing Numerical analysis 线性代数 Dot(scalar) Product Cross (vector) Product 向量之间的乘积不符合交换定律。 Cross product: Properties 右手螺旋定则 Cross product: Cartesian Formula Cross product in Graphics 判断左右 判断内外 判断向量b在向量a的左边 右手螺旋法则 向量 \ No newline at end of file diff --git "a/categories/\347\274\226\347\250\213.\346\261\207\347\274\226/index.xml" "b/categories/\347\274\226\347\250\213.\346\261\207\347\274\226/index.xml" index c8200c4d8..2d5f0808d 100644 --- "a/categories/\347\274\226\347\250\213.\346\261\207\347\274\226/index.xml" +++ "b/categories/\347\274\226\347\250\213.\346\261\207\347\274\226/index.xml" @@ -1 +1 @@ -编程.汇编 on Zzz记忆https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E6%B1%87%E7%BC%96/Recent content in 编程.汇编 on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000汇编 | C/C++调用汇编https://zfunnily.github.io/2021/02/compilation/Mon, 01 Feb 2021 14:40:51 +0000https://zfunnily.github.io/2021/02/compilation/概述 我使用AT&amp;T的规范,在linux上完成 C和汇编的互相调用,并使用gcc编译成可执行文件。 目标:汇编函数提供输出。类似C语言的函数 void hello_world(char* value) { printf(value); } 提供给C语言调用: int main() { hello_world(&#34;hello world!\n&#34;); } 搭建AT&amp汇编 | AT&T和Intel规范的区别https://zfunnily.github.io/2021/01/attandintel/Sun, 31 Jan 2021 11:25:39 +0000https://zfunnily.github.io/2021/01/attandintel/概述 常见的指令集以及汇编语言规范: x86(IA-32)、x86-64指令集(常见于PC端),对应有2家公司发布的不同汇编语言规范: intel公司发布的汇编语言规范,称intel 汇编:Windows派系 \ No newline at end of file +编程.汇编 on Zzz记忆https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E6%B1%87%E7%BC%96/Recent content in 编程.汇编 on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000汇编 | C/C++调用汇编https://zfunnily.github.io/2021/02/compilation/Mon, 01 Feb 2021 14:40:51 +0000https://zfunnily.github.io/2021/02/compilation/概述 我使用AT&amp;T的规范,在linux上完成 C和汇编的互相调用,并使用gcc编译成可执行文件。 目标:汇编函数提供输出。类似C语言的函数 void hello_world(char* value) { printf(value); } 提供给C语言调用: int main() { hello_world(&#34;hello world!\n&#34;); } 搭建AT&amp汇编 | AT&T和Intel规范的区别https://zfunnily.github.io/2021/01/attandintel/Sun, 31 Jan 2021 11:25:39 +0000https://zfunnily.github.io/2021/01/attandintel/概述 常见的指令集以及汇编语言规范: x86(IA-32)、x86-64指令集(常见于PC端),对应有2家公司发布的不同汇编语言规范: intel公司发布的汇编语言规范,称intel 汇编:Windows派系 \ No newline at end of file diff --git "a/categories/\347\274\226\347\250\213.\346\270\270\346\210\217\345\274\200\345\217\221/index.xml" "b/categories/\347\274\226\347\250\213.\346\270\270\346\210\217\345\274\200\345\217\221/index.xml" index 8cfb4df1d..78966297c 100644 --- "a/categories/\347\274\226\347\250\213.\346\270\270\346\210\217\345\274\200\345\217\221/index.xml" +++ "b/categories/\347\274\226\347\250\213.\346\270\270\346\210\217\345\274\200\345\217\221/index.xml" @@ -1 +1 @@ -编程.游戏开发 on Zzz记忆https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E6%B8%B8%E6%88%8F%E5%BC%80%E5%8F%91/Recent content in 编程.游戏开发 on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000抽卡逻辑自述https://zfunnily.github.io/2022/03/afk/Wed, 30 Mar 2022 10:50:11 +0800https://zfunnily.github.io/2022/03/afk/抽卡逻辑自述 参考《剑与远征》 卡牌颜色以及合成 颜色 合成 绿色 可分解,得到粉尘和银瓜子, 最基础的卡 蓝 蓝+ 同样的三张蓝色可合成一张蓝+ 紫 同种族的三张蓝+可以合成一张紫(可以选择合成其中蓝+的某个紫色) 紫+ 同英抽卡逻辑自述https://zfunnily.github.io/2022/03/afk/Wed, 30 Mar 2022 10:50:11 +0800https://zfunnily.github.io/2022/03/afk/抽卡逻辑自述 参考《剑与远征》 卡牌颜色以及合成 颜色 合成 绿色 可分解,得到粉尘和银瓜子, 最基础的卡 蓝 蓝+ 同样的三张蓝色可合成一张蓝+ 紫 同种族的三张蓝+可以合成一张紫(可以选择合成其中蓝+的某个紫色) 紫+ 同英层级时间轮 | skynet 定时器https://zfunnily.github.io/2022/03/timerskynet/Sun, 27 Mar 2022 12:39:12 +0800https://zfunnily.github.io/2022/03/timerskynet/skynet定时器 要解析一个程序代码,先了解数据结构,这是基础,再看函数。 拿skynet定时器举例子。 数据结构 //定时器事件 用于抛出定时器事件到消息队列里。理解这个数据结构需要先了解skynet的框架层级时间轮 | skynet 定时器https://zfunnily.github.io/2022/03/timerskynet/Sun, 27 Mar 2022 12:39:12 +0800https://zfunnily.github.io/2022/03/timerskynet/skynet定时器 要解析一个程序代码,先了解数据结构,这是基础,再看函数。 拿skynet定时器举例子。 数据结构 //定时器事件 用于抛出定时器事件到消息队列里。理解这个数据结构需要先了解skynet的框架A*算法 | Lua版本https://zfunnily.github.io/2021/12/astar/Thu, 23 Dec 2021 16:37:44 +0800https://zfunnily.github.io/2021/12/astar/A*算法思路 寻路步骤 从起点A开始, 把它作为待处理的方格存入一个&quot;开启列表&quot;, 开启列表就是一个等待检查方格的列表. 寻找起点A周围可以到达的方格, 将它们放入&quot;开启列表&quoSkynet源码赏析三 | 服务启动https://zfunnily.github.io/2021/10/skynetthree/Wed, 20 Oct 2021 11:26:07 +0800https://zfunnily.github.io/2021/10/skynetthree/skynet启动一个C服务 查看怎么启动C服务的最好的办法是打断点,看源码。 启动logger日志服务 我拿日志服务来举例子,怎么启动日志服务的呢? 传参数name = &quot;logger&quot;, param = null, struct skynet_context *ctx = skynet_context_new(config-&gt;logservice, config-&gt;logger);; 从moduleSkynet源码赏析二 | 基础数据结构https://zfunnily.github.io/2021/10/skynettwo/Tue, 19 Oct 2021 18:47:45 +0800https://zfunnily.github.io/2021/10/skynettwo/module管理模块 我们所写的C服务编译成.so文件后放在cpath变量路径下,程序会加载路径cpath = root..&quot;cservice/?.so&quot;下的.so文件,通过staticSkynet源码赏析一 | 启动初始化的过程https://zfunnily.github.io/2021/10/skynetone/Tue, 19 Oct 2021 17:28:45 +0800https://zfunnily.github.io/2021/10/skynetone/入口文件 skynet_main.c 加载配置 struct skynet_config config; config.thread = optint(&#34;thread&#34;,8); config.module_path = optstring(&#34;cpath&#34;,&#34;./cservice/?.so&#34;); config.harbor = optint(&#34;harbor&#34;, 1); config.bootstrap = optstring(&#34;bootstrap&#34;,&#34;snlua bootstrap&#34;); config.daemon = optstring(&#34;daemon&#34;, NULL); config.logger = optstring(&#34;logger&#34;, NULL); config.logservice = optstring(&#34;logservice&#34;, &#34;logger&#34;); config.profile = optboolean(&#34;profile&#34;, 1); 从上述代码可以看到,配置都已经加载到变量struct skynet_config config;中了。 初始化 初始化skynet_context管FPS游戏 | 实现移动功能https://zfunnily.github.io/2021/09/move/Sun, 12 Sep 2021 20:43:34 +0800https://zfunnily.github.io/2021/09/move/三种实现FPS Controller的区别 Transform Translate 允许移动物理,但无物理碰撞 Rigid body + Capsule Collider 符合物理学 不会鬼穿墙 无法滞空运动 可与Physics Object 交互 Charactor Controller 不会鬼穿墙 提供的API相对多 无法与Physic objects《仙剑奇侠传》编译运行https://zfunnily.github.io/2021/03/gamexian/Sun, 21 Mar 2021 10:44:58 +0000https://zfunnily.github.io/2021/03/gamexian/概述 今天在github上找到了《仙剑奇侠传》的rpg单机游戏sdlpal,sdlpal 是一个开源项目,基于sdl把仙剑奇侠传重写了一遍。 下面是我的编译过程总结。 环境 win10- sdl1.2- sdlpal- vs2017- DirectX SDK10 下载sdlpal $ git clone https://github.com.cnpmjs.org/sdlpal/sdlpal.gitLastbattle | 游戏场景服务器SS解析https://zfunnily.github.io/2021/01/lastbattle/Sat, 02 Jan 2021 23:19:58 +0000https://zfunnily.github.io/2021/01/lastbattle/游戏场景服务器概况 指令对应的处理handle的文件:SSBattleMgr.cpp 创建战场 指令: eMsgToSSFromCS_CreateBattle GC服务器发往SS fromCS 收到中心服务器CS创建站场的指令,在函数INT32 CSSBattleMgr::OnMsgFromCS_CreateBattle(const char* pData, int n32DataLengtLastBattle | 登录流程(LS & BS & GS)https://zfunnily.github.io/2020/11/lastbattlelogin/Fri, 20 Nov 2020 17:27:08 +0000https://zfunnily.github.io/2020/11/lastbattlelogin/登录流程 根据上一篇文章中的登录流程,我在工程中找到了相应的代码并记录了下来 登录服务代码解析 监听端口:49997 供BS服务连接 监听端口:49996 供客户端连接 CIocpCtrl:IOCP控制类 多线程循环LastBattle | 服务架构https://zfunnily.github.io/2020/11/lastbattleserver/Fri, 20 Nov 2020 17:24:32 +0000https://zfunnily.github.io/2020/11/lastbattleserver/服务器架构简图如下: 连线说明: 实线:表示客户端登录流程,①②③④⑤表示登录流程,详细解释见下文。 虚线:表示服务器间的连接,虚线箭头指向监听方。 架构说明: |英文名称|简称|中文名称|功能简介|单个大区需LastBattle | 安装部署笔记https://zfunnily.github.io/2020/11/lastbattleone/Mon, 16 Nov 2020 06:49:49 +0000https://zfunnily.github.io/2020/11/lastbattleone/环境准备 win10 服务器:vs2010 / 数据库 mysql5.7 清华大学mysql镜像网站:https://mirrors.tuna.tsinghua.edu.cn/mysql/downloads/MySQL-5.7/ 客户端 \ No newline at end of file +编程.游戏开发 on Zzz记忆https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E6%B8%B8%E6%88%8F%E5%BC%80%E5%8F%91/Recent content in 编程.游戏开发 on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000抽卡逻辑自述https://zfunnily.github.io/2022/03/afk/Wed, 30 Mar 2022 10:50:11 +0800https://zfunnily.github.io/2022/03/afk/抽卡逻辑自述 参考《剑与远征》 卡牌颜色以及合成 颜色 合成 绿色 可分解,得到粉尘和银瓜子, 最基础的卡 蓝 蓝+ 同样的三张蓝色可合成一张蓝+ 紫 同种族的三张蓝+可以合成一张紫(可以选择合成其中蓝+的某个紫色) 紫+ 同英抽卡逻辑自述https://zfunnily.github.io/2022/03/afk/Wed, 30 Mar 2022 10:50:11 +0800https://zfunnily.github.io/2022/03/afk/抽卡逻辑自述 参考《剑与远征》 卡牌颜色以及合成 颜色 合成 绿色 可分解,得到粉尘和银瓜子, 最基础的卡 蓝 蓝+ 同样的三张蓝色可合成一张蓝+ 紫 同种族的三张蓝+可以合成一张紫(可以选择合成其中蓝+的某个紫色) 紫+ 同英层级时间轮 | skynet 定时器https://zfunnily.github.io/2022/03/timerskynet/Sun, 27 Mar 2022 12:39:12 +0800https://zfunnily.github.io/2022/03/timerskynet/skynet定时器 要解析一个程序代码,先了解数据结构,这是基础,再看函数。 拿skynet定时器举例子。 数据结构 //定时器事件 用于抛出定时器事件到消息队列里。理解这个数据结构需要先了解skynet的框架层级时间轮 | skynet 定时器https://zfunnily.github.io/2022/03/timerskynet/Sun, 27 Mar 2022 12:39:12 +0800https://zfunnily.github.io/2022/03/timerskynet/skynet定时器 要解析一个程序代码,先了解数据结构,这是基础,再看函数。 拿skynet定时器举例子。 数据结构 //定时器事件 用于抛出定时器事件到消息队列里。理解这个数据结构需要先了解skynet的框架A*算法 | Lua版本https://zfunnily.github.io/2021/12/astar/Thu, 23 Dec 2021 16:37:44 +0800https://zfunnily.github.io/2021/12/astar/A*算法思路 寻路步骤 从起点A开始, 把它作为待处理的方格存入一个&quot;开启列表&quot;, 开启列表就是一个等待检查方格的列表. 寻找起点A周围可以到达的方格, 将它们放入&quot;开启列表&quoSkynet源码赏析三 | 服务启动https://zfunnily.github.io/2021/10/skynetthree/Wed, 20 Oct 2021 11:26:07 +0800https://zfunnily.github.io/2021/10/skynetthree/skynet启动一个C服务 查看怎么启动C服务的最好的办法是打断点,看源码。 启动logger日志服务 我拿日志服务来举例子,怎么启动日志服务的呢? 传参数name = &quot;logger&quot;, param = null, struct skynet_context *ctx = skynet_context_new(config-&gt;logservice, config-&gt;logger);; 从moduleSkynet源码赏析二 | 基础数据结构https://zfunnily.github.io/2021/10/skynettwo/Tue, 19 Oct 2021 18:47:45 +0800https://zfunnily.github.io/2021/10/skynettwo/module管理模块 我们所写的C服务编译成.so文件后放在cpath变量路径下,程序会加载路径cpath = root..&quot;cservice/?.so&quot;下的.so文件,通过staticSkynet源码赏析一 | 启动初始化的过程https://zfunnily.github.io/2021/10/skynetone/Tue, 19 Oct 2021 17:28:45 +0800https://zfunnily.github.io/2021/10/skynetone/入口文件 skynet_main.c 加载配置 struct skynet_config config; config.thread = optint(&#34;thread&#34;,8); config.module_path = optstring(&#34;cpath&#34;,&#34;./cservice/?.so&#34;); config.harbor = optint(&#34;harbor&#34;, 1); config.bootstrap = optstring(&#34;bootstrap&#34;,&#34;snlua bootstrap&#34;); config.daemon = optstring(&#34;daemon&#34;, NULL); config.logger = optstring(&#34;logger&#34;, NULL); config.logservice = optstring(&#34;logservice&#34;, &#34;logger&#34;); config.profile = optboolean(&#34;profile&#34;, 1); 从上述代码可以看到,配置都已经加载到变量struct skynet_config config;中了。 初始化 初始化skynet_context管FPS游戏 | 实现移动功能https://zfunnily.github.io/2021/09/move/Sun, 12 Sep 2021 20:43:34 +0800https://zfunnily.github.io/2021/09/move/三种实现FPS Controller的区别 Transform Translate 允许移动物理,但无物理碰撞 Rigid body + Capsule Collider 符合物理学 不会鬼穿墙 无法滞空运动 可与Physics Object 交互 Charactor Controller 不会鬼穿墙 提供的API相对多 无法与Physic objects《仙剑奇侠传》编译运行https://zfunnily.github.io/2021/03/gamexian/Sun, 21 Mar 2021 10:44:58 +0000https://zfunnily.github.io/2021/03/gamexian/概述 今天在github上找到了《仙剑奇侠传》的rpg单机游戏sdlpal,sdlpal 是一个开源项目,基于sdl把仙剑奇侠传重写了一遍。 下面是我的编译过程总结。 环境 win10- sdl1.2- sdlpal- vs2017- DirectX SDK10 下载sdlpal $ git clone https://github.com.cnpmjs.org/sdlpal/sdlpal.gitLastbattle | 游戏场景服务器SS解析https://zfunnily.github.io/2021/01/lastbattle/Sat, 02 Jan 2021 23:19:58 +0000https://zfunnily.github.io/2021/01/lastbattle/游戏场景服务器概况 指令对应的处理handle的文件:SSBattleMgr.cpp 创建战场 指令: eMsgToSSFromCS_CreateBattle GC服务器发往SS fromCS 收到中心服务器CS创建站场的指令,在函数INT32 CSSBattleMgr::OnMsgFromCS_CreateBattle(const char* pData, int n32DataLengtLastBattle | 登录流程(LS & BS & GS)https://zfunnily.github.io/2020/11/lastbattlelogin/Fri, 20 Nov 2020 17:27:08 +0000https://zfunnily.github.io/2020/11/lastbattlelogin/登录流程 根据上一篇文章中的登录流程,我在工程中找到了相应的代码并记录了下来 登录服务代码解析 监听端口:49997 供BS服务连接 监听端口:49996 供客户端连接 CIocpCtrl:IOCP控制类 多线程循环LastBattle | 服务架构https://zfunnily.github.io/2020/11/lastbattleserver/Fri, 20 Nov 2020 17:24:32 +0000https://zfunnily.github.io/2020/11/lastbattleserver/服务器架构简图如下: 连线说明: 实线:表示客户端登录流程,①②③④⑤表示登录流程,详细解释见下文。 虚线:表示服务器间的连接,虚线箭头指向监听方。 架构说明: |英文名称|简称|中文名称|功能简介|单个大区需LastBattle | 安装部署笔记https://zfunnily.github.io/2020/11/lastbattleone/Mon, 16 Nov 2020 06:49:49 +0000https://zfunnily.github.io/2020/11/lastbattleone/环境准备 win10 服务器:vs2010 / 数据库 mysql5.7 清华大学mysql镜像网站:https://mirrors.tuna.tsinghua.edu.cn/mysql/downloads/MySQL-5.7/ 客户端 \ No newline at end of file diff --git "a/categories/\347\274\226\347\250\213.\347\274\226\350\257\221/index.xml" "b/categories/\347\274\226\347\250\213.\347\274\226\350\257\221/index.xml" index 315754dac..fec416367 100644 --- "a/categories/\347\274\226\347\250\213.\347\274\226\350\257\221/index.xml" +++ "b/categories/\347\274\226\347\250\213.\347\274\226\350\257\221/index.xml" @@ -1 +1 @@ -编程.编译 on Zzz记忆https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E7%BC%96%E8%AF%91/Recent content in 编程.编译 on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000Python3.7安装https://zfunnily.github.io/2023/11/python/Thu, 16 Nov 2023 15:39:01 +0800https://zfunnily.github.io/2023/11/python/环境 centos7 开始安装 安装扩展 $ yum -y install yum-utils 安装Centos开发工具 $ yum -y groupinstall development 安装python3依赖 $ yum -y install zlib-devel bzip2-devel openssl-devel openssl-static ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel libffi-devel lzma gcc 下载python3.7安装包 # 将python3.7安装包,下载到/usr/ \ No newline at end of file +编程.编译 on Zzz记忆https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E7%BC%96%E8%AF%91/Recent content in 编程.编译 on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000Python3.7安装https://zfunnily.github.io/2023/11/python/Thu, 16 Nov 2023 15:39:01 +0800https://zfunnily.github.io/2023/11/python/环境 centos7 开始安装 安装扩展 $ yum -y install yum-utils 安装Centos开发工具 $ yum -y groupinstall development 安装python3依赖 $ yum -y install zlib-devel bzip2-devel openssl-devel openssl-static ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel libffi-devel lzma gcc 下载python3.7安装包 # 将python3.7安装包,下载到/usr/ \ No newline at end of file diff --git "a/categories/\347\274\226\347\250\213.\347\275\221\347\273\234\347\274\226\347\250\213/index.xml" "b/categories/\347\274\226\347\250\213.\347\275\221\347\273\234\347\274\226\347\250\213/index.xml" index 7aec971f6..0b99f14dc 100644 --- "a/categories/\347\274\226\347\250\213.\347\275\221\347\273\234\347\274\226\347\250\213/index.xml" +++ "b/categories/\347\274\226\347\250\213.\347\275\221\347\273\234\347\274\226\347\250\213/index.xml" @@ -1 +1 @@ -编程.网络编程 on Zzz记忆https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E7%BD%91%E7%BB%9C%E7%BC%96%E7%A8%8B/Recent content in 编程.网络编程 on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000CCnet | 单线程reactor演变为多线程https://zfunnily.github.io/2020/12/ccnet/Wed, 30 Dec 2020 09:19:41 +0000https://zfunnily.github.io/2020/12/ccnet/ccnet从单线程演变为多线程 ccnet现状: epoll linux平台 事件循环 单线程 reactor 监听和新连接的事件都在主线程中 单线程的ccnet ccnet的单线程的角色: EventLoop: 整个事件循环。 EPollPoller: 负责事件的收集。 Channel五种网络IO模型总结https://zfunnily.github.io/2020/12/iomodels/Mon, 28 Dec 2020 11:57:04 +0000https://zfunnily.github.io/2020/12/iomodels/概述 在网络上看到很多关于阻塞IO、非阻塞IO、同步IO、异步IO的例子,总觉得写的过于复杂并且让人难以理解。于是我把我自己把这几个概念的理解写下来以供参考。 POSIX POSIX(可移植操作系统接口)把同步IOCCnet | 一个reactor单线程网络库https://zfunnily.github.io/2020/12/ccnetone/Sun, 27 Dec 2020 18:41:25 +0000https://zfunnily.github.io/2020/12/ccnetone/缘由 最近在研究陈硕的网络库muduo,是一个基于reactor架构的网络库。我对网络库的感觉是易用,但是内容庞大,依赖颇多。比如boost网络库里面的一些语法让人生畏。关于reactor和proactTCP/IP | 大量TIME_WAIT对线上业务的影响https://zfunnily.github.io/2020/10/%E5%A4%A7%E9%87%8FTIME_WAIT%E5%AF%B9%E7%BA%BF%E4%B8%8A%E4%B8%9A%E5%8A%A1%E7%9A%84%E5%BD%B1%E5%93%8D/Sat, 10 Oct 2020 16:46:34 +0000https://zfunnily.github.io/2020/10/%E5%A4%A7%E9%87%8FTIME_WAIT%E5%AF%B9%E7%BA%BF%E4%B8%8A%E4%B8%9A%E5%8A%A1%E7%9A%84%E5%BD%B1%E5%93%8D/TCP的三次握手和四次挥手 TIME_WAIT概述 TIME_WAIT 状态: TCP 连接中,主动关闭连接的一方出现的状态;(收到 FIN 命令,进入 TIME_WAIT 状态,并返回 ACK 命令) 保持 2 个 MSL 时间,即,4 分钟 ;(MSL 为 2 分钟) TCP 连接建立后,「主 \ No newline at end of file +编程.网络编程 on Zzz记忆https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E7%BD%91%E7%BB%9C%E7%BC%96%E7%A8%8B/Recent content in 编程.网络编程 on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000CCnet | 单线程reactor演变为多线程https://zfunnily.github.io/2020/12/ccnet/Wed, 30 Dec 2020 09:19:41 +0000https://zfunnily.github.io/2020/12/ccnet/ccnet从单线程演变为多线程 ccnet现状: epoll linux平台 事件循环 单线程 reactor 监听和新连接的事件都在主线程中 单线程的ccnet ccnet的单线程的角色: EventLoop: 整个事件循环。 EPollPoller: 负责事件的收集。 Channel五种网络IO模型总结https://zfunnily.github.io/2020/12/iomodels/Mon, 28 Dec 2020 11:57:04 +0000https://zfunnily.github.io/2020/12/iomodels/概述 在网络上看到很多关于阻塞IO、非阻塞IO、同步IO、异步IO的例子,总觉得写的过于复杂并且让人难以理解。于是我把我自己把这几个概念的理解写下来以供参考。 POSIX POSIX(可移植操作系统接口)把同步IOCCnet | 一个reactor单线程网络库https://zfunnily.github.io/2020/12/ccnetone/Sun, 27 Dec 2020 18:41:25 +0000https://zfunnily.github.io/2020/12/ccnetone/缘由 最近在研究陈硕的网络库muduo,是一个基于reactor架构的网络库。我对网络库的感觉是易用,但是内容庞大,依赖颇多。比如boost网络库里面的一些语法让人生畏。关于reactor和proactTCP/IP | 大量TIME_WAIT对线上业务的影响https://zfunnily.github.io/2020/10/%E5%A4%A7%E9%87%8FTIME_WAIT%E5%AF%B9%E7%BA%BF%E4%B8%8A%E4%B8%9A%E5%8A%A1%E7%9A%84%E5%BD%B1%E5%93%8D/Sat, 10 Oct 2020 16:46:34 +0000https://zfunnily.github.io/2020/10/%E5%A4%A7%E9%87%8FTIME_WAIT%E5%AF%B9%E7%BA%BF%E4%B8%8A%E4%B8%9A%E5%8A%A1%E7%9A%84%E5%BD%B1%E5%93%8D/TCP的三次握手和四次挥手 TIME_WAIT概述 TIME_WAIT 状态: TCP 连接中,主动关闭连接的一方出现的状态;(收到 FIN 命令,进入 TIME_WAIT 状态,并返回 ACK 命令) 保持 2 个 MSL 时间,即,4 分钟 ;(MSL 为 2 分钟) TCP 连接建立后,「主 \ No newline at end of file diff --git "a/categories/\347\274\226\347\250\213.\351\237\263\350\247\206\351\242\221/index.xml" "b/categories/\347\274\226\347\250\213.\351\237\263\350\247\206\351\242\221/index.xml" index 43490a6ee..ee3770107 100644 --- "a/categories/\347\274\226\347\250\213.\351\237\263\350\247\206\351\242\221/index.xml" +++ "b/categories/\347\274\226\347\250\213.\351\237\263\350\247\206\351\242\221/index.xml" @@ -1 +1 @@ -编程.音视频 on Zzz记忆https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E9%9F%B3%E8%A7%86%E9%A2%91/Recent content in 编程.音视频 on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000Webrtc二 | 共享桌面https://zfunnily.github.io/2021/11/webrtcdesk/Mon, 15 Nov 2021 11:23:24 +0800https://zfunnily.github.io/2021/11/webrtcdesk/环境 Ubuntu18.04 webrtc M84 改造peerconnection例子,用来实现桌面共享 改造类CapturerTrackSource 增加桌面的数据源类RcrtcDesktopCapturerTrackSource 继承webrWebrtc一 | peerconnectionhttps://zfunnily.github.io/2021/11/webrtcpeerconnection/Sun, 14 Nov 2021 16:20:31 +0800https://zfunnily.github.io/2021/11/webrtcpeerconnection/环境 Ubuntu18.04 webrtc M84 国内镜像:https://webrtc.org.cn/mirror/ webrtc交互过程 通过peerconnection的例子来分析webrtc的交互流程 peer_connection 解析 为了便于管理,如编码,回显等,FFmpeg | 画中画和视频多宫格处理https://zfunnily.github.io/2020/09/ffmpegpicture/Mon, 14 Sep 2020 18:29:33 +0000https://zfunnily.github.io/2020/09/ffmpegpicture/FFmpeg生成画中画 静态画中画 将视频sub.mp4视频文件缩放成宽 480 、高 320 的视频,然后显示在 视频 input.mp4,x坐标为0,y 坐标为0 的位置 ffmpeg -re -i input.mp4 -vf &#34;movie=sub.mp4, scale=480x320[test]; [in][test]overlay [out]&#34; -vcodec libx264 output.flv 显示在画面的右下角,则需要用到FFmpeg | 给视频加文字和图片水印https://zfunnily.github.io/2020/09/ffmpegvideo/Sat, 12 Sep 2020 12:47:57 +0000https://zfunnily.github.io/2020/09/ffmpegvideo/FFmpeg给视频加上logo ffmpeg从视频中截取图像帧 ffmpeg -i inputfile.avi -r 1 -f image2 image-%05d.jpeg ffmpeg -i inputfile.avi -r 1 -s 4cif -f image2 image-%05d.jpeg ffmpeg -i inputfile.avi -r 1 -t 4 -f image2 image-%05d.jpeg ffmpeg -i inputfile.avi -r 1 -ss 01:30:14 -f image2 image-%05d.jpeg ffmpeg -i inputfile.avi -r 1 -ss 01:30:14 -vframes 120 4cif -f image2 image-%05d.jpeg -r 指定抽取的帧率,即从视频中每秒钟抽取FFmpeg | 录制摄像头和桌面数据windowshttps://zfunnily.github.io/2020/09/ffmpegvideow/Wed, 09 Sep 2020 09:36:49 +0000https://zfunnily.github.io/2020/09/ffmpegvideow/概述 FFmpeg Windows 设备操作 Windows 采集设备的主要方式是 dshow vfwcap gdigrab 其中 dshow 可以用来抓 取摄像头、采集卡、麦克风等,- vfwcap 主要用来采集摄像头类设备,- gdigrab 则是抓取 Windows 窗口程序 FFmpeg 使用 dshow 采集音视频设备 使用 dshow 枚举设备 ffmpeg -f dshow -list_devices true -i dymmy 输出 [dshow @ 000002622302e340]FFmpeg | 录制摄像头和桌面数据machttps://zfunnily.github.io/2020/08/macffmpeg/Sat, 29 Aug 2020 17:20:40 +0000https://zfunnily.github.io/2020/08/macffmpeg/设备枚举 查看设备列表 $ ffmpeg -hide_banner -devices Devices: D. = Demuxing supported .E = Muxing supported -- D avfoundation AVFoundation input device D lavfi Libavfilter virtual input device E sdl,sdl2 SDL2 output device 可以看到输入设备有:avfoundation,lavfi 输出设备有:sdl `` 设备采集举例: $ ffmpeg -f avfoundation -list_devices true -i &#34; &#34; 看到了 如下设Owt-server | owt-client-javascripthttps://zfunnily.github.io/2020/08/owt-client-javascript/Sun, 16 Aug 2020 23:04:13 +0000https://zfunnily.github.io/2020/08/owt-client-javascript/概述 天气燥热,不易出门。遂研究一下owt-server,从owt-client-javascript的流程开始吧。 获取一个会议室 owt-client-javascript的时候有一个初始化房间的过程 ///owt-client-javascript/src/samples/conference/samplertcservice.jsLicod | 安装和配置https://zfunnily.github.io/2020/08/licode/Sun, 09 Aug 2020 09:34:36 +0000https://zfunnily.github.io/2020/08/licode/拉取docker镜像并运行 licode官方提供了配置好的docker镜像,使用以下命令拉下来跑就行。 docker run --name licode -p 3000:3000 -p $MIN_PORT-$MAX_PORT:30000-30050/udp -p 3001:3001 -p 8080:8080 -e &#34;MIN_PORT=30000&#34; -e &#34;MAX_PORT=30050&#34; -e &#34;PUBLIC_IP=your_ip_address&#34; lynckia/licode 注意命令里的PUBLIC_IP要改为服务器的公网IP。 配置好之Owt-server | 编译运行https://zfunnily.github.io/2020/08/owtservercomplie/Wed, 05 Aug 2020 09:47:22 +0000https://zfunnily.github.io/2020/08/owtservercomplie/概述 owt是一套完整的webrtc视频会议系统。包含的功能模块有: 视频会议1. p2p 服务器是owt-server通过nodejs编写的webrtc信令。依赖是licode。licode依赖webrtc。 客 \ No newline at end of file +编程.音视频 on Zzz记忆https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E9%9F%B3%E8%A7%86%E9%A2%91/Recent content in 编程.音视频 on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000Webrtc二 | 共享桌面https://zfunnily.github.io/2021/11/webrtcdesk/Mon, 15 Nov 2021 11:23:24 +0800https://zfunnily.github.io/2021/11/webrtcdesk/环境 Ubuntu18.04 webrtc M84 改造peerconnection例子,用来实现桌面共享 改造类CapturerTrackSource 增加桌面的数据源类RcrtcDesktopCapturerTrackSource 继承webrWebrtc一 | peerconnectionhttps://zfunnily.github.io/2021/11/webrtcpeerconnection/Sun, 14 Nov 2021 16:20:31 +0800https://zfunnily.github.io/2021/11/webrtcpeerconnection/环境 Ubuntu18.04 webrtc M84 国内镜像:https://webrtc.org.cn/mirror/ webrtc交互过程 通过peerconnection的例子来分析webrtc的交互流程 peer_connection 解析 为了便于管理,如编码,回显等,FFmpeg | 画中画和视频多宫格处理https://zfunnily.github.io/2020/09/ffmpegpicture/Mon, 14 Sep 2020 18:29:33 +0000https://zfunnily.github.io/2020/09/ffmpegpicture/FFmpeg生成画中画 静态画中画 将视频sub.mp4视频文件缩放成宽 480 、高 320 的视频,然后显示在 视频 input.mp4,x坐标为0,y 坐标为0 的位置 ffmpeg -re -i input.mp4 -vf &#34;movie=sub.mp4, scale=480x320[test]; [in][test]overlay [out]&#34; -vcodec libx264 output.flv 显示在画面的右下角,则需要用到FFmpeg | 给视频加文字和图片水印https://zfunnily.github.io/2020/09/ffmpegvideo/Sat, 12 Sep 2020 12:47:57 +0000https://zfunnily.github.io/2020/09/ffmpegvideo/FFmpeg给视频加上logo ffmpeg从视频中截取图像帧 ffmpeg -i inputfile.avi -r 1 -f image2 image-%05d.jpeg ffmpeg -i inputfile.avi -r 1 -s 4cif -f image2 image-%05d.jpeg ffmpeg -i inputfile.avi -r 1 -t 4 -f image2 image-%05d.jpeg ffmpeg -i inputfile.avi -r 1 -ss 01:30:14 -f image2 image-%05d.jpeg ffmpeg -i inputfile.avi -r 1 -ss 01:30:14 -vframes 120 4cif -f image2 image-%05d.jpeg -r 指定抽取的帧率,即从视频中每秒钟抽取FFmpeg | 录制摄像头和桌面数据windowshttps://zfunnily.github.io/2020/09/ffmpegvideow/Wed, 09 Sep 2020 09:36:49 +0000https://zfunnily.github.io/2020/09/ffmpegvideow/概述 FFmpeg Windows 设备操作 Windows 采集设备的主要方式是 dshow vfwcap gdigrab 其中 dshow 可以用来抓 取摄像头、采集卡、麦克风等,- vfwcap 主要用来采集摄像头类设备,- gdigrab 则是抓取 Windows 窗口程序 FFmpeg 使用 dshow 采集音视频设备 使用 dshow 枚举设备 ffmpeg -f dshow -list_devices true -i dymmy 输出 [dshow @ 000002622302e340]FFmpeg | 录制摄像头和桌面数据machttps://zfunnily.github.io/2020/08/macffmpeg/Sat, 29 Aug 2020 17:20:40 +0000https://zfunnily.github.io/2020/08/macffmpeg/设备枚举 查看设备列表 $ ffmpeg -hide_banner -devices Devices: D. = Demuxing supported .E = Muxing supported -- D avfoundation AVFoundation input device D lavfi Libavfilter virtual input device E sdl,sdl2 SDL2 output device 可以看到输入设备有:avfoundation,lavfi 输出设备有:sdl `` 设备采集举例: $ ffmpeg -f avfoundation -list_devices true -i &#34; &#34; 看到了 如下设Owt-server | owt-client-javascripthttps://zfunnily.github.io/2020/08/owt-client-javascript/Sun, 16 Aug 2020 23:04:13 +0000https://zfunnily.github.io/2020/08/owt-client-javascript/概述 天气燥热,不易出门。遂研究一下owt-server,从owt-client-javascript的流程开始吧。 获取一个会议室 owt-client-javascript的时候有一个初始化房间的过程 ///owt-client-javascript/src/samples/conference/samplertcservice.jsLicod | 安装和配置https://zfunnily.github.io/2020/08/licode/Sun, 09 Aug 2020 09:34:36 +0000https://zfunnily.github.io/2020/08/licode/拉取docker镜像并运行 licode官方提供了配置好的docker镜像,使用以下命令拉下来跑就行。 docker run --name licode -p 3000:3000 -p $MIN_PORT-$MAX_PORT:30000-30050/udp -p 3001:3001 -p 8080:8080 -e &#34;MIN_PORT=30000&#34; -e &#34;MAX_PORT=30050&#34; -e &#34;PUBLIC_IP=your_ip_address&#34; lynckia/licode 注意命令里的PUBLIC_IP要改为服务器的公网IP。 配置好之Owt-server | 编译运行https://zfunnily.github.io/2020/08/owtservercomplie/Wed, 05 Aug 2020 09:47:22 +0000https://zfunnily.github.io/2020/08/owtservercomplie/概述 owt是一套完整的webrtc视频会议系统。包含的功能模块有: 视频会议1. p2p 服务器是owt-server通过nodejs编写的webrtc信令。依赖是licode。licode依赖webrtc。 客 \ No newline at end of file diff --git "a/categories/\347\274\226\347\250\213/index.xml" "b/categories/\347\274\226\347\250\213/index.xml" index 074b198c8..83e94a608 100644 --- "a/categories/\347\274\226\347\250\213/index.xml" +++ "b/categories/\347\274\226\347\250\213/index.xml" @@ -1 +1 @@ -编程 on Zzz记忆https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B/Recent content in 编程 on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000URP 不透明/半透明物体的折射https://zfunnily.github.io/2022/05/refraction/Tue, 17 May 2022 11:30:48 +0800https://zfunnily.github.io/2022/05/refraction/折射 应用场景 水池 玻璃 热空气(热扭曲) GrabPass + CubeMap 《Unity3D Shader入门精要》第十章介绍了,模拟实现折射效果有两种 使用cubemap: 我认为太麻烦.需要的贴图太多。也没有找到其他合适的使用场景,遂搁URP 不透明/半透明物体的折射https://zfunnily.github.io/2022/05/refraction/Tue, 17 May 2022 11:30:48 +0800https://zfunnily.github.io/2022/05/refraction/折射 应用场景 水池 玻璃 热空气(热扭曲) GrabPass + CubeMap 《Unity3D Shader入门精要》第十章介绍了,模拟实现折射效果有两种 使用cubemap: 我认为太麻烦.需要的贴图太多。也没有找到其他合适的使用场景,遂搁《Unity Shader入门精要》第八章笔记 | 透明度https://zfunnily.github.io/2022/05/shaderalpha/Sat, 07 May 2022 17:17:18 +0800https://zfunnily.github.io/2022/05/shaderalpha/渲染顺序 名称 队列索引号 描 述 Background 1000 这个渲染队列会在任何其他队列之前被渲染,我们通常使用该队列来渲染那些需要绘制在背景上的物体 Geometry 2000 默认的渲染队列,大多数物体都使用这个队列。不透明物体使用这个队列 AlphaTest 2450 需要透明《Unity Shader入门精要》第八章笔记 | 透明度https://zfunnily.github.io/2022/05/shaderalpha/Sat, 07 May 2022 17:17:18 +0800https://zfunnily.github.io/2022/05/shaderalpha/渲染顺序 名称 队列索引号 描 述 Background 1000 这个渲染队列会在任何其他队列之前被渲染,我们通常使用该队列来渲染那些需要绘制在背景上的物体 Geometry 2000 默认的渲染队列,大多数物体都使用这个队列。不透明物体使用这个队列 AlphaTest 2450 需要透明《Unity Shader入门精要》第六章笔记 | 基础光照https://zfunnily.github.io/2022/05/shaderlighting/Sat, 07 May 2022 16:22:40 +0800https://zfunnily.github.io/2022/05/shaderlighting/我们是如何看到这个世界的 光源: 在光学里,我们使用辐照度 (irradiance) 来量化光 物体的吸收和散射: 光线由光源发射出来后,就会与一些物体相交 着色: 根据材质属性(如漫反射属性等)、光源信息(如光源方《Unity Shader入门精要》第六章笔记 | 基础光照https://zfunnily.github.io/2022/05/shaderlighting/Sat, 07 May 2022 16:22:40 +0800https://zfunnily.github.io/2022/05/shaderlighting/我们是如何看到这个世界的 光源: 在光学里,我们使用辐照度 (irradiance) 来量化光 物体的吸收和散射: 光线由光源发射出来后,就会与一些物体相交 着色: 根据材质属性(如漫反射属性等)、光源信息(如光源方《Unity Shader入门精要》第五章笔记 | 开始shader练习https://zfunnily.github.io/2022/05/shaderbase/Sat, 07 May 2022 10:22:33 +0800https://zfunnily.github.io/2022/05/shaderbase/一个简单的顶点/片元着色器 代码 Shader &#34;Unity Shaders Book/Chapter 5/Simple Shader&#34; { Properties { // 声明一个Color类型的属性 _Color (&#34;Color Tint&#34;, Color) = (1.0,1.0,1.0,1.0) } SubShader { Pass { CGPROGRAM #pragma vertex vert #pragma fragment frag // 在Cg代码中,我们需要定义一个与属性名称和类型都匹配的变量 fixed4 _Color; // 使用一个结构体来定义《Unity Shader入门精要》第五章笔记 | 开始shader练习https://zfunnily.github.io/2022/05/shaderbase/Sat, 07 May 2022 10:22:33 +0800https://zfunnily.github.io/2022/05/shaderbase/一个简单的顶点/片元着色器 代码 Shader &#34;Unity Shaders Book/Chapter 5/Simple Shader&#34; { Properties { // 声明一个Color类型的属性 _Color (&#34;Color Tint&#34;, Color) = (1.0,1.0,1.0,1.0) } SubShader { Pass { CGPROGRAM #pragma vertex vert #pragma fragment frag // 在Cg代码中,我们需要定义一个与属性名称和类型都匹配的变量 fixed4 _Color; // 使用一个结构体来定义MAC平台几何着色器不生效https://zfunnily.github.io/2022/05/geometry/Thu, 05 May 2022 16:49:29 +0800https://zfunnily.github.io/2022/05/geometry/问题 MAC平台几何着色器不生效 解决步骤 unity shaderlab 怎么设置以至于支持几何着色器 找原因,设置 编译目标级别,#pragma target 4.0, 不管用 看到一句话,Unity 在 Metal 图形上支持曲面细分着色器,但 Metal 不支持几何着色器 找到maMAC平台几何着色器不生效https://zfunnily.github.io/2022/05/geometry/Thu, 05 May 2022 16:49:29 +0800https://zfunnily.github.io/2022/05/geometry/问题 MAC平台几何着色器不生效 解决步骤 unity shaderlab 怎么设置以至于支持几何着色器 找原因,设置 编译目标级别,#pragma target 4.0, 不管用 看到一句话,Unity 在 Metal 图形上支持曲面细分着色器,但 Metal 不支持几何着色器 找到maShaderLab常用函数https://zfunnily.github.io/2022/04/shaderfunc/Wed, 20 Apr 2022 15:41:29 +0800https://zfunnily.github.io/2022/04/shaderfunc/数学函数 cg/hlsl函数 功能描述 dot(A,B) 点积, 点积结果为标量,主要用于求向量的夹角或b向量在a向量上的投影 cross(A,B) 叉积, 叉积结果为向量,结果与这两个向量组成的平面垂直。主要用于3D图形学 mul(M, N) 矩阵M和矩阵N的积 mul(M,ShaderLab常用函数https://zfunnily.github.io/2022/04/shaderfunc/Wed, 20 Apr 2022 15:41:29 +0800https://zfunnily.github.io/2022/04/shaderfunc/数学函数 cg/hlsl函数 功能描述 dot(A,B) 点积, 点积结果为标量,主要用于求向量的夹角或b向量在a向量上的投影 cross(A,B) 叉积, 叉积结果为向量,结果与这两个向量组成的平面垂直。主要用于3D图形学 mul(M, N) 矩阵M和矩阵N的积 mul(M,UnityCG.cginc中常用函数https://zfunnily.github.io/2022/04/cginc/Wed, 20 Apr 2022 15:35:49 +0800https://zfunnily.github.io/2022/04/cginc/摄像机方向 WorldSpaceViewDir 输入一个模型空间中的顶点坐标 -&gt; 输出(世界空间)从这个点到摄像机的观察方向; WorldSpaceViewDir // 内部实现也是用UnityWorldSpaceViewDir // Computes world space view direction, from object space position // *Legacy* Please use UnityWorldSpaceViewDir instead inline float3 WorldSpaceViewDir( in float4 localPos ) { float3 worldPosUnityCG.cginc中常用函数https://zfunnily.github.io/2022/04/cginc/Wed, 20 Apr 2022 15:35:49 +0800https://zfunnily.github.io/2022/04/cginc/摄像机方向 WorldSpaceViewDir 输入一个模型空间中的顶点坐标 -&gt; 输出(世界空间)从这个点到摄像机的观察方向; WorldSpaceViewDir // 内部实现也是用UnityWorldSpaceViewDir // Computes world space view direction, from object space position // *Legacy* Please use UnityWorldSpaceViewDir instead inline float3 WorldSpaceViewDir( in float4 localPos ) { float3 worldPos《Unity Shader入门精要》第四章笔记 | 学习Shader所需的数学基础https://zfunnily.github.io/2022/04/shadermathematic/Sun, 10 Apr 2022 15:42:33 +0800https://zfunnily.github.io/2022/04/shadermathematic/概述 在学习Shader的过程中,我们最常使用的就是矢量和矩阵(即数学的分支之一——线性代数)。 笛卡儿坐标系 我们使用数学绝大部分都是为了计算位置、距离和角度等变量。而这些计算大部分都是在笛卡儿坐标系 (C《Unity Shader入门精要》第四章笔记 | 学习Shader所需的数学基础https://zfunnily.github.io/2022/04/shadermathematic/Sun, 10 Apr 2022 15:42:33 +0800https://zfunnily.github.io/2022/04/shadermathematic/概述 在学习Shader的过程中,我们最常使用的就是矢量和矩阵(即数学的分支之一——线性代数)。 笛卡儿坐标系 我们使用数学绝大部分都是为了计算位置、距离和角度等变量。而这些计算大部分都是在笛卡儿坐标系 (C《Unity Shader入门精要》第三章笔记| UnityShader基础https://zfunnily.github.io/2022/04/shaderbase/Sun, 10 Apr 2022 14:51:19 +0800https://zfunnily.github.io/2022/04/shaderbase/材质 在Unity中我们需要配合使用材质 (Material) 和Unity Shader才能达到需要的效果。一个最常见的流程是 创建一个材质;活着导入一个材质 创建一个Unity Shader,并把它赋给上一步中《Unity Shader入门精要》第三章笔记| UnityShader基础https://zfunnily.github.io/2022/04/shaderbase/Sun, 10 Apr 2022 14:51:19 +0800https://zfunnily.github.io/2022/04/shaderbase/材质 在Unity中我们需要配合使用材质 (Material) 和Unity Shader才能达到需要的效果。一个最常见的流程是 创建一个材质;活着导入一个材质 创建一个Unity Shader,并把它赋给上一步中《Unity Shader入门精要》第二章笔记 | 渲染流水线https://zfunnily.github.io/2022/04/shaderrenderpipline/Sat, 09 Apr 2022 11:55:55 +0800https://zfunnily.github.io/2022/04/shaderrenderpipline/渲染流水线 Render-Time Rendering, Third Edition》一书中将一个渲染流程分成3个阶段:应用阶段(Application Stage) 、几何阶段(Geometry Stage) 、光栅化阶段(Rasterizer Stage) 。 应《Unity Shader入门精要》第二章笔记 | 渲染流水线https://zfunnily.github.io/2022/04/shaderrenderpipline/Sat, 09 Apr 2022 11:55:55 +0800https://zfunnily.github.io/2022/04/shaderrenderpipline/渲染流水线 Render-Time Rendering, Third Edition》一书中将一个渲染流程分成3个阶段:应用阶段(Application Stage) 、几何阶段(Geometry Stage) 、光栅化阶段(Rasterizer Stage) 。 应shader初尝试 | 给石头覆盖一层雪景(Hello World)https://zfunnily.github.io/2022/04/shaderhelloworld/Sat, 09 Apr 2022 10:34:56 +0800https://zfunnily.github.io/2022/04/shaderhelloworld/给石头覆盖一层雪景 资源准备 石头模型 Unity2021.2.3f1c1 Mac &amp; Windows 在Unity中创建一个项目,导入石头模型,下面就开始利用shader给石头做一个雪景覆盖. 实现效果 未覆盖雪景的样子 覆盖了雪景的样子 开始代码 我在代码中标注了1,shader初尝试 | 给石头覆盖一层雪景(Hello World)https://zfunnily.github.io/2022/04/shaderhelloworld/Sat, 09 Apr 2022 10:34:56 +0800https://zfunnily.github.io/2022/04/shaderhelloworld/给石头覆盖一层雪景 资源准备 石头模型 Unity2021.2.3f1c1 Mac &amp; Windows 在Unity中创建一个项目,导入石头模型,下面就开始利用shader给石头做一个雪景覆盖. 实现效果 未覆盖雪景的样子 覆盖了雪景的样子 开始代码 我在代码中标注了1,UnityShader基本概念https://zfunnily.github.io/2022/04/shader01/Wed, 06 Apr 2022 11:54:02 +0800https://zfunnily.github.io/2022/04/shader01/何为shader shader中文翻译为着色器,其实是一种用来渲染图形的技术,我们可以通过shader编程,来自定义显卡渲染画面的算法,显示我们所期望的结果。 shader种类 顶点着色器: 处理每个顶点,将UnityShader基本概念https://zfunnily.github.io/2022/04/shader01/Wed, 06 Apr 2022 11:54:02 +0800https://zfunnily.github.io/2022/04/shader01/何为shader shader中文翻译为着色器,其实是一种用来渲染图形的技术,我们可以通过shader编程,来自定义显卡渲染画面的算法,显示我们所期望的结果。 shader种类 顶点着色器: 处理每个顶点,将抽卡逻辑自述https://zfunnily.github.io/2022/03/afk/Wed, 30 Mar 2022 10:50:11 +0800https://zfunnily.github.io/2022/03/afk/抽卡逻辑自述 参考《剑与远征》 卡牌颜色以及合成 颜色 合成 绿色 可分解,得到粉尘和银瓜子, 最基础的卡 蓝 蓝+ 同样的三张蓝色可合成一张蓝+ 紫 同种族的三张蓝+可以合成一张紫(可以选择合成其中蓝+的某个紫色) 紫+ 同英抽卡逻辑自述https://zfunnily.github.io/2022/03/afk/Wed, 30 Mar 2022 10:50:11 +0800https://zfunnily.github.io/2022/03/afk/抽卡逻辑自述 参考《剑与远征》 卡牌颜色以及合成 颜色 合成 绿色 可分解,得到粉尘和银瓜子, 最基础的卡 蓝 蓝+ 同样的三张蓝色可合成一张蓝+ 紫 同种族的三张蓝+可以合成一张紫(可以选择合成其中蓝+的某个紫色) 紫+ 同英层级时间轮 | skynet 定时器https://zfunnily.github.io/2022/03/timerskynet/Sun, 27 Mar 2022 12:39:12 +0800https://zfunnily.github.io/2022/03/timerskynet/skynet定时器 要解析一个程序代码,先了解数据结构,这是基础,再看函数。 拿skynet定时器举例子。 数据结构 //定时器事件 用于抛出定时器事件到消息队列里。理解这个数据结构需要先了解skynet的框架层级时间轮 | skynet 定时器https://zfunnily.github.io/2022/03/timerskynet/Sun, 27 Mar 2022 12:39:12 +0800https://zfunnily.github.io/2022/03/timerskynet/skynet定时器 要解析一个程序代码,先了解数据结构,这是基础,再看函数。 拿skynet定时器举例子。 数据结构 //定时器事件 用于抛出定时器事件到消息队列里。理解这个数据结构需要先了解skynet的框架利用时间轮实现定时器https://zfunnily.github.io/2022/03/timer/Thu, 10 Mar 2022 14:38:23 +0800https://zfunnily.github.io/2022/03/timer/理解定时器 适用场景 定时任务(每隔1s钟打印一次数据) 超时控制(xx分钟没有动作就断开连接) 频率限制(最快只能每5s调用一次API) 定时器常用的数据结构有如下几种: 链表 双向有序链表 最小堆 时间轮 层级时间轮利用时间轮实现定时器https://zfunnily.github.io/2022/03/timer/Thu, 10 Mar 2022 14:38:23 +0800https://zfunnily.github.io/2022/03/timer/理解定时器 适用场景 定时任务(每隔1s钟打印一次数据) 超时控制(xx分钟没有动作就断开连接) 频率限制(最快只能每5s调用一次API) 定时器常用的数据结构有如下几种: 链表 双向有序链表 最小堆 时间轮 层级时间轮Nginx | 给网站添加证书https://zfunnily.github.io/2022/03/https/Thu, 03 Mar 2022 10:26:56 +0800https://zfunnily.github.io/2022/03/https/Https 最近在购买的云服务器上把个人博客搭建起来了,实际上是hugo生成静态网页,nginx加载静态网页。现在只能通过http访问,缺少个https。 要搭建一个https的网站需要证书。之前在网上找的教程太Nginx | 给网站添加证书https://zfunnily.github.io/2022/03/https/Thu, 03 Mar 2022 10:26:56 +0800https://zfunnily.github.io/2022/03/https/Https 最近在购买的云服务器上把个人博客搭建起来了,实际上是hugo生成静态网页,nginx加载静态网页。现在只能通过http访问,缺少个https。 要搭建一个https的网站需要证书。之前在网上找的教程太Golang | http注解路由https://zfunnily.github.io/2022/03/http/Wed, 02 Mar 2022 14:51:22 +0800https://zfunnily.github.io/2022/03/http/Http服务器 Golang有一个很强大的官方http库了,使用上很方便。也有一些很强大的三方http框架, 比如gin,beego等等。 自以为,框架在提供便利,提升开发效率的同时,也限制了我们的想象力。Golang | http注解路由https://zfunnily.github.io/2022/03/http/Wed, 02 Mar 2022 14:51:22 +0800https://zfunnily.github.io/2022/03/http/Http服务器 Golang有一个很强大的官方http库了,使用上很方便。也有一些很强大的三方http框架, 比如gin,beego等等。 自以为,框架在提供便利,提升开发效率的同时,也限制了我们的想象力。Goang | Plugin插件热更https://zfunnily.github.io/2022/03/reload/Tue, 01 Mar 2022 11:33:22 +0800https://zfunnily.github.io/2022/03/reload/热更新 动态脚本更新 (php) 短链接无状态服务器热更 (http) 长连接有状态,数据跟逻辑分离 golang Plugin热更 (.so 动态库更新) &mdash;-逻辑热更 长连接有状态,在运维层面, 利用容器部署热更(docker, k8s) 服务不接受新Goang | Plugin插件热更https://zfunnily.github.io/2022/03/reload/Tue, 01 Mar 2022 11:33:22 +0800https://zfunnily.github.io/2022/03/reload/热更新 动态脚本更新 (php) 短链接无状态服务器热更 (http) 长连接有状态,数据跟逻辑分离 golang Plugin热更 (.so 动态库更新) &mdash;-逻辑热更 长连接有状态,在运维层面, 利用容器部署热更(docker, k8s) 服务不接受新Grpc | Token认证和自定义认证https://zfunnily.github.io/2022/02/jwt/Tue, 22 Feb 2022 15:39:30 +0800https://zfunnily.github.io/2022/02/jwt/概述 现在有个需求,需要在grpc的拦截器中,通过token进行身份认证。如果认证不通过则返回错误; 认证通过,则放行; TLS是用作加密通讯通道的,与该需求无关。 Token认证 具体流程 客户端通过账号密码登Grpc | Token认证和自定义认证https://zfunnily.github.io/2022/02/jwt/Tue, 22 Feb 2022 15:39:30 +0800https://zfunnily.github.io/2022/02/jwt/概述 现在有个需求,需要在grpc的拦截器中,通过token进行身份认证。如果认证不通过则返回错误; 认证通过,则放行; TLS是用作加密通讯通道的,与该需求无关。 Token认证 具体流程 客户端通过账号密码登Grpc | 通过SSL/TLS建立安全连接https://zfunnily.github.io/2022/02/san/Tue, 22 Feb 2022 14:22:41 +0800https://zfunnily.github.io/2022/02/san/使用golang的grpc库作为例子 grpc使用TLS建立安全连接需要有SAN证书, go 1.15 版本开始废弃 CommonName。 什么是SAN证书 SAN(Subject Alternative Name) 是 SSL 标准 x509 中定义的一个扩展。使用了 SAN 字段的 SSL 证书,可以扩Grpc | 通过SSL/TLS建立安全连接https://zfunnily.github.io/2022/02/san/Tue, 22 Feb 2022 14:22:41 +0800https://zfunnily.github.io/2022/02/san/使用golang的grpc库作为例子 grpc使用TLS建立安全连接需要有SAN证书, go 1.15 版本开始废弃 CommonName。 什么是SAN证书 SAN(Subject Alternative Name) 是 SSL 标准 x509 中定义的一个扩展。使用了 SAN 字段的 SSL 证书,可以扩Blog | 代码显示/隐藏https://zfunnily.github.io/2021/12/shortcodes/Wed, 29 Dec 2021 13:50:28 +0800https://zfunnily.github.io/2021/12/shortcodes/缘由 最近在写技术博客时,引入的代码太多,影响观感。 在尽力减少代码量,还是有些不可或缺的代码,代码量很惊人,已经占满整个屏幕. 因为个人博客是使用hugo生成的静态博客,我刚开始想的使用原生的js和cssNginx的一些配置https://zfunnily.github.io/2021/12/nginx/Tue, 28 Dec 2021 16:04:10 +0800https://zfunnily.github.io/2021/12/nginx/静态网站 应用场景 文件服务 静态网站 &hellip; 静态网站的配置 配置如下: nginx.conf worker_processes 1; pid nginx.pid; events { worker_connections 1024; multi_accept on; } http { default_type application/octet-stream; sendfile on; keepalive_timeout 100; server { listen 80; charset utf-8,gbk; server_name localhost; location /{ root /opt/; autoindex on; autoindex_localtime on; } index index.html; # 显示首页 #静态文件访问 location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|js|pdf|txt) { root /opt; } } } root: 表示网站根目录 autoindex: on 显A*算法 | Lua版本https://zfunnily.github.io/2021/12/astar/Thu, 23 Dec 2021 16:37:44 +0800https://zfunnily.github.io/2021/12/astar/A*算法思路 寻路步骤 从起点A开始, 把它作为待处理的方格存入一个&quot;开启列表&quot;, 开启列表就是一个等待检查方格的列表. 寻找起点A周围可以到达的方格, 将它们放入&quot;开启列表&quoBlog | 音乐播放器https://zfunnily.github.io/2021/12/music/Tue, 21 Dec 2021 16:55:23 +0800https://zfunnily.github.io/2021/12/music/概述 今天给我的个人博客加了个暗模式,这样可以在晚上阅读博客的时候不伤害眼睛。突然想到如果在阅读博客的时候可以听听音乐就更好了。 于是在github上找到了一个开源的项目MetingJS,看最后一次comBlog | 网站暗模式https://zfunnily.github.io/2021/12/dark/Tue, 21 Dec 2021 11:05:00 +0800https://zfunnily.github.io/2021/12/dark/Wordpress 如果你的网站是wordpress,则可以参考以Darkmode.js为基础的插件: blackout-darkmode-widget darkmode Nuxt.js 如果你正在使用Nuxt.js,则可以使用下面的模块 nuxtjs-darkmode-js-module 快速使用 使用Darkmode.js给网站快速部署上暗/浅色Openresty三 | 上传文件https://zfunnily.github.io/2021/12/openresty-upload/Wed, 08 Dec 2021 16:42:17 +0800https://zfunnily.github.io/2021/12/openresty-upload/上传文件接口 nginx.conf 的server 增加一个location: location /upload { resolver 8.8.8.8 ipv6=off; content_by_lua_file lua/upload.lua; } upload.lua lua -- upload.lua --========================================== -- 文件上传 --========================================== local chunk_size = 4096 local form, err = upload:new(chunk_size) if not form then ngx.log(ngx.ERR, &#34;failed to new upload: &#34;, err) ngx.exit(ngx.HTTP_INTERNAL_SERVER_ERROR) end form:set_timeout(1000) -- 文件保存的根路径 local saveRootPath = &#34;./download/&#34; -- 保存的文件对象 local fileToSave --文件是否成Webrtc二 | 共享桌面https://zfunnily.github.io/2021/11/webrtcdesk/Mon, 15 Nov 2021 11:23:24 +0800https://zfunnily.github.io/2021/11/webrtcdesk/环境 Ubuntu18.04 webrtc M84 改造peerconnection例子,用来实现桌面共享 改造类CapturerTrackSource 增加桌面的数据源类RcrtcDesktopCapturerTrackSource 继承webrWebrtc一 | peerconnectionhttps://zfunnily.github.io/2021/11/webrtcpeerconnection/Sun, 14 Nov 2021 16:20:31 +0800https://zfunnily.github.io/2021/11/webrtcpeerconnection/环境 Ubuntu18.04 webrtc M84 国内镜像:https://webrtc.org.cn/mirror/ webrtc交互过程 通过peerconnection的例子来分析webrtc的交互流程 peer_connection 解析 为了便于管理,如编码,回显等,Go-libp2p四 | 穿透NAThttps://zfunnily.github.io/2021/11/gop2pfour/Sun, 07 Nov 2021 15:49:46 +0800https://zfunnily.github.io/2021/11/gop2pfour/本文目的 上文Go-libp2p三 | relay例子已经分析过relay例子,并解释了两个节点如果通过中继服务进行通信。本文改造relay例子 并让这个服务做如下两件事: 交换两个节点的在交换机上的信息,帮助Blog | 随机名人名言https://zfunnily.github.io/2021/11/randomquotes/Fri, 05 Nov 2021 15:50:16 +0800https://zfunnily.github.io/2021/11/randomquotes/本文目的 我的个人博客已经搭建好了,使用的hugo+飞雪的主题。我看到有些博客上有些随机的名人名言,但是这个主题没有。遂自己写一个。 根据飞雪的主题自定义 飞雪主题的github: https://github.com/flysnow-org/maupassant-hugo 复制主题里的文件themGo-libp2p三 | relay例子https://zfunnily.github.io/2021/10/gop2pthree/Sun, 31 Oct 2021 10:13:40 +0800https://zfunnily.github.io/2021/10/gop2pthree/我想做什么 chat和echo两个例子,说明了两个节点之间的通信需要两节点在同一个局域网内,或者有一个节点有公网。 如果我两个节点分别在两个NAT下面, 都在各自的局域网内,则需要有一个中继服务,这个服务做Go-libp2p二 | echo例子https://zfunnily.github.io/2021/10/gop2ptwo/Fri, 29 Oct 2021 11:15:42 +0800https://zfunnily.github.io/2021/10/gop2ptwo/go-libp2p的echo例子分析 进入目录go-libp2p/examples/echo/, 编译 go build 先看README.md, 可以了解到使用echo的方式: 终端B $ ./echo -l 3001 2021/10/28 11:25:33 I am /ip4/127.0.0.1/tcp/3001/p2p/QmTu8sxDi3fSjz9ZMvkAj3qA9YAoGskroEnyLz2ZvfTBhX 2021/10/28 11:25:33 listening for connections 2021/10/28 11:25:33 Now run &#34;./echoGo-libp2p一 | chat例子https://zfunnily.github.io/2021/10/gop2pone/Thu, 28 Oct 2021 14:40:02 +0800https://zfunnily.github.io/2021/10/gop2pone/代码下载 git clone https://github.com/libp2p/go-libp2p.git chat实例分析 进入目录go-libp2p/examples/chat/, 编译 go build 先看README.md, 可以了解到使用chat的方式 在节点 B $ ./chat -sp 3001 2021/10/28 11:01:25 Run &#39;./chat -d /ip4/127.0.0.1/tcp/3001/p2p/QmXgEXt4CiqmVmDhPPQnyVkoj3Bsx3Nggq57PPsk5tLNTs&#39; on another console. 2021/10/28 11:01:25 You can replace 127.0.0.1 with public IPSkynet源码赏析四 | 消息调度https://zfunnily.github.io/2021/10/four/Thu, 21 Oct 2021 10:06:39 +0800https://zfunnily.github.io/2021/10/four/服务间消息流转 发送消息 数据结构message_queue *q是次级消息队列,每个服务都有与之绑定的唯一一个次级消息队列。当我们在lua层,调用skynet.send(...), 或者调用skynet.cSkynet源码赏析三 | 服务启动https://zfunnily.github.io/2021/10/skynetthree/Wed, 20 Oct 2021 11:26:07 +0800https://zfunnily.github.io/2021/10/skynetthree/skynet启动一个C服务 查看怎么启动C服务的最好的办法是打断点,看源码。 启动logger日志服务 我拿日志服务来举例子,怎么启动日志服务的呢? 传参数name = &quot;logger&quot;, param = null, struct skynet_context *ctx = skynet_context_new(config-&gt;logservice, config-&gt;logger);; 从moduleSkynet源码赏析二 | 基础数据结构https://zfunnily.github.io/2021/10/skynettwo/Tue, 19 Oct 2021 18:47:45 +0800https://zfunnily.github.io/2021/10/skynettwo/module管理模块 我们所写的C服务编译成.so文件后放在cpath变量路径下,程序会加载路径cpath = root..&quot;cservice/?.so&quot;下的.so文件,通过staticSkynet源码赏析一 | 启动初始化的过程https://zfunnily.github.io/2021/10/skynetone/Tue, 19 Oct 2021 17:28:45 +0800https://zfunnily.github.io/2021/10/skynetone/入口文件 skynet_main.c 加载配置 struct skynet_config config; config.thread = optint(&#34;thread&#34;,8); config.module_path = optstring(&#34;cpath&#34;,&#34;./cservice/?.so&#34;); config.harbor = optint(&#34;harbor&#34;, 1); config.bootstrap = optstring(&#34;bootstrap&#34;,&#34;snlua bootstrap&#34;); config.daemon = optstring(&#34;daemon&#34;, NULL); config.logger = optstring(&#34;logger&#34;, NULL); config.logservice = optstring(&#34;logservice&#34;, &#34;logger&#34;); config.profile = optboolean(&#34;profile&#34;, 1); 从上述代码可以看到,配置都已经加载到变量struct skynet_config config;中了。 初始化 初始化skynet_context管Golang | 调用带有后台进程shell脚本可能会被挂起https://zfunnily.github.io/2021/10/shell/Wed, 13 Oct 2021 17:15:45 +0800https://zfunnily.github.io/2021/10/shell/起因 今天用Golang写一个调用外部shell脚本的程序,使用 exec.Command方法,这段脚本代码中包含了一个后台任务语句。 结果发生了一个问题:cmd.Output 始终不会返回,一直挂起。导致我FPS游戏 | 实现移动功能https://zfunnily.github.io/2021/09/move/Sun, 12 Sep 2021 20:43:34 +0800https://zfunnily.github.io/2021/09/move/三种实现FPS Controller的区别 Transform Translate 允许移动物理,但无物理碰撞 Rigid body + Capsule Collider 符合物理学 不会鬼穿墙 无法滞空运动 可与Physics Object 交互 Charactor Controller 不会鬼穿墙 提供的API相对多 无法与Physic objects免费Musichttps://zfunnily.github.io/2021/09/music/Wed, 08 Sep 2021 14:47:14 +0800https://zfunnily.github.io/2021/09/music/介绍一个可以免费听音乐的方法 环境 docker mac 安装 $ docker run -d -p 264:264 -p 9000:9000 -v $dir_name:/var/www/html/cache --name music oldiy/music-player-docker $dir_name 是 你自己宿主机的目录。可以自定义 访问:127.0.0.1:264 就可以放心使用, 同事推荐的,贼好用。Unity3D | Transform类https://zfunnily.github.io/2021/09/transform/Tue, 07 Sep 2021 15:55:59 +0800https://zfunnily.github.io/2021/09/transform/Transform类 在unity中,把transform类理解为,transform类是在每个对象生成时自动附加的一个类。在Unity的视图中,点击Hierarchy中的对象,就可以在InspectoUnity3D | UGUIhttps://zfunnily.github.io/2021/08/ugui/Fri, 20 Aug 2021 14:15:41 +0800https://zfunnily.github.io/2021/08/ugui/Text Text的属性 在 Unity 的 Hierarchy 面板上右键–&gt;UI–&gt;Text, 在 Inspector 面板上查看属性 属性 功能 Text 需要显示的文本 Font 显示文本的字体 如:微软雅黑,宋体等 Font Style 显示文本的样式,有普通,粗体,斜体,粗体和斜体四种Golang | redis实现分布式锁https://zfunnily.github.io/2021/06/distribute/Thu, 03 Jun 2021 16:12:21 +0000https://zfunnily.github.io/2021/06/distribute/概述 网上有很多Golang操作redis的例子,我使用github.com/gomodule/redigo/redis包写一个关于redis分布式锁的问题。 redis分布式锁 锁需要的几个组件 获取锁- 删Golang | redishttps://zfunnily.github.io/2021/06/goredis/Thu, 03 Jun 2021 15:57:14 +0800https://zfunnily.github.io/2021/06/goredis/概述 网上有很多golang操作redis的例子,我使用github.com/gomodule/redigo/redis包写一个关于redis分布式锁的问题。 redis分布式锁 锁需要的几个组件 获取锁 删除Lua | next的使用https://zfunnily.github.io/2021/05/lua_next/Mon, 10 May 2021 16:39:50 +0800https://zfunnily.github.io/2021/05/lua_next/lua_next lua_next(L,index):先把 表(lua栈 index所指的表), 的当前索引弹出,再把table 当前索引的值弹出,也就是先弹出 table的索引,再弹出table索引的值 举例: local t = { [&#34;a&#34;] = 1, [&#34;b&#34;]Lua | APIhttps://zfunnily.github.io/2021/05/settopandpop/Mon, 10 May 2021 15:57:03 +0800https://zfunnily.github.io/2021/05/settopandpop/lua_pop和lua_settop lua_settop 我们直接来看lua_settop,文档解释 /* 设置栈的高度,如果之前的栈顶比新设置的更高,那么高出来的元素会被丢弃,反之压入nil来补足大小 假设栈里有2个元素。 如果Golang | gomod拉取私有仓库https://zfunnily.github.io/2021/03/gomod/Tue, 23 Mar 2021 16:10:02 +0000https://zfunnily.github.io/2021/03/gomod/概述 在使用go mod的过程中,依赖的包往往是第三方库,当我们自定义一个包并且放在github.com私有仓库时候,按照原来的方法则会有如下问题。 get &#34;gitlab.com/xxx/zz&#34;: found meta tag get.metaImport{Prefix:&#34;gitlab.com/xxx/zz&#34;, VCS:&#34;git&#34;, RepoRoot:&#34;https://gitlab.com/xxx/zz.git&#34;} at //gitlab.com/xxx/zz?go-get=1 verifying gitlab.com/xxx/zz@v0.0.1: gitlab.com/xxx/zz@v0.0.1: reading https://sum.golang.org/lookup/gitlab.com/xxx/zz@v0.0.1: 410 Gone 这个错误是因为新版本g八个基础排序https://zfunnily.github.io/2021/03/sort/Tue, 23 Mar 2021 10:13:31 +0000https://zfunnily.github.io/2021/03/sort/sort排序 std::sort( )函数是库函数提供的排序函数,必须包括头文件#include &lt;algorithm&gt;,它使用的排序方法是类似于快排的方法,时间复杂度为n*log2(n) Sort函数有三个参数:《仙剑奇侠传》编译运行https://zfunnily.github.io/2021/03/gamexian/Sun, 21 Mar 2021 10:44:58 +0000https://zfunnily.github.io/2021/03/gamexian/概述 今天在github上找到了《仙剑奇侠传》的rpg单机游戏sdlpal,sdlpal 是一个开源项目,基于sdl把仙剑奇侠传重写了一遍。 下面是我的编译过程总结。 环境 win10- sdl1.2- sdlpal- vs2017- DirectX SDK10 下载sdlpal $ git clone https://github.com.cnpmjs.org/sdlpal/sdlpal.git实现atoi和itoa函数https://zfunnily.github.io/2021/03/atoianditoa/Wed, 17 Mar 2021 16:43:20 +0000https://zfunnily.github.io/2021/03/atoianditoa/题目1: 把字符串转化为整数 有整数字符串,&quot;13579&quot;, 和 &quot;246810&quot;. 请写一个函数把这两个字符串转化为整数 步骤: 先判断正负 遍历字符串,转换字符为整数 //atoi.cc #include &lt;stdio.h&gt; int my_atoi(char *str) { bool bmin = false; int result = 0; //先判断正协程解析二 | 云风的coroutinehttps://zfunnily.github.io/2021/03/coroutinetwo/Wed, 10 Mar 2021 11:11:47 +0000https://zfunnily.github.io/2021/03/coroutinetwo/概述 云风的coroutine是通过ucontext来控制程序运行时上下文的,我们来根据该库提供的几个接口,和一个demo来解释协程的运行原理。如果不了解ucontext的,建议先了解ucontxt 环境协程解析一 | ucontexthttps://zfunnily.github.io/2021/03/coroutineone/Tue, 09 Mar 2021 09:43:00 +0000https://zfunnily.github.io/2021/03/coroutineone/概述 最近在研究协程的实现原理,看了云风的coroutine和腾讯的开源库libco后,原来要实现一个协程库也没那么难。我先来讲讲云风的coroutine库。他使用的是 uncontext来保存程序运行上Golang | 定时器https://zfunnily.github.io/2021/02/timer/Thu, 25 Feb 2021 16:02:13 +0000https://zfunnily.github.io/2021/02/timer/概述 golang有三种方式实现定时器: ticker timer select Ticker 通过 time.NewTicker(d)的方式实现定时器 d := time.Duration(time.Second * 2) t1 := time.NewTicker(d) defer t1.Stop() go func() { for { &lt;- t1.C fmt.Println(&#34;NewTicker...&#34;) } }() Timer 通过 time.NewTimer(d)的方式实现定时器 t2 := time.NewTimer(d)Lua | 解决百元买鸡的问题https://zfunnily.github.io/2021/02/chicken/Wed, 24 Feb 2021 17:51:46 +0000https://zfunnily.github.io/2021/02/chicken/问题 编写lua程序求解百鸡百钱问题。公鸡5元一只,母鸡3元一只,小鸡一元3只,问100元钱买100只鸡,可买公鸡、母鸡、小鸡各多少只? 代码 ----------------------------------------------------------------------------- --公鸡5元一只,母鸡3元一只,小鸡一元3只,问100元钱买Golang | JWT身份认证https://zfunnily.github.io/2021/02/JWT/Wed, 24 Feb 2021 14:22:04 +0000https://zfunnily.github.io/2021/02/JWT/概述 最近要在http接口上加一个token认证,但是接口很多,有没有一个省时省力的办法来解决。token的使用流程是: 用户使用帐号密码登陆到服务器1. 服务器验证登陆成功,根据帐号密码生成token。把Lua | 调用C/C++的动态库https://zfunnily.github.io/2021/02/dynamic/Sat, 20 Feb 2021 11:11:51 +0000https://zfunnily.github.io/2021/02/dynamic/概述 最近在学习 云风的skynet库,想自定义一个模块,目标是使用lua调用C/C++所编写的库。 当我们需要在Lua里面调用c/c++函数时,所有的函数都必须满足以下函数签名: typedef int (*lua_CFunction) (lua_State *L); 换句话说,所有的汇编 | C/C++调用汇编https://zfunnily.github.io/2021/02/compilation/Mon, 01 Feb 2021 14:40:51 +0000https://zfunnily.github.io/2021/02/compilation/概述 我使用AT&amp;T的规范,在linux上完成 C和汇编的互相调用,并使用gcc编译成可执行文件。 目标:汇编函数提供输出。类似C语言的函数 void hello_world(char* value) { printf(value); } 提供给C语言调用: int main() { hello_world(&#34;hello world!\n&#34;); } 搭建AT&amp汇编 | AT&T和Intel规范的区别https://zfunnily.github.io/2021/01/attandintel/Sun, 31 Jan 2021 11:25:39 +0000https://zfunnily.github.io/2021/01/attandintel/概述 常见的指令集以及汇编语言规范: x86(IA-32)、x86-64指令集(常见于PC端),对应有2家公司发布的不同汇编语言规范: intel公司发布的汇编语言规范,称intel 汇编:Windows派系Skynet | lua-protobufhttps://zfunnily.github.io/2021/01/skynetprotobuf/Mon, 25 Jan 2021 14:25:07 +0000https://zfunnily.github.io/2021/01/skynetprotobuf/概述 在最新的skynet中我使用的是云风的pbc库来解析protobuf,该项目中的一个文件protobuf.lua 使用了module语法在lua5.1版本中已经删除,最新的skynet是lua5.4Protobuf | 请求参数为空的案例https://zfunnily.github.io/2021/01/pbempty/Fri, 22 Jan 2021 16:41:16 +0000https://zfunnily.github.io/2021/01/pbempty/参数为空的grpc请求怎么定义 google protobuf已经提供了空参数 //empty.proto message Empty {&lt;!-- --&gt;} 使用方法,在proto文件中导入empty.proto, 定义一个请求参数和返回值为空的函数emptyfunction, 函数名字Golang | C数组转化为Golang的切片类型https://zfunnily.github.io/2021/01/goslience/Fri, 22 Jan 2021 15:56:40 +0000https://zfunnily.github.io/2021/01/goslience/概述 最近在巩固cgo的基础知识,在网上看到一篇Go和C之间 字符串数组、切片类型转换的文章,让我想到我之前写的一篇在go中遍历C结构体数组的文章,让我有新的方法来解决之前的问题,把C的数组转化为Go的切Skynet | echo服务https://zfunnily.github.io/2021/01/skynetecho/Fri, 15 Jan 2021 16:07:51 +0000https://zfunnily.github.io/2021/01/skynetecho/概述 引用云风博客的话:“skynet 是一个为网络游戏服务器设计的轻量框架。但它本身并没有任何为网络游戏业务而特别设计的部分,所以尽可以把它用于其它领域。skynet 并不是一个开箱即用的引擎,使用它需要Redis源码分析 | ziplisthttps://zfunnily.github.io/2021/01/ziplist/Wed, 13 Jan 2021 17:52:27 +0000https://zfunnily.github.io/2021/01/ziplist/概述 Redis中的List是一个有序(按加入的时序排序)的数据结构,一般有序我们会采用数组或者是双向链表,其中双向链表由于有前后指针实际上会很浪费内存。3.2版本之前采用两种数据结构作为底层实现: 压缩Redis源码解析 | VScode调试https://zfunnily.github.io/2021/01/vscodedebugredis/Tue, 12 Jan 2021 14:25:29 +0000https://zfunnily.github.io/2021/01/vscodedebugredis/环境 vscode- gcc5.4 ubuntu16.04 或者 ubuntu18.04 make 下载6.2版本. 我使用的是国内github镜像地址:github.com.cnpmjs.org,速度比较快。 $ git clone https://github.com.cnpmjs.org/redis/redis.git redis $ git checkout -b 6.2 remotes/origin/6.2 vscode不参与编译,只充当可视化的调试工具。 使用VScode | 调试Redis源码,指针显示的问题https://zfunnily.github.io/2021/01/vscoderedis/Tue, 12 Jan 2021 14:17:22 +0000https://zfunnily.github.io/2021/01/vscoderedis/缘由 使用VScode的时候,断点看到指针显示的是一串地址,而不是指针指向的对象的值。上网找了一圈,没看到vscode有对应的插件来解决这个问题。vscode有对应的语法来解决这个问题。 网上几乎都在说在Cgo | 遍历C结构体数组https://zfunnily.github.io/2021/01/cgostruct/Mon, 11 Jan 2021 17:18:35 +0000https://zfunnily.github.io/2021/01/cgostruct/缘由 现在有个应用场景,我们要在go中获取C结构体数组中的值。在C语言中,对于结构体数组,我们可以利用指针的偏移量来获取我们想要的值的位置。在go中我们怎么使用C指针和偏移量进行运算呢?下面的文字中C指Redis源码解析 | sdshttps://zfunnily.github.io/2021/01/sds/Wed, 06 Jan 2021 14:20:23 +0000https://zfunnily.github.io/2021/01/sds/SDS头文件及作用 sds.h: sds声明- sdsalloc.h: 为sds分配内存 源码文件sds.h中有这样一行代码 typedef char *sds; 很清晰、明了,sds其实就是char*。 最新的6.2分支的代码: struct __attribute__ ((__packed__)) sdshdr5 {&lt;!-- --&gt; unsigned char flags; /* 3 lsb ofstruct中使用char[]https://zfunnily.github.io/2021/01/chararray/Tue, 05 Jan 2021 15:45:36 +0000https://zfunnily.github.io/2021/01/chararray/缘由 最近在看redis的源码,刚开始看sds,看到这块代码 struct __attribute__ ((__packed__)) sdshdr5 { unsigned char flags; /* 3 lsb of type, and 5 msb of string length */ char buf[]; }; 好奇为什么使用 char buf[],而不用char *buf,找到答案记录一下。 struct中的char*Lastbattle | 游戏场景服务器SS解析https://zfunnily.github.io/2021/01/lastbattle/Sat, 02 Jan 2021 23:19:58 +0000https://zfunnily.github.io/2021/01/lastbattle/游戏场景服务器概况 指令对应的处理handle的文件:SSBattleMgr.cpp 创建战场 指令: eMsgToSSFromCS_CreateBattle GC服务器发往SS fromCS 收到中心服务器CS创建站场的指令,在函数INT32 CSSBattleMgr::OnMsgFromCS_CreateBattle(const char* pData, int n32DataLengtCCnet | 单线程reactor演变为多线程https://zfunnily.github.io/2020/12/ccnet/Wed, 30 Dec 2020 09:19:41 +0000https://zfunnily.github.io/2020/12/ccnet/ccnet从单线程演变为多线程 ccnet现状: epoll linux平台 事件循环 单线程 reactor 监听和新连接的事件都在主线程中 单线程的ccnet ccnet的单线程的角色: EventLoop: 整个事件循环。 EPollPoller: 负责事件的收集。 ChannelGolang | sync.Mutex详解https://zfunnily.github.io/2020/12/syncmutex/Tue, 29 Dec 2020 13:17:18 +0000https://zfunnily.github.io/2020/12/syncmutex/概述 自己做的一个golang项目需要优化,优化方向是减少gpu内存的使用。同一个模型被重复加载多次,使用更多的gpu内存,也增加 sync.Mutex的使用。 优化的方向是: 减少代码量的改动- 减少gpu内五种网络IO模型总结https://zfunnily.github.io/2020/12/iomodels/Mon, 28 Dec 2020 11:57:04 +0000https://zfunnily.github.io/2020/12/iomodels/概述 在网络上看到很多关于阻塞IO、非阻塞IO、同步IO、异步IO的例子,总觉得写的过于复杂并且让人难以理解。于是我把我自己把这几个概念的理解写下来以供参考。 POSIX POSIX(可移植操作系统接口)把同步IOCCnet | 一个reactor单线程网络库https://zfunnily.github.io/2020/12/ccnetone/Sun, 27 Dec 2020 18:41:25 +0000https://zfunnily.github.io/2020/12/ccnetone/缘由 最近在研究陈硕的网络库muduo,是一个基于reactor架构的网络库。我对网络库的感觉是易用,但是内容庞大,依赖颇多。比如boost网络库里面的一些语法让人生畏。关于reactor和proactC++ | vector中的resize()函数 VS reserve()函数https://zfunnily.github.io/2020/12/reserve/Fri, 25 Dec 2020 11:04:29 +0000https://zfunnily.github.io/2020/12/reserve/reserve void reserve (size_type n); reserver函数用来给vector预分配存储区大小,即capacity的值 ,但是没有给这段内存进行初始化。reserve 的参数n是推荐预分配内存的大小,实际分配的可能等于或大于这个值,即Golang | 用gocolly登录B站https://zfunnily.github.io/2020/12/gocolly/Sun, 13 Dec 2020 14:51:53 +0000https://zfunnily.github.io/2020/12/gocolly/概述 gocolly是golang语言开发的爬虫包,通过gocolly来进行模拟网站的登录, 目标已经确立,开始行动。 下载 $ go get -u github.com/gocolly/colly 获取cookie 登录网站:https://www.bilibili.coProtobuf | 沾包问题https://zfunnily.github.io/2020/12/tcp/Sun, 13 Dec 2020 10:22:38 +0000https://zfunnily.github.io/2020/12/tcp/缘由 最近在研究一款游戏的源码。发现里面的通信协议是protobuf定义的,但还是自己定义了协议头部,类似 head + body。先解析头部里所存储的整个包的数据长度,然后再解析包剩余的数据,这样做的目的是为了防Grpc | 概述https://zfunnily.github.io/2020/12/grpc/Sun, 13 Dec 2020 09:10:42 +0000https://zfunnily.github.io/2020/12/grpc/OverView gRPC是由Google主导开发的RPC框架,使用HTTP/2协议并用ProtoBuf作为序列化工具。其客户端提供Objective-C、Java接口,服务器侧则有Java、Golang、C++等接Openresty二 | postman小工具https://zfunnily.github.io/2020/11/%E4%BD%BF%E7%94%A8OpenResty%E5%81%9A%E4%B8%80%E4%B8%AApostman%E5%B0%8F%E5%B7%A5%E5%85%B7/Wed, 25 Nov 2020 16:30:39 +0800https://zfunnily.github.io/2020/11/%E4%BD%BF%E7%94%A8OpenResty%E5%81%9A%E4%B8%80%E4%B8%AApostman%E5%B0%8F%E5%B7%A5%E5%85%B7/用到的知识点 mvc架构 模型渲染库:https://github.com/bungle/lua-resty-template resty http请求库: https://github.com/bungle/lua-resty-template 参照 mvc模型来做postman工具 配置文件说明 worker_processes 1; error_log logs/error.log; eventsOpenresty一 | 初探https://zfunnily.github.io/2020/11/OpenResty%E5%88%9D%E6%8E%A2/Mon, 23 Nov 2020 16:21:34 +0800https://zfunnily.github.io/2020/11/OpenResty%E5%88%9D%E6%8E%A2/概述 OpenResty®是一个基于Nginx与 Lua 的高性能 Web 平台,其内部集成了大量精良的 Lua 库、第三方模块以及大多数的依赖项。用于方便地搭建能够处理超高并发、扩展性极高的动态 Web 应用、Web 服务和动态网关。LastBattle | 登录流程(LS & BS & GS)https://zfunnily.github.io/2020/11/lastbattlelogin/Fri, 20 Nov 2020 17:27:08 +0000https://zfunnily.github.io/2020/11/lastbattlelogin/登录流程 根据上一篇文章中的登录流程,我在工程中找到了相应的代码并记录了下来 登录服务代码解析 监听端口:49997 供BS服务连接 监听端口:49996 供客户端连接 CIocpCtrl:IOCP控制类 多线程循环LastBattle | 服务架构https://zfunnily.github.io/2020/11/lastbattleserver/Fri, 20 Nov 2020 17:24:32 +0000https://zfunnily.github.io/2020/11/lastbattleserver/服务器架构简图如下: 连线说明: 实线:表示客户端登录流程,①②③④⑤表示登录流程,详细解释见下文。 虚线:表示服务器间的连接,虚线箭头指向监听方。 架构说明: |英文名称|简称|中文名称|功能简介|单个大区需LastBattle | 安装部署笔记https://zfunnily.github.io/2020/11/lastbattleone/Mon, 16 Nov 2020 06:49:49 +0000https://zfunnily.github.io/2020/11/lastbattleone/环境准备 win10 服务器:vs2010 / 数据库 mysql5.7 清华大学mysql镜像网站:https://mirrors.tuna.tsinghua.edu.cn/mysql/downloads/MySQL-5.7/ 客户端Cgo | 使用libevent库实现一个定时器https://zfunnily.github.io/2020/11/cgo%E4%BD%BF%E7%94%A8libevent%E5%BA%93%E5%AE%9E%E7%8E%B0%E4%B8%80%E4%B8%AA%E5%AE%9A%E6%97%B6%E5%99%A8/Fri, 13 Nov 2020 16:40:42 +0000https://zfunnily.github.io/2020/11/cgo%E4%BD%BF%E7%94%A8libevent%E5%BA%93%E5%AE%9E%E7%8E%B0%E4%B8%80%E4%B8%AA%E5%AE%9A%E6%97%B6%E5%99%A8/使用libevent库作为例子 下载 &amp; 编译 &amp; 安装libevent $ git clone https://github.com.cnpmjs.org/libevent/libevent.git $ cd libevent &amp;&amp; mkdir build &amp;&amp; cd build $ cmake .. $ make libevent实现的定时器 // main.cpp #include &#34;event.h&#34; struct event ev; struct timeval tv; void time_cb(evutil_socket_t fd, short event, void *argc) { printf(&#34;timer wakeup\n&#34;); event_add(&amp;ev, &amp;tv); // reschedule timer } int main() { struct event_base *base = event_base_new(); tv.tv_sec = 2;Golang | 利用指针进行数据转换https://zfunnily.github.io/2020/11/Golang-%E5%88%A9%E7%94%A8%E6%8C%87%E9%92%88%E8%BF%9B%E8%A1%8C%E6%95%B0%E6%8D%AE%E8%BD%AC%E6%8D%A2/Thu, 12 Nov 2020 17:19:07 +0000https://zfunnily.github.io/2020/11/Golang-%E5%88%A9%E7%94%A8%E6%8C%87%E9%92%88%E8%BF%9B%E8%A1%8C%E6%95%B0%E6%8D%AE%E8%BD%AC%E6%8D%A2/概述 在Go语言中,Slice本质是什么呢?是一个reflect.SliceHeader结构体和这个结构体中Data字段所指向的内存。String本质是什么呢?是一个reflect.StringHeadGolang | buildshttps://zfunnily.github.io/2020/11/go-builds/Thu, 12 Nov 2020 17:15:17 +0000https://zfunnily.github.io/2020/11/go-builds/概述 通常我们会给每个产品环境设置不同的配置,比如 redis 要在开发环境就连接 localhost:6379,测试环境可能连接某一个主机的 redis。 如果放在 go 里面是否可行?因为 go 是编译二进制包,也没有动态加载这Cgo | 简单使用https://zfunnily.github.io/2020/11/cgo%E7%9A%84%E7%AE%80%E5%8D%95%E4%BD%BF%E7%94%A8/Thu, 05 Nov 2020 09:45:23 +0000https://zfunnily.github.io/2020/11/cgo%E7%9A%84%E7%AE%80%E5%8D%95%E4%BD%BF%E7%94%A8/使用自己的C函数 文件名:testC.go package main /* #include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; void c_print(char *str) { printf(&#34;%s\n&#34;, str); } */ import &#34;C&#34; //import “C” 必须单起一行,并且紧跟在注释行之后 import &#34;unsafe&#34; func main() { s := &#34;Hello Cgo&#34; cs := C.CString(s) //字符串映射 C.c_print(cs) //调用C函数 defer C.free(unsafe.Pointer(cs)) //释放内存 } 说明: 1、gGolang | 使用Lumberjack+zap进行日志切割归档https://zfunnily.github.io/2020/11/%E4%BD%BF%E7%94%A8Lumberjack-zap%E8%BF%9B%E8%A1%8C%E6%97%A5%E5%BF%97%E5%88%87%E5%89%B2%E5%BD%92%E6%A1%A3/Wed, 04 Nov 2020 12:44:03 +0000https://zfunnily.github.io/2020/11/%E4%BD%BF%E7%94%A8Lumberjack-zap%E8%BF%9B%E8%A1%8C%E6%97%A5%E5%BF%97%E5%88%87%E5%89%B2%E5%BD%92%E6%A1%A3/使用Lumberjack+zap进行日志切割归档 为了添加日志切割归档功能,我们将使用第三方库Lumberjack来实现。 安装 执行下面的命令安装Lumberjack go get -u github.com/natefinch/lumberjack zap logger中加入LumbeTCP/IP | 大量TIME_WAIT对线上业务的影响https://zfunnily.github.io/2020/10/%E5%A4%A7%E9%87%8FTIME_WAIT%E5%AF%B9%E7%BA%BF%E4%B8%8A%E4%B8%9A%E5%8A%A1%E7%9A%84%E5%BD%B1%E5%93%8D/Sat, 10 Oct 2020 16:46:34 +0000https://zfunnily.github.io/2020/10/%E5%A4%A7%E9%87%8FTIME_WAIT%E5%AF%B9%E7%BA%BF%E4%B8%8A%E4%B8%9A%E5%8A%A1%E7%9A%84%E5%BD%B1%E5%93%8D/TCP的三次握手和四次挥手 TIME_WAIT概述 TIME_WAIT 状态: TCP 连接中,主动关闭连接的一方出现的状态;(收到 FIN 命令,进入 TIME_WAIT 状态,并返回 ACK 命令) 保持 2 个 MSL 时间,即,4 分钟 ;(MSL 为 2 分钟) TCP 连接建立后,「主Libevent | 定时器https://zfunnily.github.io/2020/09/libeventimer/Wed, 16 Sep 2020 23:20:28 +0000https://zfunnily.github.io/2020/09/libeventimer/libevent 实现定时器流程 首先初始化libevent库,并保存返回的指针 struct event_base * base = event_init(); 实际上这一步相当于初始化一个Reactor实例;在初始化libevent后,就可以注册事件了。 初始化事件event,设置回调函FFmpeg | 画中画和视频多宫格处理https://zfunnily.github.io/2020/09/ffmpegpicture/Mon, 14 Sep 2020 18:29:33 +0000https://zfunnily.github.io/2020/09/ffmpegpicture/FFmpeg生成画中画 静态画中画 将视频sub.mp4视频文件缩放成宽 480 、高 320 的视频,然后显示在 视频 input.mp4,x坐标为0,y 坐标为0 的位置 ffmpeg -re -i input.mp4 -vf &#34;movie=sub.mp4, scale=480x320[test]; [in][test]overlay [out]&#34; -vcodec libx264 output.flv 显示在画面的右下角,则需要用到FFmpeg | 给视频加文字和图片水印https://zfunnily.github.io/2020/09/ffmpegvideo/Sat, 12 Sep 2020 12:47:57 +0000https://zfunnily.github.io/2020/09/ffmpegvideo/FFmpeg给视频加上logo ffmpeg从视频中截取图像帧 ffmpeg -i inputfile.avi -r 1 -f image2 image-%05d.jpeg ffmpeg -i inputfile.avi -r 1 -s 4cif -f image2 image-%05d.jpeg ffmpeg -i inputfile.avi -r 1 -t 4 -f image2 image-%05d.jpeg ffmpeg -i inputfile.avi -r 1 -ss 01:30:14 -f image2 image-%05d.jpeg ffmpeg -i inputfile.avi -r 1 -ss 01:30:14 -vframes 120 4cif -f image2 image-%05d.jpeg -r 指定抽取的帧率,即从视频中每秒钟抽取FFmpeg | 录制摄像头和桌面数据windowshttps://zfunnily.github.io/2020/09/ffmpegvideow/Wed, 09 Sep 2020 09:36:49 +0000https://zfunnily.github.io/2020/09/ffmpegvideow/概述 FFmpeg Windows 设备操作 Windows 采集设备的主要方式是 dshow vfwcap gdigrab 其中 dshow 可以用来抓 取摄像头、采集卡、麦克风等,- vfwcap 主要用来采集摄像头类设备,- gdigrab 则是抓取 Windows 窗口程序 FFmpeg 使用 dshow 采集音视频设备 使用 dshow 枚举设备 ffmpeg -f dshow -list_devices true -i dymmy 输出 [dshow @ 000002622302e340]FFmpeg | 录制摄像头和桌面数据machttps://zfunnily.github.io/2020/08/macffmpeg/Sat, 29 Aug 2020 17:20:40 +0000https://zfunnily.github.io/2020/08/macffmpeg/设备枚举 查看设备列表 $ ffmpeg -hide_banner -devices Devices: D. = Demuxing supported .E = Muxing supported -- D avfoundation AVFoundation input device D lavfi Libavfilter virtual input device E sdl,sdl2 SDL2 output device 可以看到输入设备有:avfoundation,lavfi 输出设备有:sdl `` 设备采集举例: $ ffmpeg -f avfoundation -list_devices true -i &#34; &#34; 看到了 如下设Owt-server | owt-client-javascripthttps://zfunnily.github.io/2020/08/owt-client-javascript/Sun, 16 Aug 2020 23:04:13 +0000https://zfunnily.github.io/2020/08/owt-client-javascript/概述 天气燥热,不易出门。遂研究一下owt-server,从owt-client-javascript的流程开始吧。 获取一个会议室 owt-client-javascript的时候有一个初始化房间的过程 ///owt-client-javascript/src/samples/conference/samplertcservice.jsLicod | 安装和配置https://zfunnily.github.io/2020/08/licode/Sun, 09 Aug 2020 09:34:36 +0000https://zfunnily.github.io/2020/08/licode/拉取docker镜像并运行 licode官方提供了配置好的docker镜像,使用以下命令拉下来跑就行。 docker run --name licode -p 3000:3000 -p $MIN_PORT-$MAX_PORT:30000-30050/udp -p 3001:3001 -p 8080:8080 -e &#34;MIN_PORT=30000&#34; -e &#34;MAX_PORT=30050&#34; -e &#34;PUBLIC_IP=your_ip_address&#34; lynckia/licode 注意命令里的PUBLIC_IP要改为服务器的公网IP。 配置好之Owt-server | 编译运行https://zfunnily.github.io/2020/08/owtservercomplie/Wed, 05 Aug 2020 09:47:22 +0000https://zfunnily.github.io/2020/08/owtservercomplie/概述 owt是一套完整的webrtc视频会议系统。包含的功能模块有: 视频会议1. p2p 服务器是owt-server通过nodejs编写的webrtc信令。依赖是licode。licode依赖webrtc。 客 \ No newline at end of file +编程 on Zzz记忆https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B/Recent content in 编程 on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000URP 不透明/半透明物体的折射https://zfunnily.github.io/2022/05/refraction/Tue, 17 May 2022 11:30:48 +0800https://zfunnily.github.io/2022/05/refraction/折射 应用场景 水池 玻璃 热空气(热扭曲) GrabPass + CubeMap 《Unity3D Shader入门精要》第十章介绍了,模拟实现折射效果有两种 使用cubemap: 我认为太麻烦.需要的贴图太多。也没有找到其他合适的使用场景,遂搁URP 不透明/半透明物体的折射https://zfunnily.github.io/2022/05/refraction/Tue, 17 May 2022 11:30:48 +0800https://zfunnily.github.io/2022/05/refraction/折射 应用场景 水池 玻璃 热空气(热扭曲) GrabPass + CubeMap 《Unity3D Shader入门精要》第十章介绍了,模拟实现折射效果有两种 使用cubemap: 我认为太麻烦.需要的贴图太多。也没有找到其他合适的使用场景,遂搁《Unity Shader入门精要》第八章笔记 | 透明度https://zfunnily.github.io/2022/05/shaderalpha/Sat, 07 May 2022 17:17:18 +0800https://zfunnily.github.io/2022/05/shaderalpha/渲染顺序 名称 队列索引号 描 述 Background 1000 这个渲染队列会在任何其他队列之前被渲染,我们通常使用该队列来渲染那些需要绘制在背景上的物体 Geometry 2000 默认的渲染队列,大多数物体都使用这个队列。不透明物体使用这个队列 AlphaTest 2450 需要透明《Unity Shader入门精要》第八章笔记 | 透明度https://zfunnily.github.io/2022/05/shaderalpha/Sat, 07 May 2022 17:17:18 +0800https://zfunnily.github.io/2022/05/shaderalpha/渲染顺序 名称 队列索引号 描 述 Background 1000 这个渲染队列会在任何其他队列之前被渲染,我们通常使用该队列来渲染那些需要绘制在背景上的物体 Geometry 2000 默认的渲染队列,大多数物体都使用这个队列。不透明物体使用这个队列 AlphaTest 2450 需要透明《Unity Shader入门精要》第六章笔记 | 基础光照https://zfunnily.github.io/2022/05/shaderlighting/Sat, 07 May 2022 16:22:40 +0800https://zfunnily.github.io/2022/05/shaderlighting/我们是如何看到这个世界的 光源: 在光学里,我们使用辐照度 (irradiance) 来量化光 物体的吸收和散射: 光线由光源发射出来后,就会与一些物体相交 着色: 根据材质属性(如漫反射属性等)、光源信息(如光源方《Unity Shader入门精要》第六章笔记 | 基础光照https://zfunnily.github.io/2022/05/shaderlighting/Sat, 07 May 2022 16:22:40 +0800https://zfunnily.github.io/2022/05/shaderlighting/我们是如何看到这个世界的 光源: 在光学里,我们使用辐照度 (irradiance) 来量化光 物体的吸收和散射: 光线由光源发射出来后,就会与一些物体相交 着色: 根据材质属性(如漫反射属性等)、光源信息(如光源方《Unity Shader入门精要》第五章笔记 | 开始shader练习https://zfunnily.github.io/2022/05/shaderbase/Sat, 07 May 2022 10:22:33 +0800https://zfunnily.github.io/2022/05/shaderbase/一个简单的顶点/片元着色器 代码 Shader &#34;Unity Shaders Book/Chapter 5/Simple Shader&#34; { Properties { // 声明一个Color类型的属性 _Color (&#34;Color Tint&#34;, Color) = (1.0,1.0,1.0,1.0) } SubShader { Pass { CGPROGRAM #pragma vertex vert #pragma fragment frag // 在Cg代码中,我们需要定义一个与属性名称和类型都匹配的变量 fixed4 _Color; // 使用一个结构体来定义《Unity Shader入门精要》第五章笔记 | 开始shader练习https://zfunnily.github.io/2022/05/shaderbase/Sat, 07 May 2022 10:22:33 +0800https://zfunnily.github.io/2022/05/shaderbase/一个简单的顶点/片元着色器 代码 Shader &#34;Unity Shaders Book/Chapter 5/Simple Shader&#34; { Properties { // 声明一个Color类型的属性 _Color (&#34;Color Tint&#34;, Color) = (1.0,1.0,1.0,1.0) } SubShader { Pass { CGPROGRAM #pragma vertex vert #pragma fragment frag // 在Cg代码中,我们需要定义一个与属性名称和类型都匹配的变量 fixed4 _Color; // 使用一个结构体来定义MAC平台几何着色器不生效https://zfunnily.github.io/2022/05/geometry/Thu, 05 May 2022 16:49:29 +0800https://zfunnily.github.io/2022/05/geometry/问题 MAC平台几何着色器不生效 解决步骤 unity shaderlab 怎么设置以至于支持几何着色器 找原因,设置 编译目标级别,#pragma target 4.0, 不管用 看到一句话,Unity 在 Metal 图形上支持曲面细分着色器,但 Metal 不支持几何着色器 找到maMAC平台几何着色器不生效https://zfunnily.github.io/2022/05/geometry/Thu, 05 May 2022 16:49:29 +0800https://zfunnily.github.io/2022/05/geometry/问题 MAC平台几何着色器不生效 解决步骤 unity shaderlab 怎么设置以至于支持几何着色器 找原因,设置 编译目标级别,#pragma target 4.0, 不管用 看到一句话,Unity 在 Metal 图形上支持曲面细分着色器,但 Metal 不支持几何着色器 找到maShaderLab常用函数https://zfunnily.github.io/2022/04/shaderfunc/Wed, 20 Apr 2022 15:41:29 +0800https://zfunnily.github.io/2022/04/shaderfunc/数学函数 cg/hlsl函数 功能描述 dot(A,B) 点积, 点积结果为标量,主要用于求向量的夹角或b向量在a向量上的投影 cross(A,B) 叉积, 叉积结果为向量,结果与这两个向量组成的平面垂直。主要用于3D图形学 mul(M, N) 矩阵M和矩阵N的积 mul(M,ShaderLab常用函数https://zfunnily.github.io/2022/04/shaderfunc/Wed, 20 Apr 2022 15:41:29 +0800https://zfunnily.github.io/2022/04/shaderfunc/数学函数 cg/hlsl函数 功能描述 dot(A,B) 点积, 点积结果为标量,主要用于求向量的夹角或b向量在a向量上的投影 cross(A,B) 叉积, 叉积结果为向量,结果与这两个向量组成的平面垂直。主要用于3D图形学 mul(M, N) 矩阵M和矩阵N的积 mul(M,UnityCG.cginc中常用函数https://zfunnily.github.io/2022/04/cginc/Wed, 20 Apr 2022 15:35:49 +0800https://zfunnily.github.io/2022/04/cginc/摄像机方向 WorldSpaceViewDir 输入一个模型空间中的顶点坐标 -&gt; 输出(世界空间)从这个点到摄像机的观察方向; WorldSpaceViewDir // 内部实现也是用UnityWorldSpaceViewDir // Computes world space view direction, from object space position // *Legacy* Please use UnityWorldSpaceViewDir instead inline float3 WorldSpaceViewDir( in float4 localPos ) { float3 worldPosUnityCG.cginc中常用函数https://zfunnily.github.io/2022/04/cginc/Wed, 20 Apr 2022 15:35:49 +0800https://zfunnily.github.io/2022/04/cginc/摄像机方向 WorldSpaceViewDir 输入一个模型空间中的顶点坐标 -&gt; 输出(世界空间)从这个点到摄像机的观察方向; WorldSpaceViewDir // 内部实现也是用UnityWorldSpaceViewDir // Computes world space view direction, from object space position // *Legacy* Please use UnityWorldSpaceViewDir instead inline float3 WorldSpaceViewDir( in float4 localPos ) { float3 worldPos《Unity Shader入门精要》第四章笔记 | 学习Shader所需的数学基础https://zfunnily.github.io/2022/04/shadermathematic/Sun, 10 Apr 2022 15:42:33 +0800https://zfunnily.github.io/2022/04/shadermathematic/概述 在学习Shader的过程中,我们最常使用的就是矢量和矩阵(即数学的分支之一——线性代数)。 笛卡儿坐标系 我们使用数学绝大部分都是为了计算位置、距离和角度等变量。而这些计算大部分都是在笛卡儿坐标系 (C《Unity Shader入门精要》第四章笔记 | 学习Shader所需的数学基础https://zfunnily.github.io/2022/04/shadermathematic/Sun, 10 Apr 2022 15:42:33 +0800https://zfunnily.github.io/2022/04/shadermathematic/概述 在学习Shader的过程中,我们最常使用的就是矢量和矩阵(即数学的分支之一——线性代数)。 笛卡儿坐标系 我们使用数学绝大部分都是为了计算位置、距离和角度等变量。而这些计算大部分都是在笛卡儿坐标系 (C《Unity Shader入门精要》第三章笔记| UnityShader基础https://zfunnily.github.io/2022/04/shaderbase/Sun, 10 Apr 2022 14:51:19 +0800https://zfunnily.github.io/2022/04/shaderbase/材质 在Unity中我们需要配合使用材质 (Material) 和Unity Shader才能达到需要的效果。一个最常见的流程是 创建一个材质;活着导入一个材质 创建一个Unity Shader,并把它赋给上一步中《Unity Shader入门精要》第三章笔记| UnityShader基础https://zfunnily.github.io/2022/04/shaderbase/Sun, 10 Apr 2022 14:51:19 +0800https://zfunnily.github.io/2022/04/shaderbase/材质 在Unity中我们需要配合使用材质 (Material) 和Unity Shader才能达到需要的效果。一个最常见的流程是 创建一个材质;活着导入一个材质 创建一个Unity Shader,并把它赋给上一步中《Unity Shader入门精要》第二章笔记 | 渲染流水线https://zfunnily.github.io/2022/04/shaderrenderpipline/Sat, 09 Apr 2022 11:55:55 +0800https://zfunnily.github.io/2022/04/shaderrenderpipline/渲染流水线 Render-Time Rendering, Third Edition》一书中将一个渲染流程分成3个阶段:应用阶段(Application Stage) 、几何阶段(Geometry Stage) 、光栅化阶段(Rasterizer Stage) 。 应《Unity Shader入门精要》第二章笔记 | 渲染流水线https://zfunnily.github.io/2022/04/shaderrenderpipline/Sat, 09 Apr 2022 11:55:55 +0800https://zfunnily.github.io/2022/04/shaderrenderpipline/渲染流水线 Render-Time Rendering, Third Edition》一书中将一个渲染流程分成3个阶段:应用阶段(Application Stage) 、几何阶段(Geometry Stage) 、光栅化阶段(Rasterizer Stage) 。 应shader初尝试 | 给石头覆盖一层雪景(Hello World)https://zfunnily.github.io/2022/04/shaderhelloworld/Sat, 09 Apr 2022 10:34:56 +0800https://zfunnily.github.io/2022/04/shaderhelloworld/给石头覆盖一层雪景 资源准备 石头模型 Unity2021.2.3f1c1 Mac &amp; Windows 在Unity中创建一个项目,导入石头模型,下面就开始利用shader给石头做一个雪景覆盖. 实现效果 未覆盖雪景的样子 覆盖了雪景的样子 开始代码 我在代码中标注了1,shader初尝试 | 给石头覆盖一层雪景(Hello World)https://zfunnily.github.io/2022/04/shaderhelloworld/Sat, 09 Apr 2022 10:34:56 +0800https://zfunnily.github.io/2022/04/shaderhelloworld/给石头覆盖一层雪景 资源准备 石头模型 Unity2021.2.3f1c1 Mac &amp; Windows 在Unity中创建一个项目,导入石头模型,下面就开始利用shader给石头做一个雪景覆盖. 实现效果 未覆盖雪景的样子 覆盖了雪景的样子 开始代码 我在代码中标注了1,UnityShader基本概念https://zfunnily.github.io/2022/04/shader01/Wed, 06 Apr 2022 11:54:02 +0800https://zfunnily.github.io/2022/04/shader01/何为shader shader中文翻译为着色器,其实是一种用来渲染图形的技术,我们可以通过shader编程,来自定义显卡渲染画面的算法,显示我们所期望的结果。 shader种类 顶点着色器: 处理每个顶点,将UnityShader基本概念https://zfunnily.github.io/2022/04/shader01/Wed, 06 Apr 2022 11:54:02 +0800https://zfunnily.github.io/2022/04/shader01/何为shader shader中文翻译为着色器,其实是一种用来渲染图形的技术,我们可以通过shader编程,来自定义显卡渲染画面的算法,显示我们所期望的结果。 shader种类 顶点着色器: 处理每个顶点,将抽卡逻辑自述https://zfunnily.github.io/2022/03/afk/Wed, 30 Mar 2022 10:50:11 +0800https://zfunnily.github.io/2022/03/afk/抽卡逻辑自述 参考《剑与远征》 卡牌颜色以及合成 颜色 合成 绿色 可分解,得到粉尘和银瓜子, 最基础的卡 蓝 蓝+ 同样的三张蓝色可合成一张蓝+ 紫 同种族的三张蓝+可以合成一张紫(可以选择合成其中蓝+的某个紫色) 紫+ 同英抽卡逻辑自述https://zfunnily.github.io/2022/03/afk/Wed, 30 Mar 2022 10:50:11 +0800https://zfunnily.github.io/2022/03/afk/抽卡逻辑自述 参考《剑与远征》 卡牌颜色以及合成 颜色 合成 绿色 可分解,得到粉尘和银瓜子, 最基础的卡 蓝 蓝+ 同样的三张蓝色可合成一张蓝+ 紫 同种族的三张蓝+可以合成一张紫(可以选择合成其中蓝+的某个紫色) 紫+ 同英层级时间轮 | skynet 定时器https://zfunnily.github.io/2022/03/timerskynet/Sun, 27 Mar 2022 12:39:12 +0800https://zfunnily.github.io/2022/03/timerskynet/skynet定时器 要解析一个程序代码,先了解数据结构,这是基础,再看函数。 拿skynet定时器举例子。 数据结构 //定时器事件 用于抛出定时器事件到消息队列里。理解这个数据结构需要先了解skynet的框架层级时间轮 | skynet 定时器https://zfunnily.github.io/2022/03/timerskynet/Sun, 27 Mar 2022 12:39:12 +0800https://zfunnily.github.io/2022/03/timerskynet/skynet定时器 要解析一个程序代码,先了解数据结构,这是基础,再看函数。 拿skynet定时器举例子。 数据结构 //定时器事件 用于抛出定时器事件到消息队列里。理解这个数据结构需要先了解skynet的框架利用时间轮实现定时器https://zfunnily.github.io/2022/03/timer/Thu, 10 Mar 2022 14:38:23 +0800https://zfunnily.github.io/2022/03/timer/理解定时器 适用场景 定时任务(每隔1s钟打印一次数据) 超时控制(xx分钟没有动作就断开连接) 频率限制(最快只能每5s调用一次API) 定时器常用的数据结构有如下几种: 链表 双向有序链表 最小堆 时间轮 层级时间轮利用时间轮实现定时器https://zfunnily.github.io/2022/03/timer/Thu, 10 Mar 2022 14:38:23 +0800https://zfunnily.github.io/2022/03/timer/理解定时器 适用场景 定时任务(每隔1s钟打印一次数据) 超时控制(xx分钟没有动作就断开连接) 频率限制(最快只能每5s调用一次API) 定时器常用的数据结构有如下几种: 链表 双向有序链表 最小堆 时间轮 层级时间轮Nginx | 给网站添加证书https://zfunnily.github.io/2022/03/https/Thu, 03 Mar 2022 10:26:56 +0800https://zfunnily.github.io/2022/03/https/Https 最近在购买的云服务器上把个人博客搭建起来了,实际上是hugo生成静态网页,nginx加载静态网页。现在只能通过http访问,缺少个https。 要搭建一个https的网站需要证书。之前在网上找的教程太Nginx | 给网站添加证书https://zfunnily.github.io/2022/03/https/Thu, 03 Mar 2022 10:26:56 +0800https://zfunnily.github.io/2022/03/https/Https 最近在购买的云服务器上把个人博客搭建起来了,实际上是hugo生成静态网页,nginx加载静态网页。现在只能通过http访问,缺少个https。 要搭建一个https的网站需要证书。之前在网上找的教程太Golang | http注解路由https://zfunnily.github.io/2022/03/http/Wed, 02 Mar 2022 14:51:22 +0800https://zfunnily.github.io/2022/03/http/Http服务器 Golang有一个很强大的官方http库了,使用上很方便。也有一些很强大的三方http框架, 比如gin,beego等等。 自以为,框架在提供便利,提升开发效率的同时,也限制了我们的想象力。Golang | http注解路由https://zfunnily.github.io/2022/03/http/Wed, 02 Mar 2022 14:51:22 +0800https://zfunnily.github.io/2022/03/http/Http服务器 Golang有一个很强大的官方http库了,使用上很方便。也有一些很强大的三方http框架, 比如gin,beego等等。 自以为,框架在提供便利,提升开发效率的同时,也限制了我们的想象力。Goang | Plugin插件热更https://zfunnily.github.io/2022/03/reload/Tue, 01 Mar 2022 11:33:22 +0800https://zfunnily.github.io/2022/03/reload/热更新 动态脚本更新 (php) 短链接无状态服务器热更 (http) 长连接有状态,数据跟逻辑分离 golang Plugin热更 (.so 动态库更新) &mdash;-逻辑热更 长连接有状态,在运维层面, 利用容器部署热更(docker, k8s) 服务不接受新Goang | Plugin插件热更https://zfunnily.github.io/2022/03/reload/Tue, 01 Mar 2022 11:33:22 +0800https://zfunnily.github.io/2022/03/reload/热更新 动态脚本更新 (php) 短链接无状态服务器热更 (http) 长连接有状态,数据跟逻辑分离 golang Plugin热更 (.so 动态库更新) &mdash;-逻辑热更 长连接有状态,在运维层面, 利用容器部署热更(docker, k8s) 服务不接受新Grpc | Token认证和自定义认证https://zfunnily.github.io/2022/02/jwt/Tue, 22 Feb 2022 15:39:30 +0800https://zfunnily.github.io/2022/02/jwt/概述 现在有个需求,需要在grpc的拦截器中,通过token进行身份认证。如果认证不通过则返回错误; 认证通过,则放行; TLS是用作加密通讯通道的,与该需求无关。 Token认证 具体流程 客户端通过账号密码登Grpc | Token认证和自定义认证https://zfunnily.github.io/2022/02/jwt/Tue, 22 Feb 2022 15:39:30 +0800https://zfunnily.github.io/2022/02/jwt/概述 现在有个需求,需要在grpc的拦截器中,通过token进行身份认证。如果认证不通过则返回错误; 认证通过,则放行; TLS是用作加密通讯通道的,与该需求无关。 Token认证 具体流程 客户端通过账号密码登Grpc | 通过SSL/TLS建立安全连接https://zfunnily.github.io/2022/02/san/Tue, 22 Feb 2022 14:22:41 +0800https://zfunnily.github.io/2022/02/san/使用golang的grpc库作为例子 grpc使用TLS建立安全连接需要有SAN证书, go 1.15 版本开始废弃 CommonName。 什么是SAN证书 SAN(Subject Alternative Name) 是 SSL 标准 x509 中定义的一个扩展。使用了 SAN 字段的 SSL 证书,可以扩Grpc | 通过SSL/TLS建立安全连接https://zfunnily.github.io/2022/02/san/Tue, 22 Feb 2022 14:22:41 +0800https://zfunnily.github.io/2022/02/san/使用golang的grpc库作为例子 grpc使用TLS建立安全连接需要有SAN证书, go 1.15 版本开始废弃 CommonName。 什么是SAN证书 SAN(Subject Alternative Name) 是 SSL 标准 x509 中定义的一个扩展。使用了 SAN 字段的 SSL 证书,可以扩Blog | 代码显示/隐藏https://zfunnily.github.io/2021/12/shortcodes/Wed, 29 Dec 2021 13:50:28 +0800https://zfunnily.github.io/2021/12/shortcodes/缘由 最近在写技术博客时,引入的代码太多,影响观感。 在尽力减少代码量,还是有些不可或缺的代码,代码量很惊人,已经占满整个屏幕. 因为个人博客是使用hugo生成的静态博客,我刚开始想的使用原生的js和cssNginx的一些配置https://zfunnily.github.io/2021/12/nginx/Tue, 28 Dec 2021 16:04:10 +0800https://zfunnily.github.io/2021/12/nginx/静态网站 应用场景 文件服务 静态网站 &hellip; 静态网站的配置 配置如下: nginx.conf worker_processes 1; pid nginx.pid; events { worker_connections 1024; multi_accept on; } http { default_type application/octet-stream; sendfile on; keepalive_timeout 100; server { listen 80; charset utf-8,gbk; server_name localhost; location /{ root /opt/; autoindex on; autoindex_localtime on; } index index.html; # 显示首页 #静态文件访问 location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|js|pdf|txt) { root /opt; } } } root: 表示网站根目录 autoindex: on 显A*算法 | Lua版本https://zfunnily.github.io/2021/12/astar/Thu, 23 Dec 2021 16:37:44 +0800https://zfunnily.github.io/2021/12/astar/A*算法思路 寻路步骤 从起点A开始, 把它作为待处理的方格存入一个&quot;开启列表&quot;, 开启列表就是一个等待检查方格的列表. 寻找起点A周围可以到达的方格, 将它们放入&quot;开启列表&quoBlog | 音乐播放器https://zfunnily.github.io/2021/12/music/Tue, 21 Dec 2021 16:55:23 +0800https://zfunnily.github.io/2021/12/music/概述 今天给我的个人博客加了个暗模式,这样可以在晚上阅读博客的时候不伤害眼睛。突然想到如果在阅读博客的时候可以听听音乐就更好了。 于是在github上找到了一个开源的项目MetingJS,看最后一次comBlog | 网站暗模式https://zfunnily.github.io/2021/12/dark/Tue, 21 Dec 2021 11:05:00 +0800https://zfunnily.github.io/2021/12/dark/Wordpress 如果你的网站是wordpress,则可以参考以Darkmode.js为基础的插件: blackout-darkmode-widget darkmode Nuxt.js 如果你正在使用Nuxt.js,则可以使用下面的模块 nuxtjs-darkmode-js-module 快速使用 使用Darkmode.js给网站快速部署上暗/浅色Openresty三 | 上传文件https://zfunnily.github.io/2021/12/openresty-upload/Wed, 08 Dec 2021 16:42:17 +0800https://zfunnily.github.io/2021/12/openresty-upload/上传文件接口 nginx.conf 的server 增加一个location: location /upload { resolver 8.8.8.8 ipv6=off; content_by_lua_file lua/upload.lua; } upload.lua lua -- upload.lua --========================================== -- 文件上传 --========================================== local chunk_size = 4096 local form, err = upload:new(chunk_size) if not form then ngx.log(ngx.ERR, &#34;failed to new upload: &#34;, err) ngx.exit(ngx.HTTP_INTERNAL_SERVER_ERROR) end form:set_timeout(1000) -- 文件保存的根路径 local saveRootPath = &#34;./download/&#34; -- 保存的文件对象 local fileToSave --文件是否成Webrtc二 | 共享桌面https://zfunnily.github.io/2021/11/webrtcdesk/Mon, 15 Nov 2021 11:23:24 +0800https://zfunnily.github.io/2021/11/webrtcdesk/环境 Ubuntu18.04 webrtc M84 改造peerconnection例子,用来实现桌面共享 改造类CapturerTrackSource 增加桌面的数据源类RcrtcDesktopCapturerTrackSource 继承webrWebrtc一 | peerconnectionhttps://zfunnily.github.io/2021/11/webrtcpeerconnection/Sun, 14 Nov 2021 16:20:31 +0800https://zfunnily.github.io/2021/11/webrtcpeerconnection/环境 Ubuntu18.04 webrtc M84 国内镜像:https://webrtc.org.cn/mirror/ webrtc交互过程 通过peerconnection的例子来分析webrtc的交互流程 peer_connection 解析 为了便于管理,如编码,回显等,Go-libp2p四 | 穿透NAThttps://zfunnily.github.io/2021/11/gop2pfour/Sun, 07 Nov 2021 15:49:46 +0800https://zfunnily.github.io/2021/11/gop2pfour/本文目的 上文Go-libp2p三 | relay例子已经分析过relay例子,并解释了两个节点如果通过中继服务进行通信。本文改造relay例子 并让这个服务做如下两件事: 交换两个节点的在交换机上的信息,帮助Blog | 随机名人名言https://zfunnily.github.io/2021/11/randomquotes/Fri, 05 Nov 2021 15:50:16 +0800https://zfunnily.github.io/2021/11/randomquotes/本文目的 我的个人博客已经搭建好了,使用的hugo+飞雪的主题。我看到有些博客上有些随机的名人名言,但是这个主题没有。遂自己写一个。 根据飞雪的主题自定义 飞雪主题的github: https://github.com/flysnow-org/maupassant-hugo 复制主题里的文件themGo-libp2p三 | relay例子https://zfunnily.github.io/2021/10/gop2pthree/Sun, 31 Oct 2021 10:13:40 +0800https://zfunnily.github.io/2021/10/gop2pthree/我想做什么 chat和echo两个例子,说明了两个节点之间的通信需要两节点在同一个局域网内,或者有一个节点有公网。 如果我两个节点分别在两个NAT下面, 都在各自的局域网内,则需要有一个中继服务,这个服务做Go-libp2p二 | echo例子https://zfunnily.github.io/2021/10/gop2ptwo/Fri, 29 Oct 2021 11:15:42 +0800https://zfunnily.github.io/2021/10/gop2ptwo/go-libp2p的echo例子分析 进入目录go-libp2p/examples/echo/, 编译 go build 先看README.md, 可以了解到使用echo的方式: 终端B $ ./echo -l 3001 2021/10/28 11:25:33 I am /ip4/127.0.0.1/tcp/3001/p2p/QmTu8sxDi3fSjz9ZMvkAj3qA9YAoGskroEnyLz2ZvfTBhX 2021/10/28 11:25:33 listening for connections 2021/10/28 11:25:33 Now run &#34;./echoGo-libp2p一 | chat例子https://zfunnily.github.io/2021/10/gop2pone/Thu, 28 Oct 2021 14:40:02 +0800https://zfunnily.github.io/2021/10/gop2pone/代码下载 git clone https://github.com/libp2p/go-libp2p.git chat实例分析 进入目录go-libp2p/examples/chat/, 编译 go build 先看README.md, 可以了解到使用chat的方式 在节点 B $ ./chat -sp 3001 2021/10/28 11:01:25 Run &#39;./chat -d /ip4/127.0.0.1/tcp/3001/p2p/QmXgEXt4CiqmVmDhPPQnyVkoj3Bsx3Nggq57PPsk5tLNTs&#39; on another console. 2021/10/28 11:01:25 You can replace 127.0.0.1 with public IPSkynet源码赏析四 | 消息调度https://zfunnily.github.io/2021/10/four/Thu, 21 Oct 2021 10:06:39 +0800https://zfunnily.github.io/2021/10/four/服务间消息流转 发送消息 数据结构message_queue *q是次级消息队列,每个服务都有与之绑定的唯一一个次级消息队列。当我们在lua层,调用skynet.send(...), 或者调用skynet.cSkynet源码赏析三 | 服务启动https://zfunnily.github.io/2021/10/skynetthree/Wed, 20 Oct 2021 11:26:07 +0800https://zfunnily.github.io/2021/10/skynetthree/skynet启动一个C服务 查看怎么启动C服务的最好的办法是打断点,看源码。 启动logger日志服务 我拿日志服务来举例子,怎么启动日志服务的呢? 传参数name = &quot;logger&quot;, param = null, struct skynet_context *ctx = skynet_context_new(config-&gt;logservice, config-&gt;logger);; 从moduleSkynet源码赏析二 | 基础数据结构https://zfunnily.github.io/2021/10/skynettwo/Tue, 19 Oct 2021 18:47:45 +0800https://zfunnily.github.io/2021/10/skynettwo/module管理模块 我们所写的C服务编译成.so文件后放在cpath变量路径下,程序会加载路径cpath = root..&quot;cservice/?.so&quot;下的.so文件,通过staticSkynet源码赏析一 | 启动初始化的过程https://zfunnily.github.io/2021/10/skynetone/Tue, 19 Oct 2021 17:28:45 +0800https://zfunnily.github.io/2021/10/skynetone/入口文件 skynet_main.c 加载配置 struct skynet_config config; config.thread = optint(&#34;thread&#34;,8); config.module_path = optstring(&#34;cpath&#34;,&#34;./cservice/?.so&#34;); config.harbor = optint(&#34;harbor&#34;, 1); config.bootstrap = optstring(&#34;bootstrap&#34;,&#34;snlua bootstrap&#34;); config.daemon = optstring(&#34;daemon&#34;, NULL); config.logger = optstring(&#34;logger&#34;, NULL); config.logservice = optstring(&#34;logservice&#34;, &#34;logger&#34;); config.profile = optboolean(&#34;profile&#34;, 1); 从上述代码可以看到,配置都已经加载到变量struct skynet_config config;中了。 初始化 初始化skynet_context管Golang | 调用带有后台进程shell脚本可能会被挂起https://zfunnily.github.io/2021/10/shell/Wed, 13 Oct 2021 17:15:45 +0800https://zfunnily.github.io/2021/10/shell/起因 今天用Golang写一个调用外部shell脚本的程序,使用 exec.Command方法,这段脚本代码中包含了一个后台任务语句。 结果发生了一个问题:cmd.Output 始终不会返回,一直挂起。导致我FPS游戏 | 实现移动功能https://zfunnily.github.io/2021/09/move/Sun, 12 Sep 2021 20:43:34 +0800https://zfunnily.github.io/2021/09/move/三种实现FPS Controller的区别 Transform Translate 允许移动物理,但无物理碰撞 Rigid body + Capsule Collider 符合物理学 不会鬼穿墙 无法滞空运动 可与Physics Object 交互 Charactor Controller 不会鬼穿墙 提供的API相对多 无法与Physic objects免费Musichttps://zfunnily.github.io/2021/09/music/Wed, 08 Sep 2021 14:47:14 +0800https://zfunnily.github.io/2021/09/music/介绍一个可以免费听音乐的方法 环境 docker mac 安装 $ docker run -d -p 264:264 -p 9000:9000 -v $dir_name:/var/www/html/cache --name music oldiy/music-player-docker $dir_name 是 你自己宿主机的目录。可以自定义 访问:127.0.0.1:264 就可以放心使用, 同事推荐的,贼好用。Unity3D | Transform类https://zfunnily.github.io/2021/09/transform/Tue, 07 Sep 2021 15:55:59 +0800https://zfunnily.github.io/2021/09/transform/Transform类 在unity中,把transform类理解为,transform类是在每个对象生成时自动附加的一个类。在Unity的视图中,点击Hierarchy中的对象,就可以在InspectoUnity3D | UGUIhttps://zfunnily.github.io/2021/08/ugui/Fri, 20 Aug 2021 14:15:41 +0800https://zfunnily.github.io/2021/08/ugui/Text Text的属性 在 Unity 的 Hierarchy 面板上右键–&gt;UI–&gt;Text, 在 Inspector 面板上查看属性 属性 功能 Text 需要显示的文本 Font 显示文本的字体 如:微软雅黑,宋体等 Font Style 显示文本的样式,有普通,粗体,斜体,粗体和斜体四种Golang | redis实现分布式锁https://zfunnily.github.io/2021/06/distribute/Thu, 03 Jun 2021 16:12:21 +0000https://zfunnily.github.io/2021/06/distribute/概述 网上有很多Golang操作redis的例子,我使用github.com/gomodule/redigo/redis包写一个关于redis分布式锁的问题。 redis分布式锁 锁需要的几个组件 获取锁- 删Golang | redishttps://zfunnily.github.io/2021/06/goredis/Thu, 03 Jun 2021 15:57:14 +0800https://zfunnily.github.io/2021/06/goredis/概述 网上有很多golang操作redis的例子,我使用github.com/gomodule/redigo/redis包写一个关于redis分布式锁的问题。 redis分布式锁 锁需要的几个组件 获取锁 删除Lua | next的使用https://zfunnily.github.io/2021/05/lua_next/Mon, 10 May 2021 16:39:50 +0800https://zfunnily.github.io/2021/05/lua_next/lua_next lua_next(L,index):先把 表(lua栈 index所指的表), 的当前索引弹出,再把table 当前索引的值弹出,也就是先弹出 table的索引,再弹出table索引的值 举例: local t = { [&#34;a&#34;] = 1, [&#34;b&#34;]Lua | APIhttps://zfunnily.github.io/2021/05/settopandpop/Mon, 10 May 2021 15:57:03 +0800https://zfunnily.github.io/2021/05/settopandpop/lua_pop和lua_settop lua_settop 我们直接来看lua_settop,文档解释 /* 设置栈的高度,如果之前的栈顶比新设置的更高,那么高出来的元素会被丢弃,反之压入nil来补足大小 假设栈里有2个元素。 如果Golang | gomod拉取私有仓库https://zfunnily.github.io/2021/03/gomod/Tue, 23 Mar 2021 16:10:02 +0000https://zfunnily.github.io/2021/03/gomod/概述 在使用go mod的过程中,依赖的包往往是第三方库,当我们自定义一个包并且放在github.com私有仓库时候,按照原来的方法则会有如下问题。 get &#34;gitlab.com/xxx/zz&#34;: found meta tag get.metaImport{Prefix:&#34;gitlab.com/xxx/zz&#34;, VCS:&#34;git&#34;, RepoRoot:&#34;https://gitlab.com/xxx/zz.git&#34;} at //gitlab.com/xxx/zz?go-get=1 verifying gitlab.com/xxx/zz@v0.0.1: gitlab.com/xxx/zz@v0.0.1: reading https://sum.golang.org/lookup/gitlab.com/xxx/zz@v0.0.1: 410 Gone 这个错误是因为新版本g八个基础排序https://zfunnily.github.io/2021/03/sort/Tue, 23 Mar 2021 10:13:31 +0000https://zfunnily.github.io/2021/03/sort/sort排序 std::sort( )函数是库函数提供的排序函数,必须包括头文件#include &lt;algorithm&gt;,它使用的排序方法是类似于快排的方法,时间复杂度为n*log2(n) Sort函数有三个参数:《仙剑奇侠传》编译运行https://zfunnily.github.io/2021/03/gamexian/Sun, 21 Mar 2021 10:44:58 +0000https://zfunnily.github.io/2021/03/gamexian/概述 今天在github上找到了《仙剑奇侠传》的rpg单机游戏sdlpal,sdlpal 是一个开源项目,基于sdl把仙剑奇侠传重写了一遍。 下面是我的编译过程总结。 环境 win10- sdl1.2- sdlpal- vs2017- DirectX SDK10 下载sdlpal $ git clone https://github.com.cnpmjs.org/sdlpal/sdlpal.git实现atoi和itoa函数https://zfunnily.github.io/2021/03/atoianditoa/Wed, 17 Mar 2021 16:43:20 +0000https://zfunnily.github.io/2021/03/atoianditoa/题目1: 把字符串转化为整数 有整数字符串,&quot;13579&quot;, 和 &quot;246810&quot;. 请写一个函数把这两个字符串转化为整数 步骤: 先判断正负 遍历字符串,转换字符为整数 //atoi.cc #include &lt;stdio.h&gt; int my_atoi(char *str) { bool bmin = false; int result = 0; //先判断正协程解析二 | 云风的coroutinehttps://zfunnily.github.io/2021/03/coroutinetwo/Wed, 10 Mar 2021 11:11:47 +0000https://zfunnily.github.io/2021/03/coroutinetwo/概述 云风的coroutine是通过ucontext来控制程序运行时上下文的,我们来根据该库提供的几个接口,和一个demo来解释协程的运行原理。如果不了解ucontext的,建议先了解ucontxt 环境协程解析一 | ucontexthttps://zfunnily.github.io/2021/03/coroutineone/Tue, 09 Mar 2021 09:43:00 +0000https://zfunnily.github.io/2021/03/coroutineone/概述 最近在研究协程的实现原理,看了云风的coroutine和腾讯的开源库libco后,原来要实现一个协程库也没那么难。我先来讲讲云风的coroutine库。他使用的是 uncontext来保存程序运行上Golang | 定时器https://zfunnily.github.io/2021/02/timer/Thu, 25 Feb 2021 16:02:13 +0000https://zfunnily.github.io/2021/02/timer/概述 golang有三种方式实现定时器: ticker timer select Ticker 通过 time.NewTicker(d)的方式实现定时器 d := time.Duration(time.Second * 2) t1 := time.NewTicker(d) defer t1.Stop() go func() { for { &lt;- t1.C fmt.Println(&#34;NewTicker...&#34;) } }() Timer 通过 time.NewTimer(d)的方式实现定时器 t2 := time.NewTimer(d)Lua | 解决百元买鸡的问题https://zfunnily.github.io/2021/02/chicken/Wed, 24 Feb 2021 17:51:46 +0000https://zfunnily.github.io/2021/02/chicken/问题 编写lua程序求解百鸡百钱问题。公鸡5元一只,母鸡3元一只,小鸡一元3只,问100元钱买100只鸡,可买公鸡、母鸡、小鸡各多少只? 代码 ----------------------------------------------------------------------------- --公鸡5元一只,母鸡3元一只,小鸡一元3只,问100元钱买Golang | JWT身份认证https://zfunnily.github.io/2021/02/JWT/Wed, 24 Feb 2021 14:22:04 +0000https://zfunnily.github.io/2021/02/JWT/概述 最近要在http接口上加一个token认证,但是接口很多,有没有一个省时省力的办法来解决。token的使用流程是: 用户使用帐号密码登陆到服务器1. 服务器验证登陆成功,根据帐号密码生成token。把Lua | 调用C/C++的动态库https://zfunnily.github.io/2021/02/dynamic/Sat, 20 Feb 2021 11:11:51 +0000https://zfunnily.github.io/2021/02/dynamic/概述 最近在学习 云风的skynet库,想自定义一个模块,目标是使用lua调用C/C++所编写的库。 当我们需要在Lua里面调用c/c++函数时,所有的函数都必须满足以下函数签名: typedef int (*lua_CFunction) (lua_State *L); 换句话说,所有的汇编 | C/C++调用汇编https://zfunnily.github.io/2021/02/compilation/Mon, 01 Feb 2021 14:40:51 +0000https://zfunnily.github.io/2021/02/compilation/概述 我使用AT&amp;T的规范,在linux上完成 C和汇编的互相调用,并使用gcc编译成可执行文件。 目标:汇编函数提供输出。类似C语言的函数 void hello_world(char* value) { printf(value); } 提供给C语言调用: int main() { hello_world(&#34;hello world!\n&#34;); } 搭建AT&amp汇编 | AT&T和Intel规范的区别https://zfunnily.github.io/2021/01/attandintel/Sun, 31 Jan 2021 11:25:39 +0000https://zfunnily.github.io/2021/01/attandintel/概述 常见的指令集以及汇编语言规范: x86(IA-32)、x86-64指令集(常见于PC端),对应有2家公司发布的不同汇编语言规范: intel公司发布的汇编语言规范,称intel 汇编:Windows派系Skynet | lua-protobufhttps://zfunnily.github.io/2021/01/skynetprotobuf/Mon, 25 Jan 2021 14:25:07 +0000https://zfunnily.github.io/2021/01/skynetprotobuf/概述 在最新的skynet中我使用的是云风的pbc库来解析protobuf,该项目中的一个文件protobuf.lua 使用了module语法在lua5.1版本中已经删除,最新的skynet是lua5.4Protobuf | 请求参数为空的案例https://zfunnily.github.io/2021/01/pbempty/Fri, 22 Jan 2021 16:41:16 +0000https://zfunnily.github.io/2021/01/pbempty/参数为空的grpc请求怎么定义 google protobuf已经提供了空参数 //empty.proto message Empty {&lt;!-- --&gt;} 使用方法,在proto文件中导入empty.proto, 定义一个请求参数和返回值为空的函数emptyfunction, 函数名字Golang | C数组转化为Golang的切片类型https://zfunnily.github.io/2021/01/goslience/Fri, 22 Jan 2021 15:56:40 +0000https://zfunnily.github.io/2021/01/goslience/概述 最近在巩固cgo的基础知识,在网上看到一篇Go和C之间 字符串数组、切片类型转换的文章,让我想到我之前写的一篇在go中遍历C结构体数组的文章,让我有新的方法来解决之前的问题,把C的数组转化为Go的切Skynet | echo服务https://zfunnily.github.io/2021/01/skynetecho/Fri, 15 Jan 2021 16:07:51 +0000https://zfunnily.github.io/2021/01/skynetecho/概述 引用云风博客的话:“skynet 是一个为网络游戏服务器设计的轻量框架。但它本身并没有任何为网络游戏业务而特别设计的部分,所以尽可以把它用于其它领域。skynet 并不是一个开箱即用的引擎,使用它需要Redis源码分析 | ziplisthttps://zfunnily.github.io/2021/01/ziplist/Wed, 13 Jan 2021 17:52:27 +0000https://zfunnily.github.io/2021/01/ziplist/概述 Redis中的List是一个有序(按加入的时序排序)的数据结构,一般有序我们会采用数组或者是双向链表,其中双向链表由于有前后指针实际上会很浪费内存。3.2版本之前采用两种数据结构作为底层实现: 压缩Redis源码解析 | VScode调试https://zfunnily.github.io/2021/01/vscodedebugredis/Tue, 12 Jan 2021 14:25:29 +0000https://zfunnily.github.io/2021/01/vscodedebugredis/环境 vscode- gcc5.4 ubuntu16.04 或者 ubuntu18.04 make 下载6.2版本. 我使用的是国内github镜像地址:github.com.cnpmjs.org,速度比较快。 $ git clone https://github.com.cnpmjs.org/redis/redis.git redis $ git checkout -b 6.2 remotes/origin/6.2 vscode不参与编译,只充当可视化的调试工具。 使用VScode | 调试Redis源码,指针显示的问题https://zfunnily.github.io/2021/01/vscoderedis/Tue, 12 Jan 2021 14:17:22 +0000https://zfunnily.github.io/2021/01/vscoderedis/缘由 使用VScode的时候,断点看到指针显示的是一串地址,而不是指针指向的对象的值。上网找了一圈,没看到vscode有对应的插件来解决这个问题。vscode有对应的语法来解决这个问题。 网上几乎都在说在Cgo | 遍历C结构体数组https://zfunnily.github.io/2021/01/cgostruct/Mon, 11 Jan 2021 17:18:35 +0000https://zfunnily.github.io/2021/01/cgostruct/缘由 现在有个应用场景,我们要在go中获取C结构体数组中的值。在C语言中,对于结构体数组,我们可以利用指针的偏移量来获取我们想要的值的位置。在go中我们怎么使用C指针和偏移量进行运算呢?下面的文字中C指Redis源码解析 | sdshttps://zfunnily.github.io/2021/01/sds/Wed, 06 Jan 2021 14:20:23 +0000https://zfunnily.github.io/2021/01/sds/SDS头文件及作用 sds.h: sds声明- sdsalloc.h: 为sds分配内存 源码文件sds.h中有这样一行代码 typedef char *sds; 很清晰、明了,sds其实就是char*。 最新的6.2分支的代码: struct __attribute__ ((__packed__)) sdshdr5 {&lt;!-- --&gt; unsigned char flags; /* 3 lsb ofstruct中使用char[]https://zfunnily.github.io/2021/01/chararray/Tue, 05 Jan 2021 15:45:36 +0000https://zfunnily.github.io/2021/01/chararray/缘由 最近在看redis的源码,刚开始看sds,看到这块代码 struct __attribute__ ((__packed__)) sdshdr5 { unsigned char flags; /* 3 lsb of type, and 5 msb of string length */ char buf[]; }; 好奇为什么使用 char buf[],而不用char *buf,找到答案记录一下。 struct中的char*Lastbattle | 游戏场景服务器SS解析https://zfunnily.github.io/2021/01/lastbattle/Sat, 02 Jan 2021 23:19:58 +0000https://zfunnily.github.io/2021/01/lastbattle/游戏场景服务器概况 指令对应的处理handle的文件:SSBattleMgr.cpp 创建战场 指令: eMsgToSSFromCS_CreateBattle GC服务器发往SS fromCS 收到中心服务器CS创建站场的指令,在函数INT32 CSSBattleMgr::OnMsgFromCS_CreateBattle(const char* pData, int n32DataLengtCCnet | 单线程reactor演变为多线程https://zfunnily.github.io/2020/12/ccnet/Wed, 30 Dec 2020 09:19:41 +0000https://zfunnily.github.io/2020/12/ccnet/ccnet从单线程演变为多线程 ccnet现状: epoll linux平台 事件循环 单线程 reactor 监听和新连接的事件都在主线程中 单线程的ccnet ccnet的单线程的角色: EventLoop: 整个事件循环。 EPollPoller: 负责事件的收集。 ChannelGolang | sync.Mutex详解https://zfunnily.github.io/2020/12/syncmutex/Tue, 29 Dec 2020 13:17:18 +0000https://zfunnily.github.io/2020/12/syncmutex/概述 自己做的一个golang项目需要优化,优化方向是减少gpu内存的使用。同一个模型被重复加载多次,使用更多的gpu内存,也增加 sync.Mutex的使用。 优化的方向是: 减少代码量的改动- 减少gpu内五种网络IO模型总结https://zfunnily.github.io/2020/12/iomodels/Mon, 28 Dec 2020 11:57:04 +0000https://zfunnily.github.io/2020/12/iomodels/概述 在网络上看到很多关于阻塞IO、非阻塞IO、同步IO、异步IO的例子,总觉得写的过于复杂并且让人难以理解。于是我把我自己把这几个概念的理解写下来以供参考。 POSIX POSIX(可移植操作系统接口)把同步IOCCnet | 一个reactor单线程网络库https://zfunnily.github.io/2020/12/ccnetone/Sun, 27 Dec 2020 18:41:25 +0000https://zfunnily.github.io/2020/12/ccnetone/缘由 最近在研究陈硕的网络库muduo,是一个基于reactor架构的网络库。我对网络库的感觉是易用,但是内容庞大,依赖颇多。比如boost网络库里面的一些语法让人生畏。关于reactor和proactC++ | vector中的resize()函数 VS reserve()函数https://zfunnily.github.io/2020/12/reserve/Fri, 25 Dec 2020 11:04:29 +0000https://zfunnily.github.io/2020/12/reserve/reserve void reserve (size_type n); reserver函数用来给vector预分配存储区大小,即capacity的值 ,但是没有给这段内存进行初始化。reserve 的参数n是推荐预分配内存的大小,实际分配的可能等于或大于这个值,即Golang | 用gocolly登录B站https://zfunnily.github.io/2020/12/gocolly/Sun, 13 Dec 2020 14:51:53 +0000https://zfunnily.github.io/2020/12/gocolly/概述 gocolly是golang语言开发的爬虫包,通过gocolly来进行模拟网站的登录, 目标已经确立,开始行动。 下载 $ go get -u github.com/gocolly/colly 获取cookie 登录网站:https://www.bilibili.coProtobuf | 沾包问题https://zfunnily.github.io/2020/12/tcp/Sun, 13 Dec 2020 10:22:38 +0000https://zfunnily.github.io/2020/12/tcp/缘由 最近在研究一款游戏的源码。发现里面的通信协议是protobuf定义的,但还是自己定义了协议头部,类似 head + body。先解析头部里所存储的整个包的数据长度,然后再解析包剩余的数据,这样做的目的是为了防Grpc | 概述https://zfunnily.github.io/2020/12/grpc/Sun, 13 Dec 2020 09:10:42 +0000https://zfunnily.github.io/2020/12/grpc/OverView gRPC是由Google主导开发的RPC框架,使用HTTP/2协议并用ProtoBuf作为序列化工具。其客户端提供Objective-C、Java接口,服务器侧则有Java、Golang、C++等接Openresty二 | postman小工具https://zfunnily.github.io/2020/11/%E4%BD%BF%E7%94%A8OpenResty%E5%81%9A%E4%B8%80%E4%B8%AApostman%E5%B0%8F%E5%B7%A5%E5%85%B7/Wed, 25 Nov 2020 16:30:39 +0800https://zfunnily.github.io/2020/11/%E4%BD%BF%E7%94%A8OpenResty%E5%81%9A%E4%B8%80%E4%B8%AApostman%E5%B0%8F%E5%B7%A5%E5%85%B7/用到的知识点 mvc架构 模型渲染库:https://github.com/bungle/lua-resty-template resty http请求库: https://github.com/bungle/lua-resty-template 参照 mvc模型来做postman工具 配置文件说明 worker_processes 1; error_log logs/error.log; eventsOpenresty一 | 初探https://zfunnily.github.io/2020/11/OpenResty%E5%88%9D%E6%8E%A2/Mon, 23 Nov 2020 16:21:34 +0800https://zfunnily.github.io/2020/11/OpenResty%E5%88%9D%E6%8E%A2/概述 OpenResty®是一个基于Nginx与 Lua 的高性能 Web 平台,其内部集成了大量精良的 Lua 库、第三方模块以及大多数的依赖项。用于方便地搭建能够处理超高并发、扩展性极高的动态 Web 应用、Web 服务和动态网关。LastBattle | 登录流程(LS & BS & GS)https://zfunnily.github.io/2020/11/lastbattlelogin/Fri, 20 Nov 2020 17:27:08 +0000https://zfunnily.github.io/2020/11/lastbattlelogin/登录流程 根据上一篇文章中的登录流程,我在工程中找到了相应的代码并记录了下来 登录服务代码解析 监听端口:49997 供BS服务连接 监听端口:49996 供客户端连接 CIocpCtrl:IOCP控制类 多线程循环LastBattle | 服务架构https://zfunnily.github.io/2020/11/lastbattleserver/Fri, 20 Nov 2020 17:24:32 +0000https://zfunnily.github.io/2020/11/lastbattleserver/服务器架构简图如下: 连线说明: 实线:表示客户端登录流程,①②③④⑤表示登录流程,详细解释见下文。 虚线:表示服务器间的连接,虚线箭头指向监听方。 架构说明: |英文名称|简称|中文名称|功能简介|单个大区需LastBattle | 安装部署笔记https://zfunnily.github.io/2020/11/lastbattleone/Mon, 16 Nov 2020 06:49:49 +0000https://zfunnily.github.io/2020/11/lastbattleone/环境准备 win10 服务器:vs2010 / 数据库 mysql5.7 清华大学mysql镜像网站:https://mirrors.tuna.tsinghua.edu.cn/mysql/downloads/MySQL-5.7/ 客户端Cgo | 使用libevent库实现一个定时器https://zfunnily.github.io/2020/11/cgo%E4%BD%BF%E7%94%A8libevent%E5%BA%93%E5%AE%9E%E7%8E%B0%E4%B8%80%E4%B8%AA%E5%AE%9A%E6%97%B6%E5%99%A8/Fri, 13 Nov 2020 16:40:42 +0000https://zfunnily.github.io/2020/11/cgo%E4%BD%BF%E7%94%A8libevent%E5%BA%93%E5%AE%9E%E7%8E%B0%E4%B8%80%E4%B8%AA%E5%AE%9A%E6%97%B6%E5%99%A8/使用libevent库作为例子 下载 &amp; 编译 &amp; 安装libevent $ git clone https://github.com.cnpmjs.org/libevent/libevent.git $ cd libevent &amp;&amp; mkdir build &amp;&amp; cd build $ cmake .. $ make libevent实现的定时器 // main.cpp #include &#34;event.h&#34; struct event ev; struct timeval tv; void time_cb(evutil_socket_t fd, short event, void *argc) { printf(&#34;timer wakeup\n&#34;); event_add(&amp;ev, &amp;tv); // reschedule timer } int main() { struct event_base *base = event_base_new(); tv.tv_sec = 2;Golang | 利用指针进行数据转换https://zfunnily.github.io/2020/11/Golang-%E5%88%A9%E7%94%A8%E6%8C%87%E9%92%88%E8%BF%9B%E8%A1%8C%E6%95%B0%E6%8D%AE%E8%BD%AC%E6%8D%A2/Thu, 12 Nov 2020 17:19:07 +0000https://zfunnily.github.io/2020/11/Golang-%E5%88%A9%E7%94%A8%E6%8C%87%E9%92%88%E8%BF%9B%E8%A1%8C%E6%95%B0%E6%8D%AE%E8%BD%AC%E6%8D%A2/概述 在Go语言中,Slice本质是什么呢?是一个reflect.SliceHeader结构体和这个结构体中Data字段所指向的内存。String本质是什么呢?是一个reflect.StringHeadGolang | buildshttps://zfunnily.github.io/2020/11/go-builds/Thu, 12 Nov 2020 17:15:17 +0000https://zfunnily.github.io/2020/11/go-builds/概述 通常我们会给每个产品环境设置不同的配置,比如 redis 要在开发环境就连接 localhost:6379,测试环境可能连接某一个主机的 redis。 如果放在 go 里面是否可行?因为 go 是编译二进制包,也没有动态加载这Cgo | 简单使用https://zfunnily.github.io/2020/11/cgo%E7%9A%84%E7%AE%80%E5%8D%95%E4%BD%BF%E7%94%A8/Thu, 05 Nov 2020 09:45:23 +0000https://zfunnily.github.io/2020/11/cgo%E7%9A%84%E7%AE%80%E5%8D%95%E4%BD%BF%E7%94%A8/使用自己的C函数 文件名:testC.go package main /* #include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; void c_print(char *str) { printf(&#34;%s\n&#34;, str); } */ import &#34;C&#34; //import “C” 必须单起一行,并且紧跟在注释行之后 import &#34;unsafe&#34; func main() { s := &#34;Hello Cgo&#34; cs := C.CString(s) //字符串映射 C.c_print(cs) //调用C函数 defer C.free(unsafe.Pointer(cs)) //释放内存 } 说明: 1、gGolang | 使用Lumberjack+zap进行日志切割归档https://zfunnily.github.io/2020/11/%E4%BD%BF%E7%94%A8Lumberjack-zap%E8%BF%9B%E8%A1%8C%E6%97%A5%E5%BF%97%E5%88%87%E5%89%B2%E5%BD%92%E6%A1%A3/Wed, 04 Nov 2020 12:44:03 +0000https://zfunnily.github.io/2020/11/%E4%BD%BF%E7%94%A8Lumberjack-zap%E8%BF%9B%E8%A1%8C%E6%97%A5%E5%BF%97%E5%88%87%E5%89%B2%E5%BD%92%E6%A1%A3/使用Lumberjack+zap进行日志切割归档 为了添加日志切割归档功能,我们将使用第三方库Lumberjack来实现。 安装 执行下面的命令安装Lumberjack go get -u github.com/natefinch/lumberjack zap logger中加入LumbeTCP/IP | 大量TIME_WAIT对线上业务的影响https://zfunnily.github.io/2020/10/%E5%A4%A7%E9%87%8FTIME_WAIT%E5%AF%B9%E7%BA%BF%E4%B8%8A%E4%B8%9A%E5%8A%A1%E7%9A%84%E5%BD%B1%E5%93%8D/Sat, 10 Oct 2020 16:46:34 +0000https://zfunnily.github.io/2020/10/%E5%A4%A7%E9%87%8FTIME_WAIT%E5%AF%B9%E7%BA%BF%E4%B8%8A%E4%B8%9A%E5%8A%A1%E7%9A%84%E5%BD%B1%E5%93%8D/TCP的三次握手和四次挥手 TIME_WAIT概述 TIME_WAIT 状态: TCP 连接中,主动关闭连接的一方出现的状态;(收到 FIN 命令,进入 TIME_WAIT 状态,并返回 ACK 命令) 保持 2 个 MSL 时间,即,4 分钟 ;(MSL 为 2 分钟) TCP 连接建立后,「主Libevent | 定时器https://zfunnily.github.io/2020/09/libeventimer/Wed, 16 Sep 2020 23:20:28 +0000https://zfunnily.github.io/2020/09/libeventimer/libevent 实现定时器流程 首先初始化libevent库,并保存返回的指针 struct event_base * base = event_init(); 实际上这一步相当于初始化一个Reactor实例;在初始化libevent后,就可以注册事件了。 初始化事件event,设置回调函FFmpeg | 画中画和视频多宫格处理https://zfunnily.github.io/2020/09/ffmpegpicture/Mon, 14 Sep 2020 18:29:33 +0000https://zfunnily.github.io/2020/09/ffmpegpicture/FFmpeg生成画中画 静态画中画 将视频sub.mp4视频文件缩放成宽 480 、高 320 的视频,然后显示在 视频 input.mp4,x坐标为0,y 坐标为0 的位置 ffmpeg -re -i input.mp4 -vf &#34;movie=sub.mp4, scale=480x320[test]; [in][test]overlay [out]&#34; -vcodec libx264 output.flv 显示在画面的右下角,则需要用到FFmpeg | 给视频加文字和图片水印https://zfunnily.github.io/2020/09/ffmpegvideo/Sat, 12 Sep 2020 12:47:57 +0000https://zfunnily.github.io/2020/09/ffmpegvideo/FFmpeg给视频加上logo ffmpeg从视频中截取图像帧 ffmpeg -i inputfile.avi -r 1 -f image2 image-%05d.jpeg ffmpeg -i inputfile.avi -r 1 -s 4cif -f image2 image-%05d.jpeg ffmpeg -i inputfile.avi -r 1 -t 4 -f image2 image-%05d.jpeg ffmpeg -i inputfile.avi -r 1 -ss 01:30:14 -f image2 image-%05d.jpeg ffmpeg -i inputfile.avi -r 1 -ss 01:30:14 -vframes 120 4cif -f image2 image-%05d.jpeg -r 指定抽取的帧率,即从视频中每秒钟抽取FFmpeg | 录制摄像头和桌面数据windowshttps://zfunnily.github.io/2020/09/ffmpegvideow/Wed, 09 Sep 2020 09:36:49 +0000https://zfunnily.github.io/2020/09/ffmpegvideow/概述 FFmpeg Windows 设备操作 Windows 采集设备的主要方式是 dshow vfwcap gdigrab 其中 dshow 可以用来抓 取摄像头、采集卡、麦克风等,- vfwcap 主要用来采集摄像头类设备,- gdigrab 则是抓取 Windows 窗口程序 FFmpeg 使用 dshow 采集音视频设备 使用 dshow 枚举设备 ffmpeg -f dshow -list_devices true -i dymmy 输出 [dshow @ 000002622302e340]FFmpeg | 录制摄像头和桌面数据machttps://zfunnily.github.io/2020/08/macffmpeg/Sat, 29 Aug 2020 17:20:40 +0000https://zfunnily.github.io/2020/08/macffmpeg/设备枚举 查看设备列表 $ ffmpeg -hide_banner -devices Devices: D. = Demuxing supported .E = Muxing supported -- D avfoundation AVFoundation input device D lavfi Libavfilter virtual input device E sdl,sdl2 SDL2 output device 可以看到输入设备有:avfoundation,lavfi 输出设备有:sdl `` 设备采集举例: $ ffmpeg -f avfoundation -list_devices true -i &#34; &#34; 看到了 如下设Owt-server | owt-client-javascripthttps://zfunnily.github.io/2020/08/owt-client-javascript/Sun, 16 Aug 2020 23:04:13 +0000https://zfunnily.github.io/2020/08/owt-client-javascript/概述 天气燥热,不易出门。遂研究一下owt-server,从owt-client-javascript的流程开始吧。 获取一个会议室 owt-client-javascript的时候有一个初始化房间的过程 ///owt-client-javascript/src/samples/conference/samplertcservice.jsLicod | 安装和配置https://zfunnily.github.io/2020/08/licode/Sun, 09 Aug 2020 09:34:36 +0000https://zfunnily.github.io/2020/08/licode/拉取docker镜像并运行 licode官方提供了配置好的docker镜像,使用以下命令拉下来跑就行。 docker run --name licode -p 3000:3000 -p $MIN_PORT-$MAX_PORT:30000-30050/udp -p 3001:3001 -p 8080:8080 -e &#34;MIN_PORT=30000&#34; -e &#34;MAX_PORT=30050&#34; -e &#34;PUBLIC_IP=your_ip_address&#34; lynckia/licode 注意命令里的PUBLIC_IP要改为服务器的公网IP。 配置好之Owt-server | 编译运行https://zfunnily.github.io/2020/08/owtservercomplie/Wed, 05 Aug 2020 09:47:22 +0000https://zfunnily.github.io/2020/08/owtservercomplie/概述 owt是一套完整的webrtc视频会议系统。包含的功能模块有: 视频会议1. p2p 服务器是owt-server通过nodejs编写的webrtc信令。依赖是licode。licode依赖webrtc。 客 \ No newline at end of file diff --git "a/categories/\350\207\252\345\212\250\351\203\250\347\275\262/index.xml" "b/categories/\350\207\252\345\212\250\351\203\250\347\275\262/index.xml" index 031ab8d32..dfb3cd38e 100644 --- "a/categories/\350\207\252\345\212\250\351\203\250\347\275\262/index.xml" +++ "b/categories/\350\207\252\345\212\250\351\203\250\347\275\262/index.xml" @@ -1 +1 @@ -自动部署 on Zzz记忆https://zfunnily.github.io/categories/%E8%87%AA%E5%8A%A8%E9%83%A8%E7%BD%B2/Recent content in 自动部署 on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000WSL2改为桥接https://zfunnily.github.io/2023/11/wsl2/Fri, 17 Nov 2023 15:45:00 +0800https://zfunnily.github.io/2023/11/wsl2/需求 在docker容器内部程序自己获取的ip是172开头的。我需要跟宿主机同样网段的ip。 问题 win10系统wsl2 不支持桥接 更简单的解决方案 使用vmware虚拟机,直接启动一个linux镜像,然后使Docker | Mysql 挂载目录一键部署https://zfunnily.github.io/2023/11/mysql/Thu, 16 Nov 2023 11:36:44 +0800https://zfunnily.github.io/2023/11/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 #WSL2子系统迁移https://zfunnily.github.io/2023/11/wsl/Mon, 13 Nov 2023 22:21:34 +0800https://zfunnily.github.io/2023/11/wsl/wsl 安装 参考链接: https://learn.microsoft.com/zh-cn/windows/wsl/install 通过命令行安装 wsl --update wsl -v -l wsl --install wsl &amp; docker 迁移 WSL发行版默认都是安装在C盘,在%LOCALAPPDATA%/Docker/wsl目录 docker的运行数据、镜像文件都存在%LOCALAPPGithubActionhttps://zfunnily.github.io/2023/11/gitaction/Mon, 13 Nov 2023 11:21:34 +0800https://zfunnily.github.io/2023/11/gitaction/Github Token 生成 &amp; 设置 github -&gt; Settings -&gt; Developer Settings -&gt; Personal access tokens 新增 Tokens(classic) 点击Generate new token 点击你想使用Action的github仓库 Settings -&gt; Secrets and variables -&gt; Actions -&gt; New respository secret. 填上名字ACTION_ACCESS_TOKEN和第一步生成的 token,Gitlab | CI/CD简单实现https://zfunnily.github.io/2022/06/cicd/Wed, 22 Jun 2022 14:26:25 +0800https://zfunnily.github.io/2022/06/cicd/CI/CD 流水线 组件组成 stages job gitlab runner(可以与gitlab服务器独立, c/s架构. ) -------- -------- --------- |stage1| -&gt; |stage2| -&gt; | stage3| -------- -------- --------- ------ ------ ------- |job1| |job2| | job3| ------ ------ ------- --------- --------- --------- |runner1| |runner2| -&gt; |runner3| --------- --------- --------- pipline: 包含多个stage, 顺序执行 stages: 一个stage可以包含多Gitlab | CI/CD简单实现https://zfunnily.github.io/2022/06/cicd/Wed, 22 Jun 2022 14:26:25 +0800https://zfunnily.github.io/2022/06/cicd/CI/CD 流水线 组件组成 stages job gitlab runner(可以与gitlab服务器独立, c/s架构. ) -------- -------- --------- |stage1| -&gt; |stage2| -&gt; | stage3| -------- -------- --------- ------ ------ ------- |job1| |job2| | job3| ------ ------ ------- --------- --------- --------- |runner1| |runner2| -&gt; |runner3| --------- --------- --------- pipline: 包含多个stage, 顺序执行 stages: 一个stage可以包含多Docker | 容器退出码详解https://zfunnily.github.io/2020/11/Docker%E5%AE%B9%E5%99%A8%E9%80%80%E5%87%BA%E7%A0%81%E8%AF%A6%E8%A7%A3/Sat, 28 Nov 2020 13:32:57 +0000https://zfunnily.github.io/2020/11/Docker%E5%AE%B9%E5%99%A8%E9%80%80%E5%87%BA%E7%A0%81%E8%AF%A6%E8%A7%A3/docker查看退出码指令 $ docker ps --filter &#34;status=exited&#34; $ docker inspect container-id --format=&#39;{&lt;!-- --&gt;{.State.ExitCode}}&#39; 常见退出码 Exit Code 0 退出代码0表示特定容器没有附加前台进程。 该退出代码是所有其他后续退出代码的例外。 这不一定意味着发生了不好的事情。如果开发人员想要在容器完K8S | Prometheus+Grafana监控https://zfunnily.github.io/2020/08/prometheusgrafana/Mon, 17 Aug 2020 13:58:35 +0000https://zfunnily.github.io/2020/08/prometheusgrafana/概述 作为应用与Kubernetes的监控体系,Prometheus具备诸多的优势,如: Kubernetes默认支持,非常适合容器和微服务- 无依赖,安装方便,上手容易- 社区活跃,它不仅仅是个工具,而是生K8S | Ingress的基本使用https://zfunnily.github.io/2020/08/ingress/Sat, 15 Aug 2020 00:05:15 +0000https://zfunnily.github.io/2020/08/ingress/缘由 看了statefulset基础教程的基础教程,并且把环境搭建起来后。pod内部是可以连通了。但是我不知道怎么去从外部访问。在网上搜索一番,通过Ingress可以作为集群的入口。遂记录之。 结合StaK8S | Statefluset的持久存储PVChttps://zfunnily.github.io/2020/08/pvc/Fri, 14 Aug 2020 17:18:58 +0000https://zfunnily.github.io/2020/08/pvc/缘由 在看statefluset基础教程的时候遇到pod状态为pending kubectl describe pod web-0 日志内容是 pod has unbound immediate PersistentVolumeClaims 于是就对PV和PVC进行研究。 有给出完整的 web.yaml查看最下面的完整示例。但是我建议先把PVK8S | StatefulSet基本原理https://zfunnily.github.io/2020/08/statefulset/Fri, 14 Aug 2020 16:03:41 +0000https://zfunnily.github.io/2020/08/statefulset/背景 用户通过 Deployment、ReplicationController 可以方便地在 kubernetes 中部署一套高可用、可扩展的分布式无状态服务。这类应用不在本地存储数据,通过简单的负载均衡策略可实现请求分发。随K8S | coreDNS的部署安装https://zfunnily.github.io/2020/08/coredns/Thu, 13 Aug 2020 18:44:28 +0000https://zfunnily.github.io/2020/08/coredns/概述 CoreDNS可以在具有标准的Kube-DNS的Kubernetes集群中运行。作为Kubernetes 的插件使用,CoreDNS将从 Kubernetes集群中读取区(zone)数据。它实现了为KK8S | 创建第一个应用https://zfunnily.github.io/2020/08/firstk8s/Thu, 13 Aug 2020 15:28:31 +0000https://zfunnily.github.io/2020/08/firstk8s/使用k8s部署第一个应用 创建一个nginx.yaml文件 apiVersion: v1 kind: Pod metadata: name: nginx # 指定 label,便于检索 labels: app: nginx spec: containers: - name: nginx # 指定镜像 image: nginx:alpine # 指定暴露端口 ports: - containerPort: 80 --- # 创建网络服务 apiVersion: v1 kind: Service metadata: name: kube-node-service labels: name: kube-node-service spec: type: NodePort #这里代表Docker | 远程访问加密https://zfunnily.github.io/2020/08/dockersecret/Fri, 07 Aug 2020 07:56:52 +0000https://zfunnily.github.io/2020/08/dockersecret/docker的远程访问 方法一 :编辑docker.service文件 编辑docker.service文件 sudo vim /lib/systemd/system/docker.service 修改ExecStart行为下面内容 ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock 重新加载docker配置 sudo systemctl daemon-reload // 1,加载dockDocker | web管理界面portainerhttps://zfunnily.github.io/2020/08/dockerweb/Fri, 07 Aug 2020 07:54:43 +0000https://zfunnily.github.io/2020/08/dockerweb/拉取镜像 $ docker pull portainer/portainer 运行启动portainer docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v /home/docker/portainer:/data --name portainer --restart=always portainer/portainer admin bigant.cn 汉化 Portainer-CN.zip 百度云盘: https://pan.baidu.com/s/13ra6jXHR_7vajLLlf5GVEw 提取码: nzue 新建文件夹命名为public,把Portainer-CN.zip解压至里面。 2、public文件夹传K8S | 集群资源监控 heapsterhttps://zfunnily.github.io/2020/08/heapster/Thu, 06 Aug 2020 09:06:05 +0000https://zfunnily.github.io/2020/08/heapster/安装heapster的原因 查看dashboard状态 $ sudo kubectl get pods --all-namespaces | grep dashboard kubernetes-dashboard dashboard-metrics-scraper-6b4884c9d5-mvnb9 1/1 Running 0 40m kubernetes-dashboard kubernetes-dashboard-d7f7f565d-zhpsc 1/1 Running 0 40m 查看dashboard的日志 $ sudo kubectl logs -f -n kubernetes-dashboard kubernetes-dashboard-d7f7f565d-zhpsc 日志遇到这样的情况 No metric client provided. Skipping metrics. 2020/08/03 09:02:22 [2020-08-03T09:02:22Z] Outcoming response to 192.168.84.241:40086 with 200 status code 2020/08/03 09:02:23 Metric client healthK8S | Dashboard界面管理https://zfunnily.github.io/2020/08/dashboard/Thu, 06 Aug 2020 09:04:14 +0000https://zfunnily.github.io/2020/08/dashboard/安装部署Dashboard 通过一下命令来部署, recommended.yaml $ sudo kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deploy/recommended.yaml https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deplK8S | 安装https://zfunnily.github.io/2020/08/k8sinstall/Wed, 05 Aug 2020 10:00:40 +0000https://zfunnily.github.io/2020/08/k8sinstall/安装k8s前的准备工作 环境 ubuntu18.04 docker 关闭 swap 暂时关闭 $ swapoff -a 永久关闭 注释掉这一行 sudo vim /etc/fstab # /swapfile none swap sw 0 0 重启机器 sudo reboot docker 的配置 安装完成之后需要进行一些配置,包括 切换docker下载源为国内镜像站 以及 修改cgroups \ No newline at end of file +自动部署 on Zzz记忆https://zfunnily.github.io/categories/%E8%87%AA%E5%8A%A8%E9%83%A8%E7%BD%B2/Recent content in 自动部署 on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000WSL2改为桥接https://zfunnily.github.io/2023/11/wsl2/Fri, 17 Nov 2023 15:45:00 +0800https://zfunnily.github.io/2023/11/wsl2/需求 在docker容器内部程序自己获取的ip是172开头的。我需要跟宿主机同样网段的ip。 问题 win10系统wsl2 不支持桥接 更简单的解决方案 使用vmware虚拟机,直接启动一个linux镜像,然后使Docker | Mysql 挂载目录一键部署https://zfunnily.github.io/2023/11/mysql/Thu, 16 Nov 2023 11:36:44 +0800https://zfunnily.github.io/2023/11/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 #WSL2子系统迁移https://zfunnily.github.io/2023/11/wsl/Mon, 13 Nov 2023 22:21:34 +0800https://zfunnily.github.io/2023/11/wsl/wsl 安装 参考链接: https://learn.microsoft.com/zh-cn/windows/wsl/install 通过命令行安装 wsl --update wsl -v -l wsl --install wsl &amp; docker 迁移 WSL发行版默认都是安装在C盘,在%LOCALAPPDATA%/Docker/wsl目录 docker的运行数据、镜像文件都存在%LOCALAPPGithubActionhttps://zfunnily.github.io/2023/11/gitaction/Mon, 13 Nov 2023 11:21:34 +0800https://zfunnily.github.io/2023/11/gitaction/Github Token 生成 &amp; 设置 github -&gt; Settings -&gt; Developer Settings -&gt; Personal access tokens 新增 Tokens(classic) 点击Generate new token 点击你想使用Action的github仓库 Settings -&gt; Secrets and variables -&gt; Actions -&gt; New respository secret. 填上名字ACTION_ACCESS_TOKEN和第一步生成的 token,Gitlab | CI/CD简单实现https://zfunnily.github.io/2022/06/cicd/Wed, 22 Jun 2022 14:26:25 +0800https://zfunnily.github.io/2022/06/cicd/CI/CD 流水线 组件组成 stages job gitlab runner(可以与gitlab服务器独立, c/s架构. ) -------- -------- --------- |stage1| -&gt; |stage2| -&gt; | stage3| -------- -------- --------- ------ ------ ------- |job1| |job2| | job3| ------ ------ ------- --------- --------- --------- |runner1| |runner2| -&gt; |runner3| --------- --------- --------- pipline: 包含多个stage, 顺序执行 stages: 一个stage可以包含多Gitlab | CI/CD简单实现https://zfunnily.github.io/2022/06/cicd/Wed, 22 Jun 2022 14:26:25 +0800https://zfunnily.github.io/2022/06/cicd/CI/CD 流水线 组件组成 stages job gitlab runner(可以与gitlab服务器独立, c/s架构. ) -------- -------- --------- |stage1| -&gt; |stage2| -&gt; | stage3| -------- -------- --------- ------ ------ ------- |job1| |job2| | job3| ------ ------ ------- --------- --------- --------- |runner1| |runner2| -&gt; |runner3| --------- --------- --------- pipline: 包含多个stage, 顺序执行 stages: 一个stage可以包含多Docker | 容器退出码详解https://zfunnily.github.io/2020/11/Docker%E5%AE%B9%E5%99%A8%E9%80%80%E5%87%BA%E7%A0%81%E8%AF%A6%E8%A7%A3/Sat, 28 Nov 2020 13:32:57 +0000https://zfunnily.github.io/2020/11/Docker%E5%AE%B9%E5%99%A8%E9%80%80%E5%87%BA%E7%A0%81%E8%AF%A6%E8%A7%A3/docker查看退出码指令 $ docker ps --filter &#34;status=exited&#34; $ docker inspect container-id --format=&#39;{&lt;!-- --&gt;{.State.ExitCode}}&#39; 常见退出码 Exit Code 0 退出代码0表示特定容器没有附加前台进程。 该退出代码是所有其他后续退出代码的例外。 这不一定意味着发生了不好的事情。如果开发人员想要在容器完K8S | Prometheus+Grafana监控https://zfunnily.github.io/2020/08/prometheusgrafana/Mon, 17 Aug 2020 13:58:35 +0000https://zfunnily.github.io/2020/08/prometheusgrafana/概述 作为应用与Kubernetes的监控体系,Prometheus具备诸多的优势,如: Kubernetes默认支持,非常适合容器和微服务- 无依赖,安装方便,上手容易- 社区活跃,它不仅仅是个工具,而是生K8S | Ingress的基本使用https://zfunnily.github.io/2020/08/ingress/Sat, 15 Aug 2020 00:05:15 +0000https://zfunnily.github.io/2020/08/ingress/缘由 看了statefulset基础教程的基础教程,并且把环境搭建起来后。pod内部是可以连通了。但是我不知道怎么去从外部访问。在网上搜索一番,通过Ingress可以作为集群的入口。遂记录之。 结合StaK8S | Statefluset的持久存储PVChttps://zfunnily.github.io/2020/08/pvc/Fri, 14 Aug 2020 17:18:58 +0000https://zfunnily.github.io/2020/08/pvc/缘由 在看statefluset基础教程的时候遇到pod状态为pending kubectl describe pod web-0 日志内容是 pod has unbound immediate PersistentVolumeClaims 于是就对PV和PVC进行研究。 有给出完整的 web.yaml查看最下面的完整示例。但是我建议先把PVK8S | StatefulSet基本原理https://zfunnily.github.io/2020/08/statefulset/Fri, 14 Aug 2020 16:03:41 +0000https://zfunnily.github.io/2020/08/statefulset/背景 用户通过 Deployment、ReplicationController 可以方便地在 kubernetes 中部署一套高可用、可扩展的分布式无状态服务。这类应用不在本地存储数据,通过简单的负载均衡策略可实现请求分发。随K8S | coreDNS的部署安装https://zfunnily.github.io/2020/08/coredns/Thu, 13 Aug 2020 18:44:28 +0000https://zfunnily.github.io/2020/08/coredns/概述 CoreDNS可以在具有标准的Kube-DNS的Kubernetes集群中运行。作为Kubernetes 的插件使用,CoreDNS将从 Kubernetes集群中读取区(zone)数据。它实现了为KK8S | 创建第一个应用https://zfunnily.github.io/2020/08/firstk8s/Thu, 13 Aug 2020 15:28:31 +0000https://zfunnily.github.io/2020/08/firstk8s/使用k8s部署第一个应用 创建一个nginx.yaml文件 apiVersion: v1 kind: Pod metadata: name: nginx # 指定 label,便于检索 labels: app: nginx spec: containers: - name: nginx # 指定镜像 image: nginx:alpine # 指定暴露端口 ports: - containerPort: 80 --- # 创建网络服务 apiVersion: v1 kind: Service metadata: name: kube-node-service labels: name: kube-node-service spec: type: NodePort #这里代表Docker | 远程访问加密https://zfunnily.github.io/2020/08/dockersecret/Fri, 07 Aug 2020 07:56:52 +0000https://zfunnily.github.io/2020/08/dockersecret/docker的远程访问 方法一 :编辑docker.service文件 编辑docker.service文件 sudo vim /lib/systemd/system/docker.service 修改ExecStart行为下面内容 ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock 重新加载docker配置 sudo systemctl daemon-reload // 1,加载dockDocker | web管理界面portainerhttps://zfunnily.github.io/2020/08/dockerweb/Fri, 07 Aug 2020 07:54:43 +0000https://zfunnily.github.io/2020/08/dockerweb/拉取镜像 $ docker pull portainer/portainer 运行启动portainer docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v /home/docker/portainer:/data --name portainer --restart=always portainer/portainer admin bigant.cn 汉化 Portainer-CN.zip 百度云盘: https://pan.baidu.com/s/13ra6jXHR_7vajLLlf5GVEw 提取码: nzue 新建文件夹命名为public,把Portainer-CN.zip解压至里面。 2、public文件夹传K8S | 集群资源监控 heapsterhttps://zfunnily.github.io/2020/08/heapster/Thu, 06 Aug 2020 09:06:05 +0000https://zfunnily.github.io/2020/08/heapster/安装heapster的原因 查看dashboard状态 $ sudo kubectl get pods --all-namespaces | grep dashboard kubernetes-dashboard dashboard-metrics-scraper-6b4884c9d5-mvnb9 1/1 Running 0 40m kubernetes-dashboard kubernetes-dashboard-d7f7f565d-zhpsc 1/1 Running 0 40m 查看dashboard的日志 $ sudo kubectl logs -f -n kubernetes-dashboard kubernetes-dashboard-d7f7f565d-zhpsc 日志遇到这样的情况 No metric client provided. Skipping metrics. 2020/08/03 09:02:22 [2020-08-03T09:02:22Z] Outcoming response to 192.168.84.241:40086 with 200 status code 2020/08/03 09:02:23 Metric client healthK8S | Dashboard界面管理https://zfunnily.github.io/2020/08/dashboard/Thu, 06 Aug 2020 09:04:14 +0000https://zfunnily.github.io/2020/08/dashboard/安装部署Dashboard 通过一下命令来部署, recommended.yaml $ sudo kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deploy/recommended.yaml https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deplK8S | 安装https://zfunnily.github.io/2020/08/k8sinstall/Wed, 05 Aug 2020 10:00:40 +0000https://zfunnily.github.io/2020/08/k8sinstall/安装k8s前的准备工作 环境 ubuntu18.04 docker 关闭 swap 暂时关闭 $ swapoff -a 永久关闭 注释掉这一行 sudo vim /etc/fstab # /swapfile none swap sw 0 0 重启机器 sudo reboot docker 的配置 安装完成之后需要进行一些配置,包括 切换docker下载源为国内镜像站 以及 修改cgroups \ No newline at end of file diff --git "a/categories/\350\275\254\350\275\275/index.xml" "b/categories/\350\275\254\350\275\275/index.xml" index 43c6e29df..7759aa0d8 100644 --- "a/categories/\350\275\254\350\275\275/index.xml" +++ "b/categories/\350\275\254\350\275\275/index.xml" @@ -1 +1 @@ -转载 on Zzz记忆https://zfunnily.github.io/categories/%E8%BD%AC%E8%BD%BD/Recent content in 转载 on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000转载|江雪:长安十日https://zfunnily.github.io/thinking/2022/01/jx/Thu, 06 Jan 2022 11:32:56 +0800https://zfunnily.github.io/thinking/2022/01/jx/转载 https://chinadigitaltimes.net/chinese/675386.html(需科学上网) 01/03/2022 文:江雪 小区里的大喇叭又响了起来,一遍遍重复着,喊人们下楼做核酸。队排了很长。测核 \ No newline at end of file +转载 on Zzz记忆https://zfunnily.github.io/categories/%E8%BD%AC%E8%BD%BD/Recent content in 转载 on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000转载|江雪:长安十日https://zfunnily.github.io/thinking/2022/01/jx/Thu, 06 Jan 2022 11:32:56 +0800https://zfunnily.github.io/thinking/2022/01/jx/转载 https://chinadigitaltimes.net/chinese/675386.html(需科学上网) 01/03/2022 文:江雪 小区里的大喇叭又响了起来,一遍遍重复着,喊人们下楼做核酸。队排了很长。测核 \ No newline at end of file diff --git "a/categories/\351\232\217\347\254\224.\346\221\230\346\212\204/index.xml" "b/categories/\351\232\217\347\254\224.\346\221\230\346\212\204/index.xml" index cfd80d965..7104d0aae 100644 --- "a/categories/\351\232\217\347\254\224.\346\221\230\346\212\204/index.xml" +++ "b/categories/\351\232\217\347\254\224.\346\221\230\346\212\204/index.xml" @@ -1 +1 @@ -随笔.摘抄 on Zzz记忆https://zfunnily.github.io/categories/%E9%9A%8F%E7%AC%94.%E6%91%98%E6%8A%84/Recent content in 随笔.摘抄 on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000无聊 & 痛苦https://zfunnily.github.io/thinking/2022/03/shuowang/Wed, 09 Mar 2022 12:03:36 +0800https://zfunnily.github.io/thinking/2022/03/shuowang/每天晚上我都睡得很晚,不是不困,而是不想睡,强迫自己不要睡。我似乎得了强迫症,我很忧郁。 因为我总觉得一天什么都没干就这么过去了,实在不甘心!于是我就尽量延长这一天的时间。我真是个有志气的人,我很欣慰。摘抄 | 我的精神家园https://zfunnily.github.io/thinking/2021/12/pervert/Mon, 27 Dec 2021 21:44:21 +0800https://zfunnily.github.io/thinking/2021/12/pervert/另一种文化 假如有个pervert站出来说:我就是个pervert,那他就不是个pervert。 当且仅当一个人声称:我就不知道pervert是什么时,他才是个pervert。 假如我说,我们这里有种per \ No newline at end of file +随笔.摘抄 on Zzz记忆https://zfunnily.github.io/categories/%E9%9A%8F%E7%AC%94.%E6%91%98%E6%8A%84/Recent content in 随笔.摘抄 on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000无聊 & 痛苦https://zfunnily.github.io/thinking/2022/03/shuowang/Wed, 09 Mar 2022 12:03:36 +0800https://zfunnily.github.io/thinking/2022/03/shuowang/每天晚上我都睡得很晚,不是不困,而是不想睡,强迫自己不要睡。我似乎得了强迫症,我很忧郁。 因为我总觉得一天什么都没干就这么过去了,实在不甘心!于是我就尽量延长这一天的时间。我真是个有志气的人,我很欣慰。摘抄 | 我的精神家园https://zfunnily.github.io/thinking/2021/12/pervert/Mon, 27 Dec 2021 21:44:21 +0800https://zfunnily.github.io/thinking/2021/12/pervert/另一种文化 假如有个pervert站出来说:我就是个pervert,那他就不是个pervert。 当且仅当一个人声称:我就不知道pervert是什么时,他才是个pervert。 假如我说,我们这里有种per \ No newline at end of file diff --git "a/categories/\351\232\217\347\254\224/index.xml" "b/categories/\351\232\217\347\254\224/index.xml" index 2cb24734d..30a8ec999 100644 --- "a/categories/\351\232\217\347\254\224/index.xml" +++ "b/categories/\351\232\217\347\254\224/index.xml" @@ -1 +1 @@ -随笔 on Zzz记忆https://zfunnily.github.io/categories/%E9%9A%8F%E7%AC%94/Recent content in 随笔 on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000无聊 & 痛苦https://zfunnily.github.io/thinking/2022/03/shuowang/Wed, 09 Mar 2022 12:03:36 +0800https://zfunnily.github.io/thinking/2022/03/shuowang/每天晚上我都睡得很晚,不是不困,而是不想睡,强迫自己不要睡。我似乎得了强迫症,我很忧郁。 因为我总觉得一天什么都没干就这么过去了,实在不甘心!于是我就尽量延长这一天的时间。我真是个有志气的人,我很欣慰。爬楼有感https://zfunnily.github.io/thinking/2022/03/think01/Tue, 08 Mar 2022 21:54:25 +0800https://zfunnily.github.io/thinking/2022/03/think01/28楼 今天放弃了常用乘电梯回家,决定爬楼。28楼真高呀。我还记得上次是和阿芳一起爬的。 那会爬的很轻松,还有功夫教她 &ldquo;核心收紧,抬腿的时候膝盖沿着脚尖方向歪曲&rdquo;。 一个人爬楼让我又老纪https://zfunnily.github.io/thinking/2022/03/weekly01/Mon, 07 Mar 2022 21:36:05 +0800https://zfunnily.github.io/thinking/2022/03/weekly01/周末看了《铁齿铜牙纪晓岚》,对这样经典的剧,百看不厌。 这个剧我来来回回看了很多遍了,剧集内容越来越熟悉,但是对里面的人物却又有不一样的理解。 以前觉得纪晓岚清官,好人。和珅贪官,坏人。 现在看到了那一集和2021焦虑总结https://zfunnily.github.io/thinking/2022/03/summarize/Fri, 04 Mar 2022 11:03:20 +0800https://zfunnily.github.io/thinking/2022/03/summarize/2021 已经22年3月份了,这份总结才出来,我这是拖延症晚期了。 去年一年总的来说不错, 但还是有些计划性的东西没做 我结婚了,24岁 我转行做游戏了 买车了 读了3本书 健身 无 时间太快,从我19年开始记笔记开始,已经过摘抄 | 我的精神家园https://zfunnily.github.io/thinking/2021/12/pervert/Mon, 27 Dec 2021 21:44:21 +0800https://zfunnily.github.io/thinking/2021/12/pervert/另一种文化 假如有个pervert站出来说:我就是个pervert,那他就不是个pervert。 当且仅当一个人声称:我就不知道pervert是什么时,他才是个pervert。 假如我说,我们这里有种per \ No newline at end of file +随笔 on Zzz记忆https://zfunnily.github.io/categories/%E9%9A%8F%E7%AC%94/Recent content in 随笔 on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000无聊 & 痛苦https://zfunnily.github.io/thinking/2022/03/shuowang/Wed, 09 Mar 2022 12:03:36 +0800https://zfunnily.github.io/thinking/2022/03/shuowang/每天晚上我都睡得很晚,不是不困,而是不想睡,强迫自己不要睡。我似乎得了强迫症,我很忧郁。 因为我总觉得一天什么都没干就这么过去了,实在不甘心!于是我就尽量延长这一天的时间。我真是个有志气的人,我很欣慰。爬楼有感https://zfunnily.github.io/thinking/2022/03/think01/Tue, 08 Mar 2022 21:54:25 +0800https://zfunnily.github.io/thinking/2022/03/think01/28楼 今天放弃了常用乘电梯回家,决定爬楼。28楼真高呀。我还记得上次是和阿芳一起爬的。 那会爬的很轻松,还有功夫教她 &ldquo;核心收紧,抬腿的时候膝盖沿着脚尖方向歪曲&rdquo;。 一个人爬楼让我又老纪https://zfunnily.github.io/thinking/2022/03/weekly01/Mon, 07 Mar 2022 21:36:05 +0800https://zfunnily.github.io/thinking/2022/03/weekly01/周末看了《铁齿铜牙纪晓岚》,对这样经典的剧,百看不厌。 这个剧我来来回回看了很多遍了,剧集内容越来越熟悉,但是对里面的人物却又有不一样的理解。 以前觉得纪晓岚清官,好人。和珅贪官,坏人。 现在看到了那一集和2021焦虑总结https://zfunnily.github.io/thinking/2022/03/summarize/Fri, 04 Mar 2022 11:03:20 +0800https://zfunnily.github.io/thinking/2022/03/summarize/2021 已经22年3月份了,这份总结才出来,我这是拖延症晚期了。 去年一年总的来说不错, 但还是有些计划性的东西没做 我结婚了,24岁 我转行做游戏了 买车了 读了3本书 健身 无 时间太快,从我19年开始记笔记开始,已经过摘抄 | 我的精神家园https://zfunnily.github.io/thinking/2021/12/pervert/Mon, 27 Dec 2021 21:44:21 +0800https://zfunnily.github.io/thinking/2021/12/pervert/另一种文化 假如有个pervert站出来说:我就是个pervert,那他就不是个pervert。 当且仅当一个人声称:我就不知道pervert是什么时,他才是个pervert。 假如我说,我们这里有种per \ No newline at end of file diff --git a/english/index.xml b/english/index.xml index d4f88e768..cfaa9d385 100644 --- a/english/index.xml +++ b/english/index.xml @@ -1 +1 @@ -Englishes on Zzz记忆https://zfunnily.github.io/english/Recent content in Englishes on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000adjhttps://zfunnily.github.io/english/xdf/04_adj/Mon, 18 Jul 2022 09:45:29 +0800https://zfunnily.github.io/english/xdf/04_adj/形容词在名词短语中的位置 前置修饰名词 单个形容词在名词短语中的位置 在一个名词短语中,若是单个形容词作定语修饰一个名词,其结构通常是“限定词+形容词+名词” 修饰something,anything,not \ No newline at end of file +Englishes on Zzz记忆https://zfunnily.github.io/english/Recent content in Englishes on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000adjhttps://zfunnily.github.io/english/xdf/04_adj/Mon, 18 Jul 2022 09:45:29 +0800https://zfunnily.github.io/english/xdf/04_adj/形容词在名词短语中的位置 前置修饰名词 单个形容词在名词短语中的位置 在一个名词短语中,若是单个形容词作定语修饰一个名词,其结构通常是“限定词+形容词+名词” 修饰something,anything,not \ No newline at end of file diff --git a/index.xml b/index.xml index e675f8d4e..4540b1afd 100644 --- a/index.xml +++ b/index.xml @@ -1 +1 @@ -Zzz记忆https://zfunnily.github.io/Recent content on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +00002024-2月https://zfunnily.github.io/2024/02/02/Tue, 27 Feb 2024 15:45:00 +0800https://zfunnily.github.io/2024/02/02/学习 书籍 电影 游戏 《Lies of P》 《Dark Soul》重制版 番&amp;剧 《绝命毒师》第一季/第二季 其他12月https://zfunnily.github.io/2023/12/30/Sat, 30 Dec 2023 15:45:00 +0800https://zfunnily.github.io/2023/12/30/学习 银河城地图 搭建 ue5 paper2d 书籍 《游戏设计艺术》 电影 《复仇者联盟》4 游戏 《血污:夜之仪式》 《LOL》 《神之亵渎》 23小时 番&amp;剧 其他11月https://zfunnily.github.io/2023/11/30/Thu, 30 Nov 2023 15:45:00 +0800https://zfunnily.github.io/2023/11/30/学习 chatglm + langchain 知识库 docker搭建 ue5 paper2d的使用 wsl 子系统研究, win11 镜像模式. 电视剧 《繁城之下》 番剧 《反叛的鲁路修》 一季、二季 书籍 《置身事内》 电影 《复仇者联盟》3 游戏 《马里奥惊奇》已完结 《血污:夜之WSL2改为桥接https://zfunnily.github.io/2023/11/wsl2/Fri, 17 Nov 2023 15:45:00 +0800https://zfunnily.github.io/2023/11/wsl2/需求 在docker容器内部程序自己获取的ip是172开头的。我需要跟宿主机同样网段的ip。 问题 win10系统wsl2 不支持桥接 更简单的解决方案 使用vmware虚拟机,直接启动一个linux镜像,然后使Python3.7安装https://zfunnily.github.io/2023/11/python/Thu, 16 Nov 2023 15:39:01 +0800https://zfunnily.github.io/2023/11/python/环境 centos7 开始安装 安装扩展 $ yum -y install yum-utils 安装Centos开发工具 $ yum -y groupinstall development 安装python3依赖 $ yum -y install zlib-devel bzip2-devel openssl-devel openssl-static ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel libffi-devel lzma gcc 下载python3.7安装包 # 将python3.7安装包,下载到/usr/Docker | Mysql 挂载目录一键部署https://zfunnily.github.io/2023/11/mysql/Thu, 16 Nov 2023 11:36:44 +0800https://zfunnily.github.io/2023/11/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 #Svnhttps://zfunnily.github.io/2023/11/svn/Tue, 14 Nov 2023 16:46:02 +0800https://zfunnily.github.io/2023/11/svn/SVN 合并 从源svn分支合并到目标svn分支 在源svn项目下鼠标右键,TortoiseSVN -&gt; Repo-browser, 拿到源项目svn地址 在目标svn项目下鼠标右键,TortoiseSVN -&gt; Merge -&gt;, 填入源项目svn地址 在show lWSL2子系统迁移https://zfunnily.github.io/2023/11/wsl/Mon, 13 Nov 2023 22:21:34 +0800https://zfunnily.github.io/2023/11/wsl/wsl 安装 参考链接: https://learn.microsoft.com/zh-cn/windows/wsl/install 通过命令行安装 wsl --update wsl -v -l wsl --install wsl &amp; docker 迁移 WSL发行版默认都是安装在C盘,在%LOCALAPPDATA%/Docker/wsl目录 docker的运行数据、镜像文件都存在%LOCALAPPGithubActionhttps://zfunnily.github.io/2023/11/gitaction/Mon, 13 Nov 2023 11:21:34 +0800https://zfunnily.github.io/2023/11/gitaction/Github Token 生成 &amp; 设置 github -&gt; Settings -&gt; Developer Settings -&gt; Personal access tokens 新增 Tokens(classic) 点击Generate new token 点击你想使用Action的github仓库 Settings -&gt; Secrets and variables -&gt; Actions -&gt; New respository secret. 填上名字ACTION_ACCESS_TOKEN和第一步生成的 token,ChatGLM & LangChainhttps://zfunnily.github.io/2023/11/chatglm/Fri, 10 Nov 2023 11:21:34 +0800https://zfunnily.github.io/2023/11/chatglm/参考: 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 DockerDDNS配置https://zfunnily.github.io/2023/10/DDNS/Mon, 30 Oct 2023 11:21:34 +0800https://zfunnily.github.io/2023/10/DDNS/参考: https://www.sakamoto.blog/synology-nas-cloudflare-ddns/ Cloudflare 获取 区域 ID 创建 API 令牌 群晖设置 开启并登陆群晖NAS终端 下载 Cloudflare DDNS 脚本 下载 Cloudflare 的 DDNS 脚本文件,官方推荐存放于/sbin/cloudflareddns.sh并赋予执行权限. # 下载脚本 $ wget https://raw.githubusercontent.com/joshuaavalon/SynologyCloudflareDDNS/master/cloudflareddns.sh -O /sbin/cloudflareddns.sh # 赋予执行粒子系统01-概述https://zfunnily.github.io/2023/05/particlesystem01/Wed, 24 May 2023 11:21:34 +0800https://zfunnily.github.io/2023/05/particlesystem01/参考视频 参考播客 一、两种解决方案 区别 Particle System(内置粒子系统) Visual Effect Graph(VFX Graph) 基于XX运行 CPU GPU 粒子数量 数千 数百万 渲染管线 支持全部渲染管线 不支持内置渲染管线 物理系统 可与Unity物理系统交互 特定元素交互 创作Netch加速SWITCHhttps://zfunnily.github.io/2022/10/netch/Thu, 27 Oct 2022 10:09:44 +0800https://zfunnily.github.io/2022/10/netch/需求 对于有机场的用户,不用再花一份加速器的钱给Switch加速 前提条件 电脑通过(shadowrocks/v2ray)开启科学上网,使用端口 1080 电脑局域网IP 192.168.0.103 允许局域网设备连入 解决过程 switch的代理Netch加速SWITCHhttps://zfunnily.github.io/2022/10/netch/Thu, 27 Oct 2022 10:09:44 +0800https://zfunnily.github.io/2022/10/netch/需求 对于有机场的用户,不用再花一份加速器的钱给Switch加速 前提条件 电脑通过(shadowrocks/v2ray)开启科学上网,使用端口 1080 电脑局域网IP 192.168.0.103 允许局域网设备连入 解决过程 switch的代理adjhttps://zfunnily.github.io/english/xdf/04_adj/Mon, 18 Jul 2022 09:45:29 +0800https://zfunnily.github.io/english/xdf/04_adj/形容词在名词短语中的位置 前置修饰名词 单个形容词在名词短语中的位置 在一个名词短语中,若是单个形容词作定语修饰一个名词,其结构通常是“限定词+形容词+名词” 修饰something,anything,notGitlab | CI/CD简单实现https://zfunnily.github.io/2022/06/cicd/Wed, 22 Jun 2022 14:26:25 +0800https://zfunnily.github.io/2022/06/cicd/CI/CD 流水线 组件组成 stages job gitlab runner(可以与gitlab服务器独立, c/s架构. ) -------- -------- --------- |stage1| -&gt; |stage2| -&gt; | stage3| -------- -------- --------- ------ ------ ------- |job1| |job2| | job3| ------ ------ ------- --------- --------- --------- |runner1| |runner2| -&gt; |runner3| --------- --------- --------- pipline: 包含多个stage, 顺序执行 stages: 一个stage可以包含多Gitlab | CI/CD简单实现https://zfunnily.github.io/2022/06/cicd/Wed, 22 Jun 2022 14:26:25 +0800https://zfunnily.github.io/2022/06/cicd/CI/CD 流水线 组件组成 stages job gitlab runner(可以与gitlab服务器独立, c/s架构. ) -------- -------- --------- |stage1| -&gt; |stage2| -&gt; | stage3| -------- -------- --------- ------ ------ ------- |job1| |job2| | job3| ------ ------ ------- --------- --------- --------- |runner1| |runner2| -&gt; |runner3| --------- --------- --------- pipline: 包含多个stage, 顺序执行 stages: 一个stage可以包含多百度网盘不限速 | Aria2篇https://zfunnily.github.io/2022/05/baidu/Tue, 17 May 2022 16:40:59 +0800https://zfunnily.github.io/2022/05/baidu/环境 win10 chrome 油猴插件 aria2 Aria2 对于不想折腾的有懒人包. 实际上包里含有的是aria2软件和aria2 GUI。 下载链接如下: 懒人下载包 AriaNg Aria2 百度网盘简易下载助手 安装油猴脚本: 百度网盘简易下载助手 安装好上述脚本之后,可百度网盘不限速 | Aria2篇https://zfunnily.github.io/2022/05/baidu/Tue, 17 May 2022 16:40:59 +0800https://zfunnily.github.io/2022/05/baidu/环境 win10 chrome 油猴插件 aria2 Aria2 对于不想折腾的有懒人包. 实际上包里含有的是aria2软件和aria2 GUI。 下载链接如下: 懒人下载包 AriaNg Aria2 百度网盘简易下载助手 安装油猴脚本: 百度网盘简易下载助手 安装好上述脚本之后,可URP 不透明/半透明物体的折射https://zfunnily.github.io/2022/05/refraction/Tue, 17 May 2022 11:30:48 +0800https://zfunnily.github.io/2022/05/refraction/折射 应用场景 水池 玻璃 热空气(热扭曲) GrabPass + CubeMap 《Unity3D Shader入门精要》第十章介绍了,模拟实现折射效果有两种 使用cubemap: 我认为太麻烦.需要的贴图太多。也没有找到其他合适的使用场景,遂搁URP 不透明/半透明物体的折射https://zfunnily.github.io/2022/05/refraction/Tue, 17 May 2022 11:30:48 +0800https://zfunnily.github.io/2022/05/refraction/折射 应用场景 水池 玻璃 热空气(热扭曲) GrabPass + CubeMap 《Unity3D Shader入门精要》第十章介绍了,模拟实现折射效果有两种 使用cubemap: 我认为太麻烦.需要的贴图太多。也没有找到其他合适的使用场景,遂搁《Unity Shader入门精要》第八章笔记 | 透明度https://zfunnily.github.io/2022/05/shaderalpha/Sat, 07 May 2022 17:17:18 +0800https://zfunnily.github.io/2022/05/shaderalpha/渲染顺序 名称 队列索引号 描 述 Background 1000 这个渲染队列会在任何其他队列之前被渲染,我们通常使用该队列来渲染那些需要绘制在背景上的物体 Geometry 2000 默认的渲染队列,大多数物体都使用这个队列。不透明物体使用这个队列 AlphaTest 2450 需要透明《Unity Shader入门精要》第八章笔记 | 透明度https://zfunnily.github.io/2022/05/shaderalpha/Sat, 07 May 2022 17:17:18 +0800https://zfunnily.github.io/2022/05/shaderalpha/渲染顺序 名称 队列索引号 描 述 Background 1000 这个渲染队列会在任何其他队列之前被渲染,我们通常使用该队列来渲染那些需要绘制在背景上的物体 Geometry 2000 默认的渲染队列,大多数物体都使用这个队列。不透明物体使用这个队列 AlphaTest 2450 需要透明《Unity Shader入门精要》第六章笔记 | 基础光照https://zfunnily.github.io/2022/05/shaderlighting/Sat, 07 May 2022 16:22:40 +0800https://zfunnily.github.io/2022/05/shaderlighting/我们是如何看到这个世界的 光源: 在光学里,我们使用辐照度 (irradiance) 来量化光 物体的吸收和散射: 光线由光源发射出来后,就会与一些物体相交 着色: 根据材质属性(如漫反射属性等)、光源信息(如光源方《Unity Shader入门精要》第六章笔记 | 基础光照https://zfunnily.github.io/2022/05/shaderlighting/Sat, 07 May 2022 16:22:40 +0800https://zfunnily.github.io/2022/05/shaderlighting/我们是如何看到这个世界的 光源: 在光学里,我们使用辐照度 (irradiance) 来量化光 物体的吸收和散射: 光线由光源发射出来后,就会与一些物体相交 着色: 根据材质属性(如漫反射属性等)、光源信息(如光源方《Unity Shader入门精要》第五章笔记 | 开始shader练习https://zfunnily.github.io/2022/05/shaderbase/Sat, 07 May 2022 10:22:33 +0800https://zfunnily.github.io/2022/05/shaderbase/一个简单的顶点/片元着色器 代码 Shader &#34;Unity Shaders Book/Chapter 5/Simple Shader&#34; { Properties { // 声明一个Color类型的属性 _Color (&#34;Color Tint&#34;, Color) = (1.0,1.0,1.0,1.0) } SubShader { Pass { CGPROGRAM #pragma vertex vert #pragma fragment frag // 在Cg代码中,我们需要定义一个与属性名称和类型都匹配的变量 fixed4 _Color; // 使用一个结构体来定义《Unity Shader入门精要》第五章笔记 | 开始shader练习https://zfunnily.github.io/2022/05/shaderbase/Sat, 07 May 2022 10:22:33 +0800https://zfunnily.github.io/2022/05/shaderbase/一个简单的顶点/片元着色器 代码 Shader &#34;Unity Shaders Book/Chapter 5/Simple Shader&#34; { Properties { // 声明一个Color类型的属性 _Color (&#34;Color Tint&#34;, Color) = (1.0,1.0,1.0,1.0) } SubShader { Pass { CGPROGRAM #pragma vertex vert #pragma fragment frag // 在Cg代码中,我们需要定义一个与属性名称和类型都匹配的变量 fixed4 _Color; // 使用一个结构体来定义MAC平台几何着色器不生效https://zfunnily.github.io/2022/05/geometry/Thu, 05 May 2022 16:49:29 +0800https://zfunnily.github.io/2022/05/geometry/问题 MAC平台几何着色器不生效 解决步骤 unity shaderlab 怎么设置以至于支持几何着色器 找原因,设置 编译目标级别,#pragma target 4.0, 不管用 看到一句话,Unity 在 Metal 图形上支持曲面细分着色器,但 Metal 不支持几何着色器 找到maMAC平台几何着色器不生效https://zfunnily.github.io/2022/05/geometry/Thu, 05 May 2022 16:49:29 +0800https://zfunnily.github.io/2022/05/geometry/问题 MAC平台几何着色器不生效 解决步骤 unity shaderlab 怎么设置以至于支持几何着色器 找原因,设置 编译目标级别,#pragma target 4.0, 不管用 看到一句话,Unity 在 Metal 图形上支持曲面细分着色器,但 Metal 不支持几何着色器 找到maShaderLab常用函数https://zfunnily.github.io/2022/04/shaderfunc/Wed, 20 Apr 2022 15:41:29 +0800https://zfunnily.github.io/2022/04/shaderfunc/数学函数 cg/hlsl函数 功能描述 dot(A,B) 点积, 点积结果为标量,主要用于求向量的夹角或b向量在a向量上的投影 cross(A,B) 叉积, 叉积结果为向量,结果与这两个向量组成的平面垂直。主要用于3D图形学 mul(M, N) 矩阵M和矩阵N的积 mul(M,ShaderLab常用函数https://zfunnily.github.io/2022/04/shaderfunc/Wed, 20 Apr 2022 15:41:29 +0800https://zfunnily.github.io/2022/04/shaderfunc/数学函数 cg/hlsl函数 功能描述 dot(A,B) 点积, 点积结果为标量,主要用于求向量的夹角或b向量在a向量上的投影 cross(A,B) 叉积, 叉积结果为向量,结果与这两个向量组成的平面垂直。主要用于3D图形学 mul(M, N) 矩阵M和矩阵N的积 mul(M,UnityCG.cginc中常用函数https://zfunnily.github.io/2022/04/cginc/Wed, 20 Apr 2022 15:35:49 +0800https://zfunnily.github.io/2022/04/cginc/摄像机方向 WorldSpaceViewDir 输入一个模型空间中的顶点坐标 -&gt; 输出(世界空间)从这个点到摄像机的观察方向; WorldSpaceViewDir // 内部实现也是用UnityWorldSpaceViewDir // Computes world space view direction, from object space position // *Legacy* Please use UnityWorldSpaceViewDir instead inline float3 WorldSpaceViewDir( in float4 localPos ) { float3 worldPosUnityCG.cginc中常用函数https://zfunnily.github.io/2022/04/cginc/Wed, 20 Apr 2022 15:35:49 +0800https://zfunnily.github.io/2022/04/cginc/摄像机方向 WorldSpaceViewDir 输入一个模型空间中的顶点坐标 -&gt; 输出(世界空间)从这个点到摄像机的观察方向; WorldSpaceViewDir // 内部实现也是用UnityWorldSpaceViewDir // Computes world space view direction, from object space position // *Legacy* Please use UnityWorldSpaceViewDir instead inline float3 WorldSpaceViewDir( in float4 localPos ) { float3 worldPos《Unity Shader入门精要》第四章笔记 | 学习Shader所需的数学基础https://zfunnily.github.io/2022/04/shadermathematic/Sun, 10 Apr 2022 15:42:33 +0800https://zfunnily.github.io/2022/04/shadermathematic/概述 在学习Shader的过程中,我们最常使用的就是矢量和矩阵(即数学的分支之一——线性代数)。 笛卡儿坐标系 我们使用数学绝大部分都是为了计算位置、距离和角度等变量。而这些计算大部分都是在笛卡儿坐标系 (C《Unity Shader入门精要》第四章笔记 | 学习Shader所需的数学基础https://zfunnily.github.io/2022/04/shadermathematic/Sun, 10 Apr 2022 15:42:33 +0800https://zfunnily.github.io/2022/04/shadermathematic/概述 在学习Shader的过程中,我们最常使用的就是矢量和矩阵(即数学的分支之一——线性代数)。 笛卡儿坐标系 我们使用数学绝大部分都是为了计算位置、距离和角度等变量。而这些计算大部分都是在笛卡儿坐标系 (C《Unity Shader入门精要》第三章笔记| UnityShader基础https://zfunnily.github.io/2022/04/shaderbase/Sun, 10 Apr 2022 14:51:19 +0800https://zfunnily.github.io/2022/04/shaderbase/材质 在Unity中我们需要配合使用材质 (Material) 和Unity Shader才能达到需要的效果。一个最常见的流程是 创建一个材质;活着导入一个材质 创建一个Unity Shader,并把它赋给上一步中《Unity Shader入门精要》第三章笔记| UnityShader基础https://zfunnily.github.io/2022/04/shaderbase/Sun, 10 Apr 2022 14:51:19 +0800https://zfunnily.github.io/2022/04/shaderbase/材质 在Unity中我们需要配合使用材质 (Material) 和Unity Shader才能达到需要的效果。一个最常见的流程是 创建一个材质;活着导入一个材质 创建一个Unity Shader,并把它赋给上一步中《Unity Shader入门精要》第二章笔记 | 渲染流水线https://zfunnily.github.io/2022/04/shaderrenderpipline/Sat, 09 Apr 2022 11:55:55 +0800https://zfunnily.github.io/2022/04/shaderrenderpipline/渲染流水线 Render-Time Rendering, Third Edition》一书中将一个渲染流程分成3个阶段:应用阶段(Application Stage) 、几何阶段(Geometry Stage) 、光栅化阶段(Rasterizer Stage) 。 应《Unity Shader入门精要》第二章笔记 | 渲染流水线https://zfunnily.github.io/2022/04/shaderrenderpipline/Sat, 09 Apr 2022 11:55:55 +0800https://zfunnily.github.io/2022/04/shaderrenderpipline/渲染流水线 Render-Time Rendering, Third Edition》一书中将一个渲染流程分成3个阶段:应用阶段(Application Stage) 、几何阶段(Geometry Stage) 、光栅化阶段(Rasterizer Stage) 。 应shader初尝试 | 给石头覆盖一层雪景(Hello World)https://zfunnily.github.io/2022/04/shaderhelloworld/Sat, 09 Apr 2022 10:34:56 +0800https://zfunnily.github.io/2022/04/shaderhelloworld/给石头覆盖一层雪景 资源准备 石头模型 Unity2021.2.3f1c1 Mac &amp; Windows 在Unity中创建一个项目,导入石头模型,下面就开始利用shader给石头做一个雪景覆盖. 实现效果 未覆盖雪景的样子 覆盖了雪景的样子 开始代码 我在代码中标注了1,shader初尝试 | 给石头覆盖一层雪景(Hello World)https://zfunnily.github.io/2022/04/shaderhelloworld/Sat, 09 Apr 2022 10:34:56 +0800https://zfunnily.github.io/2022/04/shaderhelloworld/给石头覆盖一层雪景 资源准备 石头模型 Unity2021.2.3f1c1 Mac &amp; Windows 在Unity中创建一个项目,导入石头模型,下面就开始利用shader给石头做一个雪景覆盖. 实现效果 未覆盖雪景的样子 覆盖了雪景的样子 开始代码 我在代码中标注了1,UnityShader基本概念https://zfunnily.github.io/2022/04/shader01/Wed, 06 Apr 2022 11:54:02 +0800https://zfunnily.github.io/2022/04/shader01/何为shader shader中文翻译为着色器,其实是一种用来渲染图形的技术,我们可以通过shader编程,来自定义显卡渲染画面的算法,显示我们所期望的结果。 shader种类 顶点着色器: 处理每个顶点,将UnityShader基本概念https://zfunnily.github.io/2022/04/shader01/Wed, 06 Apr 2022 11:54:02 +0800https://zfunnily.github.io/2022/04/shader01/何为shader shader中文翻译为着色器,其实是一种用来渲染图形的技术,我们可以通过shader编程,来自定义显卡渲染画面的算法,显示我们所期望的结果。 shader种类 顶点着色器: 处理每个顶点,将Graphicshttps://zfunnily.github.io/2022/04/graphics/Mon, 04 Apr 2022 21:48:09 +0800https://zfunnily.github.io/2022/04/graphics/Last Lecture What is Computer Graphics? Why study Computer Graphics? Course Topics Course Logistics Graphics&rsquo;s Dependencies Basic mathematics Liner algebra, calculus, statistics. Basic physics Optics, Mechanics Misc Signal processing Numerical analysis 线性代数 Dot(scalar) Product Cross (vector) Product 向量之间的乘积不符合交换定律。 Cross product: Properties 右手螺旋定则 Cross product: Cartesian Formula Cross product in Graphics 判断左右 判断内外 判断向量b在向量a的左边 右手螺旋法则 向量Graphicshttps://zfunnily.github.io/2022/04/graphics/Mon, 04 Apr 2022 21:48:09 +0800https://zfunnily.github.io/2022/04/graphics/Last Lecture What is Computer Graphics? Why study Computer Graphics? Course Topics Course Logistics Graphics&rsquo;s Dependencies Basic mathematics Liner algebra, calculus, statistics. Basic physics Optics, Mechanics Misc Signal processing Numerical analysis 线性代数 Dot(scalar) Product Cross (vector) Product 向量之间的乘积不符合交换定律。 Cross product: Properties 右手螺旋定则 Cross product: Cartesian Formula Cross product in Graphics 判断左右 判断内外 判断向量b在向量a的左边 右手螺旋法则 向量抽卡逻辑自述https://zfunnily.github.io/2022/03/afk/Wed, 30 Mar 2022 10:50:11 +0800https://zfunnily.github.io/2022/03/afk/抽卡逻辑自述 参考《剑与远征》 卡牌颜色以及合成 颜色 合成 绿色 可分解,得到粉尘和银瓜子, 最基础的卡 蓝 蓝+ 同样的三张蓝色可合成一张蓝+ 紫 同种族的三张蓝+可以合成一张紫(可以选择合成其中蓝+的某个紫色) 紫+ 同英抽卡逻辑自述https://zfunnily.github.io/2022/03/afk/Wed, 30 Mar 2022 10:50:11 +0800https://zfunnily.github.io/2022/03/afk/抽卡逻辑自述 参考《剑与远征》 卡牌颜色以及合成 颜色 合成 绿色 可分解,得到粉尘和银瓜子, 最基础的卡 蓝 蓝+ 同样的三张蓝色可合成一张蓝+ 紫 同种族的三张蓝+可以合成一张紫(可以选择合成其中蓝+的某个紫色) 紫+ 同英层级时间轮 | skynet 定时器https://zfunnily.github.io/2022/03/timerskynet/Sun, 27 Mar 2022 12:39:12 +0800https://zfunnily.github.io/2022/03/timerskynet/skynet定时器 要解析一个程序代码,先了解数据结构,这是基础,再看函数。 拿skynet定时器举例子。 数据结构 //定时器事件 用于抛出定时器事件到消息队列里。理解这个数据结构需要先了解skynet的框架层级时间轮 | skynet 定时器https://zfunnily.github.io/2022/03/timerskynet/Sun, 27 Mar 2022 12:39:12 +0800https://zfunnily.github.io/2022/03/timerskynet/skynet定时器 要解析一个程序代码,先了解数据结构,这是基础,再看函数。 拿skynet定时器举例子。 数据结构 //定时器事件 用于抛出定时器事件到消息队列里。理解这个数据结构需要先了解skynet的框架利用时间轮实现定时器https://zfunnily.github.io/2022/03/timer/Thu, 10 Mar 2022 14:38:23 +0800https://zfunnily.github.io/2022/03/timer/理解定时器 适用场景 定时任务(每隔1s钟打印一次数据) 超时控制(xx分钟没有动作就断开连接) 频率限制(最快只能每5s调用一次API) 定时器常用的数据结构有如下几种: 链表 双向有序链表 最小堆 时间轮 层级时间轮利用时间轮实现定时器https://zfunnily.github.io/2022/03/timer/Thu, 10 Mar 2022 14:38:23 +0800https://zfunnily.github.io/2022/03/timer/理解定时器 适用场景 定时任务(每隔1s钟打印一次数据) 超时控制(xx分钟没有动作就断开连接) 频率限制(最快只能每5s调用一次API) 定时器常用的数据结构有如下几种: 链表 双向有序链表 最小堆 时间轮 层级时间轮无聊 & 痛苦https://zfunnily.github.io/thinking/2022/03/shuowang/Wed, 09 Mar 2022 12:03:36 +0800https://zfunnily.github.io/thinking/2022/03/shuowang/每天晚上我都睡得很晚,不是不困,而是不想睡,强迫自己不要睡。我似乎得了强迫症,我很忧郁。 因为我总觉得一天什么都没干就这么过去了,实在不甘心!于是我就尽量延长这一天的时间。我真是个有志气的人,我很欣慰。爬楼有感https://zfunnily.github.io/thinking/2022/03/think01/Tue, 08 Mar 2022 21:54:25 +0800https://zfunnily.github.io/thinking/2022/03/think01/28楼 今天放弃了常用乘电梯回家,决定爬楼。28楼真高呀。我还记得上次是和阿芳一起爬的。 那会爬的很轻松,还有功夫教她 &ldquo;核心收紧,抬腿的时候膝盖沿着脚尖方向歪曲&rdquo;。 一个人爬楼让我又老纪https://zfunnily.github.io/thinking/2022/03/weekly01/Mon, 07 Mar 2022 21:36:05 +0800https://zfunnily.github.io/thinking/2022/03/weekly01/周末看了《铁齿铜牙纪晓岚》,对这样经典的剧,百看不厌。 这个剧我来来回回看了很多遍了,剧集内容越来越熟悉,但是对里面的人物却又有不一样的理解。 以前觉得纪晓岚清官,好人。和珅贪官,坏人。 现在看到了那一集和2021焦虑总结https://zfunnily.github.io/thinking/2022/03/summarize/Fri, 04 Mar 2022 11:03:20 +0800https://zfunnily.github.io/thinking/2022/03/summarize/2021 已经22年3月份了,这份总结才出来,我这是拖延症晚期了。 去年一年总的来说不错, 但还是有些计划性的东西没做 我结婚了,24岁 我转行做游戏了 买车了 读了3本书 健身 无 时间太快,从我19年开始记笔记开始,已经过利用云服务器搭建个人博客https://zfunnily.github.io/2022/03/blog/Thu, 03 Mar 2022 12:04:58 +0800https://zfunnily.github.io/2022/03/blog/vps选择 最近关注了一个vps推广网站。价格合适,于是买了一个128元/年的云服务器。既可以用来做代理,又可以搭建个人博客 配置是2G/1M/40G(运存/带宽/硬盘) 使用技术 nginx: 静态博客 v2ray: 代理 https + nginx freenome: 域利用云服务器搭建个人博客https://zfunnily.github.io/2022/03/blog/Thu, 03 Mar 2022 12:04:58 +0800https://zfunnily.github.io/2022/03/blog/vps选择 最近关注了一个vps推广网站。价格合适,于是买了一个128元/年的云服务器。既可以用来做代理,又可以搭建个人博客 配置是2G/1M/40G(运存/带宽/硬盘) 使用技术 nginx: 静态博客 v2ray: 代理 https + nginx freenome: 域Nginx | 给网站添加证书https://zfunnily.github.io/2022/03/https/Thu, 03 Mar 2022 10:26:56 +0800https://zfunnily.github.io/2022/03/https/Https 最近在购买的云服务器上把个人博客搭建起来了,实际上是hugo生成静态网页,nginx加载静态网页。现在只能通过http访问,缺少个https。 要搭建一个https的网站需要证书。之前在网上找的教程太Nginx | 给网站添加证书https://zfunnily.github.io/2022/03/https/Thu, 03 Mar 2022 10:26:56 +0800https://zfunnily.github.io/2022/03/https/Https 最近在购买的云服务器上把个人博客搭建起来了,实际上是hugo生成静态网页,nginx加载静态网页。现在只能通过http访问,缺少个https。 要搭建一个https的网站需要证书。之前在网上找的教程太Golang | http注解路由https://zfunnily.github.io/2022/03/http/Wed, 02 Mar 2022 14:51:22 +0800https://zfunnily.github.io/2022/03/http/Http服务器 Golang有一个很强大的官方http库了,使用上很方便。也有一些很强大的三方http框架, 比如gin,beego等等。 自以为,框架在提供便利,提升开发效率的同时,也限制了我们的想象力。Golang | http注解路由https://zfunnily.github.io/2022/03/http/Wed, 02 Mar 2022 14:51:22 +0800https://zfunnily.github.io/2022/03/http/Http服务器 Golang有一个很强大的官方http库了,使用上很方便。也有一些很强大的三方http框架, 比如gin,beego等等。 自以为,框架在提供便利,提升开发效率的同时,也限制了我们的想象力。Goang | Plugin插件热更https://zfunnily.github.io/2022/03/reload/Tue, 01 Mar 2022 11:33:22 +0800https://zfunnily.github.io/2022/03/reload/热更新 动态脚本更新 (php) 短链接无状态服务器热更 (http) 长连接有状态,数据跟逻辑分离 golang Plugin热更 (.so 动态库更新) &mdash;-逻辑热更 长连接有状态,在运维层面, 利用容器部署热更(docker, k8s) 服务不接受新Goang | Plugin插件热更https://zfunnily.github.io/2022/03/reload/Tue, 01 Mar 2022 11:33:22 +0800https://zfunnily.github.io/2022/03/reload/热更新 动态脚本更新 (php) 短链接无状态服务器热更 (http) 长连接有状态,数据跟逻辑分离 golang Plugin热更 (.so 动态库更新) &mdash;-逻辑热更 长连接有状态,在运维层面, 利用容器部署热更(docker, k8s) 服务不接受新Grpc | Token认证和自定义认证https://zfunnily.github.io/2022/02/jwt/Tue, 22 Feb 2022 15:39:30 +0800https://zfunnily.github.io/2022/02/jwt/概述 现在有个需求,需要在grpc的拦截器中,通过token进行身份认证。如果认证不通过则返回错误; 认证通过,则放行; TLS是用作加密通讯通道的,与该需求无关。 Token认证 具体流程 客户端通过账号密码登Grpc | Token认证和自定义认证https://zfunnily.github.io/2022/02/jwt/Tue, 22 Feb 2022 15:39:30 +0800https://zfunnily.github.io/2022/02/jwt/概述 现在有个需求,需要在grpc的拦截器中,通过token进行身份认证。如果认证不通过则返回错误; 认证通过,则放行; TLS是用作加密通讯通道的,与该需求无关。 Token认证 具体流程 客户端通过账号密码登Grpc | 通过SSL/TLS建立安全连接https://zfunnily.github.io/2022/02/san/Tue, 22 Feb 2022 14:22:41 +0800https://zfunnily.github.io/2022/02/san/使用golang的grpc库作为例子 grpc使用TLS建立安全连接需要有SAN证书, go 1.15 版本开始废弃 CommonName。 什么是SAN证书 SAN(Subject Alternative Name) 是 SSL 标准 x509 中定义的一个扩展。使用了 SAN 字段的 SSL 证书,可以扩Grpc | 通过SSL/TLS建立安全连接https://zfunnily.github.io/2022/02/san/Tue, 22 Feb 2022 14:22:41 +0800https://zfunnily.github.io/2022/02/san/使用golang的grpc库作为例子 grpc使用TLS建立安全连接需要有SAN证书, go 1.15 版本开始废弃 CommonName。 什么是SAN证书 SAN(Subject Alternative Name) 是 SSL 标准 x509 中定义的一个扩展。使用了 SAN 字段的 SSL 证书,可以扩转载|江雪:长安十日https://zfunnily.github.io/thinking/2022/01/jx/Thu, 06 Jan 2022 11:32:56 +0800https://zfunnily.github.io/thinking/2022/01/jx/转载 https://chinadigitaltimes.net/chinese/675386.html(需科学上网) 01/03/2022 文:江雪 小区里的大喇叭又响了起来,一遍遍重复着,喊人们下楼做核酸。队排了很长。测核Blog | 代码显示/隐藏https://zfunnily.github.io/2021/12/shortcodes/Wed, 29 Dec 2021 13:50:28 +0800https://zfunnily.github.io/2021/12/shortcodes/缘由 最近在写技术博客时,引入的代码太多,影响观感。 在尽力减少代码量,还是有些不可或缺的代码,代码量很惊人,已经占满整个屏幕. 因为个人博客是使用hugo生成的静态博客,我刚开始想的使用原生的js和cssNginx的一些配置https://zfunnily.github.io/2021/12/nginx/Tue, 28 Dec 2021 16:04:10 +0800https://zfunnily.github.io/2021/12/nginx/静态网站 应用场景 文件服务 静态网站 &hellip; 静态网站的配置 配置如下: nginx.conf worker_processes 1; pid nginx.pid; events { worker_connections 1024; multi_accept on; } http { default_type application/octet-stream; sendfile on; keepalive_timeout 100; server { listen 80; charset utf-8,gbk; server_name localhost; location /{ root /opt/; autoindex on; autoindex_localtime on; } index index.html; # 显示首页 #静态文件访问 location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|js|pdf|txt) { root /opt; } } } root: 表示网站根目录 autoindex: on 显摘抄 | 我的精神家园https://zfunnily.github.io/thinking/2021/12/pervert/Mon, 27 Dec 2021 21:44:21 +0800https://zfunnily.github.io/thinking/2021/12/pervert/另一种文化 假如有个pervert站出来说:我就是个pervert,那他就不是个pervert。 当且仅当一个人声称:我就不知道pervert是什么时,他才是个pervert。 假如我说,我们这里有种perA*算法 | Lua版本https://zfunnily.github.io/2021/12/astar/Thu, 23 Dec 2021 16:37:44 +0800https://zfunnily.github.io/2021/12/astar/A*算法思路 寻路步骤 从起点A开始, 把它作为待处理的方格存入一个&quot;开启列表&quot;, 开启列表就是一个等待检查方格的列表. 寻找起点A周围可以到达的方格, 将它们放入&quot;开启列表&quoBlog | 音乐播放器https://zfunnily.github.io/2021/12/music/Tue, 21 Dec 2021 16:55:23 +0800https://zfunnily.github.io/2021/12/music/概述 今天给我的个人博客加了个暗模式,这样可以在晚上阅读博客的时候不伤害眼睛。突然想到如果在阅读博客的时候可以听听音乐就更好了。 于是在github上找到了一个开源的项目MetingJS,看最后一次comBlog | 网站暗模式https://zfunnily.github.io/2021/12/dark/Tue, 21 Dec 2021 11:05:00 +0800https://zfunnily.github.io/2021/12/dark/Wordpress 如果你的网站是wordpress,则可以参考以Darkmode.js为基础的插件: blackout-darkmode-widget darkmode Nuxt.js 如果你正在使用Nuxt.js,则可以使用下面的模块 nuxtjs-darkmode-js-module 快速使用 使用Darkmode.js给网站快速部署上暗/浅色Openresty三 | 上传文件https://zfunnily.github.io/2021/12/openresty-upload/Wed, 08 Dec 2021 16:42:17 +0800https://zfunnily.github.io/2021/12/openresty-upload/上传文件接口 nginx.conf 的server 增加一个location: location /upload { resolver 8.8.8.8 ipv6=off; content_by_lua_file lua/upload.lua; } upload.lua lua -- upload.lua --========================================== -- 文件上传 --========================================== local chunk_size = 4096 local form, err = upload:new(chunk_size) if not form then ngx.log(ngx.ERR, &#34;failed to new upload: &#34;, err) ngx.exit(ngx.HTTP_INTERNAL_SERVER_ERROR) end form:set_timeout(1000) -- 文件保存的根路径 local saveRootPath = &#34;./download/&#34; -- 保存的文件对象 local fileToSave --文件是否成Webrtc二 | 共享桌面https://zfunnily.github.io/2021/11/webrtcdesk/Mon, 15 Nov 2021 11:23:24 +0800https://zfunnily.github.io/2021/11/webrtcdesk/环境 Ubuntu18.04 webrtc M84 改造peerconnection例子,用来实现桌面共享 改造类CapturerTrackSource 增加桌面的数据源类RcrtcDesktopCapturerTrackSource 继承webrWebrtc一 | peerconnectionhttps://zfunnily.github.io/2021/11/webrtcpeerconnection/Sun, 14 Nov 2021 16:20:31 +0800https://zfunnily.github.io/2021/11/webrtcpeerconnection/环境 Ubuntu18.04 webrtc M84 国内镜像:https://webrtc.org.cn/mirror/ webrtc交互过程 通过peerconnection的例子来分析webrtc的交互流程 peer_connection 解析 为了便于管理,如编码,回显等,Go-libp2p四 | 穿透NAThttps://zfunnily.github.io/2021/11/gop2pfour/Sun, 07 Nov 2021 15:49:46 +0800https://zfunnily.github.io/2021/11/gop2pfour/本文目的 上文Go-libp2p三 | relay例子已经分析过relay例子,并解释了两个节点如果通过中继服务进行通信。本文改造relay例子 并让这个服务做如下两件事: 交换两个节点的在交换机上的信息,帮助Blog | 随机名人名言https://zfunnily.github.io/2021/11/randomquotes/Fri, 05 Nov 2021 15:50:16 +0800https://zfunnily.github.io/2021/11/randomquotes/本文目的 我的个人博客已经搭建好了,使用的hugo+飞雪的主题。我看到有些博客上有些随机的名人名言,但是这个主题没有。遂自己写一个。 根据飞雪的主题自定义 飞雪主题的github: https://github.com/flysnow-org/maupassant-hugo 复制主题里的文件themGo-libp2p三 | relay例子https://zfunnily.github.io/2021/10/gop2pthree/Sun, 31 Oct 2021 10:13:40 +0800https://zfunnily.github.io/2021/10/gop2pthree/我想做什么 chat和echo两个例子,说明了两个节点之间的通信需要两节点在同一个局域网内,或者有一个节点有公网。 如果我两个节点分别在两个NAT下面, 都在各自的局域网内,则需要有一个中继服务,这个服务做Go-libp2p二 | echo例子https://zfunnily.github.io/2021/10/gop2ptwo/Fri, 29 Oct 2021 11:15:42 +0800https://zfunnily.github.io/2021/10/gop2ptwo/go-libp2p的echo例子分析 进入目录go-libp2p/examples/echo/, 编译 go build 先看README.md, 可以了解到使用echo的方式: 终端B $ ./echo -l 3001 2021/10/28 11:25:33 I am /ip4/127.0.0.1/tcp/3001/p2p/QmTu8sxDi3fSjz9ZMvkAj3qA9YAoGskroEnyLz2ZvfTBhX 2021/10/28 11:25:33 listening for connections 2021/10/28 11:25:33 Now run &#34;./echoGo-libp2p一 | chat例子https://zfunnily.github.io/2021/10/gop2pone/Thu, 28 Oct 2021 14:40:02 +0800https://zfunnily.github.io/2021/10/gop2pone/代码下载 git clone https://github.com/libp2p/go-libp2p.git chat实例分析 进入目录go-libp2p/examples/chat/, 编译 go build 先看README.md, 可以了解到使用chat的方式 在节点 B $ ./chat -sp 3001 2021/10/28 11:01:25 Run &#39;./chat -d /ip4/127.0.0.1/tcp/3001/p2p/QmXgEXt4CiqmVmDhPPQnyVkoj3Bsx3Nggq57PPsk5tLNTs&#39; on another console. 2021/10/28 11:01:25 You can replace 127.0.0.1 with public IPBlog | 新的开始https://zfunnily.github.io/2021/10/blogmigration/Fri, 22 Oct 2021 19:01:20 +0800https://zfunnily.github.io/2021/10/blogmigration/迁移博客 我是从18年开始写一些东西,先写在看云笔记上,后面东西越来越多。写出来的东西比较零散. 20年下半年入职新公司,开始在csdn上写博客,今年我准备尝试使用个人博客,hugo和gitPage结合部Skynet源码赏析四 | 消息调度https://zfunnily.github.io/2021/10/four/Thu, 21 Oct 2021 10:06:39 +0800https://zfunnily.github.io/2021/10/four/服务间消息流转 发送消息 数据结构message_queue *q是次级消息队列,每个服务都有与之绑定的唯一一个次级消息队列。当我们在lua层,调用skynet.send(...), 或者调用skynet.cSkynet源码赏析三 | 服务启动https://zfunnily.github.io/2021/10/skynetthree/Wed, 20 Oct 2021 11:26:07 +0800https://zfunnily.github.io/2021/10/skynetthree/skynet启动一个C服务 查看怎么启动C服务的最好的办法是打断点,看源码。 启动logger日志服务 我拿日志服务来举例子,怎么启动日志服务的呢? 传参数name = &quot;logger&quot;, param = null, struct skynet_context *ctx = skynet_context_new(config-&gt;logservice, config-&gt;logger);; 从moduleSkynet源码赏析二 | 基础数据结构https://zfunnily.github.io/2021/10/skynettwo/Tue, 19 Oct 2021 18:47:45 +0800https://zfunnily.github.io/2021/10/skynettwo/module管理模块 我们所写的C服务编译成.so文件后放在cpath变量路径下,程序会加载路径cpath = root..&quot;cservice/?.so&quot;下的.so文件,通过staticSkynet源码赏析一 | 启动初始化的过程https://zfunnily.github.io/2021/10/skynetone/Tue, 19 Oct 2021 17:28:45 +0800https://zfunnily.github.io/2021/10/skynetone/入口文件 skynet_main.c 加载配置 struct skynet_config config; config.thread = optint(&#34;thread&#34;,8); config.module_path = optstring(&#34;cpath&#34;,&#34;./cservice/?.so&#34;); config.harbor = optint(&#34;harbor&#34;, 1); config.bootstrap = optstring(&#34;bootstrap&#34;,&#34;snlua bootstrap&#34;); config.daemon = optstring(&#34;daemon&#34;, NULL); config.logger = optstring(&#34;logger&#34;, NULL); config.logservice = optstring(&#34;logservice&#34;, &#34;logger&#34;); config.profile = optboolean(&#34;profile&#34;, 1); 从上述代码可以看到,配置都已经加载到变量struct skynet_config config;中了。 初始化 初始化skynet_context管Golang | 调用带有后台进程shell脚本可能会被挂起https://zfunnily.github.io/2021/10/shell/Wed, 13 Oct 2021 17:15:45 +0800https://zfunnily.github.io/2021/10/shell/起因 今天用Golang写一个调用外部shell脚本的程序,使用 exec.Command方法,这段脚本代码中包含了一个后台任务语句。 结果发生了一个问题:cmd.Output 始终不会返回,一直挂起。导致我FPS游戏 | 实现移动功能https://zfunnily.github.io/2021/09/move/Sun, 12 Sep 2021 20:43:34 +0800https://zfunnily.github.io/2021/09/move/三种实现FPS Controller的区别 Transform Translate 允许移动物理,但无物理碰撞 Rigid body + Capsule Collider 符合物理学 不会鬼穿墙 无法滞空运动 可与Physics Object 交互 Charactor Controller 不会鬼穿墙 提供的API相对多 无法与Physic objects免费Musichttps://zfunnily.github.io/2021/09/music/Wed, 08 Sep 2021 14:47:14 +0800https://zfunnily.github.io/2021/09/music/介绍一个可以免费听音乐的方法 环境 docker mac 安装 $ docker run -d -p 264:264 -p 9000:9000 -v $dir_name:/var/www/html/cache --name music oldiy/music-player-docker $dir_name 是 你自己宿主机的目录。可以自定义 访问:127.0.0.1:264 就可以放心使用, 同事推荐的,贼好用。Unity3D | Transform类https://zfunnily.github.io/2021/09/transform/Tue, 07 Sep 2021 15:55:59 +0800https://zfunnily.github.io/2021/09/transform/Transform类 在unity中,把transform类理解为,transform类是在每个对象生成时自动附加的一个类。在Unity的视图中,点击Hierarchy中的对象,就可以在InspectoVim | 切换模式/输入法https://zfunnily.github.io/2021/09/vimchange/Tue, 07 Sep 2021 10:46:58 +0800https://zfunnily.github.io/2021/09/vimchange/vim 在退出输入模式的时候切换为原来的输入法 在敲代码的时候使用我们使用的英文,当遇到问题,我们需要搜索引擎的时候需要中文输入法,这个时候,自动切换输入法可以帮助我们节省手动切换输入法的时间。 跟编辑器结合,Linux | Screenhttps://zfunnily.github.io/2021/09/screen/Tue, 07 Sep 2021 10:02:16 +0800https://zfunnily.github.io/2021/09/screen/screen命令 screen 是一个非常有用的命令。应用场景: 单个 SSH 会话中使用多个 shell 窗口(会话)的能力 服务器开发,一个单独运行进程的窗口。可以避免单独再开一个窗口。 &hellip; screen使用 创建一个窗口 $ screen -S name 执行自己需Centos7.2 | gcc4.8升级为4.9https://zfunnily.github.io/2021/09/upgradegcc/Wed, 01 Sep 2021 18:13:41 +0800https://zfunnily.github.io/2021/09/upgradegcc/环境 CentOS 7.2.1511 Docker 我是用 docker 拉取镜像 CentOS 7.2.1511, 利用容器来作为我的开发环境。有条件的也可以用虚拟机或者实体机器。原理都一样。 $ docker $ yum update &amp;&amp; yum install gcc gcc-c++ make zlib-devel.x86_6 下载依赖包 升级 gcc, 下载安装包下载依赖。 $ wget http://ftp.gnu.org/gnu/gcc/gcc-4.9.3/gcc-4.9.3.tar.bz2 $ tar xfv gcc-4.9.3.tar.bz2 &amp;&amp; cd gcc-4.9.3 $ ./contrib/download_prerequisites 如果Shell | Except 使用https://zfunnily.github.io/2021/08/except/Mon, 30 Aug 2021 17:13:33 +0800https://zfunnily.github.io/2021/08/except/Except 参数 spawn 交互程序开始后面跟命令或者指定程序 expect 获取匹配信息匹配成功则执行expect后面的程序动作 send exp_send 用于发送指定的字符串信息 exp_continue 在expect中多次匹配就需要用到 send_user 用来打印输出 相当于shell中的echUnity3D | UGUIhttps://zfunnily.github.io/2021/08/ugui/Fri, 20 Aug 2021 14:15:41 +0800https://zfunnily.github.io/2021/08/ugui/Text Text的属性 在 Unity 的 Hierarchy 面板上右键–&gt;UI–&gt;Text, 在 Inspector 面板上查看属性 属性 功能 Text 需要显示的文本 Font 显示文本的字体 如:微软雅黑,宋体等 Font Style 显示文本的样式,有普通,粗体,斜体,粗体和斜体四种Golang | redis实现分布式锁https://zfunnily.github.io/2021/06/distribute/Thu, 03 Jun 2021 16:12:21 +0000https://zfunnily.github.io/2021/06/distribute/概述 网上有很多Golang操作redis的例子,我使用github.com/gomodule/redigo/redis包写一个关于redis分布式锁的问题。 redis分布式锁 锁需要的几个组件 获取锁- 删Golang | redishttps://zfunnily.github.io/2021/06/goredis/Thu, 03 Jun 2021 15:57:14 +0800https://zfunnily.github.io/2021/06/goredis/概述 网上有很多golang操作redis的例子,我使用github.com/gomodule/redigo/redis包写一个关于redis分布式锁的问题。 redis分布式锁 锁需要的几个组件 获取锁 删除Lua | next的使用https://zfunnily.github.io/2021/05/lua_next/Mon, 10 May 2021 16:39:50 +0800https://zfunnily.github.io/2021/05/lua_next/lua_next lua_next(L,index):先把 表(lua栈 index所指的表), 的当前索引弹出,再把table 当前索引的值弹出,也就是先弹出 table的索引,再弹出table索引的值 举例: local t = { [&#34;a&#34;] = 1, [&#34;b&#34;]Lua | APIhttps://zfunnily.github.io/2021/05/settopandpop/Mon, 10 May 2021 15:57:03 +0800https://zfunnily.github.io/2021/05/settopandpop/lua_pop和lua_settop lua_settop 我们直接来看lua_settop,文档解释 /* 设置栈的高度,如果之前的栈顶比新设置的更高,那么高出来的元素会被丢弃,反之压入nil来补足大小 假设栈里有2个元素。 如果Hugohttps://zfunnily.github.io/2021/04/hugo/Sat, 17 Apr 2021 00:00:00 +0000https://zfunnily.github.io/2021/04/hugo/hugo 我用过的静态博客有hexo、jekyll和hugo,对比起来,hugo虽然没有hexo那样丰富的插件和主题,但是hugo生成文章的速度更快。我是一名go语言爱好者,而hugo是go语言开发的, jekGolang | gomod拉取私有仓库https://zfunnily.github.io/2021/03/gomod/Tue, 23 Mar 2021 16:10:02 +0000https://zfunnily.github.io/2021/03/gomod/概述 在使用go mod的过程中,依赖的包往往是第三方库,当我们自定义一个包并且放在github.com私有仓库时候,按照原来的方法则会有如下问题。 get &#34;gitlab.com/xxx/zz&#34;: found meta tag get.metaImport{Prefix:&#34;gitlab.com/xxx/zz&#34;, VCS:&#34;git&#34;, RepoRoot:&#34;https://gitlab.com/xxx/zz.git&#34;} at //gitlab.com/xxx/zz?go-get=1 verifying gitlab.com/xxx/zz@v0.0.1: gitlab.com/xxx/zz@v0.0.1: reading https://sum.golang.org/lookup/gitlab.com/xxx/zz@v0.0.1: 410 Gone 这个错误是因为新版本g八个基础排序https://zfunnily.github.io/2021/03/sort/Tue, 23 Mar 2021 10:13:31 +0000https://zfunnily.github.io/2021/03/sort/sort排序 std::sort( )函数是库函数提供的排序函数,必须包括头文件#include &lt;algorithm&gt;,它使用的排序方法是类似于快排的方法,时间复杂度为n*log2(n) Sort函数有三个参数:《仙剑奇侠传》编译运行https://zfunnily.github.io/2021/03/gamexian/Sun, 21 Mar 2021 10:44:58 +0000https://zfunnily.github.io/2021/03/gamexian/概述 今天在github上找到了《仙剑奇侠传》的rpg单机游戏sdlpal,sdlpal 是一个开源项目,基于sdl把仙剑奇侠传重写了一遍。 下面是我的编译过程总结。 环境 win10- sdl1.2- sdlpal- vs2017- DirectX SDK10 下载sdlpal $ git clone https://github.com.cnpmjs.org/sdlpal/sdlpal.git实现atoi和itoa函数https://zfunnily.github.io/2021/03/atoianditoa/Wed, 17 Mar 2021 16:43:20 +0000https://zfunnily.github.io/2021/03/atoianditoa/题目1: 把字符串转化为整数 有整数字符串,&quot;13579&quot;, 和 &quot;246810&quot;. 请写一个函数把这两个字符串转化为整数 步骤: 先判断正负 遍历字符串,转换字符为整数 //atoi.cc #include &lt;stdio.h&gt; int my_atoi(char *str) { bool bmin = false; int result = 0; //先判断正协程解析二 | 云风的coroutinehttps://zfunnily.github.io/2021/03/coroutinetwo/Wed, 10 Mar 2021 11:11:47 +0000https://zfunnily.github.io/2021/03/coroutinetwo/概述 云风的coroutine是通过ucontext来控制程序运行时上下文的,我们来根据该库提供的几个接口,和一个demo来解释协程的运行原理。如果不了解ucontext的,建议先了解ucontxt 环境协程解析一 | ucontexthttps://zfunnily.github.io/2021/03/coroutineone/Tue, 09 Mar 2021 09:43:00 +0000https://zfunnily.github.io/2021/03/coroutineone/概述 最近在研究协程的实现原理,看了云风的coroutine和腾讯的开源库libco后,原来要实现一个协程库也没那么难。我先来讲讲云风的coroutine库。他使用的是 uncontext来保存程序运行上关于我https://zfunnily.github.io/about/Sun, 28 Feb 2021 00:00:00 +0000https://zfunnily.github.io/about/我是谁 我是一名游戏从业者, 目前在一家公司做游戏后端的工作。 地址 浙江杭州滨江区 Email 582132116@qq.com 技能 skynet框架+lua脚本 &ndash; 游戏后端 C/C++ &ndash; IM服务器 Golang &ndash; 后端Golang | 定时器https://zfunnily.github.io/2021/02/timer/Thu, 25 Feb 2021 16:02:13 +0000https://zfunnily.github.io/2021/02/timer/概述 golang有三种方式实现定时器: ticker timer select Ticker 通过 time.NewTicker(d)的方式实现定时器 d := time.Duration(time.Second * 2) t1 := time.NewTicker(d) defer t1.Stop() go func() { for { &lt;- t1.C fmt.Println(&#34;NewTicker...&#34;) } }() Timer 通过 time.NewTimer(d)的方式实现定时器 t2 := time.NewTimer(d)Lua | 解决百元买鸡的问题https://zfunnily.github.io/2021/02/chicken/Wed, 24 Feb 2021 17:51:46 +0000https://zfunnily.github.io/2021/02/chicken/问题 编写lua程序求解百鸡百钱问题。公鸡5元一只,母鸡3元一只,小鸡一元3只,问100元钱买100只鸡,可买公鸡、母鸡、小鸡各多少只? 代码 ----------------------------------------------------------------------------- --公鸡5元一只,母鸡3元一只,小鸡一元3只,问100元钱买Golang | JWT身份认证https://zfunnily.github.io/2021/02/JWT/Wed, 24 Feb 2021 14:22:04 +0000https://zfunnily.github.io/2021/02/JWT/概述 最近要在http接口上加一个token认证,但是接口很多,有没有一个省时省力的办法来解决。token的使用流程是: 用户使用帐号密码登陆到服务器1. 服务器验证登陆成功,根据帐号密码生成token。把Lua | 调用C/C++的动态库https://zfunnily.github.io/2021/02/dynamic/Sat, 20 Feb 2021 11:11:51 +0000https://zfunnily.github.io/2021/02/dynamic/概述 最近在学习 云风的skynet库,想自定义一个模块,目标是使用lua调用C/C++所编写的库。 当我们需要在Lua里面调用c/c++函数时,所有的函数都必须满足以下函数签名: typedef int (*lua_CFunction) (lua_State *L); 换句话说,所有的汇编 | C/C++调用汇编https://zfunnily.github.io/2021/02/compilation/Mon, 01 Feb 2021 14:40:51 +0000https://zfunnily.github.io/2021/02/compilation/概述 我使用AT&amp;T的规范,在linux上完成 C和汇编的互相调用,并使用gcc编译成可执行文件。 目标:汇编函数提供输出。类似C语言的函数 void hello_world(char* value) { printf(value); } 提供给C语言调用: int main() { hello_world(&#34;hello world!\n&#34;); } 搭建AT&amp汇编 | AT&T和Intel规范的区别https://zfunnily.github.io/2021/01/attandintel/Sun, 31 Jan 2021 11:25:39 +0000https://zfunnily.github.io/2021/01/attandintel/概述 常见的指令集以及汇编语言规范: x86(IA-32)、x86-64指令集(常见于PC端),对应有2家公司发布的不同汇编语言规范: intel公司发布的汇编语言规范,称intel 汇编:Windows派系Skynet | lua-protobufhttps://zfunnily.github.io/2021/01/skynetprotobuf/Mon, 25 Jan 2021 14:25:07 +0000https://zfunnily.github.io/2021/01/skynetprotobuf/概述 在最新的skynet中我使用的是云风的pbc库来解析protobuf,该项目中的一个文件protobuf.lua 使用了module语法在lua5.1版本中已经删除,最新的skynet是lua5.4Protobuf | 请求参数为空的案例https://zfunnily.github.io/2021/01/pbempty/Fri, 22 Jan 2021 16:41:16 +0000https://zfunnily.github.io/2021/01/pbempty/参数为空的grpc请求怎么定义 google protobuf已经提供了空参数 //empty.proto message Empty {&lt;!-- --&gt;} 使用方法,在proto文件中导入empty.proto, 定义一个请求参数和返回值为空的函数emptyfunction, 函数名字Golang | C数组转化为Golang的切片类型https://zfunnily.github.io/2021/01/goslience/Fri, 22 Jan 2021 15:56:40 +0000https://zfunnily.github.io/2021/01/goslience/概述 最近在巩固cgo的基础知识,在网上看到一篇Go和C之间 字符串数组、切片类型转换的文章,让我想到我之前写的一篇在go中遍历C结构体数组的文章,让我有新的方法来解决之前的问题,把C的数组转化为Go的切Skynet | echo服务https://zfunnily.github.io/2021/01/skynetecho/Fri, 15 Jan 2021 16:07:51 +0000https://zfunnily.github.io/2021/01/skynetecho/概述 引用云风博客的话:“skynet 是一个为网络游戏服务器设计的轻量框架。但它本身并没有任何为网络游戏业务而特别设计的部分,所以尽可以把它用于其它领域。skynet 并不是一个开箱即用的引擎,使用它需要Redis源码分析 | ziplisthttps://zfunnily.github.io/2021/01/ziplist/Wed, 13 Jan 2021 17:52:27 +0000https://zfunnily.github.io/2021/01/ziplist/概述 Redis中的List是一个有序(按加入的时序排序)的数据结构,一般有序我们会采用数组或者是双向链表,其中双向链表由于有前后指针实际上会很浪费内存。3.2版本之前采用两种数据结构作为底层实现: 压缩Redis源码解析 | VScode调试https://zfunnily.github.io/2021/01/vscodedebugredis/Tue, 12 Jan 2021 14:25:29 +0000https://zfunnily.github.io/2021/01/vscodedebugredis/环境 vscode- gcc5.4 ubuntu16.04 或者 ubuntu18.04 make 下载6.2版本. 我使用的是国内github镜像地址:github.com.cnpmjs.org,速度比较快。 $ git clone https://github.com.cnpmjs.org/redis/redis.git redis $ git checkout -b 6.2 remotes/origin/6.2 vscode不参与编译,只充当可视化的调试工具。 使用VScode | 调试Redis源码,指针显示的问题https://zfunnily.github.io/2021/01/vscoderedis/Tue, 12 Jan 2021 14:17:22 +0000https://zfunnily.github.io/2021/01/vscoderedis/缘由 使用VScode的时候,断点看到指针显示的是一串地址,而不是指针指向的对象的值。上网找了一圈,没看到vscode有对应的插件来解决这个问题。vscode有对应的语法来解决这个问题。 网上几乎都在说在Cgo | 遍历C结构体数组https://zfunnily.github.io/2021/01/cgostruct/Mon, 11 Jan 2021 17:18:35 +0000https://zfunnily.github.io/2021/01/cgostruct/缘由 现在有个应用场景,我们要在go中获取C结构体数组中的值。在C语言中,对于结构体数组,我们可以利用指针的偏移量来获取我们想要的值的位置。在go中我们怎么使用C指针和偏移量进行运算呢?下面的文字中C指Redis源码解析 | sdshttps://zfunnily.github.io/2021/01/sds/Wed, 06 Jan 2021 14:20:23 +0000https://zfunnily.github.io/2021/01/sds/SDS头文件及作用 sds.h: sds声明- sdsalloc.h: 为sds分配内存 源码文件sds.h中有这样一行代码 typedef char *sds; 很清晰、明了,sds其实就是char*。 最新的6.2分支的代码: struct __attribute__ ((__packed__)) sdshdr5 {&lt;!-- --&gt; unsigned char flags; /* 3 lsb ofstruct中使用char[]https://zfunnily.github.io/2021/01/chararray/Tue, 05 Jan 2021 15:45:36 +0000https://zfunnily.github.io/2021/01/chararray/缘由 最近在看redis的源码,刚开始看sds,看到这块代码 struct __attribute__ ((__packed__)) sdshdr5 { unsigned char flags; /* 3 lsb of type, and 5 msb of string length */ char buf[]; }; 好奇为什么使用 char buf[],而不用char *buf,找到答案记录一下。 struct中的char*Lastbattle | 游戏场景服务器SS解析https://zfunnily.github.io/2021/01/lastbattle/Sat, 02 Jan 2021 23:19:58 +0000https://zfunnily.github.io/2021/01/lastbattle/游戏场景服务器概况 指令对应的处理handle的文件:SSBattleMgr.cpp 创建战场 指令: eMsgToSSFromCS_CreateBattle GC服务器发往SS fromCS 收到中心服务器CS创建站场的指令,在函数INT32 CSSBattleMgr::OnMsgFromCS_CreateBattle(const char* pData, int n32DataLengtCCnet | 单线程reactor演变为多线程https://zfunnily.github.io/2020/12/ccnet/Wed, 30 Dec 2020 09:19:41 +0000https://zfunnily.github.io/2020/12/ccnet/ccnet从单线程演变为多线程 ccnet现状: epoll linux平台 事件循环 单线程 reactor 监听和新连接的事件都在主线程中 单线程的ccnet ccnet的单线程的角色: EventLoop: 整个事件循环。 EPollPoller: 负责事件的收集。 ChannelGolang | sync.Mutex详解https://zfunnily.github.io/2020/12/syncmutex/Tue, 29 Dec 2020 13:17:18 +0000https://zfunnily.github.io/2020/12/syncmutex/概述 自己做的一个golang项目需要优化,优化方向是减少gpu内存的使用。同一个模型被重复加载多次,使用更多的gpu内存,也增加 sync.Mutex的使用。 优化的方向是: 减少代码量的改动- 减少gpu内五种网络IO模型总结https://zfunnily.github.io/2020/12/iomodels/Mon, 28 Dec 2020 11:57:04 +0000https://zfunnily.github.io/2020/12/iomodels/概述 在网络上看到很多关于阻塞IO、非阻塞IO、同步IO、异步IO的例子,总觉得写的过于复杂并且让人难以理解。于是我把我自己把这几个概念的理解写下来以供参考。 POSIX POSIX(可移植操作系统接口)把同步IOCCnet | 一个reactor单线程网络库https://zfunnily.github.io/2020/12/ccnetone/Sun, 27 Dec 2020 18:41:25 +0000https://zfunnily.github.io/2020/12/ccnetone/缘由 最近在研究陈硕的网络库muduo,是一个基于reactor架构的网络库。我对网络库的感觉是易用,但是内容庞大,依赖颇多。比如boost网络库里面的一些语法让人生畏。关于reactor和proactC++ | vector中的resize()函数 VS reserve()函数https://zfunnily.github.io/2020/12/reserve/Fri, 25 Dec 2020 11:04:29 +0000https://zfunnily.github.io/2020/12/reserve/reserve void reserve (size_type n); reserver函数用来给vector预分配存储区大小,即capacity的值 ,但是没有给这段内存进行初始化。reserve 的参数n是推荐预分配内存的大小,实际分配的可能等于或大于这个值,即Golang | 用gocolly登录B站https://zfunnily.github.io/2020/12/gocolly/Sun, 13 Dec 2020 14:51:53 +0000https://zfunnily.github.io/2020/12/gocolly/概述 gocolly是golang语言开发的爬虫包,通过gocolly来进行模拟网站的登录, 目标已经确立,开始行动。 下载 $ go get -u github.com/gocolly/colly 获取cookie 登录网站:https://www.bilibili.coProtobuf | 沾包问题https://zfunnily.github.io/2020/12/tcp/Sun, 13 Dec 2020 10:22:38 +0000https://zfunnily.github.io/2020/12/tcp/缘由 最近在研究一款游戏的源码。发现里面的通信协议是protobuf定义的,但还是自己定义了协议头部,类似 head + body。先解析头部里所存储的整个包的数据长度,然后再解析包剩余的数据,这样做的目的是为了防Grpc | 概述https://zfunnily.github.io/2020/12/grpc/Sun, 13 Dec 2020 09:10:42 +0000https://zfunnily.github.io/2020/12/grpc/OverView gRPC是由Google主导开发的RPC框架,使用HTTP/2协议并用ProtoBuf作为序列化工具。其客户端提供Objective-C、Java接口,服务器侧则有Java、Golang、C++等接Ubuntu16.04.6 | 安装Cinnamon3.0https://zfunnily.github.io/2020/12/cinnamon3.0/Tue, 01 Dec 2020 15:43:58 +0000https://zfunnily.github.io/2020/12/cinnamon3.0/概述 Cinnamon[1]是Linux Mint[2]的默认桌面环境。不同于 Ubuntu 的 Unity 桌面环境,Cinnamon 是一个更加传统而优雅的桌面环境,其带有底部面板和应用菜单。由于 Cinnamon 桌面以及它类 Windows 的用户界面,许多Ubuntu | version `GLIBC_2.27‘ not found错误https://zfunnily.github.io/2020/11/glibcnotfound/Sat, 28 Nov 2020 15:03:04 +0000https://zfunnily.github.io/2020/11/glibcnotfound/version `GLIBC_2.27’ not found错误 执行strings /lib/x86_64-linux-gnu/libc.so.6 | grep GLIBC_ 结果显示如下: GLIBC_2.2.5 GLIBC_2.2.6 GLIBC_2.3 GLIBC_2.3.2 GLIBC_2.3.3 GLIBC_2.3.4 GLIBC_2.4 GLIBC_2.5 GLIBC_2.6 GLIBC_2.7 GLIBC_2.8 GLIBC_2.9 GLIBC_2.10 GLIBC_2.11 GLIBC_2.12 GLIBC_2.13 GLIBC_2.14 GLIBC_2.15 GLIBC_2.16 GLIBC_2.17 GLIBC_2.18 GLIBC_2.22 GLIBC_2.23 GLIBC_2.24 GLIBC_PRIVATE 去清华开源站点下载glibc: https://mirrors.tuna.tsinghua.edu.cn/gnu/libc/ 下载好文件后解压 $ tar -zxvf glibc-2.27.tar.gz 进入 glibc-2.27 目录,Docker | 容器退出码详解https://zfunnily.github.io/2020/11/Docker%E5%AE%B9%E5%99%A8%E9%80%80%E5%87%BA%E7%A0%81%E8%AF%A6%E8%A7%A3/Sat, 28 Nov 2020 13:32:57 +0000https://zfunnily.github.io/2020/11/Docker%E5%AE%B9%E5%99%A8%E9%80%80%E5%87%BA%E7%A0%81%E8%AF%A6%E8%A7%A3/docker查看退出码指令 $ docker ps --filter &#34;status=exited&#34; $ docker inspect container-id --format=&#39;{&lt;!-- --&gt;{.State.ExitCode}}&#39; 常见退出码 Exit Code 0 退出代码0表示特定容器没有附加前台进程。 该退出代码是所有其他后续退出代码的例外。 这不一定意味着发生了不好的事情。如果开发人员想要在容器完Openresty二 | postman小工具https://zfunnily.github.io/2020/11/%E4%BD%BF%E7%94%A8OpenResty%E5%81%9A%E4%B8%80%E4%B8%AApostman%E5%B0%8F%E5%B7%A5%E5%85%B7/Wed, 25 Nov 2020 16:30:39 +0800https://zfunnily.github.io/2020/11/%E4%BD%BF%E7%94%A8OpenResty%E5%81%9A%E4%B8%80%E4%B8%AApostman%E5%B0%8F%E5%B7%A5%E5%85%B7/用到的知识点 mvc架构 模型渲染库:https://github.com/bungle/lua-resty-template resty http请求库: https://github.com/bungle/lua-resty-template 参照 mvc模型来做postman工具 配置文件说明 worker_processes 1; error_log logs/error.log; eventsOpenresty一 | 初探https://zfunnily.github.io/2020/11/OpenResty%E5%88%9D%E6%8E%A2/Mon, 23 Nov 2020 16:21:34 +0800https://zfunnily.github.io/2020/11/OpenResty%E5%88%9D%E6%8E%A2/概述 OpenResty®是一个基于Nginx与 Lua 的高性能 Web 平台,其内部集成了大量精良的 Lua 库、第三方模块以及大多数的依赖项。用于方便地搭建能够处理超高并发、扩展性极高的动态 Web 应用、Web 服务和动态网关。LastBattle | 登录流程(LS & BS & GS)https://zfunnily.github.io/2020/11/lastbattlelogin/Fri, 20 Nov 2020 17:27:08 +0000https://zfunnily.github.io/2020/11/lastbattlelogin/登录流程 根据上一篇文章中的登录流程,我在工程中找到了相应的代码并记录了下来 登录服务代码解析 监听端口:49997 供BS服务连接 监听端口:49996 供客户端连接 CIocpCtrl:IOCP控制类 多线程循环LastBattle | 服务架构https://zfunnily.github.io/2020/11/lastbattleserver/Fri, 20 Nov 2020 17:24:32 +0000https://zfunnily.github.io/2020/11/lastbattleserver/服务器架构简图如下: 连线说明: 实线:表示客户端登录流程,①②③④⑤表示登录流程,详细解释见下文。 虚线:表示服务器间的连接,虚线箭头指向监听方。 架构说明: |英文名称|简称|中文名称|功能简介|单个大区需LastBattle | 安装部署笔记https://zfunnily.github.io/2020/11/lastbattleone/Mon, 16 Nov 2020 06:49:49 +0000https://zfunnily.github.io/2020/11/lastbattleone/环境准备 win10 服务器:vs2010 / 数据库 mysql5.7 清华大学mysql镜像网站:https://mirrors.tuna.tsinghua.edu.cn/mysql/downloads/MySQL-5.7/ 客户端Cgo | 使用libevent库实现一个定时器https://zfunnily.github.io/2020/11/cgo%E4%BD%BF%E7%94%A8libevent%E5%BA%93%E5%AE%9E%E7%8E%B0%E4%B8%80%E4%B8%AA%E5%AE%9A%E6%97%B6%E5%99%A8/Fri, 13 Nov 2020 16:40:42 +0000https://zfunnily.github.io/2020/11/cgo%E4%BD%BF%E7%94%A8libevent%E5%BA%93%E5%AE%9E%E7%8E%B0%E4%B8%80%E4%B8%AA%E5%AE%9A%E6%97%B6%E5%99%A8/使用libevent库作为例子 下载 &amp; 编译 &amp; 安装libevent $ git clone https://github.com.cnpmjs.org/libevent/libevent.git $ cd libevent &amp;&amp; mkdir build &amp;&amp; cd build $ cmake .. $ make libevent实现的定时器 // main.cpp #include &#34;event.h&#34; struct event ev; struct timeval tv; void time_cb(evutil_socket_t fd, short event, void *argc) { printf(&#34;timer wakeup\n&#34;); event_add(&amp;ev, &amp;tv); // reschedule timer } int main() { struct event_base *base = event_base_new(); tv.tv_sec = 2;Golang | 利用指针进行数据转换https://zfunnily.github.io/2020/11/Golang-%E5%88%A9%E7%94%A8%E6%8C%87%E9%92%88%E8%BF%9B%E8%A1%8C%E6%95%B0%E6%8D%AE%E8%BD%AC%E6%8D%A2/Thu, 12 Nov 2020 17:19:07 +0000https://zfunnily.github.io/2020/11/Golang-%E5%88%A9%E7%94%A8%E6%8C%87%E9%92%88%E8%BF%9B%E8%A1%8C%E6%95%B0%E6%8D%AE%E8%BD%AC%E6%8D%A2/概述 在Go语言中,Slice本质是什么呢?是一个reflect.SliceHeader结构体和这个结构体中Data字段所指向的内存。String本质是什么呢?是一个reflect.StringHeadGolang | buildshttps://zfunnily.github.io/2020/11/go-builds/Thu, 12 Nov 2020 17:15:17 +0000https://zfunnily.github.io/2020/11/go-builds/概述 通常我们会给每个产品环境设置不同的配置,比如 redis 要在开发环境就连接 localhost:6379,测试环境可能连接某一个主机的 redis。 如果放在 go 里面是否可行?因为 go 是编译二进制包,也没有动态加载这Cgo | 简单使用https://zfunnily.github.io/2020/11/cgo%E7%9A%84%E7%AE%80%E5%8D%95%E4%BD%BF%E7%94%A8/Thu, 05 Nov 2020 09:45:23 +0000https://zfunnily.github.io/2020/11/cgo%E7%9A%84%E7%AE%80%E5%8D%95%E4%BD%BF%E7%94%A8/使用自己的C函数 文件名:testC.go package main /* #include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; void c_print(char *str) { printf(&#34;%s\n&#34;, str); } */ import &#34;C&#34; //import “C” 必须单起一行,并且紧跟在注释行之后 import &#34;unsafe&#34; func main() { s := &#34;Hello Cgo&#34; cs := C.CString(s) //字符串映射 C.c_print(cs) //调用C函数 defer C.free(unsafe.Pointer(cs)) //释放内存 } 说明: 1、gGolang | 使用Lumberjack+zap进行日志切割归档https://zfunnily.github.io/2020/11/%E4%BD%BF%E7%94%A8Lumberjack-zap%E8%BF%9B%E8%A1%8C%E6%97%A5%E5%BF%97%E5%88%87%E5%89%B2%E5%BD%92%E6%A1%A3/Wed, 04 Nov 2020 12:44:03 +0000https://zfunnily.github.io/2020/11/%E4%BD%BF%E7%94%A8Lumberjack-zap%E8%BF%9B%E8%A1%8C%E6%97%A5%E5%BF%97%E5%88%87%E5%89%B2%E5%BD%92%E6%A1%A3/使用Lumberjack+zap进行日志切割归档 为了添加日志切割归档功能,我们将使用第三方库Lumberjack来实现。 安装 执行下面的命令安装Lumberjack go get -u github.com/natefinch/lumberjack zap logger中加入LumbeVim | vimplus快捷键https://zfunnily.github.io/2020/10/vimplus%E5%BF%AB%E6%8D%B7%E9%94%AE/Wed, 28 Oct 2020 09:14:28 +0000https://zfunnily.github.io/2020/10/vimplus%E5%BF%AB%E6%8D%B7%E9%94%AE/插件相关 |快捷键|说明 |&mdash;&mdash; |,|Leader Key |&lt;leader&gt;n|打开 / 关闭代码资源管理器 |&lt;leader&gt;t|打开 / 关闭函数列表 |&lt;leader&gt;a|.h .cpp 文件切换 |&lt;leader&gt;u|转到函数声明 |&Vim | 打造编C++IDEhttps://zfunnily.github.io/2020/10/%E4%BD%BF%E7%94%A8vim%E6%89%93%E9%80%A0%E7%BC%96C-IDE/Wed, 28 Oct 2020 09:11:32 +0000https://zfunnily.github.io/2020/10/%E4%BD%BF%E7%94%A8vim%E6%89%93%E9%80%A0%E7%BC%96C-IDE/使用 vimplus 打造C++ IDE GitHub: https://github.com/chxuan/vimplus 支持平台: macos/linux 安装vimplus // 原来的链接, 国内速度较慢 $ git clone https://github.com/chxuan/vimplus.git ~/.vimplus // github修改为镜像的链接 $ git clone --depth=1 https://github.com.cnpmjs.org/chxuan/vimplus.git ~/.vimplus $ cd ~/.vimplus //不加sudo $ ./install.sh 设置Nerd Font 为防止vimpluLinux | 删除大量文件指令--rsynchttps://zfunnily.github.io/2020/10/linux%E7%B3%BB%E7%BB%9F%E5%88%A0%E9%99%A4%E5%A4%A7%E9%87%8F%E6%96%87%E4%BB%B6%E6%8C%87%E4%BB%A4--rsync/Tue, 13 Oct 2020 16:29:34 +0000https://zfunnily.github.io/2020/10/linux%E7%B3%BB%E7%BB%9F%E5%88%A0%E9%99%A4%E5%A4%A7%E9%87%8F%E6%96%87%E4%BB%B6%E6%8C%87%E4%BB%A4--rsync/rsync的安装 rsync安装,有些系统默认安装有该命令 ubuntu系统 sudo apt-get install rsync centos系统 sudo yum install rsync rsync参数详解 rsync提供了一些跟删除有关的参数 rsync --help | grep delete -del an alias for --delete-during --delete delete extraneous files from destination dirs --delete-before receiver deletes beforeCPU的核与线程-4核8线程https://zfunnily.github.io/2020/10/CPU%E7%9A%84%E6%A0%B8%E4%B8%8E%E7%BA%BF%E7%A8%8B-4%E6%A0%B88%E7%BA%BF%E7%A8%8B/Mon, 12 Oct 2020 16:29:34 +0000https://zfunnily.github.io/2020/10/CPU%E7%9A%84%E6%A0%B8%E4%B8%8E%E7%BA%BF%E7%A8%8B-4%E6%A0%B88%E7%BA%BF%E7%A8%8B/查看cpu信息 $ cat /proc/cpuinfo 物理CPU 物理CPU就是计算机上实际配置的CPU个数。 在linux上可以打开cat /proc/cpuinfo 来查看,其中的physical id就是每个物理CPU的ID,能找到几个physical id就代表TCP/IP | 大量TIME_WAIT对线上业务的影响https://zfunnily.github.io/2020/10/%E5%A4%A7%E9%87%8FTIME_WAIT%E5%AF%B9%E7%BA%BF%E4%B8%8A%E4%B8%9A%E5%8A%A1%E7%9A%84%E5%BD%B1%E5%93%8D/Sat, 10 Oct 2020 16:46:34 +0000https://zfunnily.github.io/2020/10/%E5%A4%A7%E9%87%8FTIME_WAIT%E5%AF%B9%E7%BA%BF%E4%B8%8A%E4%B8%9A%E5%8A%A1%E7%9A%84%E5%BD%B1%E5%93%8D/TCP的三次握手和四次挥手 TIME_WAIT概述 TIME_WAIT 状态: TCP 连接中,主动关闭连接的一方出现的状态;(收到 FIN 命令,进入 TIME_WAIT 状态,并返回 ACK 命令) 保持 2 个 MSL 时间,即,4 分钟 ;(MSL 为 2 分钟) TCP 连接建立后,「主Libevent | 定时器https://zfunnily.github.io/2020/09/libeventimer/Wed, 16 Sep 2020 23:20:28 +0000https://zfunnily.github.io/2020/09/libeventimer/libevent 实现定时器流程 首先初始化libevent库,并保存返回的指针 struct event_base * base = event_init(); 实际上这一步相当于初始化一个Reactor实例;在初始化libevent后,就可以注册事件了。 初始化事件event,设置回调函FFmpeg | 画中画和视频多宫格处理https://zfunnily.github.io/2020/09/ffmpegpicture/Mon, 14 Sep 2020 18:29:33 +0000https://zfunnily.github.io/2020/09/ffmpegpicture/FFmpeg生成画中画 静态画中画 将视频sub.mp4视频文件缩放成宽 480 、高 320 的视频,然后显示在 视频 input.mp4,x坐标为0,y 坐标为0 的位置 ffmpeg -re -i input.mp4 -vf &#34;movie=sub.mp4, scale=480x320[test]; [in][test]overlay [out]&#34; -vcodec libx264 output.flv 显示在画面的右下角,则需要用到FFmpeg | 给视频加文字和图片水印https://zfunnily.github.io/2020/09/ffmpegvideo/Sat, 12 Sep 2020 12:47:57 +0000https://zfunnily.github.io/2020/09/ffmpegvideo/FFmpeg给视频加上logo ffmpeg从视频中截取图像帧 ffmpeg -i inputfile.avi -r 1 -f image2 image-%05d.jpeg ffmpeg -i inputfile.avi -r 1 -s 4cif -f image2 image-%05d.jpeg ffmpeg -i inputfile.avi -r 1 -t 4 -f image2 image-%05d.jpeg ffmpeg -i inputfile.avi -r 1 -ss 01:30:14 -f image2 image-%05d.jpeg ffmpeg -i inputfile.avi -r 1 -ss 01:30:14 -vframes 120 4cif -f image2 image-%05d.jpeg -r 指定抽取的帧率,即从视频中每秒钟抽取FFmpeg | 录制摄像头和桌面数据windowshttps://zfunnily.github.io/2020/09/ffmpegvideow/Wed, 09 Sep 2020 09:36:49 +0000https://zfunnily.github.io/2020/09/ffmpegvideow/概述 FFmpeg Windows 设备操作 Windows 采集设备的主要方式是 dshow vfwcap gdigrab 其中 dshow 可以用来抓 取摄像头、采集卡、麦克风等,- vfwcap 主要用来采集摄像头类设备,- gdigrab 则是抓取 Windows 窗口程序 FFmpeg 使用 dshow 采集音视频设备 使用 dshow 枚举设备 ffmpeg -f dshow -list_devices true -i dymmy 输出 [dshow @ 000002622302e340]FFmpeg | 录制摄像头和桌面数据machttps://zfunnily.github.io/2020/08/macffmpeg/Sat, 29 Aug 2020 17:20:40 +0000https://zfunnily.github.io/2020/08/macffmpeg/设备枚举 查看设备列表 $ ffmpeg -hide_banner -devices Devices: D. = Demuxing supported .E = Muxing supported -- D avfoundation AVFoundation input device D lavfi Libavfilter virtual input device E sdl,sdl2 SDL2 output device 可以看到输入设备有:avfoundation,lavfi 输出设备有:sdl `` 设备采集举例: $ ffmpeg -f avfoundation -list_devices true -i &#34; &#34; 看到了 如下设K8S | Prometheus+Grafana监控https://zfunnily.github.io/2020/08/prometheusgrafana/Mon, 17 Aug 2020 13:58:35 +0000https://zfunnily.github.io/2020/08/prometheusgrafana/概述 作为应用与Kubernetes的监控体系,Prometheus具备诸多的优势,如: Kubernetes默认支持,非常适合容器和微服务- 无依赖,安装方便,上手容易- 社区活跃,它不仅仅是个工具,而是生Owt-server | owt-client-javascripthttps://zfunnily.github.io/2020/08/owt-client-javascript/Sun, 16 Aug 2020 23:04:13 +0000https://zfunnily.github.io/2020/08/owt-client-javascript/概述 天气燥热,不易出门。遂研究一下owt-server,从owt-client-javascript的流程开始吧。 获取一个会议室 owt-client-javascript的时候有一个初始化房间的过程 ///owt-client-javascript/src/samples/conference/samplertcservice.jsK8S | Ingress的基本使用https://zfunnily.github.io/2020/08/ingress/Sat, 15 Aug 2020 00:05:15 +0000https://zfunnily.github.io/2020/08/ingress/缘由 看了statefulset基础教程的基础教程,并且把环境搭建起来后。pod内部是可以连通了。但是我不知道怎么去从外部访问。在网上搜索一番,通过Ingress可以作为集群的入口。遂记录之。 结合StaK8S | Statefluset的持久存储PVChttps://zfunnily.github.io/2020/08/pvc/Fri, 14 Aug 2020 17:18:58 +0000https://zfunnily.github.io/2020/08/pvc/缘由 在看statefluset基础教程的时候遇到pod状态为pending kubectl describe pod web-0 日志内容是 pod has unbound immediate PersistentVolumeClaims 于是就对PV和PVC进行研究。 有给出完整的 web.yaml查看最下面的完整示例。但是我建议先把PVLinux | nsf服务的搭建和使用https://zfunnily.github.io/2020/08/nsf/Fri, 14 Aug 2020 17:17:54 +0000https://zfunnily.github.io/2020/08/nsf/搭建nsf服务 sudo apt install nfs-kernel-server 默认情况下,在Ubuntu 18.04上,NFS版本2是禁用的。版本3和版本4已启用。您可以通过运行以下cat命令来验证: sudo cat /proc/fs/nfsd/versions 写入 exports cat /etc/exports sudo echo /nfs/prometheus/data/ 192.168.84.75/24(rw,no_root_squash,no_all_squash,sync) &gt;&gt; /etc/exports sudo echo /nfs/prometheus/data/ 192.168.84.75/24(rw,no_root_squash,no_all_squash,sync) &gt;&gt; /etc/exports 可以设定的参数主要K8S | StatefulSet基本原理https://zfunnily.github.io/2020/08/statefulset/Fri, 14 Aug 2020 16:03:41 +0000https://zfunnily.github.io/2020/08/statefulset/背景 用户通过 Deployment、ReplicationController 可以方便地在 kubernetes 中部署一套高可用、可扩展的分布式无状态服务。这类应用不在本地存储数据,通过简单的负载均衡策略可实现请求分发。随K8S | coreDNS的部署安装https://zfunnily.github.io/2020/08/coredns/Thu, 13 Aug 2020 18:44:28 +0000https://zfunnily.github.io/2020/08/coredns/概述 CoreDNS可以在具有标准的Kube-DNS的Kubernetes集群中运行。作为Kubernetes 的插件使用,CoreDNS将从 Kubernetes集群中读取区(zone)数据。它实现了为KK8S | 创建第一个应用https://zfunnily.github.io/2020/08/firstk8s/Thu, 13 Aug 2020 15:28:31 +0000https://zfunnily.github.io/2020/08/firstk8s/使用k8s部署第一个应用 创建一个nginx.yaml文件 apiVersion: v1 kind: Pod metadata: name: nginx # 指定 label,便于检索 labels: app: nginx spec: containers: - name: nginx # 指定镜像 image: nginx:alpine # 指定暴露端口 ports: - containerPort: 80 --- # 创建网络服务 apiVersion: v1 kind: Service metadata: name: kube-node-service labels: name: kube-node-service spec: type: NodePort #这里代表Licod | 安装和配置https://zfunnily.github.io/2020/08/licode/Sun, 09 Aug 2020 09:34:36 +0000https://zfunnily.github.io/2020/08/licode/拉取docker镜像并运行 licode官方提供了配置好的docker镜像,使用以下命令拉下来跑就行。 docker run --name licode -p 3000:3000 -p $MIN_PORT-$MAX_PORT:30000-30050/udp -p 3001:3001 -p 8080:8080 -e &#34;MIN_PORT=30000&#34; -e &#34;MAX_PORT=30050&#34; -e &#34;PUBLIC_IP=your_ip_address&#34; lynckia/licode 注意命令里的PUBLIC_IP要改为服务器的公网IP。 配置好之Docker | 远程访问加密https://zfunnily.github.io/2020/08/dockersecret/Fri, 07 Aug 2020 07:56:52 +0000https://zfunnily.github.io/2020/08/dockersecret/docker的远程访问 方法一 :编辑docker.service文件 编辑docker.service文件 sudo vim /lib/systemd/system/docker.service 修改ExecStart行为下面内容 ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock 重新加载docker配置 sudo systemctl daemon-reload // 1,加载dockDocker | web管理界面portainerhttps://zfunnily.github.io/2020/08/dockerweb/Fri, 07 Aug 2020 07:54:43 +0000https://zfunnily.github.io/2020/08/dockerweb/拉取镜像 $ docker pull portainer/portainer 运行启动portainer docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v /home/docker/portainer:/data --name portainer --restart=always portainer/portainer admin bigant.cn 汉化 Portainer-CN.zip 百度云盘: https://pan.baidu.com/s/13ra6jXHR_7vajLLlf5GVEw 提取码: nzue 新建文件夹命名为public,把Portainer-CN.zip解压至里面。 2、public文件夹传K8S | 集群资源监控 heapsterhttps://zfunnily.github.io/2020/08/heapster/Thu, 06 Aug 2020 09:06:05 +0000https://zfunnily.github.io/2020/08/heapster/安装heapster的原因 查看dashboard状态 $ sudo kubectl get pods --all-namespaces | grep dashboard kubernetes-dashboard dashboard-metrics-scraper-6b4884c9d5-mvnb9 1/1 Running 0 40m kubernetes-dashboard kubernetes-dashboard-d7f7f565d-zhpsc 1/1 Running 0 40m 查看dashboard的日志 $ sudo kubectl logs -f -n kubernetes-dashboard kubernetes-dashboard-d7f7f565d-zhpsc 日志遇到这样的情况 No metric client provided. Skipping metrics. 2020/08/03 09:02:22 [2020-08-03T09:02:22Z] Outcoming response to 192.168.84.241:40086 with 200 status code 2020/08/03 09:02:23 Metric client healthK8S | Dashboard界面管理https://zfunnily.github.io/2020/08/dashboard/Thu, 06 Aug 2020 09:04:14 +0000https://zfunnily.github.io/2020/08/dashboard/安装部署Dashboard 通过一下命令来部署, recommended.yaml $ sudo kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deploy/recommended.yaml https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deplK8S | 安装https://zfunnily.github.io/2020/08/k8sinstall/Wed, 05 Aug 2020 10:00:40 +0000https://zfunnily.github.io/2020/08/k8sinstall/安装k8s前的准备工作 环境 ubuntu18.04 docker 关闭 swap 暂时关闭 $ swapoff -a 永久关闭 注释掉这一行 sudo vim /etc/fstab # /swapfile none swap sw 0 0 重启机器 sudo reboot docker 的配置 安装完成之后需要进行一些配置,包括 切换docker下载源为国内镜像站 以及 修改cgroupsOwt-server | 编译运行https://zfunnily.github.io/2020/08/owtservercomplie/Wed, 05 Aug 2020 09:47:22 +0000https://zfunnily.github.io/2020/08/owtservercomplie/概述 owt是一套完整的webrtc视频会议系统。包含的功能模块有: 视频会议1. p2p 服务器是owt-server通过nodejs编写的webrtc信令。依赖是licode。licode依赖webrtc。 客归档https://zfunnily.github.io/archives/Fri, 17 Apr 2020 20:43:57 +0800https://zfunnily.github.io/archives/2024-01月https://zfunnily.github.io/1/01/30/Mon, 01 Jan 0001 00:00:00 +0000https://zfunnily.github.io/1/01/30/学习 书籍 电影 游戏 《艾尔登法环》 《Dark Soul》3 《LOL》 番&amp;剧 其他搜索https://zfunnily.github.io/search/Mon, 01 Jan 0001 00:00:00 +0000https://zfunnily.github.io/search/神之亵渎1https://zfunnily.github.io/1/01/blasphemous/Mon, 01 Jan 0001 00:00:00 +0000https://zfunnily.github.io/1/01/blasphemous/地图设计 非线性结构: 游戏的地图是非线性的,允许玩家在一个庞大的世界中自由探索。玩家可以决定选择不同的路径和区域,解锁新的能力以访问之前无法到达的地方。 多样化的区域: 地图中包含了多个主题区域,每个区域都血污booshttps://zfunnily.github.io/1/01/blood/Mon, 01 Jan 0001 00:00:00 +0000https://zfunnily.github.io/1/01/blood/《血污:夜之仪式》 BOSS一/猎魔斩月 挑衅 + 招架 飞镖 横砍 劈砍 冲刺 + 横砍 跳起来 + 劈砍 跳起来 + 上挑 跳起来 + 上挑 + 劈砍 钩锁 + 劈砍 刀刃,火焰附魔 + 上面的轮回 影分身 格莫瑞 最终boss 没有后续boss的分析 地图设 \ No newline at end of file +Zzz记忆https://zfunnily.github.io/Recent content on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +00002024-2月https://zfunnily.github.io/2024/02/02/Tue, 27 Feb 2024 15:45:00 +0800https://zfunnily.github.io/2024/02/02/学习 书籍 电影 游戏 《Lies of P》 《Dark Soul》重制版 番&amp;剧 《绝命毒师》第一季/第二季 其他12月https://zfunnily.github.io/2023/12/30/Sat, 30 Dec 2023 15:45:00 +0800https://zfunnily.github.io/2023/12/30/学习 银河城地图 搭建 ue5 paper2d 书籍 《游戏设计艺术》 电影 《复仇者联盟》4 游戏 《血污:夜之仪式》 《LOL》 《神之亵渎》 23小时 番&amp;剧 其他11月https://zfunnily.github.io/2023/11/30/Thu, 30 Nov 2023 15:45:00 +0800https://zfunnily.github.io/2023/11/30/学习 chatglm + langchain 知识库 docker搭建 ue5 paper2d的使用 wsl 子系统研究, win11 镜像模式. 电视剧 《繁城之下》 番剧 《反叛的鲁路修》 一季、二季 书籍 《置身事内》 电影 《复仇者联盟》3 游戏 《马里奥惊奇》已完结 《血污:夜之WSL2改为桥接https://zfunnily.github.io/2023/11/wsl2/Fri, 17 Nov 2023 15:45:00 +0800https://zfunnily.github.io/2023/11/wsl2/需求 在docker容器内部程序自己获取的ip是172开头的。我需要跟宿主机同样网段的ip。 问题 win10系统wsl2 不支持桥接 更简单的解决方案 使用vmware虚拟机,直接启动一个linux镜像,然后使Python3.7安装https://zfunnily.github.io/2023/11/python/Thu, 16 Nov 2023 15:39:01 +0800https://zfunnily.github.io/2023/11/python/环境 centos7 开始安装 安装扩展 $ yum -y install yum-utils 安装Centos开发工具 $ yum -y groupinstall development 安装python3依赖 $ yum -y install zlib-devel bzip2-devel openssl-devel openssl-static ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel libffi-devel lzma gcc 下载python3.7安装包 # 将python3.7安装包,下载到/usr/Docker | Mysql 挂载目录一键部署https://zfunnily.github.io/2023/11/mysql/Thu, 16 Nov 2023 11:36:44 +0800https://zfunnily.github.io/2023/11/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 #Svnhttps://zfunnily.github.io/2023/11/svn/Tue, 14 Nov 2023 16:46:02 +0800https://zfunnily.github.io/2023/11/svn/SVN 合并 从源svn分支合并到目标svn分支 在源svn项目下鼠标右键,TortoiseSVN -&gt; Repo-browser, 拿到源项目svn地址 在目标svn项目下鼠标右键,TortoiseSVN -&gt; Merge -&gt;, 填入源项目svn地址 在show lWSL2子系统迁移https://zfunnily.github.io/2023/11/wsl/Mon, 13 Nov 2023 22:21:34 +0800https://zfunnily.github.io/2023/11/wsl/wsl 安装 参考链接: https://learn.microsoft.com/zh-cn/windows/wsl/install 通过命令行安装 wsl --update wsl -v -l wsl --install wsl &amp; docker 迁移 WSL发行版默认都是安装在C盘,在%LOCALAPPDATA%/Docker/wsl目录 docker的运行数据、镜像文件都存在%LOCALAPPGithubActionhttps://zfunnily.github.io/2023/11/gitaction/Mon, 13 Nov 2023 11:21:34 +0800https://zfunnily.github.io/2023/11/gitaction/Github Token 生成 &amp; 设置 github -&gt; Settings -&gt; Developer Settings -&gt; Personal access tokens 新增 Tokens(classic) 点击Generate new token 点击你想使用Action的github仓库 Settings -&gt; Secrets and variables -&gt; Actions -&gt; New respository secret. 填上名字ACTION_ACCESS_TOKEN和第一步生成的 token,ChatGLM & LangChainhttps://zfunnily.github.io/2023/11/chatglm/Fri, 10 Nov 2023 11:21:34 +0800https://zfunnily.github.io/2023/11/chatglm/参考: 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 DockerDDNS配置https://zfunnily.github.io/2023/10/DDNS/Mon, 30 Oct 2023 11:21:34 +0800https://zfunnily.github.io/2023/10/DDNS/参考: https://www.sakamoto.blog/synology-nas-cloudflare-ddns/ Cloudflare 获取 区域 ID 创建 API 令牌 群晖设置 开启并登陆群晖NAS终端 下载 Cloudflare DDNS 脚本 下载 Cloudflare 的 DDNS 脚本文件,官方推荐存放于/sbin/cloudflareddns.sh并赋予执行权限. # 下载脚本 $ wget https://raw.githubusercontent.com/joshuaavalon/SynologyCloudflareDDNS/master/cloudflareddns.sh -O /sbin/cloudflareddns.sh # 赋予执行粒子系统01-概述https://zfunnily.github.io/2023/05/particlesystem01/Wed, 24 May 2023 11:21:34 +0800https://zfunnily.github.io/2023/05/particlesystem01/参考视频 参考播客 一、两种解决方案 区别 Particle System(内置粒子系统) Visual Effect Graph(VFX Graph) 基于XX运行 CPU GPU 粒子数量 数千 数百万 渲染管线 支持全部渲染管线 不支持内置渲染管线 物理系统 可与Unity物理系统交互 特定元素交互 创作Netch加速SWITCHhttps://zfunnily.github.io/2022/10/netch/Thu, 27 Oct 2022 10:09:44 +0800https://zfunnily.github.io/2022/10/netch/需求 对于有机场的用户,不用再花一份加速器的钱给Switch加速 前提条件 电脑通过(shadowrocks/v2ray)开启科学上网,使用端口 1080 电脑局域网IP 192.168.0.103 允许局域网设备连入 解决过程 switch的代理Netch加速SWITCHhttps://zfunnily.github.io/2022/10/netch/Thu, 27 Oct 2022 10:09:44 +0800https://zfunnily.github.io/2022/10/netch/需求 对于有机场的用户,不用再花一份加速器的钱给Switch加速 前提条件 电脑通过(shadowrocks/v2ray)开启科学上网,使用端口 1080 电脑局域网IP 192.168.0.103 允许局域网设备连入 解决过程 switch的代理adjhttps://zfunnily.github.io/english/xdf/04_adj/Mon, 18 Jul 2022 09:45:29 +0800https://zfunnily.github.io/english/xdf/04_adj/形容词在名词短语中的位置 前置修饰名词 单个形容词在名词短语中的位置 在一个名词短语中,若是单个形容词作定语修饰一个名词,其结构通常是“限定词+形容词+名词” 修饰something,anything,notGitlab | CI/CD简单实现https://zfunnily.github.io/2022/06/cicd/Wed, 22 Jun 2022 14:26:25 +0800https://zfunnily.github.io/2022/06/cicd/CI/CD 流水线 组件组成 stages job gitlab runner(可以与gitlab服务器独立, c/s架构. ) -------- -------- --------- |stage1| -&gt; |stage2| -&gt; | stage3| -------- -------- --------- ------ ------ ------- |job1| |job2| | job3| ------ ------ ------- --------- --------- --------- |runner1| |runner2| -&gt; |runner3| --------- --------- --------- pipline: 包含多个stage, 顺序执行 stages: 一个stage可以包含多Gitlab | CI/CD简单实现https://zfunnily.github.io/2022/06/cicd/Wed, 22 Jun 2022 14:26:25 +0800https://zfunnily.github.io/2022/06/cicd/CI/CD 流水线 组件组成 stages job gitlab runner(可以与gitlab服务器独立, c/s架构. ) -------- -------- --------- |stage1| -&gt; |stage2| -&gt; | stage3| -------- -------- --------- ------ ------ ------- |job1| |job2| | job3| ------ ------ ------- --------- --------- --------- |runner1| |runner2| -&gt; |runner3| --------- --------- --------- pipline: 包含多个stage, 顺序执行 stages: 一个stage可以包含多百度网盘不限速 | Aria2篇https://zfunnily.github.io/2022/05/baidu/Tue, 17 May 2022 16:40:59 +0800https://zfunnily.github.io/2022/05/baidu/环境 win10 chrome 油猴插件 aria2 Aria2 对于不想折腾的有懒人包. 实际上包里含有的是aria2软件和aria2 GUI。 下载链接如下: 懒人下载包 AriaNg Aria2 百度网盘简易下载助手 安装油猴脚本: 百度网盘简易下载助手 安装好上述脚本之后,可百度网盘不限速 | Aria2篇https://zfunnily.github.io/2022/05/baidu/Tue, 17 May 2022 16:40:59 +0800https://zfunnily.github.io/2022/05/baidu/环境 win10 chrome 油猴插件 aria2 Aria2 对于不想折腾的有懒人包. 实际上包里含有的是aria2软件和aria2 GUI。 下载链接如下: 懒人下载包 AriaNg Aria2 百度网盘简易下载助手 安装油猴脚本: 百度网盘简易下载助手 安装好上述脚本之后,可URP 不透明/半透明物体的折射https://zfunnily.github.io/2022/05/refraction/Tue, 17 May 2022 11:30:48 +0800https://zfunnily.github.io/2022/05/refraction/折射 应用场景 水池 玻璃 热空气(热扭曲) GrabPass + CubeMap 《Unity3D Shader入门精要》第十章介绍了,模拟实现折射效果有两种 使用cubemap: 我认为太麻烦.需要的贴图太多。也没有找到其他合适的使用场景,遂搁URP 不透明/半透明物体的折射https://zfunnily.github.io/2022/05/refraction/Tue, 17 May 2022 11:30:48 +0800https://zfunnily.github.io/2022/05/refraction/折射 应用场景 水池 玻璃 热空气(热扭曲) GrabPass + CubeMap 《Unity3D Shader入门精要》第十章介绍了,模拟实现折射效果有两种 使用cubemap: 我认为太麻烦.需要的贴图太多。也没有找到其他合适的使用场景,遂搁《Unity Shader入门精要》第八章笔记 | 透明度https://zfunnily.github.io/2022/05/shaderalpha/Sat, 07 May 2022 17:17:18 +0800https://zfunnily.github.io/2022/05/shaderalpha/渲染顺序 名称 队列索引号 描 述 Background 1000 这个渲染队列会在任何其他队列之前被渲染,我们通常使用该队列来渲染那些需要绘制在背景上的物体 Geometry 2000 默认的渲染队列,大多数物体都使用这个队列。不透明物体使用这个队列 AlphaTest 2450 需要透明《Unity Shader入门精要》第八章笔记 | 透明度https://zfunnily.github.io/2022/05/shaderalpha/Sat, 07 May 2022 17:17:18 +0800https://zfunnily.github.io/2022/05/shaderalpha/渲染顺序 名称 队列索引号 描 述 Background 1000 这个渲染队列会在任何其他队列之前被渲染,我们通常使用该队列来渲染那些需要绘制在背景上的物体 Geometry 2000 默认的渲染队列,大多数物体都使用这个队列。不透明物体使用这个队列 AlphaTest 2450 需要透明《Unity Shader入门精要》第六章笔记 | 基础光照https://zfunnily.github.io/2022/05/shaderlighting/Sat, 07 May 2022 16:22:40 +0800https://zfunnily.github.io/2022/05/shaderlighting/我们是如何看到这个世界的 光源: 在光学里,我们使用辐照度 (irradiance) 来量化光 物体的吸收和散射: 光线由光源发射出来后,就会与一些物体相交 着色: 根据材质属性(如漫反射属性等)、光源信息(如光源方《Unity Shader入门精要》第六章笔记 | 基础光照https://zfunnily.github.io/2022/05/shaderlighting/Sat, 07 May 2022 16:22:40 +0800https://zfunnily.github.io/2022/05/shaderlighting/我们是如何看到这个世界的 光源: 在光学里,我们使用辐照度 (irradiance) 来量化光 物体的吸收和散射: 光线由光源发射出来后,就会与一些物体相交 着色: 根据材质属性(如漫反射属性等)、光源信息(如光源方《Unity Shader入门精要》第五章笔记 | 开始shader练习https://zfunnily.github.io/2022/05/shaderbase/Sat, 07 May 2022 10:22:33 +0800https://zfunnily.github.io/2022/05/shaderbase/一个简单的顶点/片元着色器 代码 Shader &#34;Unity Shaders Book/Chapter 5/Simple Shader&#34; { Properties { // 声明一个Color类型的属性 _Color (&#34;Color Tint&#34;, Color) = (1.0,1.0,1.0,1.0) } SubShader { Pass { CGPROGRAM #pragma vertex vert #pragma fragment frag // 在Cg代码中,我们需要定义一个与属性名称和类型都匹配的变量 fixed4 _Color; // 使用一个结构体来定义《Unity Shader入门精要》第五章笔记 | 开始shader练习https://zfunnily.github.io/2022/05/shaderbase/Sat, 07 May 2022 10:22:33 +0800https://zfunnily.github.io/2022/05/shaderbase/一个简单的顶点/片元着色器 代码 Shader &#34;Unity Shaders Book/Chapter 5/Simple Shader&#34; { Properties { // 声明一个Color类型的属性 _Color (&#34;Color Tint&#34;, Color) = (1.0,1.0,1.0,1.0) } SubShader { Pass { CGPROGRAM #pragma vertex vert #pragma fragment frag // 在Cg代码中,我们需要定义一个与属性名称和类型都匹配的变量 fixed4 _Color; // 使用一个结构体来定义MAC平台几何着色器不生效https://zfunnily.github.io/2022/05/geometry/Thu, 05 May 2022 16:49:29 +0800https://zfunnily.github.io/2022/05/geometry/问题 MAC平台几何着色器不生效 解决步骤 unity shaderlab 怎么设置以至于支持几何着色器 找原因,设置 编译目标级别,#pragma target 4.0, 不管用 看到一句话,Unity 在 Metal 图形上支持曲面细分着色器,但 Metal 不支持几何着色器 找到maMAC平台几何着色器不生效https://zfunnily.github.io/2022/05/geometry/Thu, 05 May 2022 16:49:29 +0800https://zfunnily.github.io/2022/05/geometry/问题 MAC平台几何着色器不生效 解决步骤 unity shaderlab 怎么设置以至于支持几何着色器 找原因,设置 编译目标级别,#pragma target 4.0, 不管用 看到一句话,Unity 在 Metal 图形上支持曲面细分着色器,但 Metal 不支持几何着色器 找到maShaderLab常用函数https://zfunnily.github.io/2022/04/shaderfunc/Wed, 20 Apr 2022 15:41:29 +0800https://zfunnily.github.io/2022/04/shaderfunc/数学函数 cg/hlsl函数 功能描述 dot(A,B) 点积, 点积结果为标量,主要用于求向量的夹角或b向量在a向量上的投影 cross(A,B) 叉积, 叉积结果为向量,结果与这两个向量组成的平面垂直。主要用于3D图形学 mul(M, N) 矩阵M和矩阵N的积 mul(M,ShaderLab常用函数https://zfunnily.github.io/2022/04/shaderfunc/Wed, 20 Apr 2022 15:41:29 +0800https://zfunnily.github.io/2022/04/shaderfunc/数学函数 cg/hlsl函数 功能描述 dot(A,B) 点积, 点积结果为标量,主要用于求向量的夹角或b向量在a向量上的投影 cross(A,B) 叉积, 叉积结果为向量,结果与这两个向量组成的平面垂直。主要用于3D图形学 mul(M, N) 矩阵M和矩阵N的积 mul(M,UnityCG.cginc中常用函数https://zfunnily.github.io/2022/04/cginc/Wed, 20 Apr 2022 15:35:49 +0800https://zfunnily.github.io/2022/04/cginc/摄像机方向 WorldSpaceViewDir 输入一个模型空间中的顶点坐标 -&gt; 输出(世界空间)从这个点到摄像机的观察方向; WorldSpaceViewDir // 内部实现也是用UnityWorldSpaceViewDir // Computes world space view direction, from object space position // *Legacy* Please use UnityWorldSpaceViewDir instead inline float3 WorldSpaceViewDir( in float4 localPos ) { float3 worldPosUnityCG.cginc中常用函数https://zfunnily.github.io/2022/04/cginc/Wed, 20 Apr 2022 15:35:49 +0800https://zfunnily.github.io/2022/04/cginc/摄像机方向 WorldSpaceViewDir 输入一个模型空间中的顶点坐标 -&gt; 输出(世界空间)从这个点到摄像机的观察方向; WorldSpaceViewDir // 内部实现也是用UnityWorldSpaceViewDir // Computes world space view direction, from object space position // *Legacy* Please use UnityWorldSpaceViewDir instead inline float3 WorldSpaceViewDir( in float4 localPos ) { float3 worldPos《Unity Shader入门精要》第四章笔记 | 学习Shader所需的数学基础https://zfunnily.github.io/2022/04/shadermathematic/Sun, 10 Apr 2022 15:42:33 +0800https://zfunnily.github.io/2022/04/shadermathematic/概述 在学习Shader的过程中,我们最常使用的就是矢量和矩阵(即数学的分支之一——线性代数)。 笛卡儿坐标系 我们使用数学绝大部分都是为了计算位置、距离和角度等变量。而这些计算大部分都是在笛卡儿坐标系 (C《Unity Shader入门精要》第四章笔记 | 学习Shader所需的数学基础https://zfunnily.github.io/2022/04/shadermathematic/Sun, 10 Apr 2022 15:42:33 +0800https://zfunnily.github.io/2022/04/shadermathematic/概述 在学习Shader的过程中,我们最常使用的就是矢量和矩阵(即数学的分支之一——线性代数)。 笛卡儿坐标系 我们使用数学绝大部分都是为了计算位置、距离和角度等变量。而这些计算大部分都是在笛卡儿坐标系 (C《Unity Shader入门精要》第三章笔记| UnityShader基础https://zfunnily.github.io/2022/04/shaderbase/Sun, 10 Apr 2022 14:51:19 +0800https://zfunnily.github.io/2022/04/shaderbase/材质 在Unity中我们需要配合使用材质 (Material) 和Unity Shader才能达到需要的效果。一个最常见的流程是 创建一个材质;活着导入一个材质 创建一个Unity Shader,并把它赋给上一步中《Unity Shader入门精要》第三章笔记| UnityShader基础https://zfunnily.github.io/2022/04/shaderbase/Sun, 10 Apr 2022 14:51:19 +0800https://zfunnily.github.io/2022/04/shaderbase/材质 在Unity中我们需要配合使用材质 (Material) 和Unity Shader才能达到需要的效果。一个最常见的流程是 创建一个材质;活着导入一个材质 创建一个Unity Shader,并把它赋给上一步中《Unity Shader入门精要》第二章笔记 | 渲染流水线https://zfunnily.github.io/2022/04/shaderrenderpipline/Sat, 09 Apr 2022 11:55:55 +0800https://zfunnily.github.io/2022/04/shaderrenderpipline/渲染流水线 Render-Time Rendering, Third Edition》一书中将一个渲染流程分成3个阶段:应用阶段(Application Stage) 、几何阶段(Geometry Stage) 、光栅化阶段(Rasterizer Stage) 。 应《Unity Shader入门精要》第二章笔记 | 渲染流水线https://zfunnily.github.io/2022/04/shaderrenderpipline/Sat, 09 Apr 2022 11:55:55 +0800https://zfunnily.github.io/2022/04/shaderrenderpipline/渲染流水线 Render-Time Rendering, Third Edition》一书中将一个渲染流程分成3个阶段:应用阶段(Application Stage) 、几何阶段(Geometry Stage) 、光栅化阶段(Rasterizer Stage) 。 应shader初尝试 | 给石头覆盖一层雪景(Hello World)https://zfunnily.github.io/2022/04/shaderhelloworld/Sat, 09 Apr 2022 10:34:56 +0800https://zfunnily.github.io/2022/04/shaderhelloworld/给石头覆盖一层雪景 资源准备 石头模型 Unity2021.2.3f1c1 Mac &amp; Windows 在Unity中创建一个项目,导入石头模型,下面就开始利用shader给石头做一个雪景覆盖. 实现效果 未覆盖雪景的样子 覆盖了雪景的样子 开始代码 我在代码中标注了1,shader初尝试 | 给石头覆盖一层雪景(Hello World)https://zfunnily.github.io/2022/04/shaderhelloworld/Sat, 09 Apr 2022 10:34:56 +0800https://zfunnily.github.io/2022/04/shaderhelloworld/给石头覆盖一层雪景 资源准备 石头模型 Unity2021.2.3f1c1 Mac &amp; Windows 在Unity中创建一个项目,导入石头模型,下面就开始利用shader给石头做一个雪景覆盖. 实现效果 未覆盖雪景的样子 覆盖了雪景的样子 开始代码 我在代码中标注了1,UnityShader基本概念https://zfunnily.github.io/2022/04/shader01/Wed, 06 Apr 2022 11:54:02 +0800https://zfunnily.github.io/2022/04/shader01/何为shader shader中文翻译为着色器,其实是一种用来渲染图形的技术,我们可以通过shader编程,来自定义显卡渲染画面的算法,显示我们所期望的结果。 shader种类 顶点着色器: 处理每个顶点,将UnityShader基本概念https://zfunnily.github.io/2022/04/shader01/Wed, 06 Apr 2022 11:54:02 +0800https://zfunnily.github.io/2022/04/shader01/何为shader shader中文翻译为着色器,其实是一种用来渲染图形的技术,我们可以通过shader编程,来自定义显卡渲染画面的算法,显示我们所期望的结果。 shader种类 顶点着色器: 处理每个顶点,将Graphicshttps://zfunnily.github.io/2022/04/graphics/Mon, 04 Apr 2022 21:48:09 +0800https://zfunnily.github.io/2022/04/graphics/Last Lecture What is Computer Graphics? Why study Computer Graphics? Course Topics Course Logistics Graphics&rsquo;s Dependencies Basic mathematics Liner algebra, calculus, statistics. Basic physics Optics, Mechanics Misc Signal processing Numerical analysis 线性代数 Dot(scalar) Product Cross (vector) Product 向量之间的乘积不符合交换定律。 Cross product: Properties 右手螺旋定则 Cross product: Cartesian Formula Cross product in Graphics 判断左右 判断内外 判断向量b在向量a的左边 右手螺旋法则 向量Graphicshttps://zfunnily.github.io/2022/04/graphics/Mon, 04 Apr 2022 21:48:09 +0800https://zfunnily.github.io/2022/04/graphics/Last Lecture What is Computer Graphics? Why study Computer Graphics? Course Topics Course Logistics Graphics&rsquo;s Dependencies Basic mathematics Liner algebra, calculus, statistics. Basic physics Optics, Mechanics Misc Signal processing Numerical analysis 线性代数 Dot(scalar) Product Cross (vector) Product 向量之间的乘积不符合交换定律。 Cross product: Properties 右手螺旋定则 Cross product: Cartesian Formula Cross product in Graphics 判断左右 判断内外 判断向量b在向量a的左边 右手螺旋法则 向量抽卡逻辑自述https://zfunnily.github.io/2022/03/afk/Wed, 30 Mar 2022 10:50:11 +0800https://zfunnily.github.io/2022/03/afk/抽卡逻辑自述 参考《剑与远征》 卡牌颜色以及合成 颜色 合成 绿色 可分解,得到粉尘和银瓜子, 最基础的卡 蓝 蓝+ 同样的三张蓝色可合成一张蓝+ 紫 同种族的三张蓝+可以合成一张紫(可以选择合成其中蓝+的某个紫色) 紫+ 同英抽卡逻辑自述https://zfunnily.github.io/2022/03/afk/Wed, 30 Mar 2022 10:50:11 +0800https://zfunnily.github.io/2022/03/afk/抽卡逻辑自述 参考《剑与远征》 卡牌颜色以及合成 颜色 合成 绿色 可分解,得到粉尘和银瓜子, 最基础的卡 蓝 蓝+ 同样的三张蓝色可合成一张蓝+ 紫 同种族的三张蓝+可以合成一张紫(可以选择合成其中蓝+的某个紫色) 紫+ 同英层级时间轮 | skynet 定时器https://zfunnily.github.io/2022/03/timerskynet/Sun, 27 Mar 2022 12:39:12 +0800https://zfunnily.github.io/2022/03/timerskynet/skynet定时器 要解析一个程序代码,先了解数据结构,这是基础,再看函数。 拿skynet定时器举例子。 数据结构 //定时器事件 用于抛出定时器事件到消息队列里。理解这个数据结构需要先了解skynet的框架层级时间轮 | skynet 定时器https://zfunnily.github.io/2022/03/timerskynet/Sun, 27 Mar 2022 12:39:12 +0800https://zfunnily.github.io/2022/03/timerskynet/skynet定时器 要解析一个程序代码,先了解数据结构,这是基础,再看函数。 拿skynet定时器举例子。 数据结构 //定时器事件 用于抛出定时器事件到消息队列里。理解这个数据结构需要先了解skynet的框架利用时间轮实现定时器https://zfunnily.github.io/2022/03/timer/Thu, 10 Mar 2022 14:38:23 +0800https://zfunnily.github.io/2022/03/timer/理解定时器 适用场景 定时任务(每隔1s钟打印一次数据) 超时控制(xx分钟没有动作就断开连接) 频率限制(最快只能每5s调用一次API) 定时器常用的数据结构有如下几种: 链表 双向有序链表 最小堆 时间轮 层级时间轮利用时间轮实现定时器https://zfunnily.github.io/2022/03/timer/Thu, 10 Mar 2022 14:38:23 +0800https://zfunnily.github.io/2022/03/timer/理解定时器 适用场景 定时任务(每隔1s钟打印一次数据) 超时控制(xx分钟没有动作就断开连接) 频率限制(最快只能每5s调用一次API) 定时器常用的数据结构有如下几种: 链表 双向有序链表 最小堆 时间轮 层级时间轮无聊 & 痛苦https://zfunnily.github.io/thinking/2022/03/shuowang/Wed, 09 Mar 2022 12:03:36 +0800https://zfunnily.github.io/thinking/2022/03/shuowang/每天晚上我都睡得很晚,不是不困,而是不想睡,强迫自己不要睡。我似乎得了强迫症,我很忧郁。 因为我总觉得一天什么都没干就这么过去了,实在不甘心!于是我就尽量延长这一天的时间。我真是个有志气的人,我很欣慰。爬楼有感https://zfunnily.github.io/thinking/2022/03/think01/Tue, 08 Mar 2022 21:54:25 +0800https://zfunnily.github.io/thinking/2022/03/think01/28楼 今天放弃了常用乘电梯回家,决定爬楼。28楼真高呀。我还记得上次是和阿芳一起爬的。 那会爬的很轻松,还有功夫教她 &ldquo;核心收紧,抬腿的时候膝盖沿着脚尖方向歪曲&rdquo;。 一个人爬楼让我又老纪https://zfunnily.github.io/thinking/2022/03/weekly01/Mon, 07 Mar 2022 21:36:05 +0800https://zfunnily.github.io/thinking/2022/03/weekly01/周末看了《铁齿铜牙纪晓岚》,对这样经典的剧,百看不厌。 这个剧我来来回回看了很多遍了,剧集内容越来越熟悉,但是对里面的人物却又有不一样的理解。 以前觉得纪晓岚清官,好人。和珅贪官,坏人。 现在看到了那一集和2021焦虑总结https://zfunnily.github.io/thinking/2022/03/summarize/Fri, 04 Mar 2022 11:03:20 +0800https://zfunnily.github.io/thinking/2022/03/summarize/2021 已经22年3月份了,这份总结才出来,我这是拖延症晚期了。 去年一年总的来说不错, 但还是有些计划性的东西没做 我结婚了,24岁 我转行做游戏了 买车了 读了3本书 健身 无 时间太快,从我19年开始记笔记开始,已经过利用云服务器搭建个人博客https://zfunnily.github.io/2022/03/blog/Thu, 03 Mar 2022 12:04:58 +0800https://zfunnily.github.io/2022/03/blog/vps选择 最近关注了一个vps推广网站。价格合适,于是买了一个128元/年的云服务器。既可以用来做代理,又可以搭建个人博客 配置是2G/1M/40G(运存/带宽/硬盘) 使用技术 nginx: 静态博客 v2ray: 代理 https + nginx freenome: 域利用云服务器搭建个人博客https://zfunnily.github.io/2022/03/blog/Thu, 03 Mar 2022 12:04:58 +0800https://zfunnily.github.io/2022/03/blog/vps选择 最近关注了一个vps推广网站。价格合适,于是买了一个128元/年的云服务器。既可以用来做代理,又可以搭建个人博客 配置是2G/1M/40G(运存/带宽/硬盘) 使用技术 nginx: 静态博客 v2ray: 代理 https + nginx freenome: 域Nginx | 给网站添加证书https://zfunnily.github.io/2022/03/https/Thu, 03 Mar 2022 10:26:56 +0800https://zfunnily.github.io/2022/03/https/Https 最近在购买的云服务器上把个人博客搭建起来了,实际上是hugo生成静态网页,nginx加载静态网页。现在只能通过http访问,缺少个https。 要搭建一个https的网站需要证书。之前在网上找的教程太Nginx | 给网站添加证书https://zfunnily.github.io/2022/03/https/Thu, 03 Mar 2022 10:26:56 +0800https://zfunnily.github.io/2022/03/https/Https 最近在购买的云服务器上把个人博客搭建起来了,实际上是hugo生成静态网页,nginx加载静态网页。现在只能通过http访问,缺少个https。 要搭建一个https的网站需要证书。之前在网上找的教程太Golang | http注解路由https://zfunnily.github.io/2022/03/http/Wed, 02 Mar 2022 14:51:22 +0800https://zfunnily.github.io/2022/03/http/Http服务器 Golang有一个很强大的官方http库了,使用上很方便。也有一些很强大的三方http框架, 比如gin,beego等等。 自以为,框架在提供便利,提升开发效率的同时,也限制了我们的想象力。Golang | http注解路由https://zfunnily.github.io/2022/03/http/Wed, 02 Mar 2022 14:51:22 +0800https://zfunnily.github.io/2022/03/http/Http服务器 Golang有一个很强大的官方http库了,使用上很方便。也有一些很强大的三方http框架, 比如gin,beego等等。 自以为,框架在提供便利,提升开发效率的同时,也限制了我们的想象力。Goang | Plugin插件热更https://zfunnily.github.io/2022/03/reload/Tue, 01 Mar 2022 11:33:22 +0800https://zfunnily.github.io/2022/03/reload/热更新 动态脚本更新 (php) 短链接无状态服务器热更 (http) 长连接有状态,数据跟逻辑分离 golang Plugin热更 (.so 动态库更新) &mdash;-逻辑热更 长连接有状态,在运维层面, 利用容器部署热更(docker, k8s) 服务不接受新Goang | Plugin插件热更https://zfunnily.github.io/2022/03/reload/Tue, 01 Mar 2022 11:33:22 +0800https://zfunnily.github.io/2022/03/reload/热更新 动态脚本更新 (php) 短链接无状态服务器热更 (http) 长连接有状态,数据跟逻辑分离 golang Plugin热更 (.so 动态库更新) &mdash;-逻辑热更 长连接有状态,在运维层面, 利用容器部署热更(docker, k8s) 服务不接受新Grpc | Token认证和自定义认证https://zfunnily.github.io/2022/02/jwt/Tue, 22 Feb 2022 15:39:30 +0800https://zfunnily.github.io/2022/02/jwt/概述 现在有个需求,需要在grpc的拦截器中,通过token进行身份认证。如果认证不通过则返回错误; 认证通过,则放行; TLS是用作加密通讯通道的,与该需求无关。 Token认证 具体流程 客户端通过账号密码登Grpc | Token认证和自定义认证https://zfunnily.github.io/2022/02/jwt/Tue, 22 Feb 2022 15:39:30 +0800https://zfunnily.github.io/2022/02/jwt/概述 现在有个需求,需要在grpc的拦截器中,通过token进行身份认证。如果认证不通过则返回错误; 认证通过,则放行; TLS是用作加密通讯通道的,与该需求无关。 Token认证 具体流程 客户端通过账号密码登Grpc | 通过SSL/TLS建立安全连接https://zfunnily.github.io/2022/02/san/Tue, 22 Feb 2022 14:22:41 +0800https://zfunnily.github.io/2022/02/san/使用golang的grpc库作为例子 grpc使用TLS建立安全连接需要有SAN证书, go 1.15 版本开始废弃 CommonName。 什么是SAN证书 SAN(Subject Alternative Name) 是 SSL 标准 x509 中定义的一个扩展。使用了 SAN 字段的 SSL 证书,可以扩Grpc | 通过SSL/TLS建立安全连接https://zfunnily.github.io/2022/02/san/Tue, 22 Feb 2022 14:22:41 +0800https://zfunnily.github.io/2022/02/san/使用golang的grpc库作为例子 grpc使用TLS建立安全连接需要有SAN证书, go 1.15 版本开始废弃 CommonName。 什么是SAN证书 SAN(Subject Alternative Name) 是 SSL 标准 x509 中定义的一个扩展。使用了 SAN 字段的 SSL 证书,可以扩转载|江雪:长安十日https://zfunnily.github.io/thinking/2022/01/jx/Thu, 06 Jan 2022 11:32:56 +0800https://zfunnily.github.io/thinking/2022/01/jx/转载 https://chinadigitaltimes.net/chinese/675386.html(需科学上网) 01/03/2022 文:江雪 小区里的大喇叭又响了起来,一遍遍重复着,喊人们下楼做核酸。队排了很长。测核Blog | 代码显示/隐藏https://zfunnily.github.io/2021/12/shortcodes/Wed, 29 Dec 2021 13:50:28 +0800https://zfunnily.github.io/2021/12/shortcodes/缘由 最近在写技术博客时,引入的代码太多,影响观感。 在尽力减少代码量,还是有些不可或缺的代码,代码量很惊人,已经占满整个屏幕. 因为个人博客是使用hugo生成的静态博客,我刚开始想的使用原生的js和cssNginx的一些配置https://zfunnily.github.io/2021/12/nginx/Tue, 28 Dec 2021 16:04:10 +0800https://zfunnily.github.io/2021/12/nginx/静态网站 应用场景 文件服务 静态网站 &hellip; 静态网站的配置 配置如下: nginx.conf worker_processes 1; pid nginx.pid; events { worker_connections 1024; multi_accept on; } http { default_type application/octet-stream; sendfile on; keepalive_timeout 100; server { listen 80; charset utf-8,gbk; server_name localhost; location /{ root /opt/; autoindex on; autoindex_localtime on; } index index.html; # 显示首页 #静态文件访问 location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|js|pdf|txt) { root /opt; } } } root: 表示网站根目录 autoindex: on 显摘抄 | 我的精神家园https://zfunnily.github.io/thinking/2021/12/pervert/Mon, 27 Dec 2021 21:44:21 +0800https://zfunnily.github.io/thinking/2021/12/pervert/另一种文化 假如有个pervert站出来说:我就是个pervert,那他就不是个pervert。 当且仅当一个人声称:我就不知道pervert是什么时,他才是个pervert。 假如我说,我们这里有种perA*算法 | Lua版本https://zfunnily.github.io/2021/12/astar/Thu, 23 Dec 2021 16:37:44 +0800https://zfunnily.github.io/2021/12/astar/A*算法思路 寻路步骤 从起点A开始, 把它作为待处理的方格存入一个&quot;开启列表&quot;, 开启列表就是一个等待检查方格的列表. 寻找起点A周围可以到达的方格, 将它们放入&quot;开启列表&quoBlog | 音乐播放器https://zfunnily.github.io/2021/12/music/Tue, 21 Dec 2021 16:55:23 +0800https://zfunnily.github.io/2021/12/music/概述 今天给我的个人博客加了个暗模式,这样可以在晚上阅读博客的时候不伤害眼睛。突然想到如果在阅读博客的时候可以听听音乐就更好了。 于是在github上找到了一个开源的项目MetingJS,看最后一次comBlog | 网站暗模式https://zfunnily.github.io/2021/12/dark/Tue, 21 Dec 2021 11:05:00 +0800https://zfunnily.github.io/2021/12/dark/Wordpress 如果你的网站是wordpress,则可以参考以Darkmode.js为基础的插件: blackout-darkmode-widget darkmode Nuxt.js 如果你正在使用Nuxt.js,则可以使用下面的模块 nuxtjs-darkmode-js-module 快速使用 使用Darkmode.js给网站快速部署上暗/浅色Openresty三 | 上传文件https://zfunnily.github.io/2021/12/openresty-upload/Wed, 08 Dec 2021 16:42:17 +0800https://zfunnily.github.io/2021/12/openresty-upload/上传文件接口 nginx.conf 的server 增加一个location: location /upload { resolver 8.8.8.8 ipv6=off; content_by_lua_file lua/upload.lua; } upload.lua lua -- upload.lua --========================================== -- 文件上传 --========================================== local chunk_size = 4096 local form, err = upload:new(chunk_size) if not form then ngx.log(ngx.ERR, &#34;failed to new upload: &#34;, err) ngx.exit(ngx.HTTP_INTERNAL_SERVER_ERROR) end form:set_timeout(1000) -- 文件保存的根路径 local saveRootPath = &#34;./download/&#34; -- 保存的文件对象 local fileToSave --文件是否成Webrtc二 | 共享桌面https://zfunnily.github.io/2021/11/webrtcdesk/Mon, 15 Nov 2021 11:23:24 +0800https://zfunnily.github.io/2021/11/webrtcdesk/环境 Ubuntu18.04 webrtc M84 改造peerconnection例子,用来实现桌面共享 改造类CapturerTrackSource 增加桌面的数据源类RcrtcDesktopCapturerTrackSource 继承webrWebrtc一 | peerconnectionhttps://zfunnily.github.io/2021/11/webrtcpeerconnection/Sun, 14 Nov 2021 16:20:31 +0800https://zfunnily.github.io/2021/11/webrtcpeerconnection/环境 Ubuntu18.04 webrtc M84 国内镜像:https://webrtc.org.cn/mirror/ webrtc交互过程 通过peerconnection的例子来分析webrtc的交互流程 peer_connection 解析 为了便于管理,如编码,回显等,Go-libp2p四 | 穿透NAThttps://zfunnily.github.io/2021/11/gop2pfour/Sun, 07 Nov 2021 15:49:46 +0800https://zfunnily.github.io/2021/11/gop2pfour/本文目的 上文Go-libp2p三 | relay例子已经分析过relay例子,并解释了两个节点如果通过中继服务进行通信。本文改造relay例子 并让这个服务做如下两件事: 交换两个节点的在交换机上的信息,帮助Blog | 随机名人名言https://zfunnily.github.io/2021/11/randomquotes/Fri, 05 Nov 2021 15:50:16 +0800https://zfunnily.github.io/2021/11/randomquotes/本文目的 我的个人博客已经搭建好了,使用的hugo+飞雪的主题。我看到有些博客上有些随机的名人名言,但是这个主题没有。遂自己写一个。 根据飞雪的主题自定义 飞雪主题的github: https://github.com/flysnow-org/maupassant-hugo 复制主题里的文件themGo-libp2p三 | relay例子https://zfunnily.github.io/2021/10/gop2pthree/Sun, 31 Oct 2021 10:13:40 +0800https://zfunnily.github.io/2021/10/gop2pthree/我想做什么 chat和echo两个例子,说明了两个节点之间的通信需要两节点在同一个局域网内,或者有一个节点有公网。 如果我两个节点分别在两个NAT下面, 都在各自的局域网内,则需要有一个中继服务,这个服务做Go-libp2p二 | echo例子https://zfunnily.github.io/2021/10/gop2ptwo/Fri, 29 Oct 2021 11:15:42 +0800https://zfunnily.github.io/2021/10/gop2ptwo/go-libp2p的echo例子分析 进入目录go-libp2p/examples/echo/, 编译 go build 先看README.md, 可以了解到使用echo的方式: 终端B $ ./echo -l 3001 2021/10/28 11:25:33 I am /ip4/127.0.0.1/tcp/3001/p2p/QmTu8sxDi3fSjz9ZMvkAj3qA9YAoGskroEnyLz2ZvfTBhX 2021/10/28 11:25:33 listening for connections 2021/10/28 11:25:33 Now run &#34;./echoGo-libp2p一 | chat例子https://zfunnily.github.io/2021/10/gop2pone/Thu, 28 Oct 2021 14:40:02 +0800https://zfunnily.github.io/2021/10/gop2pone/代码下载 git clone https://github.com/libp2p/go-libp2p.git chat实例分析 进入目录go-libp2p/examples/chat/, 编译 go build 先看README.md, 可以了解到使用chat的方式 在节点 B $ ./chat -sp 3001 2021/10/28 11:01:25 Run &#39;./chat -d /ip4/127.0.0.1/tcp/3001/p2p/QmXgEXt4CiqmVmDhPPQnyVkoj3Bsx3Nggq57PPsk5tLNTs&#39; on another console. 2021/10/28 11:01:25 You can replace 127.0.0.1 with public IPBlog | 新的开始https://zfunnily.github.io/2021/10/blogmigration/Fri, 22 Oct 2021 19:01:20 +0800https://zfunnily.github.io/2021/10/blogmigration/迁移博客 我是从18年开始写一些东西,先写在看云笔记上,后面东西越来越多。写出来的东西比较零散. 20年下半年入职新公司,开始在csdn上写博客,今年我准备尝试使用个人博客,hugo和gitPage结合部Skynet源码赏析四 | 消息调度https://zfunnily.github.io/2021/10/four/Thu, 21 Oct 2021 10:06:39 +0800https://zfunnily.github.io/2021/10/four/服务间消息流转 发送消息 数据结构message_queue *q是次级消息队列,每个服务都有与之绑定的唯一一个次级消息队列。当我们在lua层,调用skynet.send(...), 或者调用skynet.cSkynet源码赏析三 | 服务启动https://zfunnily.github.io/2021/10/skynetthree/Wed, 20 Oct 2021 11:26:07 +0800https://zfunnily.github.io/2021/10/skynetthree/skynet启动一个C服务 查看怎么启动C服务的最好的办法是打断点,看源码。 启动logger日志服务 我拿日志服务来举例子,怎么启动日志服务的呢? 传参数name = &quot;logger&quot;, param = null, struct skynet_context *ctx = skynet_context_new(config-&gt;logservice, config-&gt;logger);; 从moduleSkynet源码赏析二 | 基础数据结构https://zfunnily.github.io/2021/10/skynettwo/Tue, 19 Oct 2021 18:47:45 +0800https://zfunnily.github.io/2021/10/skynettwo/module管理模块 我们所写的C服务编译成.so文件后放在cpath变量路径下,程序会加载路径cpath = root..&quot;cservice/?.so&quot;下的.so文件,通过staticSkynet源码赏析一 | 启动初始化的过程https://zfunnily.github.io/2021/10/skynetone/Tue, 19 Oct 2021 17:28:45 +0800https://zfunnily.github.io/2021/10/skynetone/入口文件 skynet_main.c 加载配置 struct skynet_config config; config.thread = optint(&#34;thread&#34;,8); config.module_path = optstring(&#34;cpath&#34;,&#34;./cservice/?.so&#34;); config.harbor = optint(&#34;harbor&#34;, 1); config.bootstrap = optstring(&#34;bootstrap&#34;,&#34;snlua bootstrap&#34;); config.daemon = optstring(&#34;daemon&#34;, NULL); config.logger = optstring(&#34;logger&#34;, NULL); config.logservice = optstring(&#34;logservice&#34;, &#34;logger&#34;); config.profile = optboolean(&#34;profile&#34;, 1); 从上述代码可以看到,配置都已经加载到变量struct skynet_config config;中了。 初始化 初始化skynet_context管Golang | 调用带有后台进程shell脚本可能会被挂起https://zfunnily.github.io/2021/10/shell/Wed, 13 Oct 2021 17:15:45 +0800https://zfunnily.github.io/2021/10/shell/起因 今天用Golang写一个调用外部shell脚本的程序,使用 exec.Command方法,这段脚本代码中包含了一个后台任务语句。 结果发生了一个问题:cmd.Output 始终不会返回,一直挂起。导致我FPS游戏 | 实现移动功能https://zfunnily.github.io/2021/09/move/Sun, 12 Sep 2021 20:43:34 +0800https://zfunnily.github.io/2021/09/move/三种实现FPS Controller的区别 Transform Translate 允许移动物理,但无物理碰撞 Rigid body + Capsule Collider 符合物理学 不会鬼穿墙 无法滞空运动 可与Physics Object 交互 Charactor Controller 不会鬼穿墙 提供的API相对多 无法与Physic objects免费Musichttps://zfunnily.github.io/2021/09/music/Wed, 08 Sep 2021 14:47:14 +0800https://zfunnily.github.io/2021/09/music/介绍一个可以免费听音乐的方法 环境 docker mac 安装 $ docker run -d -p 264:264 -p 9000:9000 -v $dir_name:/var/www/html/cache --name music oldiy/music-player-docker $dir_name 是 你自己宿主机的目录。可以自定义 访问:127.0.0.1:264 就可以放心使用, 同事推荐的,贼好用。Unity3D | Transform类https://zfunnily.github.io/2021/09/transform/Tue, 07 Sep 2021 15:55:59 +0800https://zfunnily.github.io/2021/09/transform/Transform类 在unity中,把transform类理解为,transform类是在每个对象生成时自动附加的一个类。在Unity的视图中,点击Hierarchy中的对象,就可以在InspectoVim | 切换模式/输入法https://zfunnily.github.io/2021/09/vimchange/Tue, 07 Sep 2021 10:46:58 +0800https://zfunnily.github.io/2021/09/vimchange/vim 在退出输入模式的时候切换为原来的输入法 在敲代码的时候使用我们使用的英文,当遇到问题,我们需要搜索引擎的时候需要中文输入法,这个时候,自动切换输入法可以帮助我们节省手动切换输入法的时间。 跟编辑器结合,Linux | Screenhttps://zfunnily.github.io/2021/09/screen/Tue, 07 Sep 2021 10:02:16 +0800https://zfunnily.github.io/2021/09/screen/screen命令 screen 是一个非常有用的命令。应用场景: 单个 SSH 会话中使用多个 shell 窗口(会话)的能力 服务器开发,一个单独运行进程的窗口。可以避免单独再开一个窗口。 &hellip; screen使用 创建一个窗口 $ screen -S name 执行自己需Centos7.2 | gcc4.8升级为4.9https://zfunnily.github.io/2021/09/upgradegcc/Wed, 01 Sep 2021 18:13:41 +0800https://zfunnily.github.io/2021/09/upgradegcc/环境 CentOS 7.2.1511 Docker 我是用 docker 拉取镜像 CentOS 7.2.1511, 利用容器来作为我的开发环境。有条件的也可以用虚拟机或者实体机器。原理都一样。 $ docker $ yum update &amp;&amp; yum install gcc gcc-c++ make zlib-devel.x86_6 下载依赖包 升级 gcc, 下载安装包下载依赖。 $ wget http://ftp.gnu.org/gnu/gcc/gcc-4.9.3/gcc-4.9.3.tar.bz2 $ tar xfv gcc-4.9.3.tar.bz2 &amp;&amp; cd gcc-4.9.3 $ ./contrib/download_prerequisites 如果Shell | Except 使用https://zfunnily.github.io/2021/08/except/Mon, 30 Aug 2021 17:13:33 +0800https://zfunnily.github.io/2021/08/except/Except 参数 spawn 交互程序开始后面跟命令或者指定程序 expect 获取匹配信息匹配成功则执行expect后面的程序动作 send exp_send 用于发送指定的字符串信息 exp_continue 在expect中多次匹配就需要用到 send_user 用来打印输出 相当于shell中的echUnity3D | UGUIhttps://zfunnily.github.io/2021/08/ugui/Fri, 20 Aug 2021 14:15:41 +0800https://zfunnily.github.io/2021/08/ugui/Text Text的属性 在 Unity 的 Hierarchy 面板上右键–&gt;UI–&gt;Text, 在 Inspector 面板上查看属性 属性 功能 Text 需要显示的文本 Font 显示文本的字体 如:微软雅黑,宋体等 Font Style 显示文本的样式,有普通,粗体,斜体,粗体和斜体四种Golang | redis实现分布式锁https://zfunnily.github.io/2021/06/distribute/Thu, 03 Jun 2021 16:12:21 +0000https://zfunnily.github.io/2021/06/distribute/概述 网上有很多Golang操作redis的例子,我使用github.com/gomodule/redigo/redis包写一个关于redis分布式锁的问题。 redis分布式锁 锁需要的几个组件 获取锁- 删Golang | redishttps://zfunnily.github.io/2021/06/goredis/Thu, 03 Jun 2021 15:57:14 +0800https://zfunnily.github.io/2021/06/goredis/概述 网上有很多golang操作redis的例子,我使用github.com/gomodule/redigo/redis包写一个关于redis分布式锁的问题。 redis分布式锁 锁需要的几个组件 获取锁 删除Lua | next的使用https://zfunnily.github.io/2021/05/lua_next/Mon, 10 May 2021 16:39:50 +0800https://zfunnily.github.io/2021/05/lua_next/lua_next lua_next(L,index):先把 表(lua栈 index所指的表), 的当前索引弹出,再把table 当前索引的值弹出,也就是先弹出 table的索引,再弹出table索引的值 举例: local t = { [&#34;a&#34;] = 1, [&#34;b&#34;]Lua | APIhttps://zfunnily.github.io/2021/05/settopandpop/Mon, 10 May 2021 15:57:03 +0800https://zfunnily.github.io/2021/05/settopandpop/lua_pop和lua_settop lua_settop 我们直接来看lua_settop,文档解释 /* 设置栈的高度,如果之前的栈顶比新设置的更高,那么高出来的元素会被丢弃,反之压入nil来补足大小 假设栈里有2个元素。 如果Hugohttps://zfunnily.github.io/2021/04/hugo/Sat, 17 Apr 2021 00:00:00 +0000https://zfunnily.github.io/2021/04/hugo/hugo 我用过的静态博客有hexo、jekyll和hugo,对比起来,hugo虽然没有hexo那样丰富的插件和主题,但是hugo生成文章的速度更快。我是一名go语言爱好者,而hugo是go语言开发的, jekGolang | gomod拉取私有仓库https://zfunnily.github.io/2021/03/gomod/Tue, 23 Mar 2021 16:10:02 +0000https://zfunnily.github.io/2021/03/gomod/概述 在使用go mod的过程中,依赖的包往往是第三方库,当我们自定义一个包并且放在github.com私有仓库时候,按照原来的方法则会有如下问题。 get &#34;gitlab.com/xxx/zz&#34;: found meta tag get.metaImport{Prefix:&#34;gitlab.com/xxx/zz&#34;, VCS:&#34;git&#34;, RepoRoot:&#34;https://gitlab.com/xxx/zz.git&#34;} at //gitlab.com/xxx/zz?go-get=1 verifying gitlab.com/xxx/zz@v0.0.1: gitlab.com/xxx/zz@v0.0.1: reading https://sum.golang.org/lookup/gitlab.com/xxx/zz@v0.0.1: 410 Gone 这个错误是因为新版本g八个基础排序https://zfunnily.github.io/2021/03/sort/Tue, 23 Mar 2021 10:13:31 +0000https://zfunnily.github.io/2021/03/sort/sort排序 std::sort( )函数是库函数提供的排序函数,必须包括头文件#include &lt;algorithm&gt;,它使用的排序方法是类似于快排的方法,时间复杂度为n*log2(n) Sort函数有三个参数:《仙剑奇侠传》编译运行https://zfunnily.github.io/2021/03/gamexian/Sun, 21 Mar 2021 10:44:58 +0000https://zfunnily.github.io/2021/03/gamexian/概述 今天在github上找到了《仙剑奇侠传》的rpg单机游戏sdlpal,sdlpal 是一个开源项目,基于sdl把仙剑奇侠传重写了一遍。 下面是我的编译过程总结。 环境 win10- sdl1.2- sdlpal- vs2017- DirectX SDK10 下载sdlpal $ git clone https://github.com.cnpmjs.org/sdlpal/sdlpal.git实现atoi和itoa函数https://zfunnily.github.io/2021/03/atoianditoa/Wed, 17 Mar 2021 16:43:20 +0000https://zfunnily.github.io/2021/03/atoianditoa/题目1: 把字符串转化为整数 有整数字符串,&quot;13579&quot;, 和 &quot;246810&quot;. 请写一个函数把这两个字符串转化为整数 步骤: 先判断正负 遍历字符串,转换字符为整数 //atoi.cc #include &lt;stdio.h&gt; int my_atoi(char *str) { bool bmin = false; int result = 0; //先判断正协程解析二 | 云风的coroutinehttps://zfunnily.github.io/2021/03/coroutinetwo/Wed, 10 Mar 2021 11:11:47 +0000https://zfunnily.github.io/2021/03/coroutinetwo/概述 云风的coroutine是通过ucontext来控制程序运行时上下文的,我们来根据该库提供的几个接口,和一个demo来解释协程的运行原理。如果不了解ucontext的,建议先了解ucontxt 环境协程解析一 | ucontexthttps://zfunnily.github.io/2021/03/coroutineone/Tue, 09 Mar 2021 09:43:00 +0000https://zfunnily.github.io/2021/03/coroutineone/概述 最近在研究协程的实现原理,看了云风的coroutine和腾讯的开源库libco后,原来要实现一个协程库也没那么难。我先来讲讲云风的coroutine库。他使用的是 uncontext来保存程序运行上关于我https://zfunnily.github.io/about/Sun, 28 Feb 2021 00:00:00 +0000https://zfunnily.github.io/about/我是谁 我是一名游戏从业者, 目前在一家公司做游戏后端的工作。 地址 浙江杭州滨江区 Email 582132116@qq.com 技能 skynet框架+lua脚本 &ndash; 游戏后端 C/C++ &ndash; IM服务器 Golang &ndash; 后端Golang | 定时器https://zfunnily.github.io/2021/02/timer/Thu, 25 Feb 2021 16:02:13 +0000https://zfunnily.github.io/2021/02/timer/概述 golang有三种方式实现定时器: ticker timer select Ticker 通过 time.NewTicker(d)的方式实现定时器 d := time.Duration(time.Second * 2) t1 := time.NewTicker(d) defer t1.Stop() go func() { for { &lt;- t1.C fmt.Println(&#34;NewTicker...&#34;) } }() Timer 通过 time.NewTimer(d)的方式实现定时器 t2 := time.NewTimer(d)Lua | 解决百元买鸡的问题https://zfunnily.github.io/2021/02/chicken/Wed, 24 Feb 2021 17:51:46 +0000https://zfunnily.github.io/2021/02/chicken/问题 编写lua程序求解百鸡百钱问题。公鸡5元一只,母鸡3元一只,小鸡一元3只,问100元钱买100只鸡,可买公鸡、母鸡、小鸡各多少只? 代码 ----------------------------------------------------------------------------- --公鸡5元一只,母鸡3元一只,小鸡一元3只,问100元钱买Golang | JWT身份认证https://zfunnily.github.io/2021/02/JWT/Wed, 24 Feb 2021 14:22:04 +0000https://zfunnily.github.io/2021/02/JWT/概述 最近要在http接口上加一个token认证,但是接口很多,有没有一个省时省力的办法来解决。token的使用流程是: 用户使用帐号密码登陆到服务器1. 服务器验证登陆成功,根据帐号密码生成token。把Lua | 调用C/C++的动态库https://zfunnily.github.io/2021/02/dynamic/Sat, 20 Feb 2021 11:11:51 +0000https://zfunnily.github.io/2021/02/dynamic/概述 最近在学习 云风的skynet库,想自定义一个模块,目标是使用lua调用C/C++所编写的库。 当我们需要在Lua里面调用c/c++函数时,所有的函数都必须满足以下函数签名: typedef int (*lua_CFunction) (lua_State *L); 换句话说,所有的汇编 | C/C++调用汇编https://zfunnily.github.io/2021/02/compilation/Mon, 01 Feb 2021 14:40:51 +0000https://zfunnily.github.io/2021/02/compilation/概述 我使用AT&amp;T的规范,在linux上完成 C和汇编的互相调用,并使用gcc编译成可执行文件。 目标:汇编函数提供输出。类似C语言的函数 void hello_world(char* value) { printf(value); } 提供给C语言调用: int main() { hello_world(&#34;hello world!\n&#34;); } 搭建AT&amp汇编 | AT&T和Intel规范的区别https://zfunnily.github.io/2021/01/attandintel/Sun, 31 Jan 2021 11:25:39 +0000https://zfunnily.github.io/2021/01/attandintel/概述 常见的指令集以及汇编语言规范: x86(IA-32)、x86-64指令集(常见于PC端),对应有2家公司发布的不同汇编语言规范: intel公司发布的汇编语言规范,称intel 汇编:Windows派系Skynet | lua-protobufhttps://zfunnily.github.io/2021/01/skynetprotobuf/Mon, 25 Jan 2021 14:25:07 +0000https://zfunnily.github.io/2021/01/skynetprotobuf/概述 在最新的skynet中我使用的是云风的pbc库来解析protobuf,该项目中的一个文件protobuf.lua 使用了module语法在lua5.1版本中已经删除,最新的skynet是lua5.4Protobuf | 请求参数为空的案例https://zfunnily.github.io/2021/01/pbempty/Fri, 22 Jan 2021 16:41:16 +0000https://zfunnily.github.io/2021/01/pbempty/参数为空的grpc请求怎么定义 google protobuf已经提供了空参数 //empty.proto message Empty {&lt;!-- --&gt;} 使用方法,在proto文件中导入empty.proto, 定义一个请求参数和返回值为空的函数emptyfunction, 函数名字Golang | C数组转化为Golang的切片类型https://zfunnily.github.io/2021/01/goslience/Fri, 22 Jan 2021 15:56:40 +0000https://zfunnily.github.io/2021/01/goslience/概述 最近在巩固cgo的基础知识,在网上看到一篇Go和C之间 字符串数组、切片类型转换的文章,让我想到我之前写的一篇在go中遍历C结构体数组的文章,让我有新的方法来解决之前的问题,把C的数组转化为Go的切Skynet | echo服务https://zfunnily.github.io/2021/01/skynetecho/Fri, 15 Jan 2021 16:07:51 +0000https://zfunnily.github.io/2021/01/skynetecho/概述 引用云风博客的话:“skynet 是一个为网络游戏服务器设计的轻量框架。但它本身并没有任何为网络游戏业务而特别设计的部分,所以尽可以把它用于其它领域。skynet 并不是一个开箱即用的引擎,使用它需要Redis源码分析 | ziplisthttps://zfunnily.github.io/2021/01/ziplist/Wed, 13 Jan 2021 17:52:27 +0000https://zfunnily.github.io/2021/01/ziplist/概述 Redis中的List是一个有序(按加入的时序排序)的数据结构,一般有序我们会采用数组或者是双向链表,其中双向链表由于有前后指针实际上会很浪费内存。3.2版本之前采用两种数据结构作为底层实现: 压缩Redis源码解析 | VScode调试https://zfunnily.github.io/2021/01/vscodedebugredis/Tue, 12 Jan 2021 14:25:29 +0000https://zfunnily.github.io/2021/01/vscodedebugredis/环境 vscode- gcc5.4 ubuntu16.04 或者 ubuntu18.04 make 下载6.2版本. 我使用的是国内github镜像地址:github.com.cnpmjs.org,速度比较快。 $ git clone https://github.com.cnpmjs.org/redis/redis.git redis $ git checkout -b 6.2 remotes/origin/6.2 vscode不参与编译,只充当可视化的调试工具。 使用VScode | 调试Redis源码,指针显示的问题https://zfunnily.github.io/2021/01/vscoderedis/Tue, 12 Jan 2021 14:17:22 +0000https://zfunnily.github.io/2021/01/vscoderedis/缘由 使用VScode的时候,断点看到指针显示的是一串地址,而不是指针指向的对象的值。上网找了一圈,没看到vscode有对应的插件来解决这个问题。vscode有对应的语法来解决这个问题。 网上几乎都在说在Cgo | 遍历C结构体数组https://zfunnily.github.io/2021/01/cgostruct/Mon, 11 Jan 2021 17:18:35 +0000https://zfunnily.github.io/2021/01/cgostruct/缘由 现在有个应用场景,我们要在go中获取C结构体数组中的值。在C语言中,对于结构体数组,我们可以利用指针的偏移量来获取我们想要的值的位置。在go中我们怎么使用C指针和偏移量进行运算呢?下面的文字中C指Redis源码解析 | sdshttps://zfunnily.github.io/2021/01/sds/Wed, 06 Jan 2021 14:20:23 +0000https://zfunnily.github.io/2021/01/sds/SDS头文件及作用 sds.h: sds声明- sdsalloc.h: 为sds分配内存 源码文件sds.h中有这样一行代码 typedef char *sds; 很清晰、明了,sds其实就是char*。 最新的6.2分支的代码: struct __attribute__ ((__packed__)) sdshdr5 {&lt;!-- --&gt; unsigned char flags; /* 3 lsb ofstruct中使用char[]https://zfunnily.github.io/2021/01/chararray/Tue, 05 Jan 2021 15:45:36 +0000https://zfunnily.github.io/2021/01/chararray/缘由 最近在看redis的源码,刚开始看sds,看到这块代码 struct __attribute__ ((__packed__)) sdshdr5 { unsigned char flags; /* 3 lsb of type, and 5 msb of string length */ char buf[]; }; 好奇为什么使用 char buf[],而不用char *buf,找到答案记录一下。 struct中的char*Lastbattle | 游戏场景服务器SS解析https://zfunnily.github.io/2021/01/lastbattle/Sat, 02 Jan 2021 23:19:58 +0000https://zfunnily.github.io/2021/01/lastbattle/游戏场景服务器概况 指令对应的处理handle的文件:SSBattleMgr.cpp 创建战场 指令: eMsgToSSFromCS_CreateBattle GC服务器发往SS fromCS 收到中心服务器CS创建站场的指令,在函数INT32 CSSBattleMgr::OnMsgFromCS_CreateBattle(const char* pData, int n32DataLengtCCnet | 单线程reactor演变为多线程https://zfunnily.github.io/2020/12/ccnet/Wed, 30 Dec 2020 09:19:41 +0000https://zfunnily.github.io/2020/12/ccnet/ccnet从单线程演变为多线程 ccnet现状: epoll linux平台 事件循环 单线程 reactor 监听和新连接的事件都在主线程中 单线程的ccnet ccnet的单线程的角色: EventLoop: 整个事件循环。 EPollPoller: 负责事件的收集。 ChannelGolang | sync.Mutex详解https://zfunnily.github.io/2020/12/syncmutex/Tue, 29 Dec 2020 13:17:18 +0000https://zfunnily.github.io/2020/12/syncmutex/概述 自己做的一个golang项目需要优化,优化方向是减少gpu内存的使用。同一个模型被重复加载多次,使用更多的gpu内存,也增加 sync.Mutex的使用。 优化的方向是: 减少代码量的改动- 减少gpu内五种网络IO模型总结https://zfunnily.github.io/2020/12/iomodels/Mon, 28 Dec 2020 11:57:04 +0000https://zfunnily.github.io/2020/12/iomodels/概述 在网络上看到很多关于阻塞IO、非阻塞IO、同步IO、异步IO的例子,总觉得写的过于复杂并且让人难以理解。于是我把我自己把这几个概念的理解写下来以供参考。 POSIX POSIX(可移植操作系统接口)把同步IOCCnet | 一个reactor单线程网络库https://zfunnily.github.io/2020/12/ccnetone/Sun, 27 Dec 2020 18:41:25 +0000https://zfunnily.github.io/2020/12/ccnetone/缘由 最近在研究陈硕的网络库muduo,是一个基于reactor架构的网络库。我对网络库的感觉是易用,但是内容庞大,依赖颇多。比如boost网络库里面的一些语法让人生畏。关于reactor和proactC++ | vector中的resize()函数 VS reserve()函数https://zfunnily.github.io/2020/12/reserve/Fri, 25 Dec 2020 11:04:29 +0000https://zfunnily.github.io/2020/12/reserve/reserve void reserve (size_type n); reserver函数用来给vector预分配存储区大小,即capacity的值 ,但是没有给这段内存进行初始化。reserve 的参数n是推荐预分配内存的大小,实际分配的可能等于或大于这个值,即Golang | 用gocolly登录B站https://zfunnily.github.io/2020/12/gocolly/Sun, 13 Dec 2020 14:51:53 +0000https://zfunnily.github.io/2020/12/gocolly/概述 gocolly是golang语言开发的爬虫包,通过gocolly来进行模拟网站的登录, 目标已经确立,开始行动。 下载 $ go get -u github.com/gocolly/colly 获取cookie 登录网站:https://www.bilibili.coProtobuf | 沾包问题https://zfunnily.github.io/2020/12/tcp/Sun, 13 Dec 2020 10:22:38 +0000https://zfunnily.github.io/2020/12/tcp/缘由 最近在研究一款游戏的源码。发现里面的通信协议是protobuf定义的,但还是自己定义了协议头部,类似 head + body。先解析头部里所存储的整个包的数据长度,然后再解析包剩余的数据,这样做的目的是为了防Grpc | 概述https://zfunnily.github.io/2020/12/grpc/Sun, 13 Dec 2020 09:10:42 +0000https://zfunnily.github.io/2020/12/grpc/OverView gRPC是由Google主导开发的RPC框架,使用HTTP/2协议并用ProtoBuf作为序列化工具。其客户端提供Objective-C、Java接口,服务器侧则有Java、Golang、C++等接Ubuntu16.04.6 | 安装Cinnamon3.0https://zfunnily.github.io/2020/12/cinnamon3.0/Tue, 01 Dec 2020 15:43:58 +0000https://zfunnily.github.io/2020/12/cinnamon3.0/概述 Cinnamon[1]是Linux Mint[2]的默认桌面环境。不同于 Ubuntu 的 Unity 桌面环境,Cinnamon 是一个更加传统而优雅的桌面环境,其带有底部面板和应用菜单。由于 Cinnamon 桌面以及它类 Windows 的用户界面,许多Ubuntu | version `GLIBC_2.27‘ not found错误https://zfunnily.github.io/2020/11/glibcnotfound/Sat, 28 Nov 2020 15:03:04 +0000https://zfunnily.github.io/2020/11/glibcnotfound/version `GLIBC_2.27’ not found错误 执行strings /lib/x86_64-linux-gnu/libc.so.6 | grep GLIBC_ 结果显示如下: GLIBC_2.2.5 GLIBC_2.2.6 GLIBC_2.3 GLIBC_2.3.2 GLIBC_2.3.3 GLIBC_2.3.4 GLIBC_2.4 GLIBC_2.5 GLIBC_2.6 GLIBC_2.7 GLIBC_2.8 GLIBC_2.9 GLIBC_2.10 GLIBC_2.11 GLIBC_2.12 GLIBC_2.13 GLIBC_2.14 GLIBC_2.15 GLIBC_2.16 GLIBC_2.17 GLIBC_2.18 GLIBC_2.22 GLIBC_2.23 GLIBC_2.24 GLIBC_PRIVATE 去清华开源站点下载glibc: https://mirrors.tuna.tsinghua.edu.cn/gnu/libc/ 下载好文件后解压 $ tar -zxvf glibc-2.27.tar.gz 进入 glibc-2.27 目录,Docker | 容器退出码详解https://zfunnily.github.io/2020/11/Docker%E5%AE%B9%E5%99%A8%E9%80%80%E5%87%BA%E7%A0%81%E8%AF%A6%E8%A7%A3/Sat, 28 Nov 2020 13:32:57 +0000https://zfunnily.github.io/2020/11/Docker%E5%AE%B9%E5%99%A8%E9%80%80%E5%87%BA%E7%A0%81%E8%AF%A6%E8%A7%A3/docker查看退出码指令 $ docker ps --filter &#34;status=exited&#34; $ docker inspect container-id --format=&#39;{&lt;!-- --&gt;{.State.ExitCode}}&#39; 常见退出码 Exit Code 0 退出代码0表示特定容器没有附加前台进程。 该退出代码是所有其他后续退出代码的例外。 这不一定意味着发生了不好的事情。如果开发人员想要在容器完Openresty二 | postman小工具https://zfunnily.github.io/2020/11/%E4%BD%BF%E7%94%A8OpenResty%E5%81%9A%E4%B8%80%E4%B8%AApostman%E5%B0%8F%E5%B7%A5%E5%85%B7/Wed, 25 Nov 2020 16:30:39 +0800https://zfunnily.github.io/2020/11/%E4%BD%BF%E7%94%A8OpenResty%E5%81%9A%E4%B8%80%E4%B8%AApostman%E5%B0%8F%E5%B7%A5%E5%85%B7/用到的知识点 mvc架构 模型渲染库:https://github.com/bungle/lua-resty-template resty http请求库: https://github.com/bungle/lua-resty-template 参照 mvc模型来做postman工具 配置文件说明 worker_processes 1; error_log logs/error.log; eventsOpenresty一 | 初探https://zfunnily.github.io/2020/11/OpenResty%E5%88%9D%E6%8E%A2/Mon, 23 Nov 2020 16:21:34 +0800https://zfunnily.github.io/2020/11/OpenResty%E5%88%9D%E6%8E%A2/概述 OpenResty®是一个基于Nginx与 Lua 的高性能 Web 平台,其内部集成了大量精良的 Lua 库、第三方模块以及大多数的依赖项。用于方便地搭建能够处理超高并发、扩展性极高的动态 Web 应用、Web 服务和动态网关。LastBattle | 登录流程(LS & BS & GS)https://zfunnily.github.io/2020/11/lastbattlelogin/Fri, 20 Nov 2020 17:27:08 +0000https://zfunnily.github.io/2020/11/lastbattlelogin/登录流程 根据上一篇文章中的登录流程,我在工程中找到了相应的代码并记录了下来 登录服务代码解析 监听端口:49997 供BS服务连接 监听端口:49996 供客户端连接 CIocpCtrl:IOCP控制类 多线程循环LastBattle | 服务架构https://zfunnily.github.io/2020/11/lastbattleserver/Fri, 20 Nov 2020 17:24:32 +0000https://zfunnily.github.io/2020/11/lastbattleserver/服务器架构简图如下: 连线说明: 实线:表示客户端登录流程,①②③④⑤表示登录流程,详细解释见下文。 虚线:表示服务器间的连接,虚线箭头指向监听方。 架构说明: |英文名称|简称|中文名称|功能简介|单个大区需LastBattle | 安装部署笔记https://zfunnily.github.io/2020/11/lastbattleone/Mon, 16 Nov 2020 06:49:49 +0000https://zfunnily.github.io/2020/11/lastbattleone/环境准备 win10 服务器:vs2010 / 数据库 mysql5.7 清华大学mysql镜像网站:https://mirrors.tuna.tsinghua.edu.cn/mysql/downloads/MySQL-5.7/ 客户端Cgo | 使用libevent库实现一个定时器https://zfunnily.github.io/2020/11/cgo%E4%BD%BF%E7%94%A8libevent%E5%BA%93%E5%AE%9E%E7%8E%B0%E4%B8%80%E4%B8%AA%E5%AE%9A%E6%97%B6%E5%99%A8/Fri, 13 Nov 2020 16:40:42 +0000https://zfunnily.github.io/2020/11/cgo%E4%BD%BF%E7%94%A8libevent%E5%BA%93%E5%AE%9E%E7%8E%B0%E4%B8%80%E4%B8%AA%E5%AE%9A%E6%97%B6%E5%99%A8/使用libevent库作为例子 下载 &amp; 编译 &amp; 安装libevent $ git clone https://github.com.cnpmjs.org/libevent/libevent.git $ cd libevent &amp;&amp; mkdir build &amp;&amp; cd build $ cmake .. $ make libevent实现的定时器 // main.cpp #include &#34;event.h&#34; struct event ev; struct timeval tv; void time_cb(evutil_socket_t fd, short event, void *argc) { printf(&#34;timer wakeup\n&#34;); event_add(&amp;ev, &amp;tv); // reschedule timer } int main() { struct event_base *base = event_base_new(); tv.tv_sec = 2;Golang | 利用指针进行数据转换https://zfunnily.github.io/2020/11/Golang-%E5%88%A9%E7%94%A8%E6%8C%87%E9%92%88%E8%BF%9B%E8%A1%8C%E6%95%B0%E6%8D%AE%E8%BD%AC%E6%8D%A2/Thu, 12 Nov 2020 17:19:07 +0000https://zfunnily.github.io/2020/11/Golang-%E5%88%A9%E7%94%A8%E6%8C%87%E9%92%88%E8%BF%9B%E8%A1%8C%E6%95%B0%E6%8D%AE%E8%BD%AC%E6%8D%A2/概述 在Go语言中,Slice本质是什么呢?是一个reflect.SliceHeader结构体和这个结构体中Data字段所指向的内存。String本质是什么呢?是一个reflect.StringHeadGolang | buildshttps://zfunnily.github.io/2020/11/go-builds/Thu, 12 Nov 2020 17:15:17 +0000https://zfunnily.github.io/2020/11/go-builds/概述 通常我们会给每个产品环境设置不同的配置,比如 redis 要在开发环境就连接 localhost:6379,测试环境可能连接某一个主机的 redis。 如果放在 go 里面是否可行?因为 go 是编译二进制包,也没有动态加载这Cgo | 简单使用https://zfunnily.github.io/2020/11/cgo%E7%9A%84%E7%AE%80%E5%8D%95%E4%BD%BF%E7%94%A8/Thu, 05 Nov 2020 09:45:23 +0000https://zfunnily.github.io/2020/11/cgo%E7%9A%84%E7%AE%80%E5%8D%95%E4%BD%BF%E7%94%A8/使用自己的C函数 文件名:testC.go package main /* #include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; void c_print(char *str) { printf(&#34;%s\n&#34;, str); } */ import &#34;C&#34; //import “C” 必须单起一行,并且紧跟在注释行之后 import &#34;unsafe&#34; func main() { s := &#34;Hello Cgo&#34; cs := C.CString(s) //字符串映射 C.c_print(cs) //调用C函数 defer C.free(unsafe.Pointer(cs)) //释放内存 } 说明: 1、gGolang | 使用Lumberjack+zap进行日志切割归档https://zfunnily.github.io/2020/11/%E4%BD%BF%E7%94%A8Lumberjack-zap%E8%BF%9B%E8%A1%8C%E6%97%A5%E5%BF%97%E5%88%87%E5%89%B2%E5%BD%92%E6%A1%A3/Wed, 04 Nov 2020 12:44:03 +0000https://zfunnily.github.io/2020/11/%E4%BD%BF%E7%94%A8Lumberjack-zap%E8%BF%9B%E8%A1%8C%E6%97%A5%E5%BF%97%E5%88%87%E5%89%B2%E5%BD%92%E6%A1%A3/使用Lumberjack+zap进行日志切割归档 为了添加日志切割归档功能,我们将使用第三方库Lumberjack来实现。 安装 执行下面的命令安装Lumberjack go get -u github.com/natefinch/lumberjack zap logger中加入LumbeVim | vimplus快捷键https://zfunnily.github.io/2020/10/vimplus%E5%BF%AB%E6%8D%B7%E9%94%AE/Wed, 28 Oct 2020 09:14:28 +0000https://zfunnily.github.io/2020/10/vimplus%E5%BF%AB%E6%8D%B7%E9%94%AE/插件相关 |快捷键|说明 |&mdash;&mdash; |,|Leader Key |&lt;leader&gt;n|打开 / 关闭代码资源管理器 |&lt;leader&gt;t|打开 / 关闭函数列表 |&lt;leader&gt;a|.h .cpp 文件切换 |&lt;leader&gt;u|转到函数声明 |&Vim | 打造编C++IDEhttps://zfunnily.github.io/2020/10/%E4%BD%BF%E7%94%A8vim%E6%89%93%E9%80%A0%E7%BC%96C-IDE/Wed, 28 Oct 2020 09:11:32 +0000https://zfunnily.github.io/2020/10/%E4%BD%BF%E7%94%A8vim%E6%89%93%E9%80%A0%E7%BC%96C-IDE/使用 vimplus 打造C++ IDE GitHub: https://github.com/chxuan/vimplus 支持平台: macos/linux 安装vimplus // 原来的链接, 国内速度较慢 $ git clone https://github.com/chxuan/vimplus.git ~/.vimplus // github修改为镜像的链接 $ git clone --depth=1 https://github.com.cnpmjs.org/chxuan/vimplus.git ~/.vimplus $ cd ~/.vimplus //不加sudo $ ./install.sh 设置Nerd Font 为防止vimpluLinux | 删除大量文件指令--rsynchttps://zfunnily.github.io/2020/10/linux%E7%B3%BB%E7%BB%9F%E5%88%A0%E9%99%A4%E5%A4%A7%E9%87%8F%E6%96%87%E4%BB%B6%E6%8C%87%E4%BB%A4--rsync/Tue, 13 Oct 2020 16:29:34 +0000https://zfunnily.github.io/2020/10/linux%E7%B3%BB%E7%BB%9F%E5%88%A0%E9%99%A4%E5%A4%A7%E9%87%8F%E6%96%87%E4%BB%B6%E6%8C%87%E4%BB%A4--rsync/rsync的安装 rsync安装,有些系统默认安装有该命令 ubuntu系统 sudo apt-get install rsync centos系统 sudo yum install rsync rsync参数详解 rsync提供了一些跟删除有关的参数 rsync --help | grep delete -del an alias for --delete-during --delete delete extraneous files from destination dirs --delete-before receiver deletes beforeCPU的核与线程-4核8线程https://zfunnily.github.io/2020/10/CPU%E7%9A%84%E6%A0%B8%E4%B8%8E%E7%BA%BF%E7%A8%8B-4%E6%A0%B88%E7%BA%BF%E7%A8%8B/Mon, 12 Oct 2020 16:29:34 +0000https://zfunnily.github.io/2020/10/CPU%E7%9A%84%E6%A0%B8%E4%B8%8E%E7%BA%BF%E7%A8%8B-4%E6%A0%B88%E7%BA%BF%E7%A8%8B/查看cpu信息 $ cat /proc/cpuinfo 物理CPU 物理CPU就是计算机上实际配置的CPU个数。 在linux上可以打开cat /proc/cpuinfo 来查看,其中的physical id就是每个物理CPU的ID,能找到几个physical id就代表TCP/IP | 大量TIME_WAIT对线上业务的影响https://zfunnily.github.io/2020/10/%E5%A4%A7%E9%87%8FTIME_WAIT%E5%AF%B9%E7%BA%BF%E4%B8%8A%E4%B8%9A%E5%8A%A1%E7%9A%84%E5%BD%B1%E5%93%8D/Sat, 10 Oct 2020 16:46:34 +0000https://zfunnily.github.io/2020/10/%E5%A4%A7%E9%87%8FTIME_WAIT%E5%AF%B9%E7%BA%BF%E4%B8%8A%E4%B8%9A%E5%8A%A1%E7%9A%84%E5%BD%B1%E5%93%8D/TCP的三次握手和四次挥手 TIME_WAIT概述 TIME_WAIT 状态: TCP 连接中,主动关闭连接的一方出现的状态;(收到 FIN 命令,进入 TIME_WAIT 状态,并返回 ACK 命令) 保持 2 个 MSL 时间,即,4 分钟 ;(MSL 为 2 分钟) TCP 连接建立后,「主Libevent | 定时器https://zfunnily.github.io/2020/09/libeventimer/Wed, 16 Sep 2020 23:20:28 +0000https://zfunnily.github.io/2020/09/libeventimer/libevent 实现定时器流程 首先初始化libevent库,并保存返回的指针 struct event_base * base = event_init(); 实际上这一步相当于初始化一个Reactor实例;在初始化libevent后,就可以注册事件了。 初始化事件event,设置回调函FFmpeg | 画中画和视频多宫格处理https://zfunnily.github.io/2020/09/ffmpegpicture/Mon, 14 Sep 2020 18:29:33 +0000https://zfunnily.github.io/2020/09/ffmpegpicture/FFmpeg生成画中画 静态画中画 将视频sub.mp4视频文件缩放成宽 480 、高 320 的视频,然后显示在 视频 input.mp4,x坐标为0,y 坐标为0 的位置 ffmpeg -re -i input.mp4 -vf &#34;movie=sub.mp4, scale=480x320[test]; [in][test]overlay [out]&#34; -vcodec libx264 output.flv 显示在画面的右下角,则需要用到FFmpeg | 给视频加文字和图片水印https://zfunnily.github.io/2020/09/ffmpegvideo/Sat, 12 Sep 2020 12:47:57 +0000https://zfunnily.github.io/2020/09/ffmpegvideo/FFmpeg给视频加上logo ffmpeg从视频中截取图像帧 ffmpeg -i inputfile.avi -r 1 -f image2 image-%05d.jpeg ffmpeg -i inputfile.avi -r 1 -s 4cif -f image2 image-%05d.jpeg ffmpeg -i inputfile.avi -r 1 -t 4 -f image2 image-%05d.jpeg ffmpeg -i inputfile.avi -r 1 -ss 01:30:14 -f image2 image-%05d.jpeg ffmpeg -i inputfile.avi -r 1 -ss 01:30:14 -vframes 120 4cif -f image2 image-%05d.jpeg -r 指定抽取的帧率,即从视频中每秒钟抽取FFmpeg | 录制摄像头和桌面数据windowshttps://zfunnily.github.io/2020/09/ffmpegvideow/Wed, 09 Sep 2020 09:36:49 +0000https://zfunnily.github.io/2020/09/ffmpegvideow/概述 FFmpeg Windows 设备操作 Windows 采集设备的主要方式是 dshow vfwcap gdigrab 其中 dshow 可以用来抓 取摄像头、采集卡、麦克风等,- vfwcap 主要用来采集摄像头类设备,- gdigrab 则是抓取 Windows 窗口程序 FFmpeg 使用 dshow 采集音视频设备 使用 dshow 枚举设备 ffmpeg -f dshow -list_devices true -i dymmy 输出 [dshow @ 000002622302e340]FFmpeg | 录制摄像头和桌面数据machttps://zfunnily.github.io/2020/08/macffmpeg/Sat, 29 Aug 2020 17:20:40 +0000https://zfunnily.github.io/2020/08/macffmpeg/设备枚举 查看设备列表 $ ffmpeg -hide_banner -devices Devices: D. = Demuxing supported .E = Muxing supported -- D avfoundation AVFoundation input device D lavfi Libavfilter virtual input device E sdl,sdl2 SDL2 output device 可以看到输入设备有:avfoundation,lavfi 输出设备有:sdl `` 设备采集举例: $ ffmpeg -f avfoundation -list_devices true -i &#34; &#34; 看到了 如下设K8S | Prometheus+Grafana监控https://zfunnily.github.io/2020/08/prometheusgrafana/Mon, 17 Aug 2020 13:58:35 +0000https://zfunnily.github.io/2020/08/prometheusgrafana/概述 作为应用与Kubernetes的监控体系,Prometheus具备诸多的优势,如: Kubernetes默认支持,非常适合容器和微服务- 无依赖,安装方便,上手容易- 社区活跃,它不仅仅是个工具,而是生Owt-server | owt-client-javascripthttps://zfunnily.github.io/2020/08/owt-client-javascript/Sun, 16 Aug 2020 23:04:13 +0000https://zfunnily.github.io/2020/08/owt-client-javascript/概述 天气燥热,不易出门。遂研究一下owt-server,从owt-client-javascript的流程开始吧。 获取一个会议室 owt-client-javascript的时候有一个初始化房间的过程 ///owt-client-javascript/src/samples/conference/samplertcservice.jsK8S | Ingress的基本使用https://zfunnily.github.io/2020/08/ingress/Sat, 15 Aug 2020 00:05:15 +0000https://zfunnily.github.io/2020/08/ingress/缘由 看了statefulset基础教程的基础教程,并且把环境搭建起来后。pod内部是可以连通了。但是我不知道怎么去从外部访问。在网上搜索一番,通过Ingress可以作为集群的入口。遂记录之。 结合StaK8S | Statefluset的持久存储PVChttps://zfunnily.github.io/2020/08/pvc/Fri, 14 Aug 2020 17:18:58 +0000https://zfunnily.github.io/2020/08/pvc/缘由 在看statefluset基础教程的时候遇到pod状态为pending kubectl describe pod web-0 日志内容是 pod has unbound immediate PersistentVolumeClaims 于是就对PV和PVC进行研究。 有给出完整的 web.yaml查看最下面的完整示例。但是我建议先把PVLinux | nsf服务的搭建和使用https://zfunnily.github.io/2020/08/nsf/Fri, 14 Aug 2020 17:17:54 +0000https://zfunnily.github.io/2020/08/nsf/搭建nsf服务 sudo apt install nfs-kernel-server 默认情况下,在Ubuntu 18.04上,NFS版本2是禁用的。版本3和版本4已启用。您可以通过运行以下cat命令来验证: sudo cat /proc/fs/nfsd/versions 写入 exports cat /etc/exports sudo echo /nfs/prometheus/data/ 192.168.84.75/24(rw,no_root_squash,no_all_squash,sync) &gt;&gt; /etc/exports sudo echo /nfs/prometheus/data/ 192.168.84.75/24(rw,no_root_squash,no_all_squash,sync) &gt;&gt; /etc/exports 可以设定的参数主要K8S | StatefulSet基本原理https://zfunnily.github.io/2020/08/statefulset/Fri, 14 Aug 2020 16:03:41 +0000https://zfunnily.github.io/2020/08/statefulset/背景 用户通过 Deployment、ReplicationController 可以方便地在 kubernetes 中部署一套高可用、可扩展的分布式无状态服务。这类应用不在本地存储数据,通过简单的负载均衡策略可实现请求分发。随K8S | coreDNS的部署安装https://zfunnily.github.io/2020/08/coredns/Thu, 13 Aug 2020 18:44:28 +0000https://zfunnily.github.io/2020/08/coredns/概述 CoreDNS可以在具有标准的Kube-DNS的Kubernetes集群中运行。作为Kubernetes 的插件使用,CoreDNS将从 Kubernetes集群中读取区(zone)数据。它实现了为KK8S | 创建第一个应用https://zfunnily.github.io/2020/08/firstk8s/Thu, 13 Aug 2020 15:28:31 +0000https://zfunnily.github.io/2020/08/firstk8s/使用k8s部署第一个应用 创建一个nginx.yaml文件 apiVersion: v1 kind: Pod metadata: name: nginx # 指定 label,便于检索 labels: app: nginx spec: containers: - name: nginx # 指定镜像 image: nginx:alpine # 指定暴露端口 ports: - containerPort: 80 --- # 创建网络服务 apiVersion: v1 kind: Service metadata: name: kube-node-service labels: name: kube-node-service spec: type: NodePort #这里代表Licod | 安装和配置https://zfunnily.github.io/2020/08/licode/Sun, 09 Aug 2020 09:34:36 +0000https://zfunnily.github.io/2020/08/licode/拉取docker镜像并运行 licode官方提供了配置好的docker镜像,使用以下命令拉下来跑就行。 docker run --name licode -p 3000:3000 -p $MIN_PORT-$MAX_PORT:30000-30050/udp -p 3001:3001 -p 8080:8080 -e &#34;MIN_PORT=30000&#34; -e &#34;MAX_PORT=30050&#34; -e &#34;PUBLIC_IP=your_ip_address&#34; lynckia/licode 注意命令里的PUBLIC_IP要改为服务器的公网IP。 配置好之Docker | 远程访问加密https://zfunnily.github.io/2020/08/dockersecret/Fri, 07 Aug 2020 07:56:52 +0000https://zfunnily.github.io/2020/08/dockersecret/docker的远程访问 方法一 :编辑docker.service文件 编辑docker.service文件 sudo vim /lib/systemd/system/docker.service 修改ExecStart行为下面内容 ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock 重新加载docker配置 sudo systemctl daemon-reload // 1,加载dockDocker | web管理界面portainerhttps://zfunnily.github.io/2020/08/dockerweb/Fri, 07 Aug 2020 07:54:43 +0000https://zfunnily.github.io/2020/08/dockerweb/拉取镜像 $ docker pull portainer/portainer 运行启动portainer docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v /home/docker/portainer:/data --name portainer --restart=always portainer/portainer admin bigant.cn 汉化 Portainer-CN.zip 百度云盘: https://pan.baidu.com/s/13ra6jXHR_7vajLLlf5GVEw 提取码: nzue 新建文件夹命名为public,把Portainer-CN.zip解压至里面。 2、public文件夹传K8S | 集群资源监控 heapsterhttps://zfunnily.github.io/2020/08/heapster/Thu, 06 Aug 2020 09:06:05 +0000https://zfunnily.github.io/2020/08/heapster/安装heapster的原因 查看dashboard状态 $ sudo kubectl get pods --all-namespaces | grep dashboard kubernetes-dashboard dashboard-metrics-scraper-6b4884c9d5-mvnb9 1/1 Running 0 40m kubernetes-dashboard kubernetes-dashboard-d7f7f565d-zhpsc 1/1 Running 0 40m 查看dashboard的日志 $ sudo kubectl logs -f -n kubernetes-dashboard kubernetes-dashboard-d7f7f565d-zhpsc 日志遇到这样的情况 No metric client provided. Skipping metrics. 2020/08/03 09:02:22 [2020-08-03T09:02:22Z] Outcoming response to 192.168.84.241:40086 with 200 status code 2020/08/03 09:02:23 Metric client healthK8S | Dashboard界面管理https://zfunnily.github.io/2020/08/dashboard/Thu, 06 Aug 2020 09:04:14 +0000https://zfunnily.github.io/2020/08/dashboard/安装部署Dashboard 通过一下命令来部署, recommended.yaml $ sudo kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deploy/recommended.yaml https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deplK8S | 安装https://zfunnily.github.io/2020/08/k8sinstall/Wed, 05 Aug 2020 10:00:40 +0000https://zfunnily.github.io/2020/08/k8sinstall/安装k8s前的准备工作 环境 ubuntu18.04 docker 关闭 swap 暂时关闭 $ swapoff -a 永久关闭 注释掉这一行 sudo vim /etc/fstab # /swapfile none swap sw 0 0 重启机器 sudo reboot docker 的配置 安装完成之后需要进行一些配置,包括 切换docker下载源为国内镜像站 以及 修改cgroupsOwt-server | 编译运行https://zfunnily.github.io/2020/08/owtservercomplie/Wed, 05 Aug 2020 09:47:22 +0000https://zfunnily.github.io/2020/08/owtservercomplie/概述 owt是一套完整的webrtc视频会议系统。包含的功能模块有: 视频会议1. p2p 服务器是owt-server通过nodejs编写的webrtc信令。依赖是licode。licode依赖webrtc。 客归档https://zfunnily.github.io/archives/Fri, 17 Apr 2020 20:43:57 +0800https://zfunnily.github.io/archives/2024-01月https://zfunnily.github.io/1/01/30/Mon, 01 Jan 0001 00:00:00 +0000https://zfunnily.github.io/1/01/30/学习 书籍 电影 游戏 《艾尔登法环》 《Dark Soul》3 《LOL》 番&amp;剧 其他搜索https://zfunnily.github.io/search/Mon, 01 Jan 0001 00:00:00 +0000https://zfunnily.github.io/search/神之亵渎1https://zfunnily.github.io/1/01/blasphemous/Mon, 01 Jan 0001 00:00:00 +0000https://zfunnily.github.io/1/01/blasphemous/地图设计 非线性结构: 游戏的地图是非线性的,允许玩家在一个庞大的世界中自由探索。玩家可以决定选择不同的路径和区域,解锁新的能力以访问之前无法到达的地方。 多样化的区域: 地图中包含了多个主题区域,每个区域都血污booshttps://zfunnily.github.io/1/01/blood/Mon, 01 Jan 0001 00:00:00 +0000https://zfunnily.github.io/1/01/blood/《血污:夜之仪式》 BOSS一/猎魔斩月 挑衅 + 招架 飞镖 横砍 劈砍 冲刺 + 横砍 跳起来 + 劈砍 跳起来 + 上挑 跳起来 + 上挑 + 劈砍 钩锁 + 劈砍 刀刃,火焰附魔 + 上面的轮回 影分身 格莫瑞 最终boss 没有后续boss的分析 地图设 \ No newline at end of file diff --git a/post/index.xml b/post/index.xml index a1e323922..5f3072d5d 100644 --- a/post/index.xml +++ b/post/index.xml @@ -1 +1 @@ -Posts on Zzz记忆https://zfunnily.github.io/post/Recent content in Posts on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +00002024-2月https://zfunnily.github.io/2024/02/02/Tue, 27 Feb 2024 15:45:00 +0800https://zfunnily.github.io/2024/02/02/学习 书籍 电影 游戏 《Lies of P》 《Dark Soul》重制版 番&amp;剧 《绝命毒师》第一季/第二季 其他12月https://zfunnily.github.io/2023/12/30/Sat, 30 Dec 2023 15:45:00 +0800https://zfunnily.github.io/2023/12/30/学习 银河城地图 搭建 ue5 paper2d 书籍 《游戏设计艺术》 电影 《复仇者联盟》4 游戏 《血污:夜之仪式》 《LOL》 《神之亵渎》 23小时 番&amp;剧 其他11月https://zfunnily.github.io/2023/11/30/Thu, 30 Nov 2023 15:45:00 +0800https://zfunnily.github.io/2023/11/30/学习 chatglm + langchain 知识库 docker搭建 ue5 paper2d的使用 wsl 子系统研究, win11 镜像模式. 电视剧 《繁城之下》 番剧 《反叛的鲁路修》 一季、二季 书籍 《置身事内》 电影 《复仇者联盟》3 游戏 《马里奥惊奇》已完结 《血污:夜之WSL2改为桥接https://zfunnily.github.io/2023/11/wsl2/Fri, 17 Nov 2023 15:45:00 +0800https://zfunnily.github.io/2023/11/wsl2/需求 在docker容器内部程序自己获取的ip是172开头的。我需要跟宿主机同样网段的ip。 问题 win10系统wsl2 不支持桥接 更简单的解决方案 使用vmware虚拟机,直接启动一个linux镜像,然后使Python3.7安装https://zfunnily.github.io/2023/11/python/Thu, 16 Nov 2023 15:39:01 +0800https://zfunnily.github.io/2023/11/python/环境 centos7 开始安装 安装扩展 $ yum -y install yum-utils 安装Centos开发工具 $ yum -y groupinstall development 安装python3依赖 $ yum -y install zlib-devel bzip2-devel openssl-devel openssl-static ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel libffi-devel lzma gcc 下载python3.7安装包 # 将python3.7安装包,下载到/usr/Docker | Mysql 挂载目录一键部署https://zfunnily.github.io/2023/11/mysql/Thu, 16 Nov 2023 11:36:44 +0800https://zfunnily.github.io/2023/11/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 #Svnhttps://zfunnily.github.io/2023/11/svn/Tue, 14 Nov 2023 16:46:02 +0800https://zfunnily.github.io/2023/11/svn/SVN 合并 从源svn分支合并到目标svn分支 在源svn项目下鼠标右键,TortoiseSVN -&gt; Repo-browser, 拿到源项目svn地址 在目标svn项目下鼠标右键,TortoiseSVN -&gt; Merge -&gt;, 填入源项目svn地址 在show lWSL2子系统迁移https://zfunnily.github.io/2023/11/wsl/Mon, 13 Nov 2023 22:21:34 +0800https://zfunnily.github.io/2023/11/wsl/wsl 安装 参考链接: https://learn.microsoft.com/zh-cn/windows/wsl/install 通过命令行安装 wsl --update wsl -v -l wsl --install wsl &amp; docker 迁移 WSL发行版默认都是安装在C盘,在%LOCALAPPDATA%/Docker/wsl目录 docker的运行数据、镜像文件都存在%LOCALAPPGithubActionhttps://zfunnily.github.io/2023/11/gitaction/Mon, 13 Nov 2023 11:21:34 +0800https://zfunnily.github.io/2023/11/gitaction/Github Token 生成 &amp; 设置 github -&gt; Settings -&gt; Developer Settings -&gt; Personal access tokens 新增 Tokens(classic) 点击Generate new token 点击你想使用Action的github仓库 Settings -&gt; Secrets and variables -&gt; Actions -&gt; New respository secret. 填上名字ACTION_ACCESS_TOKEN和第一步生成的 token,ChatGLM & LangChainhttps://zfunnily.github.io/2023/11/chatglm/Fri, 10 Nov 2023 11:21:34 +0800https://zfunnily.github.io/2023/11/chatglm/参考: 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 DockerDDNS配置https://zfunnily.github.io/2023/10/DDNS/Mon, 30 Oct 2023 11:21:34 +0800https://zfunnily.github.io/2023/10/DDNS/参考: https://www.sakamoto.blog/synology-nas-cloudflare-ddns/ Cloudflare 获取 区域 ID 创建 API 令牌 群晖设置 开启并登陆群晖NAS终端 下载 Cloudflare DDNS 脚本 下载 Cloudflare 的 DDNS 脚本文件,官方推荐存放于/sbin/cloudflareddns.sh并赋予执行权限. # 下载脚本 $ wget https://raw.githubusercontent.com/joshuaavalon/SynologyCloudflareDDNS/master/cloudflareddns.sh -O /sbin/cloudflareddns.sh # 赋予执行粒子系统01-概述https://zfunnily.github.io/2023/05/particlesystem01/Wed, 24 May 2023 11:21:34 +0800https://zfunnily.github.io/2023/05/particlesystem01/参考视频 参考播客 一、两种解决方案 区别 Particle System(内置粒子系统) Visual Effect Graph(VFX Graph) 基于XX运行 CPU GPU 粒子数量 数千 数百万 渲染管线 支持全部渲染管线 不支持内置渲染管线 物理系统 可与Unity物理系统交互 特定元素交互 创作Netch加速SWITCHhttps://zfunnily.github.io/2022/10/netch/Thu, 27 Oct 2022 10:09:44 +0800https://zfunnily.github.io/2022/10/netch/需求 对于有机场的用户,不用再花一份加速器的钱给Switch加速 前提条件 电脑通过(shadowrocks/v2ray)开启科学上网,使用端口 1080 电脑局域网IP 192.168.0.103 允许局域网设备连入 解决过程 switch的代理Netch加速SWITCHhttps://zfunnily.github.io/2022/10/netch/Thu, 27 Oct 2022 10:09:44 +0800https://zfunnily.github.io/2022/10/netch/需求 对于有机场的用户,不用再花一份加速器的钱给Switch加速 前提条件 电脑通过(shadowrocks/v2ray)开启科学上网,使用端口 1080 电脑局域网IP 192.168.0.103 允许局域网设备连入 解决过程 switch的代理Gitlab | CI/CD简单实现https://zfunnily.github.io/2022/06/cicd/Wed, 22 Jun 2022 14:26:25 +0800https://zfunnily.github.io/2022/06/cicd/CI/CD 流水线 组件组成 stages job gitlab runner(可以与gitlab服务器独立, c/s架构. ) -------- -------- --------- |stage1| -&gt; |stage2| -&gt; | stage3| -------- -------- --------- ------ ------ ------- |job1| |job2| | job3| ------ ------ ------- --------- --------- --------- |runner1| |runner2| -&gt; |runner3| --------- --------- --------- pipline: 包含多个stage, 顺序执行 stages: 一个stage可以包含多Gitlab | CI/CD简单实现https://zfunnily.github.io/2022/06/cicd/Wed, 22 Jun 2022 14:26:25 +0800https://zfunnily.github.io/2022/06/cicd/CI/CD 流水线 组件组成 stages job gitlab runner(可以与gitlab服务器独立, c/s架构. ) -------- -------- --------- |stage1| -&gt; |stage2| -&gt; | stage3| -------- -------- --------- ------ ------ ------- |job1| |job2| | job3| ------ ------ ------- --------- --------- --------- |runner1| |runner2| -&gt; |runner3| --------- --------- --------- pipline: 包含多个stage, 顺序执行 stages: 一个stage可以包含多百度网盘不限速 | Aria2篇https://zfunnily.github.io/2022/05/baidu/Tue, 17 May 2022 16:40:59 +0800https://zfunnily.github.io/2022/05/baidu/环境 win10 chrome 油猴插件 aria2 Aria2 对于不想折腾的有懒人包. 实际上包里含有的是aria2软件和aria2 GUI。 下载链接如下: 懒人下载包 AriaNg Aria2 百度网盘简易下载助手 安装油猴脚本: 百度网盘简易下载助手 安装好上述脚本之后,可百度网盘不限速 | Aria2篇https://zfunnily.github.io/2022/05/baidu/Tue, 17 May 2022 16:40:59 +0800https://zfunnily.github.io/2022/05/baidu/环境 win10 chrome 油猴插件 aria2 Aria2 对于不想折腾的有懒人包. 实际上包里含有的是aria2软件和aria2 GUI。 下载链接如下: 懒人下载包 AriaNg Aria2 百度网盘简易下载助手 安装油猴脚本: 百度网盘简易下载助手 安装好上述脚本之后,可URP 不透明/半透明物体的折射https://zfunnily.github.io/2022/05/refraction/Tue, 17 May 2022 11:30:48 +0800https://zfunnily.github.io/2022/05/refraction/折射 应用场景 水池 玻璃 热空气(热扭曲) GrabPass + CubeMap 《Unity3D Shader入门精要》第十章介绍了,模拟实现折射效果有两种 使用cubemap: 我认为太麻烦.需要的贴图太多。也没有找到其他合适的使用场景,遂搁URP 不透明/半透明物体的折射https://zfunnily.github.io/2022/05/refraction/Tue, 17 May 2022 11:30:48 +0800https://zfunnily.github.io/2022/05/refraction/折射 应用场景 水池 玻璃 热空气(热扭曲) GrabPass + CubeMap 《Unity3D Shader入门精要》第十章介绍了,模拟实现折射效果有两种 使用cubemap: 我认为太麻烦.需要的贴图太多。也没有找到其他合适的使用场景,遂搁《Unity Shader入门精要》第八章笔记 | 透明度https://zfunnily.github.io/2022/05/shaderalpha/Sat, 07 May 2022 17:17:18 +0800https://zfunnily.github.io/2022/05/shaderalpha/渲染顺序 名称 队列索引号 描 述 Background 1000 这个渲染队列会在任何其他队列之前被渲染,我们通常使用该队列来渲染那些需要绘制在背景上的物体 Geometry 2000 默认的渲染队列,大多数物体都使用这个队列。不透明物体使用这个队列 AlphaTest 2450 需要透明《Unity Shader入门精要》第八章笔记 | 透明度https://zfunnily.github.io/2022/05/shaderalpha/Sat, 07 May 2022 17:17:18 +0800https://zfunnily.github.io/2022/05/shaderalpha/渲染顺序 名称 队列索引号 描 述 Background 1000 这个渲染队列会在任何其他队列之前被渲染,我们通常使用该队列来渲染那些需要绘制在背景上的物体 Geometry 2000 默认的渲染队列,大多数物体都使用这个队列。不透明物体使用这个队列 AlphaTest 2450 需要透明《Unity Shader入门精要》第六章笔记 | 基础光照https://zfunnily.github.io/2022/05/shaderlighting/Sat, 07 May 2022 16:22:40 +0800https://zfunnily.github.io/2022/05/shaderlighting/我们是如何看到这个世界的 光源: 在光学里,我们使用辐照度 (irradiance) 来量化光 物体的吸收和散射: 光线由光源发射出来后,就会与一些物体相交 着色: 根据材质属性(如漫反射属性等)、光源信息(如光源方《Unity Shader入门精要》第六章笔记 | 基础光照https://zfunnily.github.io/2022/05/shaderlighting/Sat, 07 May 2022 16:22:40 +0800https://zfunnily.github.io/2022/05/shaderlighting/我们是如何看到这个世界的 光源: 在光学里,我们使用辐照度 (irradiance) 来量化光 物体的吸收和散射: 光线由光源发射出来后,就会与一些物体相交 着色: 根据材质属性(如漫反射属性等)、光源信息(如光源方《Unity Shader入门精要》第五章笔记 | 开始shader练习https://zfunnily.github.io/2022/05/shaderbase/Sat, 07 May 2022 10:22:33 +0800https://zfunnily.github.io/2022/05/shaderbase/一个简单的顶点/片元着色器 代码 Shader &#34;Unity Shaders Book/Chapter 5/Simple Shader&#34; { Properties { // 声明一个Color类型的属性 _Color (&#34;Color Tint&#34;, Color) = (1.0,1.0,1.0,1.0) } SubShader { Pass { CGPROGRAM #pragma vertex vert #pragma fragment frag // 在Cg代码中,我们需要定义一个与属性名称和类型都匹配的变量 fixed4 _Color; // 使用一个结构体来定义《Unity Shader入门精要》第五章笔记 | 开始shader练习https://zfunnily.github.io/2022/05/shaderbase/Sat, 07 May 2022 10:22:33 +0800https://zfunnily.github.io/2022/05/shaderbase/一个简单的顶点/片元着色器 代码 Shader &#34;Unity Shaders Book/Chapter 5/Simple Shader&#34; { Properties { // 声明一个Color类型的属性 _Color (&#34;Color Tint&#34;, Color) = (1.0,1.0,1.0,1.0) } SubShader { Pass { CGPROGRAM #pragma vertex vert #pragma fragment frag // 在Cg代码中,我们需要定义一个与属性名称和类型都匹配的变量 fixed4 _Color; // 使用一个结构体来定义MAC平台几何着色器不生效https://zfunnily.github.io/2022/05/geometry/Thu, 05 May 2022 16:49:29 +0800https://zfunnily.github.io/2022/05/geometry/问题 MAC平台几何着色器不生效 解决步骤 unity shaderlab 怎么设置以至于支持几何着色器 找原因,设置 编译目标级别,#pragma target 4.0, 不管用 看到一句话,Unity 在 Metal 图形上支持曲面细分着色器,但 Metal 不支持几何着色器 找到maMAC平台几何着色器不生效https://zfunnily.github.io/2022/05/geometry/Thu, 05 May 2022 16:49:29 +0800https://zfunnily.github.io/2022/05/geometry/问题 MAC平台几何着色器不生效 解决步骤 unity shaderlab 怎么设置以至于支持几何着色器 找原因,设置 编译目标级别,#pragma target 4.0, 不管用 看到一句话,Unity 在 Metal 图形上支持曲面细分着色器,但 Metal 不支持几何着色器 找到maShaderLab常用函数https://zfunnily.github.io/2022/04/shaderfunc/Wed, 20 Apr 2022 15:41:29 +0800https://zfunnily.github.io/2022/04/shaderfunc/数学函数 cg/hlsl函数 功能描述 dot(A,B) 点积, 点积结果为标量,主要用于求向量的夹角或b向量在a向量上的投影 cross(A,B) 叉积, 叉积结果为向量,结果与这两个向量组成的平面垂直。主要用于3D图形学 mul(M, N) 矩阵M和矩阵N的积 mul(M,ShaderLab常用函数https://zfunnily.github.io/2022/04/shaderfunc/Wed, 20 Apr 2022 15:41:29 +0800https://zfunnily.github.io/2022/04/shaderfunc/数学函数 cg/hlsl函数 功能描述 dot(A,B) 点积, 点积结果为标量,主要用于求向量的夹角或b向量在a向量上的投影 cross(A,B) 叉积, 叉积结果为向量,结果与这两个向量组成的平面垂直。主要用于3D图形学 mul(M, N) 矩阵M和矩阵N的积 mul(M,UnityCG.cginc中常用函数https://zfunnily.github.io/2022/04/cginc/Wed, 20 Apr 2022 15:35:49 +0800https://zfunnily.github.io/2022/04/cginc/摄像机方向 WorldSpaceViewDir 输入一个模型空间中的顶点坐标 -&gt; 输出(世界空间)从这个点到摄像机的观察方向; WorldSpaceViewDir // 内部实现也是用UnityWorldSpaceViewDir // Computes world space view direction, from object space position // *Legacy* Please use UnityWorldSpaceViewDir instead inline float3 WorldSpaceViewDir( in float4 localPos ) { float3 worldPosUnityCG.cginc中常用函数https://zfunnily.github.io/2022/04/cginc/Wed, 20 Apr 2022 15:35:49 +0800https://zfunnily.github.io/2022/04/cginc/摄像机方向 WorldSpaceViewDir 输入一个模型空间中的顶点坐标 -&gt; 输出(世界空间)从这个点到摄像机的观察方向; WorldSpaceViewDir // 内部实现也是用UnityWorldSpaceViewDir // Computes world space view direction, from object space position // *Legacy* Please use UnityWorldSpaceViewDir instead inline float3 WorldSpaceViewDir( in float4 localPos ) { float3 worldPos《Unity Shader入门精要》第四章笔记 | 学习Shader所需的数学基础https://zfunnily.github.io/2022/04/shadermathematic/Sun, 10 Apr 2022 15:42:33 +0800https://zfunnily.github.io/2022/04/shadermathematic/概述 在学习Shader的过程中,我们最常使用的就是矢量和矩阵(即数学的分支之一——线性代数)。 笛卡儿坐标系 我们使用数学绝大部分都是为了计算位置、距离和角度等变量。而这些计算大部分都是在笛卡儿坐标系 (C《Unity Shader入门精要》第四章笔记 | 学习Shader所需的数学基础https://zfunnily.github.io/2022/04/shadermathematic/Sun, 10 Apr 2022 15:42:33 +0800https://zfunnily.github.io/2022/04/shadermathematic/概述 在学习Shader的过程中,我们最常使用的就是矢量和矩阵(即数学的分支之一——线性代数)。 笛卡儿坐标系 我们使用数学绝大部分都是为了计算位置、距离和角度等变量。而这些计算大部分都是在笛卡儿坐标系 (C《Unity Shader入门精要》第三章笔记| UnityShader基础https://zfunnily.github.io/2022/04/shaderbase/Sun, 10 Apr 2022 14:51:19 +0800https://zfunnily.github.io/2022/04/shaderbase/材质 在Unity中我们需要配合使用材质 (Material) 和Unity Shader才能达到需要的效果。一个最常见的流程是 创建一个材质;活着导入一个材质 创建一个Unity Shader,并把它赋给上一步中《Unity Shader入门精要》第三章笔记| UnityShader基础https://zfunnily.github.io/2022/04/shaderbase/Sun, 10 Apr 2022 14:51:19 +0800https://zfunnily.github.io/2022/04/shaderbase/材质 在Unity中我们需要配合使用材质 (Material) 和Unity Shader才能达到需要的效果。一个最常见的流程是 创建一个材质;活着导入一个材质 创建一个Unity Shader,并把它赋给上一步中《Unity Shader入门精要》第二章笔记 | 渲染流水线https://zfunnily.github.io/2022/04/shaderrenderpipline/Sat, 09 Apr 2022 11:55:55 +0800https://zfunnily.github.io/2022/04/shaderrenderpipline/渲染流水线 Render-Time Rendering, Third Edition》一书中将一个渲染流程分成3个阶段:应用阶段(Application Stage) 、几何阶段(Geometry Stage) 、光栅化阶段(Rasterizer Stage) 。 应《Unity Shader入门精要》第二章笔记 | 渲染流水线https://zfunnily.github.io/2022/04/shaderrenderpipline/Sat, 09 Apr 2022 11:55:55 +0800https://zfunnily.github.io/2022/04/shaderrenderpipline/渲染流水线 Render-Time Rendering, Third Edition》一书中将一个渲染流程分成3个阶段:应用阶段(Application Stage) 、几何阶段(Geometry Stage) 、光栅化阶段(Rasterizer Stage) 。 应shader初尝试 | 给石头覆盖一层雪景(Hello World)https://zfunnily.github.io/2022/04/shaderhelloworld/Sat, 09 Apr 2022 10:34:56 +0800https://zfunnily.github.io/2022/04/shaderhelloworld/给石头覆盖一层雪景 资源准备 石头模型 Unity2021.2.3f1c1 Mac &amp; Windows 在Unity中创建一个项目,导入石头模型,下面就开始利用shader给石头做一个雪景覆盖. 实现效果 未覆盖雪景的样子 覆盖了雪景的样子 开始代码 我在代码中标注了1,shader初尝试 | 给石头覆盖一层雪景(Hello World)https://zfunnily.github.io/2022/04/shaderhelloworld/Sat, 09 Apr 2022 10:34:56 +0800https://zfunnily.github.io/2022/04/shaderhelloworld/给石头覆盖一层雪景 资源准备 石头模型 Unity2021.2.3f1c1 Mac &amp; Windows 在Unity中创建一个项目,导入石头模型,下面就开始利用shader给石头做一个雪景覆盖. 实现效果 未覆盖雪景的样子 覆盖了雪景的样子 开始代码 我在代码中标注了1,UnityShader基本概念https://zfunnily.github.io/2022/04/shader01/Wed, 06 Apr 2022 11:54:02 +0800https://zfunnily.github.io/2022/04/shader01/何为shader shader中文翻译为着色器,其实是一种用来渲染图形的技术,我们可以通过shader编程,来自定义显卡渲染画面的算法,显示我们所期望的结果。 shader种类 顶点着色器: 处理每个顶点,将UnityShader基本概念https://zfunnily.github.io/2022/04/shader01/Wed, 06 Apr 2022 11:54:02 +0800https://zfunnily.github.io/2022/04/shader01/何为shader shader中文翻译为着色器,其实是一种用来渲染图形的技术,我们可以通过shader编程,来自定义显卡渲染画面的算法,显示我们所期望的结果。 shader种类 顶点着色器: 处理每个顶点,将Graphicshttps://zfunnily.github.io/2022/04/graphics/Mon, 04 Apr 2022 21:48:09 +0800https://zfunnily.github.io/2022/04/graphics/Last Lecture What is Computer Graphics? Why study Computer Graphics? Course Topics Course Logistics Graphics&rsquo;s Dependencies Basic mathematics Liner algebra, calculus, statistics. Basic physics Optics, Mechanics Misc Signal processing Numerical analysis 线性代数 Dot(scalar) Product Cross (vector) Product 向量之间的乘积不符合交换定律。 Cross product: Properties 右手螺旋定则 Cross product: Cartesian Formula Cross product in Graphics 判断左右 判断内外 判断向量b在向量a的左边 右手螺旋法则 向量Graphicshttps://zfunnily.github.io/2022/04/graphics/Mon, 04 Apr 2022 21:48:09 +0800https://zfunnily.github.io/2022/04/graphics/Last Lecture What is Computer Graphics? Why study Computer Graphics? Course Topics Course Logistics Graphics&rsquo;s Dependencies Basic mathematics Liner algebra, calculus, statistics. Basic physics Optics, Mechanics Misc Signal processing Numerical analysis 线性代数 Dot(scalar) Product Cross (vector) Product 向量之间的乘积不符合交换定律。 Cross product: Properties 右手螺旋定则 Cross product: Cartesian Formula Cross product in Graphics 判断左右 判断内外 判断向量b在向量a的左边 右手螺旋法则 向量抽卡逻辑自述https://zfunnily.github.io/2022/03/afk/Wed, 30 Mar 2022 10:50:11 +0800https://zfunnily.github.io/2022/03/afk/抽卡逻辑自述 参考《剑与远征》 卡牌颜色以及合成 颜色 合成 绿色 可分解,得到粉尘和银瓜子, 最基础的卡 蓝 蓝+ 同样的三张蓝色可合成一张蓝+ 紫 同种族的三张蓝+可以合成一张紫(可以选择合成其中蓝+的某个紫色) 紫+ 同英抽卡逻辑自述https://zfunnily.github.io/2022/03/afk/Wed, 30 Mar 2022 10:50:11 +0800https://zfunnily.github.io/2022/03/afk/抽卡逻辑自述 参考《剑与远征》 卡牌颜色以及合成 颜色 合成 绿色 可分解,得到粉尘和银瓜子, 最基础的卡 蓝 蓝+ 同样的三张蓝色可合成一张蓝+ 紫 同种族的三张蓝+可以合成一张紫(可以选择合成其中蓝+的某个紫色) 紫+ 同英层级时间轮 | skynet 定时器https://zfunnily.github.io/2022/03/timerskynet/Sun, 27 Mar 2022 12:39:12 +0800https://zfunnily.github.io/2022/03/timerskynet/skynet定时器 要解析一个程序代码,先了解数据结构,这是基础,再看函数。 拿skynet定时器举例子。 数据结构 //定时器事件 用于抛出定时器事件到消息队列里。理解这个数据结构需要先了解skynet的框架层级时间轮 | skynet 定时器https://zfunnily.github.io/2022/03/timerskynet/Sun, 27 Mar 2022 12:39:12 +0800https://zfunnily.github.io/2022/03/timerskynet/skynet定时器 要解析一个程序代码,先了解数据结构,这是基础,再看函数。 拿skynet定时器举例子。 数据结构 //定时器事件 用于抛出定时器事件到消息队列里。理解这个数据结构需要先了解skynet的框架利用时间轮实现定时器https://zfunnily.github.io/2022/03/timer/Thu, 10 Mar 2022 14:38:23 +0800https://zfunnily.github.io/2022/03/timer/理解定时器 适用场景 定时任务(每隔1s钟打印一次数据) 超时控制(xx分钟没有动作就断开连接) 频率限制(最快只能每5s调用一次API) 定时器常用的数据结构有如下几种: 链表 双向有序链表 最小堆 时间轮 层级时间轮利用时间轮实现定时器https://zfunnily.github.io/2022/03/timer/Thu, 10 Mar 2022 14:38:23 +0800https://zfunnily.github.io/2022/03/timer/理解定时器 适用场景 定时任务(每隔1s钟打印一次数据) 超时控制(xx分钟没有动作就断开连接) 频率限制(最快只能每5s调用一次API) 定时器常用的数据结构有如下几种: 链表 双向有序链表 最小堆 时间轮 层级时间轮利用云服务器搭建个人博客https://zfunnily.github.io/2022/03/blog/Thu, 03 Mar 2022 12:04:58 +0800https://zfunnily.github.io/2022/03/blog/vps选择 最近关注了一个vps推广网站。价格合适,于是买了一个128元/年的云服务器。既可以用来做代理,又可以搭建个人博客 配置是2G/1M/40G(运存/带宽/硬盘) 使用技术 nginx: 静态博客 v2ray: 代理 https + nginx freenome: 域利用云服务器搭建个人博客https://zfunnily.github.io/2022/03/blog/Thu, 03 Mar 2022 12:04:58 +0800https://zfunnily.github.io/2022/03/blog/vps选择 最近关注了一个vps推广网站。价格合适,于是买了一个128元/年的云服务器。既可以用来做代理,又可以搭建个人博客 配置是2G/1M/40G(运存/带宽/硬盘) 使用技术 nginx: 静态博客 v2ray: 代理 https + nginx freenome: 域Nginx | 给网站添加证书https://zfunnily.github.io/2022/03/https/Thu, 03 Mar 2022 10:26:56 +0800https://zfunnily.github.io/2022/03/https/Https 最近在购买的云服务器上把个人博客搭建起来了,实际上是hugo生成静态网页,nginx加载静态网页。现在只能通过http访问,缺少个https。 要搭建一个https的网站需要证书。之前在网上找的教程太Nginx | 给网站添加证书https://zfunnily.github.io/2022/03/https/Thu, 03 Mar 2022 10:26:56 +0800https://zfunnily.github.io/2022/03/https/Https 最近在购买的云服务器上把个人博客搭建起来了,实际上是hugo生成静态网页,nginx加载静态网页。现在只能通过http访问,缺少个https。 要搭建一个https的网站需要证书。之前在网上找的教程太Golang | http注解路由https://zfunnily.github.io/2022/03/http/Wed, 02 Mar 2022 14:51:22 +0800https://zfunnily.github.io/2022/03/http/Http服务器 Golang有一个很强大的官方http库了,使用上很方便。也有一些很强大的三方http框架, 比如gin,beego等等。 自以为,框架在提供便利,提升开发效率的同时,也限制了我们的想象力。Golang | http注解路由https://zfunnily.github.io/2022/03/http/Wed, 02 Mar 2022 14:51:22 +0800https://zfunnily.github.io/2022/03/http/Http服务器 Golang有一个很强大的官方http库了,使用上很方便。也有一些很强大的三方http框架, 比如gin,beego等等。 自以为,框架在提供便利,提升开发效率的同时,也限制了我们的想象力。Goang | Plugin插件热更https://zfunnily.github.io/2022/03/reload/Tue, 01 Mar 2022 11:33:22 +0800https://zfunnily.github.io/2022/03/reload/热更新 动态脚本更新 (php) 短链接无状态服务器热更 (http) 长连接有状态,数据跟逻辑分离 golang Plugin热更 (.so 动态库更新) &mdash;-逻辑热更 长连接有状态,在运维层面, 利用容器部署热更(docker, k8s) 服务不接受新Goang | Plugin插件热更https://zfunnily.github.io/2022/03/reload/Tue, 01 Mar 2022 11:33:22 +0800https://zfunnily.github.io/2022/03/reload/热更新 动态脚本更新 (php) 短链接无状态服务器热更 (http) 长连接有状态,数据跟逻辑分离 golang Plugin热更 (.so 动态库更新) &mdash;-逻辑热更 长连接有状态,在运维层面, 利用容器部署热更(docker, k8s) 服务不接受新Grpc | Token认证和自定义认证https://zfunnily.github.io/2022/02/jwt/Tue, 22 Feb 2022 15:39:30 +0800https://zfunnily.github.io/2022/02/jwt/概述 现在有个需求,需要在grpc的拦截器中,通过token进行身份认证。如果认证不通过则返回错误; 认证通过,则放行; TLS是用作加密通讯通道的,与该需求无关。 Token认证 具体流程 客户端通过账号密码登Grpc | Token认证和自定义认证https://zfunnily.github.io/2022/02/jwt/Tue, 22 Feb 2022 15:39:30 +0800https://zfunnily.github.io/2022/02/jwt/概述 现在有个需求,需要在grpc的拦截器中,通过token进行身份认证。如果认证不通过则返回错误; 认证通过,则放行; TLS是用作加密通讯通道的,与该需求无关。 Token认证 具体流程 客户端通过账号密码登Grpc | 通过SSL/TLS建立安全连接https://zfunnily.github.io/2022/02/san/Tue, 22 Feb 2022 14:22:41 +0800https://zfunnily.github.io/2022/02/san/使用golang的grpc库作为例子 grpc使用TLS建立安全连接需要有SAN证书, go 1.15 版本开始废弃 CommonName。 什么是SAN证书 SAN(Subject Alternative Name) 是 SSL 标准 x509 中定义的一个扩展。使用了 SAN 字段的 SSL 证书,可以扩Grpc | 通过SSL/TLS建立安全连接https://zfunnily.github.io/2022/02/san/Tue, 22 Feb 2022 14:22:41 +0800https://zfunnily.github.io/2022/02/san/使用golang的grpc库作为例子 grpc使用TLS建立安全连接需要有SAN证书, go 1.15 版本开始废弃 CommonName。 什么是SAN证书 SAN(Subject Alternative Name) 是 SSL 标准 x509 中定义的一个扩展。使用了 SAN 字段的 SSL 证书,可以扩Blog | 代码显示/隐藏https://zfunnily.github.io/2021/12/shortcodes/Wed, 29 Dec 2021 13:50:28 +0800https://zfunnily.github.io/2021/12/shortcodes/缘由 最近在写技术博客时,引入的代码太多,影响观感。 在尽力减少代码量,还是有些不可或缺的代码,代码量很惊人,已经占满整个屏幕. 因为个人博客是使用hugo生成的静态博客,我刚开始想的使用原生的js和cssNginx的一些配置https://zfunnily.github.io/2021/12/nginx/Tue, 28 Dec 2021 16:04:10 +0800https://zfunnily.github.io/2021/12/nginx/静态网站 应用场景 文件服务 静态网站 &hellip; 静态网站的配置 配置如下: nginx.conf worker_processes 1; pid nginx.pid; events { worker_connections 1024; multi_accept on; } http { default_type application/octet-stream; sendfile on; keepalive_timeout 100; server { listen 80; charset utf-8,gbk; server_name localhost; location /{ root /opt/; autoindex on; autoindex_localtime on; } index index.html; # 显示首页 #静态文件访问 location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|js|pdf|txt) { root /opt; } } } root: 表示网站根目录 autoindex: on 显A*算法 | Lua版本https://zfunnily.github.io/2021/12/astar/Thu, 23 Dec 2021 16:37:44 +0800https://zfunnily.github.io/2021/12/astar/A*算法思路 寻路步骤 从起点A开始, 把它作为待处理的方格存入一个&quot;开启列表&quot;, 开启列表就是一个等待检查方格的列表. 寻找起点A周围可以到达的方格, 将它们放入&quot;开启列表&quoBlog | 音乐播放器https://zfunnily.github.io/2021/12/music/Tue, 21 Dec 2021 16:55:23 +0800https://zfunnily.github.io/2021/12/music/概述 今天给我的个人博客加了个暗模式,这样可以在晚上阅读博客的时候不伤害眼睛。突然想到如果在阅读博客的时候可以听听音乐就更好了。 于是在github上找到了一个开源的项目MetingJS,看最后一次comBlog | 网站暗模式https://zfunnily.github.io/2021/12/dark/Tue, 21 Dec 2021 11:05:00 +0800https://zfunnily.github.io/2021/12/dark/Wordpress 如果你的网站是wordpress,则可以参考以Darkmode.js为基础的插件: blackout-darkmode-widget darkmode Nuxt.js 如果你正在使用Nuxt.js,则可以使用下面的模块 nuxtjs-darkmode-js-module 快速使用 使用Darkmode.js给网站快速部署上暗/浅色Openresty三 | 上传文件https://zfunnily.github.io/2021/12/openresty-upload/Wed, 08 Dec 2021 16:42:17 +0800https://zfunnily.github.io/2021/12/openresty-upload/上传文件接口 nginx.conf 的server 增加一个location: location /upload { resolver 8.8.8.8 ipv6=off; content_by_lua_file lua/upload.lua; } upload.lua lua -- upload.lua --========================================== -- 文件上传 --========================================== local chunk_size = 4096 local form, err = upload:new(chunk_size) if not form then ngx.log(ngx.ERR, &#34;failed to new upload: &#34;, err) ngx.exit(ngx.HTTP_INTERNAL_SERVER_ERROR) end form:set_timeout(1000) -- 文件保存的根路径 local saveRootPath = &#34;./download/&#34; -- 保存的文件对象 local fileToSave --文件是否成Webrtc二 | 共享桌面https://zfunnily.github.io/2021/11/webrtcdesk/Mon, 15 Nov 2021 11:23:24 +0800https://zfunnily.github.io/2021/11/webrtcdesk/环境 Ubuntu18.04 webrtc M84 改造peerconnection例子,用来实现桌面共享 改造类CapturerTrackSource 增加桌面的数据源类RcrtcDesktopCapturerTrackSource 继承webrWebrtc一 | peerconnectionhttps://zfunnily.github.io/2021/11/webrtcpeerconnection/Sun, 14 Nov 2021 16:20:31 +0800https://zfunnily.github.io/2021/11/webrtcpeerconnection/环境 Ubuntu18.04 webrtc M84 国内镜像:https://webrtc.org.cn/mirror/ webrtc交互过程 通过peerconnection的例子来分析webrtc的交互流程 peer_connection 解析 为了便于管理,如编码,回显等,Go-libp2p四 | 穿透NAThttps://zfunnily.github.io/2021/11/gop2pfour/Sun, 07 Nov 2021 15:49:46 +0800https://zfunnily.github.io/2021/11/gop2pfour/本文目的 上文Go-libp2p三 | relay例子已经分析过relay例子,并解释了两个节点如果通过中继服务进行通信。本文改造relay例子 并让这个服务做如下两件事: 交换两个节点的在交换机上的信息,帮助Blog | 随机名人名言https://zfunnily.github.io/2021/11/randomquotes/Fri, 05 Nov 2021 15:50:16 +0800https://zfunnily.github.io/2021/11/randomquotes/本文目的 我的个人博客已经搭建好了,使用的hugo+飞雪的主题。我看到有些博客上有些随机的名人名言,但是这个主题没有。遂自己写一个。 根据飞雪的主题自定义 飞雪主题的github: https://github.com/flysnow-org/maupassant-hugo 复制主题里的文件themGo-libp2p三 | relay例子https://zfunnily.github.io/2021/10/gop2pthree/Sun, 31 Oct 2021 10:13:40 +0800https://zfunnily.github.io/2021/10/gop2pthree/我想做什么 chat和echo两个例子,说明了两个节点之间的通信需要两节点在同一个局域网内,或者有一个节点有公网。 如果我两个节点分别在两个NAT下面, 都在各自的局域网内,则需要有一个中继服务,这个服务做Go-libp2p二 | echo例子https://zfunnily.github.io/2021/10/gop2ptwo/Fri, 29 Oct 2021 11:15:42 +0800https://zfunnily.github.io/2021/10/gop2ptwo/go-libp2p的echo例子分析 进入目录go-libp2p/examples/echo/, 编译 go build 先看README.md, 可以了解到使用echo的方式: 终端B $ ./echo -l 3001 2021/10/28 11:25:33 I am /ip4/127.0.0.1/tcp/3001/p2p/QmTu8sxDi3fSjz9ZMvkAj3qA9YAoGskroEnyLz2ZvfTBhX 2021/10/28 11:25:33 listening for connections 2021/10/28 11:25:33 Now run &#34;./echoGo-libp2p一 | chat例子https://zfunnily.github.io/2021/10/gop2pone/Thu, 28 Oct 2021 14:40:02 +0800https://zfunnily.github.io/2021/10/gop2pone/代码下载 git clone https://github.com/libp2p/go-libp2p.git chat实例分析 进入目录go-libp2p/examples/chat/, 编译 go build 先看README.md, 可以了解到使用chat的方式 在节点 B $ ./chat -sp 3001 2021/10/28 11:01:25 Run &#39;./chat -d /ip4/127.0.0.1/tcp/3001/p2p/QmXgEXt4CiqmVmDhPPQnyVkoj3Bsx3Nggq57PPsk5tLNTs&#39; on another console. 2021/10/28 11:01:25 You can replace 127.0.0.1 with public IPBlog | 新的开始https://zfunnily.github.io/2021/10/blogmigration/Fri, 22 Oct 2021 19:01:20 +0800https://zfunnily.github.io/2021/10/blogmigration/迁移博客 我是从18年开始写一些东西,先写在看云笔记上,后面东西越来越多。写出来的东西比较零散. 20年下半年入职新公司,开始在csdn上写博客,今年我准备尝试使用个人博客,hugo和gitPage结合部Skynet源码赏析四 | 消息调度https://zfunnily.github.io/2021/10/four/Thu, 21 Oct 2021 10:06:39 +0800https://zfunnily.github.io/2021/10/four/服务间消息流转 发送消息 数据结构message_queue *q是次级消息队列,每个服务都有与之绑定的唯一一个次级消息队列。当我们在lua层,调用skynet.send(...), 或者调用skynet.cSkynet源码赏析三 | 服务启动https://zfunnily.github.io/2021/10/skynetthree/Wed, 20 Oct 2021 11:26:07 +0800https://zfunnily.github.io/2021/10/skynetthree/skynet启动一个C服务 查看怎么启动C服务的最好的办法是打断点,看源码。 启动logger日志服务 我拿日志服务来举例子,怎么启动日志服务的呢? 传参数name = &quot;logger&quot;, param = null, struct skynet_context *ctx = skynet_context_new(config-&gt;logservice, config-&gt;logger);; 从moduleSkynet源码赏析二 | 基础数据结构https://zfunnily.github.io/2021/10/skynettwo/Tue, 19 Oct 2021 18:47:45 +0800https://zfunnily.github.io/2021/10/skynettwo/module管理模块 我们所写的C服务编译成.so文件后放在cpath变量路径下,程序会加载路径cpath = root..&quot;cservice/?.so&quot;下的.so文件,通过staticSkynet源码赏析一 | 启动初始化的过程https://zfunnily.github.io/2021/10/skynetone/Tue, 19 Oct 2021 17:28:45 +0800https://zfunnily.github.io/2021/10/skynetone/入口文件 skynet_main.c 加载配置 struct skynet_config config; config.thread = optint(&#34;thread&#34;,8); config.module_path = optstring(&#34;cpath&#34;,&#34;./cservice/?.so&#34;); config.harbor = optint(&#34;harbor&#34;, 1); config.bootstrap = optstring(&#34;bootstrap&#34;,&#34;snlua bootstrap&#34;); config.daemon = optstring(&#34;daemon&#34;, NULL); config.logger = optstring(&#34;logger&#34;, NULL); config.logservice = optstring(&#34;logservice&#34;, &#34;logger&#34;); config.profile = optboolean(&#34;profile&#34;, 1); 从上述代码可以看到,配置都已经加载到变量struct skynet_config config;中了。 初始化 初始化skynet_context管Golang | 调用带有后台进程shell脚本可能会被挂起https://zfunnily.github.io/2021/10/shell/Wed, 13 Oct 2021 17:15:45 +0800https://zfunnily.github.io/2021/10/shell/起因 今天用Golang写一个调用外部shell脚本的程序,使用 exec.Command方法,这段脚本代码中包含了一个后台任务语句。 结果发生了一个问题:cmd.Output 始终不会返回,一直挂起。导致我FPS游戏 | 实现移动功能https://zfunnily.github.io/2021/09/move/Sun, 12 Sep 2021 20:43:34 +0800https://zfunnily.github.io/2021/09/move/三种实现FPS Controller的区别 Transform Translate 允许移动物理,但无物理碰撞 Rigid body + Capsule Collider 符合物理学 不会鬼穿墙 无法滞空运动 可与Physics Object 交互 Charactor Controller 不会鬼穿墙 提供的API相对多 无法与Physic objects免费Musichttps://zfunnily.github.io/2021/09/music/Wed, 08 Sep 2021 14:47:14 +0800https://zfunnily.github.io/2021/09/music/介绍一个可以免费听音乐的方法 环境 docker mac 安装 $ docker run -d -p 264:264 -p 9000:9000 -v $dir_name:/var/www/html/cache --name music oldiy/music-player-docker $dir_name 是 你自己宿主机的目录。可以自定义 访问:127.0.0.1:264 就可以放心使用, 同事推荐的,贼好用。Unity3D | Transform类https://zfunnily.github.io/2021/09/transform/Tue, 07 Sep 2021 15:55:59 +0800https://zfunnily.github.io/2021/09/transform/Transform类 在unity中,把transform类理解为,transform类是在每个对象生成时自动附加的一个类。在Unity的视图中,点击Hierarchy中的对象,就可以在InspectoVim | 切换模式/输入法https://zfunnily.github.io/2021/09/vimchange/Tue, 07 Sep 2021 10:46:58 +0800https://zfunnily.github.io/2021/09/vimchange/vim 在退出输入模式的时候切换为原来的输入法 在敲代码的时候使用我们使用的英文,当遇到问题,我们需要搜索引擎的时候需要中文输入法,这个时候,自动切换输入法可以帮助我们节省手动切换输入法的时间。 跟编辑器结合,Linux | Screenhttps://zfunnily.github.io/2021/09/screen/Tue, 07 Sep 2021 10:02:16 +0800https://zfunnily.github.io/2021/09/screen/screen命令 screen 是一个非常有用的命令。应用场景: 单个 SSH 会话中使用多个 shell 窗口(会话)的能力 服务器开发,一个单独运行进程的窗口。可以避免单独再开一个窗口。 &hellip; screen使用 创建一个窗口 $ screen -S name 执行自己需Centos7.2 | gcc4.8升级为4.9https://zfunnily.github.io/2021/09/upgradegcc/Wed, 01 Sep 2021 18:13:41 +0800https://zfunnily.github.io/2021/09/upgradegcc/环境 CentOS 7.2.1511 Docker 我是用 docker 拉取镜像 CentOS 7.2.1511, 利用容器来作为我的开发环境。有条件的也可以用虚拟机或者实体机器。原理都一样。 $ docker $ yum update &amp;&amp; yum install gcc gcc-c++ make zlib-devel.x86_6 下载依赖包 升级 gcc, 下载安装包下载依赖。 $ wget http://ftp.gnu.org/gnu/gcc/gcc-4.9.3/gcc-4.9.3.tar.bz2 $ tar xfv gcc-4.9.3.tar.bz2 &amp;&amp; cd gcc-4.9.3 $ ./contrib/download_prerequisites 如果Shell | Except 使用https://zfunnily.github.io/2021/08/except/Mon, 30 Aug 2021 17:13:33 +0800https://zfunnily.github.io/2021/08/except/Except 参数 spawn 交互程序开始后面跟命令或者指定程序 expect 获取匹配信息匹配成功则执行expect后面的程序动作 send exp_send 用于发送指定的字符串信息 exp_continue 在expect中多次匹配就需要用到 send_user 用来打印输出 相当于shell中的echUnity3D | UGUIhttps://zfunnily.github.io/2021/08/ugui/Fri, 20 Aug 2021 14:15:41 +0800https://zfunnily.github.io/2021/08/ugui/Text Text的属性 在 Unity 的 Hierarchy 面板上右键–&gt;UI–&gt;Text, 在 Inspector 面板上查看属性 属性 功能 Text 需要显示的文本 Font 显示文本的字体 如:微软雅黑,宋体等 Font Style 显示文本的样式,有普通,粗体,斜体,粗体和斜体四种Golang | redis实现分布式锁https://zfunnily.github.io/2021/06/distribute/Thu, 03 Jun 2021 16:12:21 +0000https://zfunnily.github.io/2021/06/distribute/概述 网上有很多Golang操作redis的例子,我使用github.com/gomodule/redigo/redis包写一个关于redis分布式锁的问题。 redis分布式锁 锁需要的几个组件 获取锁- 删Golang | redishttps://zfunnily.github.io/2021/06/goredis/Thu, 03 Jun 2021 15:57:14 +0800https://zfunnily.github.io/2021/06/goredis/概述 网上有很多golang操作redis的例子,我使用github.com/gomodule/redigo/redis包写一个关于redis分布式锁的问题。 redis分布式锁 锁需要的几个组件 获取锁 删除Lua | next的使用https://zfunnily.github.io/2021/05/lua_next/Mon, 10 May 2021 16:39:50 +0800https://zfunnily.github.io/2021/05/lua_next/lua_next lua_next(L,index):先把 表(lua栈 index所指的表), 的当前索引弹出,再把table 当前索引的值弹出,也就是先弹出 table的索引,再弹出table索引的值 举例: local t = { [&#34;a&#34;] = 1, [&#34;b&#34;]Lua | APIhttps://zfunnily.github.io/2021/05/settopandpop/Mon, 10 May 2021 15:57:03 +0800https://zfunnily.github.io/2021/05/settopandpop/lua_pop和lua_settop lua_settop 我们直接来看lua_settop,文档解释 /* 设置栈的高度,如果之前的栈顶比新设置的更高,那么高出来的元素会被丢弃,反之压入nil来补足大小 假设栈里有2个元素。 如果Hugohttps://zfunnily.github.io/2021/04/hugo/Sat, 17 Apr 2021 00:00:00 +0000https://zfunnily.github.io/2021/04/hugo/hugo 我用过的静态博客有hexo、jekyll和hugo,对比起来,hugo虽然没有hexo那样丰富的插件和主题,但是hugo生成文章的速度更快。我是一名go语言爱好者,而hugo是go语言开发的, jekGolang | gomod拉取私有仓库https://zfunnily.github.io/2021/03/gomod/Tue, 23 Mar 2021 16:10:02 +0000https://zfunnily.github.io/2021/03/gomod/概述 在使用go mod的过程中,依赖的包往往是第三方库,当我们自定义一个包并且放在github.com私有仓库时候,按照原来的方法则会有如下问题。 get &#34;gitlab.com/xxx/zz&#34;: found meta tag get.metaImport{Prefix:&#34;gitlab.com/xxx/zz&#34;, VCS:&#34;git&#34;, RepoRoot:&#34;https://gitlab.com/xxx/zz.git&#34;} at //gitlab.com/xxx/zz?go-get=1 verifying gitlab.com/xxx/zz@v0.0.1: gitlab.com/xxx/zz@v0.0.1: reading https://sum.golang.org/lookup/gitlab.com/xxx/zz@v0.0.1: 410 Gone 这个错误是因为新版本g八个基础排序https://zfunnily.github.io/2021/03/sort/Tue, 23 Mar 2021 10:13:31 +0000https://zfunnily.github.io/2021/03/sort/sort排序 std::sort( )函数是库函数提供的排序函数,必须包括头文件#include &lt;algorithm&gt;,它使用的排序方法是类似于快排的方法,时间复杂度为n*log2(n) Sort函数有三个参数:《仙剑奇侠传》编译运行https://zfunnily.github.io/2021/03/gamexian/Sun, 21 Mar 2021 10:44:58 +0000https://zfunnily.github.io/2021/03/gamexian/概述 今天在github上找到了《仙剑奇侠传》的rpg单机游戏sdlpal,sdlpal 是一个开源项目,基于sdl把仙剑奇侠传重写了一遍。 下面是我的编译过程总结。 环境 win10- sdl1.2- sdlpal- vs2017- DirectX SDK10 下载sdlpal $ git clone https://github.com.cnpmjs.org/sdlpal/sdlpal.git实现atoi和itoa函数https://zfunnily.github.io/2021/03/atoianditoa/Wed, 17 Mar 2021 16:43:20 +0000https://zfunnily.github.io/2021/03/atoianditoa/题目1: 把字符串转化为整数 有整数字符串,&quot;13579&quot;, 和 &quot;246810&quot;. 请写一个函数把这两个字符串转化为整数 步骤: 先判断正负 遍历字符串,转换字符为整数 //atoi.cc #include &lt;stdio.h&gt; int my_atoi(char *str) { bool bmin = false; int result = 0; //先判断正协程解析二 | 云风的coroutinehttps://zfunnily.github.io/2021/03/coroutinetwo/Wed, 10 Mar 2021 11:11:47 +0000https://zfunnily.github.io/2021/03/coroutinetwo/概述 云风的coroutine是通过ucontext来控制程序运行时上下文的,我们来根据该库提供的几个接口,和一个demo来解释协程的运行原理。如果不了解ucontext的,建议先了解ucontxt 环境协程解析一 | ucontexthttps://zfunnily.github.io/2021/03/coroutineone/Tue, 09 Mar 2021 09:43:00 +0000https://zfunnily.github.io/2021/03/coroutineone/概述 最近在研究协程的实现原理,看了云风的coroutine和腾讯的开源库libco后,原来要实现一个协程库也没那么难。我先来讲讲云风的coroutine库。他使用的是 uncontext来保存程序运行上Golang | 定时器https://zfunnily.github.io/2021/02/timer/Thu, 25 Feb 2021 16:02:13 +0000https://zfunnily.github.io/2021/02/timer/概述 golang有三种方式实现定时器: ticker timer select Ticker 通过 time.NewTicker(d)的方式实现定时器 d := time.Duration(time.Second * 2) t1 := time.NewTicker(d) defer t1.Stop() go func() { for { &lt;- t1.C fmt.Println(&#34;NewTicker...&#34;) } }() Timer 通过 time.NewTimer(d)的方式实现定时器 t2 := time.NewTimer(d)Lua | 解决百元买鸡的问题https://zfunnily.github.io/2021/02/chicken/Wed, 24 Feb 2021 17:51:46 +0000https://zfunnily.github.io/2021/02/chicken/问题 编写lua程序求解百鸡百钱问题。公鸡5元一只,母鸡3元一只,小鸡一元3只,问100元钱买100只鸡,可买公鸡、母鸡、小鸡各多少只? 代码 ----------------------------------------------------------------------------- --公鸡5元一只,母鸡3元一只,小鸡一元3只,问100元钱买Golang | JWT身份认证https://zfunnily.github.io/2021/02/JWT/Wed, 24 Feb 2021 14:22:04 +0000https://zfunnily.github.io/2021/02/JWT/概述 最近要在http接口上加一个token认证,但是接口很多,有没有一个省时省力的办法来解决。token的使用流程是: 用户使用帐号密码登陆到服务器1. 服务器验证登陆成功,根据帐号密码生成token。把Lua | 调用C/C++的动态库https://zfunnily.github.io/2021/02/dynamic/Sat, 20 Feb 2021 11:11:51 +0000https://zfunnily.github.io/2021/02/dynamic/概述 最近在学习 云风的skynet库,想自定义一个模块,目标是使用lua调用C/C++所编写的库。 当我们需要在Lua里面调用c/c++函数时,所有的函数都必须满足以下函数签名: typedef int (*lua_CFunction) (lua_State *L); 换句话说,所有的汇编 | C/C++调用汇编https://zfunnily.github.io/2021/02/compilation/Mon, 01 Feb 2021 14:40:51 +0000https://zfunnily.github.io/2021/02/compilation/概述 我使用AT&amp;T的规范,在linux上完成 C和汇编的互相调用,并使用gcc编译成可执行文件。 目标:汇编函数提供输出。类似C语言的函数 void hello_world(char* value) { printf(value); } 提供给C语言调用: int main() { hello_world(&#34;hello world!\n&#34;); } 搭建AT&amp汇编 | AT&T和Intel规范的区别https://zfunnily.github.io/2021/01/attandintel/Sun, 31 Jan 2021 11:25:39 +0000https://zfunnily.github.io/2021/01/attandintel/概述 常见的指令集以及汇编语言规范: x86(IA-32)、x86-64指令集(常见于PC端),对应有2家公司发布的不同汇编语言规范: intel公司发布的汇编语言规范,称intel 汇编:Windows派系Skynet | lua-protobufhttps://zfunnily.github.io/2021/01/skynetprotobuf/Mon, 25 Jan 2021 14:25:07 +0000https://zfunnily.github.io/2021/01/skynetprotobuf/概述 在最新的skynet中我使用的是云风的pbc库来解析protobuf,该项目中的一个文件protobuf.lua 使用了module语法在lua5.1版本中已经删除,最新的skynet是lua5.4Protobuf | 请求参数为空的案例https://zfunnily.github.io/2021/01/pbempty/Fri, 22 Jan 2021 16:41:16 +0000https://zfunnily.github.io/2021/01/pbempty/参数为空的grpc请求怎么定义 google protobuf已经提供了空参数 //empty.proto message Empty {&lt;!-- --&gt;} 使用方法,在proto文件中导入empty.proto, 定义一个请求参数和返回值为空的函数emptyfunction, 函数名字Golang | C数组转化为Golang的切片类型https://zfunnily.github.io/2021/01/goslience/Fri, 22 Jan 2021 15:56:40 +0000https://zfunnily.github.io/2021/01/goslience/概述 最近在巩固cgo的基础知识,在网上看到一篇Go和C之间 字符串数组、切片类型转换的文章,让我想到我之前写的一篇在go中遍历C结构体数组的文章,让我有新的方法来解决之前的问题,把C的数组转化为Go的切Skynet | echo服务https://zfunnily.github.io/2021/01/skynetecho/Fri, 15 Jan 2021 16:07:51 +0000https://zfunnily.github.io/2021/01/skynetecho/概述 引用云风博客的话:“skynet 是一个为网络游戏服务器设计的轻量框架。但它本身并没有任何为网络游戏业务而特别设计的部分,所以尽可以把它用于其它领域。skynet 并不是一个开箱即用的引擎,使用它需要Redis源码分析 | ziplisthttps://zfunnily.github.io/2021/01/ziplist/Wed, 13 Jan 2021 17:52:27 +0000https://zfunnily.github.io/2021/01/ziplist/概述 Redis中的List是一个有序(按加入的时序排序)的数据结构,一般有序我们会采用数组或者是双向链表,其中双向链表由于有前后指针实际上会很浪费内存。3.2版本之前采用两种数据结构作为底层实现: 压缩Redis源码解析 | VScode调试https://zfunnily.github.io/2021/01/vscodedebugredis/Tue, 12 Jan 2021 14:25:29 +0000https://zfunnily.github.io/2021/01/vscodedebugredis/环境 vscode- gcc5.4 ubuntu16.04 或者 ubuntu18.04 make 下载6.2版本. 我使用的是国内github镜像地址:github.com.cnpmjs.org,速度比较快。 $ git clone https://github.com.cnpmjs.org/redis/redis.git redis $ git checkout -b 6.2 remotes/origin/6.2 vscode不参与编译,只充当可视化的调试工具。 使用VScode | 调试Redis源码,指针显示的问题https://zfunnily.github.io/2021/01/vscoderedis/Tue, 12 Jan 2021 14:17:22 +0000https://zfunnily.github.io/2021/01/vscoderedis/缘由 使用VScode的时候,断点看到指针显示的是一串地址,而不是指针指向的对象的值。上网找了一圈,没看到vscode有对应的插件来解决这个问题。vscode有对应的语法来解决这个问题。 网上几乎都在说在Cgo | 遍历C结构体数组https://zfunnily.github.io/2021/01/cgostruct/Mon, 11 Jan 2021 17:18:35 +0000https://zfunnily.github.io/2021/01/cgostruct/缘由 现在有个应用场景,我们要在go中获取C结构体数组中的值。在C语言中,对于结构体数组,我们可以利用指针的偏移量来获取我们想要的值的位置。在go中我们怎么使用C指针和偏移量进行运算呢?下面的文字中C指Redis源码解析 | sdshttps://zfunnily.github.io/2021/01/sds/Wed, 06 Jan 2021 14:20:23 +0000https://zfunnily.github.io/2021/01/sds/SDS头文件及作用 sds.h: sds声明- sdsalloc.h: 为sds分配内存 源码文件sds.h中有这样一行代码 typedef char *sds; 很清晰、明了,sds其实就是char*。 最新的6.2分支的代码: struct __attribute__ ((__packed__)) sdshdr5 {&lt;!-- --&gt; unsigned char flags; /* 3 lsb ofstruct中使用char[]https://zfunnily.github.io/2021/01/chararray/Tue, 05 Jan 2021 15:45:36 +0000https://zfunnily.github.io/2021/01/chararray/缘由 最近在看redis的源码,刚开始看sds,看到这块代码 struct __attribute__ ((__packed__)) sdshdr5 { unsigned char flags; /* 3 lsb of type, and 5 msb of string length */ char buf[]; }; 好奇为什么使用 char buf[],而不用char *buf,找到答案记录一下。 struct中的char*Lastbattle | 游戏场景服务器SS解析https://zfunnily.github.io/2021/01/lastbattle/Sat, 02 Jan 2021 23:19:58 +0000https://zfunnily.github.io/2021/01/lastbattle/游戏场景服务器概况 指令对应的处理handle的文件:SSBattleMgr.cpp 创建战场 指令: eMsgToSSFromCS_CreateBattle GC服务器发往SS fromCS 收到中心服务器CS创建站场的指令,在函数INT32 CSSBattleMgr::OnMsgFromCS_CreateBattle(const char* pData, int n32DataLengtCCnet | 单线程reactor演变为多线程https://zfunnily.github.io/2020/12/ccnet/Wed, 30 Dec 2020 09:19:41 +0000https://zfunnily.github.io/2020/12/ccnet/ccnet从单线程演变为多线程 ccnet现状: epoll linux平台 事件循环 单线程 reactor 监听和新连接的事件都在主线程中 单线程的ccnet ccnet的单线程的角色: EventLoop: 整个事件循环。 EPollPoller: 负责事件的收集。 ChannelGolang | sync.Mutex详解https://zfunnily.github.io/2020/12/syncmutex/Tue, 29 Dec 2020 13:17:18 +0000https://zfunnily.github.io/2020/12/syncmutex/概述 自己做的一个golang项目需要优化,优化方向是减少gpu内存的使用。同一个模型被重复加载多次,使用更多的gpu内存,也增加 sync.Mutex的使用。 优化的方向是: 减少代码量的改动- 减少gpu内五种网络IO模型总结https://zfunnily.github.io/2020/12/iomodels/Mon, 28 Dec 2020 11:57:04 +0000https://zfunnily.github.io/2020/12/iomodels/概述 在网络上看到很多关于阻塞IO、非阻塞IO、同步IO、异步IO的例子,总觉得写的过于复杂并且让人难以理解。于是我把我自己把这几个概念的理解写下来以供参考。 POSIX POSIX(可移植操作系统接口)把同步IOCCnet | 一个reactor单线程网络库https://zfunnily.github.io/2020/12/ccnetone/Sun, 27 Dec 2020 18:41:25 +0000https://zfunnily.github.io/2020/12/ccnetone/缘由 最近在研究陈硕的网络库muduo,是一个基于reactor架构的网络库。我对网络库的感觉是易用,但是内容庞大,依赖颇多。比如boost网络库里面的一些语法让人生畏。关于reactor和proactC++ | vector中的resize()函数 VS reserve()函数https://zfunnily.github.io/2020/12/reserve/Fri, 25 Dec 2020 11:04:29 +0000https://zfunnily.github.io/2020/12/reserve/reserve void reserve (size_type n); reserver函数用来给vector预分配存储区大小,即capacity的值 ,但是没有给这段内存进行初始化。reserve 的参数n是推荐预分配内存的大小,实际分配的可能等于或大于这个值,即Golang | 用gocolly登录B站https://zfunnily.github.io/2020/12/gocolly/Sun, 13 Dec 2020 14:51:53 +0000https://zfunnily.github.io/2020/12/gocolly/概述 gocolly是golang语言开发的爬虫包,通过gocolly来进行模拟网站的登录, 目标已经确立,开始行动。 下载 $ go get -u github.com/gocolly/colly 获取cookie 登录网站:https://www.bilibili.coProtobuf | 沾包问题https://zfunnily.github.io/2020/12/tcp/Sun, 13 Dec 2020 10:22:38 +0000https://zfunnily.github.io/2020/12/tcp/缘由 最近在研究一款游戏的源码。发现里面的通信协议是protobuf定义的,但还是自己定义了协议头部,类似 head + body。先解析头部里所存储的整个包的数据长度,然后再解析包剩余的数据,这样做的目的是为了防Grpc | 概述https://zfunnily.github.io/2020/12/grpc/Sun, 13 Dec 2020 09:10:42 +0000https://zfunnily.github.io/2020/12/grpc/OverView gRPC是由Google主导开发的RPC框架,使用HTTP/2协议并用ProtoBuf作为序列化工具。其客户端提供Objective-C、Java接口,服务器侧则有Java、Golang、C++等接Ubuntu16.04.6 | 安装Cinnamon3.0https://zfunnily.github.io/2020/12/cinnamon3.0/Tue, 01 Dec 2020 15:43:58 +0000https://zfunnily.github.io/2020/12/cinnamon3.0/概述 Cinnamon[1]是Linux Mint[2]的默认桌面环境。不同于 Ubuntu 的 Unity 桌面环境,Cinnamon 是一个更加传统而优雅的桌面环境,其带有底部面板和应用菜单。由于 Cinnamon 桌面以及它类 Windows 的用户界面,许多Ubuntu | version `GLIBC_2.27‘ not found错误https://zfunnily.github.io/2020/11/glibcnotfound/Sat, 28 Nov 2020 15:03:04 +0000https://zfunnily.github.io/2020/11/glibcnotfound/version `GLIBC_2.27’ not found错误 执行strings /lib/x86_64-linux-gnu/libc.so.6 | grep GLIBC_ 结果显示如下: GLIBC_2.2.5 GLIBC_2.2.6 GLIBC_2.3 GLIBC_2.3.2 GLIBC_2.3.3 GLIBC_2.3.4 GLIBC_2.4 GLIBC_2.5 GLIBC_2.6 GLIBC_2.7 GLIBC_2.8 GLIBC_2.9 GLIBC_2.10 GLIBC_2.11 GLIBC_2.12 GLIBC_2.13 GLIBC_2.14 GLIBC_2.15 GLIBC_2.16 GLIBC_2.17 GLIBC_2.18 GLIBC_2.22 GLIBC_2.23 GLIBC_2.24 GLIBC_PRIVATE 去清华开源站点下载glibc: https://mirrors.tuna.tsinghua.edu.cn/gnu/libc/ 下载好文件后解压 $ tar -zxvf glibc-2.27.tar.gz 进入 glibc-2.27 目录,Docker | 容器退出码详解https://zfunnily.github.io/2020/11/Docker%E5%AE%B9%E5%99%A8%E9%80%80%E5%87%BA%E7%A0%81%E8%AF%A6%E8%A7%A3/Sat, 28 Nov 2020 13:32:57 +0000https://zfunnily.github.io/2020/11/Docker%E5%AE%B9%E5%99%A8%E9%80%80%E5%87%BA%E7%A0%81%E8%AF%A6%E8%A7%A3/docker查看退出码指令 $ docker ps --filter &#34;status=exited&#34; $ docker inspect container-id --format=&#39;{&lt;!-- --&gt;{.State.ExitCode}}&#39; 常见退出码 Exit Code 0 退出代码0表示特定容器没有附加前台进程。 该退出代码是所有其他后续退出代码的例外。 这不一定意味着发生了不好的事情。如果开发人员想要在容器完Openresty二 | postman小工具https://zfunnily.github.io/2020/11/%E4%BD%BF%E7%94%A8OpenResty%E5%81%9A%E4%B8%80%E4%B8%AApostman%E5%B0%8F%E5%B7%A5%E5%85%B7/Wed, 25 Nov 2020 16:30:39 +0800https://zfunnily.github.io/2020/11/%E4%BD%BF%E7%94%A8OpenResty%E5%81%9A%E4%B8%80%E4%B8%AApostman%E5%B0%8F%E5%B7%A5%E5%85%B7/用到的知识点 mvc架构 模型渲染库:https://github.com/bungle/lua-resty-template resty http请求库: https://github.com/bungle/lua-resty-template 参照 mvc模型来做postman工具 配置文件说明 worker_processes 1; error_log logs/error.log; eventsOpenresty一 | 初探https://zfunnily.github.io/2020/11/OpenResty%E5%88%9D%E6%8E%A2/Mon, 23 Nov 2020 16:21:34 +0800https://zfunnily.github.io/2020/11/OpenResty%E5%88%9D%E6%8E%A2/概述 OpenResty®是一个基于Nginx与 Lua 的高性能 Web 平台,其内部集成了大量精良的 Lua 库、第三方模块以及大多数的依赖项。用于方便地搭建能够处理超高并发、扩展性极高的动态 Web 应用、Web 服务和动态网关。LastBattle | 登录流程(LS & BS & GS)https://zfunnily.github.io/2020/11/lastbattlelogin/Fri, 20 Nov 2020 17:27:08 +0000https://zfunnily.github.io/2020/11/lastbattlelogin/登录流程 根据上一篇文章中的登录流程,我在工程中找到了相应的代码并记录了下来 登录服务代码解析 监听端口:49997 供BS服务连接 监听端口:49996 供客户端连接 CIocpCtrl:IOCP控制类 多线程循环LastBattle | 服务架构https://zfunnily.github.io/2020/11/lastbattleserver/Fri, 20 Nov 2020 17:24:32 +0000https://zfunnily.github.io/2020/11/lastbattleserver/服务器架构简图如下: 连线说明: 实线:表示客户端登录流程,①②③④⑤表示登录流程,详细解释见下文。 虚线:表示服务器间的连接,虚线箭头指向监听方。 架构说明: |英文名称|简称|中文名称|功能简介|单个大区需LastBattle | 安装部署笔记https://zfunnily.github.io/2020/11/lastbattleone/Mon, 16 Nov 2020 06:49:49 +0000https://zfunnily.github.io/2020/11/lastbattleone/环境准备 win10 服务器:vs2010 / 数据库 mysql5.7 清华大学mysql镜像网站:https://mirrors.tuna.tsinghua.edu.cn/mysql/downloads/MySQL-5.7/ 客户端Cgo | 使用libevent库实现一个定时器https://zfunnily.github.io/2020/11/cgo%E4%BD%BF%E7%94%A8libevent%E5%BA%93%E5%AE%9E%E7%8E%B0%E4%B8%80%E4%B8%AA%E5%AE%9A%E6%97%B6%E5%99%A8/Fri, 13 Nov 2020 16:40:42 +0000https://zfunnily.github.io/2020/11/cgo%E4%BD%BF%E7%94%A8libevent%E5%BA%93%E5%AE%9E%E7%8E%B0%E4%B8%80%E4%B8%AA%E5%AE%9A%E6%97%B6%E5%99%A8/使用libevent库作为例子 下载 &amp; 编译 &amp; 安装libevent $ git clone https://github.com.cnpmjs.org/libevent/libevent.git $ cd libevent &amp;&amp; mkdir build &amp;&amp; cd build $ cmake .. $ make libevent实现的定时器 // main.cpp #include &#34;event.h&#34; struct event ev; struct timeval tv; void time_cb(evutil_socket_t fd, short event, void *argc) { printf(&#34;timer wakeup\n&#34;); event_add(&amp;ev, &amp;tv); // reschedule timer } int main() { struct event_base *base = event_base_new(); tv.tv_sec = 2;Golang | 利用指针进行数据转换https://zfunnily.github.io/2020/11/Golang-%E5%88%A9%E7%94%A8%E6%8C%87%E9%92%88%E8%BF%9B%E8%A1%8C%E6%95%B0%E6%8D%AE%E8%BD%AC%E6%8D%A2/Thu, 12 Nov 2020 17:19:07 +0000https://zfunnily.github.io/2020/11/Golang-%E5%88%A9%E7%94%A8%E6%8C%87%E9%92%88%E8%BF%9B%E8%A1%8C%E6%95%B0%E6%8D%AE%E8%BD%AC%E6%8D%A2/概述 在Go语言中,Slice本质是什么呢?是一个reflect.SliceHeader结构体和这个结构体中Data字段所指向的内存。String本质是什么呢?是一个reflect.StringHeadGolang | buildshttps://zfunnily.github.io/2020/11/go-builds/Thu, 12 Nov 2020 17:15:17 +0000https://zfunnily.github.io/2020/11/go-builds/概述 通常我们会给每个产品环境设置不同的配置,比如 redis 要在开发环境就连接 localhost:6379,测试环境可能连接某一个主机的 redis。 如果放在 go 里面是否可行?因为 go 是编译二进制包,也没有动态加载这Cgo | 简单使用https://zfunnily.github.io/2020/11/cgo%E7%9A%84%E7%AE%80%E5%8D%95%E4%BD%BF%E7%94%A8/Thu, 05 Nov 2020 09:45:23 +0000https://zfunnily.github.io/2020/11/cgo%E7%9A%84%E7%AE%80%E5%8D%95%E4%BD%BF%E7%94%A8/使用自己的C函数 文件名:testC.go package main /* #include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; void c_print(char *str) { printf(&#34;%s\n&#34;, str); } */ import &#34;C&#34; //import “C” 必须单起一行,并且紧跟在注释行之后 import &#34;unsafe&#34; func main() { s := &#34;Hello Cgo&#34; cs := C.CString(s) //字符串映射 C.c_print(cs) //调用C函数 defer C.free(unsafe.Pointer(cs)) //释放内存 } 说明: 1、gGolang | 使用Lumberjack+zap进行日志切割归档https://zfunnily.github.io/2020/11/%E4%BD%BF%E7%94%A8Lumberjack-zap%E8%BF%9B%E8%A1%8C%E6%97%A5%E5%BF%97%E5%88%87%E5%89%B2%E5%BD%92%E6%A1%A3/Wed, 04 Nov 2020 12:44:03 +0000https://zfunnily.github.io/2020/11/%E4%BD%BF%E7%94%A8Lumberjack-zap%E8%BF%9B%E8%A1%8C%E6%97%A5%E5%BF%97%E5%88%87%E5%89%B2%E5%BD%92%E6%A1%A3/使用Lumberjack+zap进行日志切割归档 为了添加日志切割归档功能,我们将使用第三方库Lumberjack来实现。 安装 执行下面的命令安装Lumberjack go get -u github.com/natefinch/lumberjack zap logger中加入LumbeVim | vimplus快捷键https://zfunnily.github.io/2020/10/vimplus%E5%BF%AB%E6%8D%B7%E9%94%AE/Wed, 28 Oct 2020 09:14:28 +0000https://zfunnily.github.io/2020/10/vimplus%E5%BF%AB%E6%8D%B7%E9%94%AE/插件相关 |快捷键|说明 |&mdash;&mdash; |,|Leader Key |&lt;leader&gt;n|打开 / 关闭代码资源管理器 |&lt;leader&gt;t|打开 / 关闭函数列表 |&lt;leader&gt;a|.h .cpp 文件切换 |&lt;leader&gt;u|转到函数声明 |&Vim | 打造编C++IDEhttps://zfunnily.github.io/2020/10/%E4%BD%BF%E7%94%A8vim%E6%89%93%E9%80%A0%E7%BC%96C-IDE/Wed, 28 Oct 2020 09:11:32 +0000https://zfunnily.github.io/2020/10/%E4%BD%BF%E7%94%A8vim%E6%89%93%E9%80%A0%E7%BC%96C-IDE/使用 vimplus 打造C++ IDE GitHub: https://github.com/chxuan/vimplus 支持平台: macos/linux 安装vimplus // 原来的链接, 国内速度较慢 $ git clone https://github.com/chxuan/vimplus.git ~/.vimplus // github修改为镜像的链接 $ git clone --depth=1 https://github.com.cnpmjs.org/chxuan/vimplus.git ~/.vimplus $ cd ~/.vimplus //不加sudo $ ./install.sh 设置Nerd Font 为防止vimpluLinux | 删除大量文件指令--rsynchttps://zfunnily.github.io/2020/10/linux%E7%B3%BB%E7%BB%9F%E5%88%A0%E9%99%A4%E5%A4%A7%E9%87%8F%E6%96%87%E4%BB%B6%E6%8C%87%E4%BB%A4--rsync/Tue, 13 Oct 2020 16:29:34 +0000https://zfunnily.github.io/2020/10/linux%E7%B3%BB%E7%BB%9F%E5%88%A0%E9%99%A4%E5%A4%A7%E9%87%8F%E6%96%87%E4%BB%B6%E6%8C%87%E4%BB%A4--rsync/rsync的安装 rsync安装,有些系统默认安装有该命令 ubuntu系统 sudo apt-get install rsync centos系统 sudo yum install rsync rsync参数详解 rsync提供了一些跟删除有关的参数 rsync --help | grep delete -del an alias for --delete-during --delete delete extraneous files from destination dirs --delete-before receiver deletes beforeCPU的核与线程-4核8线程https://zfunnily.github.io/2020/10/CPU%E7%9A%84%E6%A0%B8%E4%B8%8E%E7%BA%BF%E7%A8%8B-4%E6%A0%B88%E7%BA%BF%E7%A8%8B/Mon, 12 Oct 2020 16:29:34 +0000https://zfunnily.github.io/2020/10/CPU%E7%9A%84%E6%A0%B8%E4%B8%8E%E7%BA%BF%E7%A8%8B-4%E6%A0%B88%E7%BA%BF%E7%A8%8B/查看cpu信息 $ cat /proc/cpuinfo 物理CPU 物理CPU就是计算机上实际配置的CPU个数。 在linux上可以打开cat /proc/cpuinfo 来查看,其中的physical id就是每个物理CPU的ID,能找到几个physical id就代表TCP/IP | 大量TIME_WAIT对线上业务的影响https://zfunnily.github.io/2020/10/%E5%A4%A7%E9%87%8FTIME_WAIT%E5%AF%B9%E7%BA%BF%E4%B8%8A%E4%B8%9A%E5%8A%A1%E7%9A%84%E5%BD%B1%E5%93%8D/Sat, 10 Oct 2020 16:46:34 +0000https://zfunnily.github.io/2020/10/%E5%A4%A7%E9%87%8FTIME_WAIT%E5%AF%B9%E7%BA%BF%E4%B8%8A%E4%B8%9A%E5%8A%A1%E7%9A%84%E5%BD%B1%E5%93%8D/TCP的三次握手和四次挥手 TIME_WAIT概述 TIME_WAIT 状态: TCP 连接中,主动关闭连接的一方出现的状态;(收到 FIN 命令,进入 TIME_WAIT 状态,并返回 ACK 命令) 保持 2 个 MSL 时间,即,4 分钟 ;(MSL 为 2 分钟) TCP 连接建立后,「主Libevent | 定时器https://zfunnily.github.io/2020/09/libeventimer/Wed, 16 Sep 2020 23:20:28 +0000https://zfunnily.github.io/2020/09/libeventimer/libevent 实现定时器流程 首先初始化libevent库,并保存返回的指针 struct event_base * base = event_init(); 实际上这一步相当于初始化一个Reactor实例;在初始化libevent后,就可以注册事件了。 初始化事件event,设置回调函FFmpeg | 画中画和视频多宫格处理https://zfunnily.github.io/2020/09/ffmpegpicture/Mon, 14 Sep 2020 18:29:33 +0000https://zfunnily.github.io/2020/09/ffmpegpicture/FFmpeg生成画中画 静态画中画 将视频sub.mp4视频文件缩放成宽 480 、高 320 的视频,然后显示在 视频 input.mp4,x坐标为0,y 坐标为0 的位置 ffmpeg -re -i input.mp4 -vf &#34;movie=sub.mp4, scale=480x320[test]; [in][test]overlay [out]&#34; -vcodec libx264 output.flv 显示在画面的右下角,则需要用到FFmpeg | 给视频加文字和图片水印https://zfunnily.github.io/2020/09/ffmpegvideo/Sat, 12 Sep 2020 12:47:57 +0000https://zfunnily.github.io/2020/09/ffmpegvideo/FFmpeg给视频加上logo ffmpeg从视频中截取图像帧 ffmpeg -i inputfile.avi -r 1 -f image2 image-%05d.jpeg ffmpeg -i inputfile.avi -r 1 -s 4cif -f image2 image-%05d.jpeg ffmpeg -i inputfile.avi -r 1 -t 4 -f image2 image-%05d.jpeg ffmpeg -i inputfile.avi -r 1 -ss 01:30:14 -f image2 image-%05d.jpeg ffmpeg -i inputfile.avi -r 1 -ss 01:30:14 -vframes 120 4cif -f image2 image-%05d.jpeg -r 指定抽取的帧率,即从视频中每秒钟抽取FFmpeg | 录制摄像头和桌面数据windowshttps://zfunnily.github.io/2020/09/ffmpegvideow/Wed, 09 Sep 2020 09:36:49 +0000https://zfunnily.github.io/2020/09/ffmpegvideow/概述 FFmpeg Windows 设备操作 Windows 采集设备的主要方式是 dshow vfwcap gdigrab 其中 dshow 可以用来抓 取摄像头、采集卡、麦克风等,- vfwcap 主要用来采集摄像头类设备,- gdigrab 则是抓取 Windows 窗口程序 FFmpeg 使用 dshow 采集音视频设备 使用 dshow 枚举设备 ffmpeg -f dshow -list_devices true -i dymmy 输出 [dshow @ 000002622302e340]FFmpeg | 录制摄像头和桌面数据machttps://zfunnily.github.io/2020/08/macffmpeg/Sat, 29 Aug 2020 17:20:40 +0000https://zfunnily.github.io/2020/08/macffmpeg/设备枚举 查看设备列表 $ ffmpeg -hide_banner -devices Devices: D. = Demuxing supported .E = Muxing supported -- D avfoundation AVFoundation input device D lavfi Libavfilter virtual input device E sdl,sdl2 SDL2 output device 可以看到输入设备有:avfoundation,lavfi 输出设备有:sdl `` 设备采集举例: $ ffmpeg -f avfoundation -list_devices true -i &#34; &#34; 看到了 如下设K8S | Prometheus+Grafana监控https://zfunnily.github.io/2020/08/prometheusgrafana/Mon, 17 Aug 2020 13:58:35 +0000https://zfunnily.github.io/2020/08/prometheusgrafana/概述 作为应用与Kubernetes的监控体系,Prometheus具备诸多的优势,如: Kubernetes默认支持,非常适合容器和微服务- 无依赖,安装方便,上手容易- 社区活跃,它不仅仅是个工具,而是生Owt-server | owt-client-javascripthttps://zfunnily.github.io/2020/08/owt-client-javascript/Sun, 16 Aug 2020 23:04:13 +0000https://zfunnily.github.io/2020/08/owt-client-javascript/概述 天气燥热,不易出门。遂研究一下owt-server,从owt-client-javascript的流程开始吧。 获取一个会议室 owt-client-javascript的时候有一个初始化房间的过程 ///owt-client-javascript/src/samples/conference/samplertcservice.jsK8S | Ingress的基本使用https://zfunnily.github.io/2020/08/ingress/Sat, 15 Aug 2020 00:05:15 +0000https://zfunnily.github.io/2020/08/ingress/缘由 看了statefulset基础教程的基础教程,并且把环境搭建起来后。pod内部是可以连通了。但是我不知道怎么去从外部访问。在网上搜索一番,通过Ingress可以作为集群的入口。遂记录之。 结合StaK8S | Statefluset的持久存储PVChttps://zfunnily.github.io/2020/08/pvc/Fri, 14 Aug 2020 17:18:58 +0000https://zfunnily.github.io/2020/08/pvc/缘由 在看statefluset基础教程的时候遇到pod状态为pending kubectl describe pod web-0 日志内容是 pod has unbound immediate PersistentVolumeClaims 于是就对PV和PVC进行研究。 有给出完整的 web.yaml查看最下面的完整示例。但是我建议先把PVLinux | nsf服务的搭建和使用https://zfunnily.github.io/2020/08/nsf/Fri, 14 Aug 2020 17:17:54 +0000https://zfunnily.github.io/2020/08/nsf/搭建nsf服务 sudo apt install nfs-kernel-server 默认情况下,在Ubuntu 18.04上,NFS版本2是禁用的。版本3和版本4已启用。您可以通过运行以下cat命令来验证: sudo cat /proc/fs/nfsd/versions 写入 exports cat /etc/exports sudo echo /nfs/prometheus/data/ 192.168.84.75/24(rw,no_root_squash,no_all_squash,sync) &gt;&gt; /etc/exports sudo echo /nfs/prometheus/data/ 192.168.84.75/24(rw,no_root_squash,no_all_squash,sync) &gt;&gt; /etc/exports 可以设定的参数主要K8S | StatefulSet基本原理https://zfunnily.github.io/2020/08/statefulset/Fri, 14 Aug 2020 16:03:41 +0000https://zfunnily.github.io/2020/08/statefulset/背景 用户通过 Deployment、ReplicationController 可以方便地在 kubernetes 中部署一套高可用、可扩展的分布式无状态服务。这类应用不在本地存储数据,通过简单的负载均衡策略可实现请求分发。随K8S | coreDNS的部署安装https://zfunnily.github.io/2020/08/coredns/Thu, 13 Aug 2020 18:44:28 +0000https://zfunnily.github.io/2020/08/coredns/概述 CoreDNS可以在具有标准的Kube-DNS的Kubernetes集群中运行。作为Kubernetes 的插件使用,CoreDNS将从 Kubernetes集群中读取区(zone)数据。它实现了为KK8S | 创建第一个应用https://zfunnily.github.io/2020/08/firstk8s/Thu, 13 Aug 2020 15:28:31 +0000https://zfunnily.github.io/2020/08/firstk8s/使用k8s部署第一个应用 创建一个nginx.yaml文件 apiVersion: v1 kind: Pod metadata: name: nginx # 指定 label,便于检索 labels: app: nginx spec: containers: - name: nginx # 指定镜像 image: nginx:alpine # 指定暴露端口 ports: - containerPort: 80 --- # 创建网络服务 apiVersion: v1 kind: Service metadata: name: kube-node-service labels: name: kube-node-service spec: type: NodePort #这里代表Licod | 安装和配置https://zfunnily.github.io/2020/08/licode/Sun, 09 Aug 2020 09:34:36 +0000https://zfunnily.github.io/2020/08/licode/拉取docker镜像并运行 licode官方提供了配置好的docker镜像,使用以下命令拉下来跑就行。 docker run --name licode -p 3000:3000 -p $MIN_PORT-$MAX_PORT:30000-30050/udp -p 3001:3001 -p 8080:8080 -e &#34;MIN_PORT=30000&#34; -e &#34;MAX_PORT=30050&#34; -e &#34;PUBLIC_IP=your_ip_address&#34; lynckia/licode 注意命令里的PUBLIC_IP要改为服务器的公网IP。 配置好之Docker | 远程访问加密https://zfunnily.github.io/2020/08/dockersecret/Fri, 07 Aug 2020 07:56:52 +0000https://zfunnily.github.io/2020/08/dockersecret/docker的远程访问 方法一 :编辑docker.service文件 编辑docker.service文件 sudo vim /lib/systemd/system/docker.service 修改ExecStart行为下面内容 ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock 重新加载docker配置 sudo systemctl daemon-reload // 1,加载dockDocker | web管理界面portainerhttps://zfunnily.github.io/2020/08/dockerweb/Fri, 07 Aug 2020 07:54:43 +0000https://zfunnily.github.io/2020/08/dockerweb/拉取镜像 $ docker pull portainer/portainer 运行启动portainer docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v /home/docker/portainer:/data --name portainer --restart=always portainer/portainer admin bigant.cn 汉化 Portainer-CN.zip 百度云盘: https://pan.baidu.com/s/13ra6jXHR_7vajLLlf5GVEw 提取码: nzue 新建文件夹命名为public,把Portainer-CN.zip解压至里面。 2、public文件夹传K8S | 集群资源监控 heapsterhttps://zfunnily.github.io/2020/08/heapster/Thu, 06 Aug 2020 09:06:05 +0000https://zfunnily.github.io/2020/08/heapster/安装heapster的原因 查看dashboard状态 $ sudo kubectl get pods --all-namespaces | grep dashboard kubernetes-dashboard dashboard-metrics-scraper-6b4884c9d5-mvnb9 1/1 Running 0 40m kubernetes-dashboard kubernetes-dashboard-d7f7f565d-zhpsc 1/1 Running 0 40m 查看dashboard的日志 $ sudo kubectl logs -f -n kubernetes-dashboard kubernetes-dashboard-d7f7f565d-zhpsc 日志遇到这样的情况 No metric client provided. Skipping metrics. 2020/08/03 09:02:22 [2020-08-03T09:02:22Z] Outcoming response to 192.168.84.241:40086 with 200 status code 2020/08/03 09:02:23 Metric client healthK8S | Dashboard界面管理https://zfunnily.github.io/2020/08/dashboard/Thu, 06 Aug 2020 09:04:14 +0000https://zfunnily.github.io/2020/08/dashboard/安装部署Dashboard 通过一下命令来部署, recommended.yaml $ sudo kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deploy/recommended.yaml https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deplK8S | 安装https://zfunnily.github.io/2020/08/k8sinstall/Wed, 05 Aug 2020 10:00:40 +0000https://zfunnily.github.io/2020/08/k8sinstall/安装k8s前的准备工作 环境 ubuntu18.04 docker 关闭 swap 暂时关闭 $ swapoff -a 永久关闭 注释掉这一行 sudo vim /etc/fstab # /swapfile none swap sw 0 0 重启机器 sudo reboot docker 的配置 安装完成之后需要进行一些配置,包括 切换docker下载源为国内镜像站 以及 修改cgroupsOwt-server | 编译运行https://zfunnily.github.io/2020/08/owtservercomplie/Wed, 05 Aug 2020 09:47:22 +0000https://zfunnily.github.io/2020/08/owtservercomplie/概述 owt是一套完整的webrtc视频会议系统。包含的功能模块有: 视频会议1. p2p 服务器是owt-server通过nodejs编写的webrtc信令。依赖是licode。licode依赖webrtc。 客2024-01月https://zfunnily.github.io/1/01/30/Mon, 01 Jan 0001 00:00:00 +0000https://zfunnily.github.io/1/01/30/学习 书籍 电影 游戏 《艾尔登法环》 《Dark Soul》3 《LOL》 番&amp;剧 其他神之亵渎1https://zfunnily.github.io/1/01/blasphemous/Mon, 01 Jan 0001 00:00:00 +0000https://zfunnily.github.io/1/01/blasphemous/地图设计 非线性结构: 游戏的地图是非线性的,允许玩家在一个庞大的世界中自由探索。玩家可以决定选择不同的路径和区域,解锁新的能力以访问之前无法到达的地方。 多样化的区域: 地图中包含了多个主题区域,每个区域都血污booshttps://zfunnily.github.io/1/01/blood/Mon, 01 Jan 0001 00:00:00 +0000https://zfunnily.github.io/1/01/blood/《血污:夜之仪式》 BOSS一/猎魔斩月 挑衅 + 招架 飞镖 横砍 劈砍 冲刺 + 横砍 跳起来 + 劈砍 跳起来 + 上挑 跳起来 + 上挑 + 劈砍 钩锁 + 劈砍 刀刃,火焰附魔 + 上面的轮回 影分身 格莫瑞 最终boss 没有后续boss的分析 地图设 \ No newline at end of file +Posts on Zzz记忆https://zfunnily.github.io/post/Recent content in Posts on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +00002024-2月https://zfunnily.github.io/2024/02/02/Tue, 27 Feb 2024 15:45:00 +0800https://zfunnily.github.io/2024/02/02/学习 书籍 电影 游戏 《Lies of P》 《Dark Soul》重制版 番&amp;剧 《绝命毒师》第一季/第二季 其他12月https://zfunnily.github.io/2023/12/30/Sat, 30 Dec 2023 15:45:00 +0800https://zfunnily.github.io/2023/12/30/学习 银河城地图 搭建 ue5 paper2d 书籍 《游戏设计艺术》 电影 《复仇者联盟》4 游戏 《血污:夜之仪式》 《LOL》 《神之亵渎》 23小时 番&amp;剧 其他11月https://zfunnily.github.io/2023/11/30/Thu, 30 Nov 2023 15:45:00 +0800https://zfunnily.github.io/2023/11/30/学习 chatglm + langchain 知识库 docker搭建 ue5 paper2d的使用 wsl 子系统研究, win11 镜像模式. 电视剧 《繁城之下》 番剧 《反叛的鲁路修》 一季、二季 书籍 《置身事内》 电影 《复仇者联盟》3 游戏 《马里奥惊奇》已完结 《血污:夜之WSL2改为桥接https://zfunnily.github.io/2023/11/wsl2/Fri, 17 Nov 2023 15:45:00 +0800https://zfunnily.github.io/2023/11/wsl2/需求 在docker容器内部程序自己获取的ip是172开头的。我需要跟宿主机同样网段的ip。 问题 win10系统wsl2 不支持桥接 更简单的解决方案 使用vmware虚拟机,直接启动一个linux镜像,然后使Python3.7安装https://zfunnily.github.io/2023/11/python/Thu, 16 Nov 2023 15:39:01 +0800https://zfunnily.github.io/2023/11/python/环境 centos7 开始安装 安装扩展 $ yum -y install yum-utils 安装Centos开发工具 $ yum -y groupinstall development 安装python3依赖 $ yum -y install zlib-devel bzip2-devel openssl-devel openssl-static ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel libffi-devel lzma gcc 下载python3.7安装包 # 将python3.7安装包,下载到/usr/Docker | Mysql 挂载目录一键部署https://zfunnily.github.io/2023/11/mysql/Thu, 16 Nov 2023 11:36:44 +0800https://zfunnily.github.io/2023/11/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 #Svnhttps://zfunnily.github.io/2023/11/svn/Tue, 14 Nov 2023 16:46:02 +0800https://zfunnily.github.io/2023/11/svn/SVN 合并 从源svn分支合并到目标svn分支 在源svn项目下鼠标右键,TortoiseSVN -&gt; Repo-browser, 拿到源项目svn地址 在目标svn项目下鼠标右键,TortoiseSVN -&gt; Merge -&gt;, 填入源项目svn地址 在show lWSL2子系统迁移https://zfunnily.github.io/2023/11/wsl/Mon, 13 Nov 2023 22:21:34 +0800https://zfunnily.github.io/2023/11/wsl/wsl 安装 参考链接: https://learn.microsoft.com/zh-cn/windows/wsl/install 通过命令行安装 wsl --update wsl -v -l wsl --install wsl &amp; docker 迁移 WSL发行版默认都是安装在C盘,在%LOCALAPPDATA%/Docker/wsl目录 docker的运行数据、镜像文件都存在%LOCALAPPGithubActionhttps://zfunnily.github.io/2023/11/gitaction/Mon, 13 Nov 2023 11:21:34 +0800https://zfunnily.github.io/2023/11/gitaction/Github Token 生成 &amp; 设置 github -&gt; Settings -&gt; Developer Settings -&gt; Personal access tokens 新增 Tokens(classic) 点击Generate new token 点击你想使用Action的github仓库 Settings -&gt; Secrets and variables -&gt; Actions -&gt; New respository secret. 填上名字ACTION_ACCESS_TOKEN和第一步生成的 token,ChatGLM & LangChainhttps://zfunnily.github.io/2023/11/chatglm/Fri, 10 Nov 2023 11:21:34 +0800https://zfunnily.github.io/2023/11/chatglm/参考: 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 DockerDDNS配置https://zfunnily.github.io/2023/10/DDNS/Mon, 30 Oct 2023 11:21:34 +0800https://zfunnily.github.io/2023/10/DDNS/参考: https://www.sakamoto.blog/synology-nas-cloudflare-ddns/ Cloudflare 获取 区域 ID 创建 API 令牌 群晖设置 开启并登陆群晖NAS终端 下载 Cloudflare DDNS 脚本 下载 Cloudflare 的 DDNS 脚本文件,官方推荐存放于/sbin/cloudflareddns.sh并赋予执行权限. # 下载脚本 $ wget https://raw.githubusercontent.com/joshuaavalon/SynologyCloudflareDDNS/master/cloudflareddns.sh -O /sbin/cloudflareddns.sh # 赋予执行粒子系统01-概述https://zfunnily.github.io/2023/05/particlesystem01/Wed, 24 May 2023 11:21:34 +0800https://zfunnily.github.io/2023/05/particlesystem01/参考视频 参考播客 一、两种解决方案 区别 Particle System(内置粒子系统) Visual Effect Graph(VFX Graph) 基于XX运行 CPU GPU 粒子数量 数千 数百万 渲染管线 支持全部渲染管线 不支持内置渲染管线 物理系统 可与Unity物理系统交互 特定元素交互 创作Netch加速SWITCHhttps://zfunnily.github.io/2022/10/netch/Thu, 27 Oct 2022 10:09:44 +0800https://zfunnily.github.io/2022/10/netch/需求 对于有机场的用户,不用再花一份加速器的钱给Switch加速 前提条件 电脑通过(shadowrocks/v2ray)开启科学上网,使用端口 1080 电脑局域网IP 192.168.0.103 允许局域网设备连入 解决过程 switch的代理Netch加速SWITCHhttps://zfunnily.github.io/2022/10/netch/Thu, 27 Oct 2022 10:09:44 +0800https://zfunnily.github.io/2022/10/netch/需求 对于有机场的用户,不用再花一份加速器的钱给Switch加速 前提条件 电脑通过(shadowrocks/v2ray)开启科学上网,使用端口 1080 电脑局域网IP 192.168.0.103 允许局域网设备连入 解决过程 switch的代理Gitlab | CI/CD简单实现https://zfunnily.github.io/2022/06/cicd/Wed, 22 Jun 2022 14:26:25 +0800https://zfunnily.github.io/2022/06/cicd/CI/CD 流水线 组件组成 stages job gitlab runner(可以与gitlab服务器独立, c/s架构. ) -------- -------- --------- |stage1| -&gt; |stage2| -&gt; | stage3| -------- -------- --------- ------ ------ ------- |job1| |job2| | job3| ------ ------ ------- --------- --------- --------- |runner1| |runner2| -&gt; |runner3| --------- --------- --------- pipline: 包含多个stage, 顺序执行 stages: 一个stage可以包含多Gitlab | CI/CD简单实现https://zfunnily.github.io/2022/06/cicd/Wed, 22 Jun 2022 14:26:25 +0800https://zfunnily.github.io/2022/06/cicd/CI/CD 流水线 组件组成 stages job gitlab runner(可以与gitlab服务器独立, c/s架构. ) -------- -------- --------- |stage1| -&gt; |stage2| -&gt; | stage3| -------- -------- --------- ------ ------ ------- |job1| |job2| | job3| ------ ------ ------- --------- --------- --------- |runner1| |runner2| -&gt; |runner3| --------- --------- --------- pipline: 包含多个stage, 顺序执行 stages: 一个stage可以包含多百度网盘不限速 | Aria2篇https://zfunnily.github.io/2022/05/baidu/Tue, 17 May 2022 16:40:59 +0800https://zfunnily.github.io/2022/05/baidu/环境 win10 chrome 油猴插件 aria2 Aria2 对于不想折腾的有懒人包. 实际上包里含有的是aria2软件和aria2 GUI。 下载链接如下: 懒人下载包 AriaNg Aria2 百度网盘简易下载助手 安装油猴脚本: 百度网盘简易下载助手 安装好上述脚本之后,可百度网盘不限速 | Aria2篇https://zfunnily.github.io/2022/05/baidu/Tue, 17 May 2022 16:40:59 +0800https://zfunnily.github.io/2022/05/baidu/环境 win10 chrome 油猴插件 aria2 Aria2 对于不想折腾的有懒人包. 实际上包里含有的是aria2软件和aria2 GUI。 下载链接如下: 懒人下载包 AriaNg Aria2 百度网盘简易下载助手 安装油猴脚本: 百度网盘简易下载助手 安装好上述脚本之后,可URP 不透明/半透明物体的折射https://zfunnily.github.io/2022/05/refraction/Tue, 17 May 2022 11:30:48 +0800https://zfunnily.github.io/2022/05/refraction/折射 应用场景 水池 玻璃 热空气(热扭曲) GrabPass + CubeMap 《Unity3D Shader入门精要》第十章介绍了,模拟实现折射效果有两种 使用cubemap: 我认为太麻烦.需要的贴图太多。也没有找到其他合适的使用场景,遂搁URP 不透明/半透明物体的折射https://zfunnily.github.io/2022/05/refraction/Tue, 17 May 2022 11:30:48 +0800https://zfunnily.github.io/2022/05/refraction/折射 应用场景 水池 玻璃 热空气(热扭曲) GrabPass + CubeMap 《Unity3D Shader入门精要》第十章介绍了,模拟实现折射效果有两种 使用cubemap: 我认为太麻烦.需要的贴图太多。也没有找到其他合适的使用场景,遂搁《Unity Shader入门精要》第八章笔记 | 透明度https://zfunnily.github.io/2022/05/shaderalpha/Sat, 07 May 2022 17:17:18 +0800https://zfunnily.github.io/2022/05/shaderalpha/渲染顺序 名称 队列索引号 描 述 Background 1000 这个渲染队列会在任何其他队列之前被渲染,我们通常使用该队列来渲染那些需要绘制在背景上的物体 Geometry 2000 默认的渲染队列,大多数物体都使用这个队列。不透明物体使用这个队列 AlphaTest 2450 需要透明《Unity Shader入门精要》第八章笔记 | 透明度https://zfunnily.github.io/2022/05/shaderalpha/Sat, 07 May 2022 17:17:18 +0800https://zfunnily.github.io/2022/05/shaderalpha/渲染顺序 名称 队列索引号 描 述 Background 1000 这个渲染队列会在任何其他队列之前被渲染,我们通常使用该队列来渲染那些需要绘制在背景上的物体 Geometry 2000 默认的渲染队列,大多数物体都使用这个队列。不透明物体使用这个队列 AlphaTest 2450 需要透明《Unity Shader入门精要》第六章笔记 | 基础光照https://zfunnily.github.io/2022/05/shaderlighting/Sat, 07 May 2022 16:22:40 +0800https://zfunnily.github.io/2022/05/shaderlighting/我们是如何看到这个世界的 光源: 在光学里,我们使用辐照度 (irradiance) 来量化光 物体的吸收和散射: 光线由光源发射出来后,就会与一些物体相交 着色: 根据材质属性(如漫反射属性等)、光源信息(如光源方《Unity Shader入门精要》第六章笔记 | 基础光照https://zfunnily.github.io/2022/05/shaderlighting/Sat, 07 May 2022 16:22:40 +0800https://zfunnily.github.io/2022/05/shaderlighting/我们是如何看到这个世界的 光源: 在光学里,我们使用辐照度 (irradiance) 来量化光 物体的吸收和散射: 光线由光源发射出来后,就会与一些物体相交 着色: 根据材质属性(如漫反射属性等)、光源信息(如光源方《Unity Shader入门精要》第五章笔记 | 开始shader练习https://zfunnily.github.io/2022/05/shaderbase/Sat, 07 May 2022 10:22:33 +0800https://zfunnily.github.io/2022/05/shaderbase/一个简单的顶点/片元着色器 代码 Shader &#34;Unity Shaders Book/Chapter 5/Simple Shader&#34; { Properties { // 声明一个Color类型的属性 _Color (&#34;Color Tint&#34;, Color) = (1.0,1.0,1.0,1.0) } SubShader { Pass { CGPROGRAM #pragma vertex vert #pragma fragment frag // 在Cg代码中,我们需要定义一个与属性名称和类型都匹配的变量 fixed4 _Color; // 使用一个结构体来定义《Unity Shader入门精要》第五章笔记 | 开始shader练习https://zfunnily.github.io/2022/05/shaderbase/Sat, 07 May 2022 10:22:33 +0800https://zfunnily.github.io/2022/05/shaderbase/一个简单的顶点/片元着色器 代码 Shader &#34;Unity Shaders Book/Chapter 5/Simple Shader&#34; { Properties { // 声明一个Color类型的属性 _Color (&#34;Color Tint&#34;, Color) = (1.0,1.0,1.0,1.0) } SubShader { Pass { CGPROGRAM #pragma vertex vert #pragma fragment frag // 在Cg代码中,我们需要定义一个与属性名称和类型都匹配的变量 fixed4 _Color; // 使用一个结构体来定义MAC平台几何着色器不生效https://zfunnily.github.io/2022/05/geometry/Thu, 05 May 2022 16:49:29 +0800https://zfunnily.github.io/2022/05/geometry/问题 MAC平台几何着色器不生效 解决步骤 unity shaderlab 怎么设置以至于支持几何着色器 找原因,设置 编译目标级别,#pragma target 4.0, 不管用 看到一句话,Unity 在 Metal 图形上支持曲面细分着色器,但 Metal 不支持几何着色器 找到maMAC平台几何着色器不生效https://zfunnily.github.io/2022/05/geometry/Thu, 05 May 2022 16:49:29 +0800https://zfunnily.github.io/2022/05/geometry/问题 MAC平台几何着色器不生效 解决步骤 unity shaderlab 怎么设置以至于支持几何着色器 找原因,设置 编译目标级别,#pragma target 4.0, 不管用 看到一句话,Unity 在 Metal 图形上支持曲面细分着色器,但 Metal 不支持几何着色器 找到maShaderLab常用函数https://zfunnily.github.io/2022/04/shaderfunc/Wed, 20 Apr 2022 15:41:29 +0800https://zfunnily.github.io/2022/04/shaderfunc/数学函数 cg/hlsl函数 功能描述 dot(A,B) 点积, 点积结果为标量,主要用于求向量的夹角或b向量在a向量上的投影 cross(A,B) 叉积, 叉积结果为向量,结果与这两个向量组成的平面垂直。主要用于3D图形学 mul(M, N) 矩阵M和矩阵N的积 mul(M,ShaderLab常用函数https://zfunnily.github.io/2022/04/shaderfunc/Wed, 20 Apr 2022 15:41:29 +0800https://zfunnily.github.io/2022/04/shaderfunc/数学函数 cg/hlsl函数 功能描述 dot(A,B) 点积, 点积结果为标量,主要用于求向量的夹角或b向量在a向量上的投影 cross(A,B) 叉积, 叉积结果为向量,结果与这两个向量组成的平面垂直。主要用于3D图形学 mul(M, N) 矩阵M和矩阵N的积 mul(M,UnityCG.cginc中常用函数https://zfunnily.github.io/2022/04/cginc/Wed, 20 Apr 2022 15:35:49 +0800https://zfunnily.github.io/2022/04/cginc/摄像机方向 WorldSpaceViewDir 输入一个模型空间中的顶点坐标 -&gt; 输出(世界空间)从这个点到摄像机的观察方向; WorldSpaceViewDir // 内部实现也是用UnityWorldSpaceViewDir // Computes world space view direction, from object space position // *Legacy* Please use UnityWorldSpaceViewDir instead inline float3 WorldSpaceViewDir( in float4 localPos ) { float3 worldPosUnityCG.cginc中常用函数https://zfunnily.github.io/2022/04/cginc/Wed, 20 Apr 2022 15:35:49 +0800https://zfunnily.github.io/2022/04/cginc/摄像机方向 WorldSpaceViewDir 输入一个模型空间中的顶点坐标 -&gt; 输出(世界空间)从这个点到摄像机的观察方向; WorldSpaceViewDir // 内部实现也是用UnityWorldSpaceViewDir // Computes world space view direction, from object space position // *Legacy* Please use UnityWorldSpaceViewDir instead inline float3 WorldSpaceViewDir( in float4 localPos ) { float3 worldPos《Unity Shader入门精要》第四章笔记 | 学习Shader所需的数学基础https://zfunnily.github.io/2022/04/shadermathematic/Sun, 10 Apr 2022 15:42:33 +0800https://zfunnily.github.io/2022/04/shadermathematic/概述 在学习Shader的过程中,我们最常使用的就是矢量和矩阵(即数学的分支之一——线性代数)。 笛卡儿坐标系 我们使用数学绝大部分都是为了计算位置、距离和角度等变量。而这些计算大部分都是在笛卡儿坐标系 (C《Unity Shader入门精要》第四章笔记 | 学习Shader所需的数学基础https://zfunnily.github.io/2022/04/shadermathematic/Sun, 10 Apr 2022 15:42:33 +0800https://zfunnily.github.io/2022/04/shadermathematic/概述 在学习Shader的过程中,我们最常使用的就是矢量和矩阵(即数学的分支之一——线性代数)。 笛卡儿坐标系 我们使用数学绝大部分都是为了计算位置、距离和角度等变量。而这些计算大部分都是在笛卡儿坐标系 (C《Unity Shader入门精要》第三章笔记| UnityShader基础https://zfunnily.github.io/2022/04/shaderbase/Sun, 10 Apr 2022 14:51:19 +0800https://zfunnily.github.io/2022/04/shaderbase/材质 在Unity中我们需要配合使用材质 (Material) 和Unity Shader才能达到需要的效果。一个最常见的流程是 创建一个材质;活着导入一个材质 创建一个Unity Shader,并把它赋给上一步中《Unity Shader入门精要》第三章笔记| UnityShader基础https://zfunnily.github.io/2022/04/shaderbase/Sun, 10 Apr 2022 14:51:19 +0800https://zfunnily.github.io/2022/04/shaderbase/材质 在Unity中我们需要配合使用材质 (Material) 和Unity Shader才能达到需要的效果。一个最常见的流程是 创建一个材质;活着导入一个材质 创建一个Unity Shader,并把它赋给上一步中《Unity Shader入门精要》第二章笔记 | 渲染流水线https://zfunnily.github.io/2022/04/shaderrenderpipline/Sat, 09 Apr 2022 11:55:55 +0800https://zfunnily.github.io/2022/04/shaderrenderpipline/渲染流水线 Render-Time Rendering, Third Edition》一书中将一个渲染流程分成3个阶段:应用阶段(Application Stage) 、几何阶段(Geometry Stage) 、光栅化阶段(Rasterizer Stage) 。 应《Unity Shader入门精要》第二章笔记 | 渲染流水线https://zfunnily.github.io/2022/04/shaderrenderpipline/Sat, 09 Apr 2022 11:55:55 +0800https://zfunnily.github.io/2022/04/shaderrenderpipline/渲染流水线 Render-Time Rendering, Third Edition》一书中将一个渲染流程分成3个阶段:应用阶段(Application Stage) 、几何阶段(Geometry Stage) 、光栅化阶段(Rasterizer Stage) 。 应shader初尝试 | 给石头覆盖一层雪景(Hello World)https://zfunnily.github.io/2022/04/shaderhelloworld/Sat, 09 Apr 2022 10:34:56 +0800https://zfunnily.github.io/2022/04/shaderhelloworld/给石头覆盖一层雪景 资源准备 石头模型 Unity2021.2.3f1c1 Mac &amp; Windows 在Unity中创建一个项目,导入石头模型,下面就开始利用shader给石头做一个雪景覆盖. 实现效果 未覆盖雪景的样子 覆盖了雪景的样子 开始代码 我在代码中标注了1,shader初尝试 | 给石头覆盖一层雪景(Hello World)https://zfunnily.github.io/2022/04/shaderhelloworld/Sat, 09 Apr 2022 10:34:56 +0800https://zfunnily.github.io/2022/04/shaderhelloworld/给石头覆盖一层雪景 资源准备 石头模型 Unity2021.2.3f1c1 Mac &amp; Windows 在Unity中创建一个项目,导入石头模型,下面就开始利用shader给石头做一个雪景覆盖. 实现效果 未覆盖雪景的样子 覆盖了雪景的样子 开始代码 我在代码中标注了1,UnityShader基本概念https://zfunnily.github.io/2022/04/shader01/Wed, 06 Apr 2022 11:54:02 +0800https://zfunnily.github.io/2022/04/shader01/何为shader shader中文翻译为着色器,其实是一种用来渲染图形的技术,我们可以通过shader编程,来自定义显卡渲染画面的算法,显示我们所期望的结果。 shader种类 顶点着色器: 处理每个顶点,将UnityShader基本概念https://zfunnily.github.io/2022/04/shader01/Wed, 06 Apr 2022 11:54:02 +0800https://zfunnily.github.io/2022/04/shader01/何为shader shader中文翻译为着色器,其实是一种用来渲染图形的技术,我们可以通过shader编程,来自定义显卡渲染画面的算法,显示我们所期望的结果。 shader种类 顶点着色器: 处理每个顶点,将Graphicshttps://zfunnily.github.io/2022/04/graphics/Mon, 04 Apr 2022 21:48:09 +0800https://zfunnily.github.io/2022/04/graphics/Last Lecture What is Computer Graphics? Why study Computer Graphics? Course Topics Course Logistics Graphics&rsquo;s Dependencies Basic mathematics Liner algebra, calculus, statistics. Basic physics Optics, Mechanics Misc Signal processing Numerical analysis 线性代数 Dot(scalar) Product Cross (vector) Product 向量之间的乘积不符合交换定律。 Cross product: Properties 右手螺旋定则 Cross product: Cartesian Formula Cross product in Graphics 判断左右 判断内外 判断向量b在向量a的左边 右手螺旋法则 向量Graphicshttps://zfunnily.github.io/2022/04/graphics/Mon, 04 Apr 2022 21:48:09 +0800https://zfunnily.github.io/2022/04/graphics/Last Lecture What is Computer Graphics? Why study Computer Graphics? Course Topics Course Logistics Graphics&rsquo;s Dependencies Basic mathematics Liner algebra, calculus, statistics. Basic physics Optics, Mechanics Misc Signal processing Numerical analysis 线性代数 Dot(scalar) Product Cross (vector) Product 向量之间的乘积不符合交换定律。 Cross product: Properties 右手螺旋定则 Cross product: Cartesian Formula Cross product in Graphics 判断左右 判断内外 判断向量b在向量a的左边 右手螺旋法则 向量抽卡逻辑自述https://zfunnily.github.io/2022/03/afk/Wed, 30 Mar 2022 10:50:11 +0800https://zfunnily.github.io/2022/03/afk/抽卡逻辑自述 参考《剑与远征》 卡牌颜色以及合成 颜色 合成 绿色 可分解,得到粉尘和银瓜子, 最基础的卡 蓝 蓝+ 同样的三张蓝色可合成一张蓝+ 紫 同种族的三张蓝+可以合成一张紫(可以选择合成其中蓝+的某个紫色) 紫+ 同英抽卡逻辑自述https://zfunnily.github.io/2022/03/afk/Wed, 30 Mar 2022 10:50:11 +0800https://zfunnily.github.io/2022/03/afk/抽卡逻辑自述 参考《剑与远征》 卡牌颜色以及合成 颜色 合成 绿色 可分解,得到粉尘和银瓜子, 最基础的卡 蓝 蓝+ 同样的三张蓝色可合成一张蓝+ 紫 同种族的三张蓝+可以合成一张紫(可以选择合成其中蓝+的某个紫色) 紫+ 同英层级时间轮 | skynet 定时器https://zfunnily.github.io/2022/03/timerskynet/Sun, 27 Mar 2022 12:39:12 +0800https://zfunnily.github.io/2022/03/timerskynet/skynet定时器 要解析一个程序代码,先了解数据结构,这是基础,再看函数。 拿skynet定时器举例子。 数据结构 //定时器事件 用于抛出定时器事件到消息队列里。理解这个数据结构需要先了解skynet的框架层级时间轮 | skynet 定时器https://zfunnily.github.io/2022/03/timerskynet/Sun, 27 Mar 2022 12:39:12 +0800https://zfunnily.github.io/2022/03/timerskynet/skynet定时器 要解析一个程序代码,先了解数据结构,这是基础,再看函数。 拿skynet定时器举例子。 数据结构 //定时器事件 用于抛出定时器事件到消息队列里。理解这个数据结构需要先了解skynet的框架利用时间轮实现定时器https://zfunnily.github.io/2022/03/timer/Thu, 10 Mar 2022 14:38:23 +0800https://zfunnily.github.io/2022/03/timer/理解定时器 适用场景 定时任务(每隔1s钟打印一次数据) 超时控制(xx分钟没有动作就断开连接) 频率限制(最快只能每5s调用一次API) 定时器常用的数据结构有如下几种: 链表 双向有序链表 最小堆 时间轮 层级时间轮利用时间轮实现定时器https://zfunnily.github.io/2022/03/timer/Thu, 10 Mar 2022 14:38:23 +0800https://zfunnily.github.io/2022/03/timer/理解定时器 适用场景 定时任务(每隔1s钟打印一次数据) 超时控制(xx分钟没有动作就断开连接) 频率限制(最快只能每5s调用一次API) 定时器常用的数据结构有如下几种: 链表 双向有序链表 最小堆 时间轮 层级时间轮利用云服务器搭建个人博客https://zfunnily.github.io/2022/03/blog/Thu, 03 Mar 2022 12:04:58 +0800https://zfunnily.github.io/2022/03/blog/vps选择 最近关注了一个vps推广网站。价格合适,于是买了一个128元/年的云服务器。既可以用来做代理,又可以搭建个人博客 配置是2G/1M/40G(运存/带宽/硬盘) 使用技术 nginx: 静态博客 v2ray: 代理 https + nginx freenome: 域利用云服务器搭建个人博客https://zfunnily.github.io/2022/03/blog/Thu, 03 Mar 2022 12:04:58 +0800https://zfunnily.github.io/2022/03/blog/vps选择 最近关注了一个vps推广网站。价格合适,于是买了一个128元/年的云服务器。既可以用来做代理,又可以搭建个人博客 配置是2G/1M/40G(运存/带宽/硬盘) 使用技术 nginx: 静态博客 v2ray: 代理 https + nginx freenome: 域Nginx | 给网站添加证书https://zfunnily.github.io/2022/03/https/Thu, 03 Mar 2022 10:26:56 +0800https://zfunnily.github.io/2022/03/https/Https 最近在购买的云服务器上把个人博客搭建起来了,实际上是hugo生成静态网页,nginx加载静态网页。现在只能通过http访问,缺少个https。 要搭建一个https的网站需要证书。之前在网上找的教程太Nginx | 给网站添加证书https://zfunnily.github.io/2022/03/https/Thu, 03 Mar 2022 10:26:56 +0800https://zfunnily.github.io/2022/03/https/Https 最近在购买的云服务器上把个人博客搭建起来了,实际上是hugo生成静态网页,nginx加载静态网页。现在只能通过http访问,缺少个https。 要搭建一个https的网站需要证书。之前在网上找的教程太Golang | http注解路由https://zfunnily.github.io/2022/03/http/Wed, 02 Mar 2022 14:51:22 +0800https://zfunnily.github.io/2022/03/http/Http服务器 Golang有一个很强大的官方http库了,使用上很方便。也有一些很强大的三方http框架, 比如gin,beego等等。 自以为,框架在提供便利,提升开发效率的同时,也限制了我们的想象力。Golang | http注解路由https://zfunnily.github.io/2022/03/http/Wed, 02 Mar 2022 14:51:22 +0800https://zfunnily.github.io/2022/03/http/Http服务器 Golang有一个很强大的官方http库了,使用上很方便。也有一些很强大的三方http框架, 比如gin,beego等等。 自以为,框架在提供便利,提升开发效率的同时,也限制了我们的想象力。Goang | Plugin插件热更https://zfunnily.github.io/2022/03/reload/Tue, 01 Mar 2022 11:33:22 +0800https://zfunnily.github.io/2022/03/reload/热更新 动态脚本更新 (php) 短链接无状态服务器热更 (http) 长连接有状态,数据跟逻辑分离 golang Plugin热更 (.so 动态库更新) &mdash;-逻辑热更 长连接有状态,在运维层面, 利用容器部署热更(docker, k8s) 服务不接受新Goang | Plugin插件热更https://zfunnily.github.io/2022/03/reload/Tue, 01 Mar 2022 11:33:22 +0800https://zfunnily.github.io/2022/03/reload/热更新 动态脚本更新 (php) 短链接无状态服务器热更 (http) 长连接有状态,数据跟逻辑分离 golang Plugin热更 (.so 动态库更新) &mdash;-逻辑热更 长连接有状态,在运维层面, 利用容器部署热更(docker, k8s) 服务不接受新Grpc | Token认证和自定义认证https://zfunnily.github.io/2022/02/jwt/Tue, 22 Feb 2022 15:39:30 +0800https://zfunnily.github.io/2022/02/jwt/概述 现在有个需求,需要在grpc的拦截器中,通过token进行身份认证。如果认证不通过则返回错误; 认证通过,则放行; TLS是用作加密通讯通道的,与该需求无关。 Token认证 具体流程 客户端通过账号密码登Grpc | Token认证和自定义认证https://zfunnily.github.io/2022/02/jwt/Tue, 22 Feb 2022 15:39:30 +0800https://zfunnily.github.io/2022/02/jwt/概述 现在有个需求,需要在grpc的拦截器中,通过token进行身份认证。如果认证不通过则返回错误; 认证通过,则放行; TLS是用作加密通讯通道的,与该需求无关。 Token认证 具体流程 客户端通过账号密码登Grpc | 通过SSL/TLS建立安全连接https://zfunnily.github.io/2022/02/san/Tue, 22 Feb 2022 14:22:41 +0800https://zfunnily.github.io/2022/02/san/使用golang的grpc库作为例子 grpc使用TLS建立安全连接需要有SAN证书, go 1.15 版本开始废弃 CommonName。 什么是SAN证书 SAN(Subject Alternative Name) 是 SSL 标准 x509 中定义的一个扩展。使用了 SAN 字段的 SSL 证书,可以扩Grpc | 通过SSL/TLS建立安全连接https://zfunnily.github.io/2022/02/san/Tue, 22 Feb 2022 14:22:41 +0800https://zfunnily.github.io/2022/02/san/使用golang的grpc库作为例子 grpc使用TLS建立安全连接需要有SAN证书, go 1.15 版本开始废弃 CommonName。 什么是SAN证书 SAN(Subject Alternative Name) 是 SSL 标准 x509 中定义的一个扩展。使用了 SAN 字段的 SSL 证书,可以扩Blog | 代码显示/隐藏https://zfunnily.github.io/2021/12/shortcodes/Wed, 29 Dec 2021 13:50:28 +0800https://zfunnily.github.io/2021/12/shortcodes/缘由 最近在写技术博客时,引入的代码太多,影响观感。 在尽力减少代码量,还是有些不可或缺的代码,代码量很惊人,已经占满整个屏幕. 因为个人博客是使用hugo生成的静态博客,我刚开始想的使用原生的js和cssNginx的一些配置https://zfunnily.github.io/2021/12/nginx/Tue, 28 Dec 2021 16:04:10 +0800https://zfunnily.github.io/2021/12/nginx/静态网站 应用场景 文件服务 静态网站 &hellip; 静态网站的配置 配置如下: nginx.conf worker_processes 1; pid nginx.pid; events { worker_connections 1024; multi_accept on; } http { default_type application/octet-stream; sendfile on; keepalive_timeout 100; server { listen 80; charset utf-8,gbk; server_name localhost; location /{ root /opt/; autoindex on; autoindex_localtime on; } index index.html; # 显示首页 #静态文件访问 location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|js|pdf|txt) { root /opt; } } } root: 表示网站根目录 autoindex: on 显A*算法 | Lua版本https://zfunnily.github.io/2021/12/astar/Thu, 23 Dec 2021 16:37:44 +0800https://zfunnily.github.io/2021/12/astar/A*算法思路 寻路步骤 从起点A开始, 把它作为待处理的方格存入一个&quot;开启列表&quot;, 开启列表就是一个等待检查方格的列表. 寻找起点A周围可以到达的方格, 将它们放入&quot;开启列表&quoBlog | 音乐播放器https://zfunnily.github.io/2021/12/music/Tue, 21 Dec 2021 16:55:23 +0800https://zfunnily.github.io/2021/12/music/概述 今天给我的个人博客加了个暗模式,这样可以在晚上阅读博客的时候不伤害眼睛。突然想到如果在阅读博客的时候可以听听音乐就更好了。 于是在github上找到了一个开源的项目MetingJS,看最后一次comBlog | 网站暗模式https://zfunnily.github.io/2021/12/dark/Tue, 21 Dec 2021 11:05:00 +0800https://zfunnily.github.io/2021/12/dark/Wordpress 如果你的网站是wordpress,则可以参考以Darkmode.js为基础的插件: blackout-darkmode-widget darkmode Nuxt.js 如果你正在使用Nuxt.js,则可以使用下面的模块 nuxtjs-darkmode-js-module 快速使用 使用Darkmode.js给网站快速部署上暗/浅色Openresty三 | 上传文件https://zfunnily.github.io/2021/12/openresty-upload/Wed, 08 Dec 2021 16:42:17 +0800https://zfunnily.github.io/2021/12/openresty-upload/上传文件接口 nginx.conf 的server 增加一个location: location /upload { resolver 8.8.8.8 ipv6=off; content_by_lua_file lua/upload.lua; } upload.lua lua -- upload.lua --========================================== -- 文件上传 --========================================== local chunk_size = 4096 local form, err = upload:new(chunk_size) if not form then ngx.log(ngx.ERR, &#34;failed to new upload: &#34;, err) ngx.exit(ngx.HTTP_INTERNAL_SERVER_ERROR) end form:set_timeout(1000) -- 文件保存的根路径 local saveRootPath = &#34;./download/&#34; -- 保存的文件对象 local fileToSave --文件是否成Webrtc二 | 共享桌面https://zfunnily.github.io/2021/11/webrtcdesk/Mon, 15 Nov 2021 11:23:24 +0800https://zfunnily.github.io/2021/11/webrtcdesk/环境 Ubuntu18.04 webrtc M84 改造peerconnection例子,用来实现桌面共享 改造类CapturerTrackSource 增加桌面的数据源类RcrtcDesktopCapturerTrackSource 继承webrWebrtc一 | peerconnectionhttps://zfunnily.github.io/2021/11/webrtcpeerconnection/Sun, 14 Nov 2021 16:20:31 +0800https://zfunnily.github.io/2021/11/webrtcpeerconnection/环境 Ubuntu18.04 webrtc M84 国内镜像:https://webrtc.org.cn/mirror/ webrtc交互过程 通过peerconnection的例子来分析webrtc的交互流程 peer_connection 解析 为了便于管理,如编码,回显等,Go-libp2p四 | 穿透NAThttps://zfunnily.github.io/2021/11/gop2pfour/Sun, 07 Nov 2021 15:49:46 +0800https://zfunnily.github.io/2021/11/gop2pfour/本文目的 上文Go-libp2p三 | relay例子已经分析过relay例子,并解释了两个节点如果通过中继服务进行通信。本文改造relay例子 并让这个服务做如下两件事: 交换两个节点的在交换机上的信息,帮助Blog | 随机名人名言https://zfunnily.github.io/2021/11/randomquotes/Fri, 05 Nov 2021 15:50:16 +0800https://zfunnily.github.io/2021/11/randomquotes/本文目的 我的个人博客已经搭建好了,使用的hugo+飞雪的主题。我看到有些博客上有些随机的名人名言,但是这个主题没有。遂自己写一个。 根据飞雪的主题自定义 飞雪主题的github: https://github.com/flysnow-org/maupassant-hugo 复制主题里的文件themGo-libp2p三 | relay例子https://zfunnily.github.io/2021/10/gop2pthree/Sun, 31 Oct 2021 10:13:40 +0800https://zfunnily.github.io/2021/10/gop2pthree/我想做什么 chat和echo两个例子,说明了两个节点之间的通信需要两节点在同一个局域网内,或者有一个节点有公网。 如果我两个节点分别在两个NAT下面, 都在各自的局域网内,则需要有一个中继服务,这个服务做Go-libp2p二 | echo例子https://zfunnily.github.io/2021/10/gop2ptwo/Fri, 29 Oct 2021 11:15:42 +0800https://zfunnily.github.io/2021/10/gop2ptwo/go-libp2p的echo例子分析 进入目录go-libp2p/examples/echo/, 编译 go build 先看README.md, 可以了解到使用echo的方式: 终端B $ ./echo -l 3001 2021/10/28 11:25:33 I am /ip4/127.0.0.1/tcp/3001/p2p/QmTu8sxDi3fSjz9ZMvkAj3qA9YAoGskroEnyLz2ZvfTBhX 2021/10/28 11:25:33 listening for connections 2021/10/28 11:25:33 Now run &#34;./echoGo-libp2p一 | chat例子https://zfunnily.github.io/2021/10/gop2pone/Thu, 28 Oct 2021 14:40:02 +0800https://zfunnily.github.io/2021/10/gop2pone/代码下载 git clone https://github.com/libp2p/go-libp2p.git chat实例分析 进入目录go-libp2p/examples/chat/, 编译 go build 先看README.md, 可以了解到使用chat的方式 在节点 B $ ./chat -sp 3001 2021/10/28 11:01:25 Run &#39;./chat -d /ip4/127.0.0.1/tcp/3001/p2p/QmXgEXt4CiqmVmDhPPQnyVkoj3Bsx3Nggq57PPsk5tLNTs&#39; on another console. 2021/10/28 11:01:25 You can replace 127.0.0.1 with public IPBlog | 新的开始https://zfunnily.github.io/2021/10/blogmigration/Fri, 22 Oct 2021 19:01:20 +0800https://zfunnily.github.io/2021/10/blogmigration/迁移博客 我是从18年开始写一些东西,先写在看云笔记上,后面东西越来越多。写出来的东西比较零散. 20年下半年入职新公司,开始在csdn上写博客,今年我准备尝试使用个人博客,hugo和gitPage结合部Skynet源码赏析四 | 消息调度https://zfunnily.github.io/2021/10/four/Thu, 21 Oct 2021 10:06:39 +0800https://zfunnily.github.io/2021/10/four/服务间消息流转 发送消息 数据结构message_queue *q是次级消息队列,每个服务都有与之绑定的唯一一个次级消息队列。当我们在lua层,调用skynet.send(...), 或者调用skynet.cSkynet源码赏析三 | 服务启动https://zfunnily.github.io/2021/10/skynetthree/Wed, 20 Oct 2021 11:26:07 +0800https://zfunnily.github.io/2021/10/skynetthree/skynet启动一个C服务 查看怎么启动C服务的最好的办法是打断点,看源码。 启动logger日志服务 我拿日志服务来举例子,怎么启动日志服务的呢? 传参数name = &quot;logger&quot;, param = null, struct skynet_context *ctx = skynet_context_new(config-&gt;logservice, config-&gt;logger);; 从moduleSkynet源码赏析二 | 基础数据结构https://zfunnily.github.io/2021/10/skynettwo/Tue, 19 Oct 2021 18:47:45 +0800https://zfunnily.github.io/2021/10/skynettwo/module管理模块 我们所写的C服务编译成.so文件后放在cpath变量路径下,程序会加载路径cpath = root..&quot;cservice/?.so&quot;下的.so文件,通过staticSkynet源码赏析一 | 启动初始化的过程https://zfunnily.github.io/2021/10/skynetone/Tue, 19 Oct 2021 17:28:45 +0800https://zfunnily.github.io/2021/10/skynetone/入口文件 skynet_main.c 加载配置 struct skynet_config config; config.thread = optint(&#34;thread&#34;,8); config.module_path = optstring(&#34;cpath&#34;,&#34;./cservice/?.so&#34;); config.harbor = optint(&#34;harbor&#34;, 1); config.bootstrap = optstring(&#34;bootstrap&#34;,&#34;snlua bootstrap&#34;); config.daemon = optstring(&#34;daemon&#34;, NULL); config.logger = optstring(&#34;logger&#34;, NULL); config.logservice = optstring(&#34;logservice&#34;, &#34;logger&#34;); config.profile = optboolean(&#34;profile&#34;, 1); 从上述代码可以看到,配置都已经加载到变量struct skynet_config config;中了。 初始化 初始化skynet_context管Golang | 调用带有后台进程shell脚本可能会被挂起https://zfunnily.github.io/2021/10/shell/Wed, 13 Oct 2021 17:15:45 +0800https://zfunnily.github.io/2021/10/shell/起因 今天用Golang写一个调用外部shell脚本的程序,使用 exec.Command方法,这段脚本代码中包含了一个后台任务语句。 结果发生了一个问题:cmd.Output 始终不会返回,一直挂起。导致我FPS游戏 | 实现移动功能https://zfunnily.github.io/2021/09/move/Sun, 12 Sep 2021 20:43:34 +0800https://zfunnily.github.io/2021/09/move/三种实现FPS Controller的区别 Transform Translate 允许移动物理,但无物理碰撞 Rigid body + Capsule Collider 符合物理学 不会鬼穿墙 无法滞空运动 可与Physics Object 交互 Charactor Controller 不会鬼穿墙 提供的API相对多 无法与Physic objects免费Musichttps://zfunnily.github.io/2021/09/music/Wed, 08 Sep 2021 14:47:14 +0800https://zfunnily.github.io/2021/09/music/介绍一个可以免费听音乐的方法 环境 docker mac 安装 $ docker run -d -p 264:264 -p 9000:9000 -v $dir_name:/var/www/html/cache --name music oldiy/music-player-docker $dir_name 是 你自己宿主机的目录。可以自定义 访问:127.0.0.1:264 就可以放心使用, 同事推荐的,贼好用。Unity3D | Transform类https://zfunnily.github.io/2021/09/transform/Tue, 07 Sep 2021 15:55:59 +0800https://zfunnily.github.io/2021/09/transform/Transform类 在unity中,把transform类理解为,transform类是在每个对象生成时自动附加的一个类。在Unity的视图中,点击Hierarchy中的对象,就可以在InspectoVim | 切换模式/输入法https://zfunnily.github.io/2021/09/vimchange/Tue, 07 Sep 2021 10:46:58 +0800https://zfunnily.github.io/2021/09/vimchange/vim 在退出输入模式的时候切换为原来的输入法 在敲代码的时候使用我们使用的英文,当遇到问题,我们需要搜索引擎的时候需要中文输入法,这个时候,自动切换输入法可以帮助我们节省手动切换输入法的时间。 跟编辑器结合,Linux | Screenhttps://zfunnily.github.io/2021/09/screen/Tue, 07 Sep 2021 10:02:16 +0800https://zfunnily.github.io/2021/09/screen/screen命令 screen 是一个非常有用的命令。应用场景: 单个 SSH 会话中使用多个 shell 窗口(会话)的能力 服务器开发,一个单独运行进程的窗口。可以避免单独再开一个窗口。 &hellip; screen使用 创建一个窗口 $ screen -S name 执行自己需Centos7.2 | gcc4.8升级为4.9https://zfunnily.github.io/2021/09/upgradegcc/Wed, 01 Sep 2021 18:13:41 +0800https://zfunnily.github.io/2021/09/upgradegcc/环境 CentOS 7.2.1511 Docker 我是用 docker 拉取镜像 CentOS 7.2.1511, 利用容器来作为我的开发环境。有条件的也可以用虚拟机或者实体机器。原理都一样。 $ docker $ yum update &amp;&amp; yum install gcc gcc-c++ make zlib-devel.x86_6 下载依赖包 升级 gcc, 下载安装包下载依赖。 $ wget http://ftp.gnu.org/gnu/gcc/gcc-4.9.3/gcc-4.9.3.tar.bz2 $ tar xfv gcc-4.9.3.tar.bz2 &amp;&amp; cd gcc-4.9.3 $ ./contrib/download_prerequisites 如果Shell | Except 使用https://zfunnily.github.io/2021/08/except/Mon, 30 Aug 2021 17:13:33 +0800https://zfunnily.github.io/2021/08/except/Except 参数 spawn 交互程序开始后面跟命令或者指定程序 expect 获取匹配信息匹配成功则执行expect后面的程序动作 send exp_send 用于发送指定的字符串信息 exp_continue 在expect中多次匹配就需要用到 send_user 用来打印输出 相当于shell中的echUnity3D | UGUIhttps://zfunnily.github.io/2021/08/ugui/Fri, 20 Aug 2021 14:15:41 +0800https://zfunnily.github.io/2021/08/ugui/Text Text的属性 在 Unity 的 Hierarchy 面板上右键–&gt;UI–&gt;Text, 在 Inspector 面板上查看属性 属性 功能 Text 需要显示的文本 Font 显示文本的字体 如:微软雅黑,宋体等 Font Style 显示文本的样式,有普通,粗体,斜体,粗体和斜体四种Golang | redis实现分布式锁https://zfunnily.github.io/2021/06/distribute/Thu, 03 Jun 2021 16:12:21 +0000https://zfunnily.github.io/2021/06/distribute/概述 网上有很多Golang操作redis的例子,我使用github.com/gomodule/redigo/redis包写一个关于redis分布式锁的问题。 redis分布式锁 锁需要的几个组件 获取锁- 删Golang | redishttps://zfunnily.github.io/2021/06/goredis/Thu, 03 Jun 2021 15:57:14 +0800https://zfunnily.github.io/2021/06/goredis/概述 网上有很多golang操作redis的例子,我使用github.com/gomodule/redigo/redis包写一个关于redis分布式锁的问题。 redis分布式锁 锁需要的几个组件 获取锁 删除Lua | next的使用https://zfunnily.github.io/2021/05/lua_next/Mon, 10 May 2021 16:39:50 +0800https://zfunnily.github.io/2021/05/lua_next/lua_next lua_next(L,index):先把 表(lua栈 index所指的表), 的当前索引弹出,再把table 当前索引的值弹出,也就是先弹出 table的索引,再弹出table索引的值 举例: local t = { [&#34;a&#34;] = 1, [&#34;b&#34;]Lua | APIhttps://zfunnily.github.io/2021/05/settopandpop/Mon, 10 May 2021 15:57:03 +0800https://zfunnily.github.io/2021/05/settopandpop/lua_pop和lua_settop lua_settop 我们直接来看lua_settop,文档解释 /* 设置栈的高度,如果之前的栈顶比新设置的更高,那么高出来的元素会被丢弃,反之压入nil来补足大小 假设栈里有2个元素。 如果Hugohttps://zfunnily.github.io/2021/04/hugo/Sat, 17 Apr 2021 00:00:00 +0000https://zfunnily.github.io/2021/04/hugo/hugo 我用过的静态博客有hexo、jekyll和hugo,对比起来,hugo虽然没有hexo那样丰富的插件和主题,但是hugo生成文章的速度更快。我是一名go语言爱好者,而hugo是go语言开发的, jekGolang | gomod拉取私有仓库https://zfunnily.github.io/2021/03/gomod/Tue, 23 Mar 2021 16:10:02 +0000https://zfunnily.github.io/2021/03/gomod/概述 在使用go mod的过程中,依赖的包往往是第三方库,当我们自定义一个包并且放在github.com私有仓库时候,按照原来的方法则会有如下问题。 get &#34;gitlab.com/xxx/zz&#34;: found meta tag get.metaImport{Prefix:&#34;gitlab.com/xxx/zz&#34;, VCS:&#34;git&#34;, RepoRoot:&#34;https://gitlab.com/xxx/zz.git&#34;} at //gitlab.com/xxx/zz?go-get=1 verifying gitlab.com/xxx/zz@v0.0.1: gitlab.com/xxx/zz@v0.0.1: reading https://sum.golang.org/lookup/gitlab.com/xxx/zz@v0.0.1: 410 Gone 这个错误是因为新版本g八个基础排序https://zfunnily.github.io/2021/03/sort/Tue, 23 Mar 2021 10:13:31 +0000https://zfunnily.github.io/2021/03/sort/sort排序 std::sort( )函数是库函数提供的排序函数,必须包括头文件#include &lt;algorithm&gt;,它使用的排序方法是类似于快排的方法,时间复杂度为n*log2(n) Sort函数有三个参数:《仙剑奇侠传》编译运行https://zfunnily.github.io/2021/03/gamexian/Sun, 21 Mar 2021 10:44:58 +0000https://zfunnily.github.io/2021/03/gamexian/概述 今天在github上找到了《仙剑奇侠传》的rpg单机游戏sdlpal,sdlpal 是一个开源项目,基于sdl把仙剑奇侠传重写了一遍。 下面是我的编译过程总结。 环境 win10- sdl1.2- sdlpal- vs2017- DirectX SDK10 下载sdlpal $ git clone https://github.com.cnpmjs.org/sdlpal/sdlpal.git实现atoi和itoa函数https://zfunnily.github.io/2021/03/atoianditoa/Wed, 17 Mar 2021 16:43:20 +0000https://zfunnily.github.io/2021/03/atoianditoa/题目1: 把字符串转化为整数 有整数字符串,&quot;13579&quot;, 和 &quot;246810&quot;. 请写一个函数把这两个字符串转化为整数 步骤: 先判断正负 遍历字符串,转换字符为整数 //atoi.cc #include &lt;stdio.h&gt; int my_atoi(char *str) { bool bmin = false; int result = 0; //先判断正协程解析二 | 云风的coroutinehttps://zfunnily.github.io/2021/03/coroutinetwo/Wed, 10 Mar 2021 11:11:47 +0000https://zfunnily.github.io/2021/03/coroutinetwo/概述 云风的coroutine是通过ucontext来控制程序运行时上下文的,我们来根据该库提供的几个接口,和一个demo来解释协程的运行原理。如果不了解ucontext的,建议先了解ucontxt 环境协程解析一 | ucontexthttps://zfunnily.github.io/2021/03/coroutineone/Tue, 09 Mar 2021 09:43:00 +0000https://zfunnily.github.io/2021/03/coroutineone/概述 最近在研究协程的实现原理,看了云风的coroutine和腾讯的开源库libco后,原来要实现一个协程库也没那么难。我先来讲讲云风的coroutine库。他使用的是 uncontext来保存程序运行上Golang | 定时器https://zfunnily.github.io/2021/02/timer/Thu, 25 Feb 2021 16:02:13 +0000https://zfunnily.github.io/2021/02/timer/概述 golang有三种方式实现定时器: ticker timer select Ticker 通过 time.NewTicker(d)的方式实现定时器 d := time.Duration(time.Second * 2) t1 := time.NewTicker(d) defer t1.Stop() go func() { for { &lt;- t1.C fmt.Println(&#34;NewTicker...&#34;) } }() Timer 通过 time.NewTimer(d)的方式实现定时器 t2 := time.NewTimer(d)Lua | 解决百元买鸡的问题https://zfunnily.github.io/2021/02/chicken/Wed, 24 Feb 2021 17:51:46 +0000https://zfunnily.github.io/2021/02/chicken/问题 编写lua程序求解百鸡百钱问题。公鸡5元一只,母鸡3元一只,小鸡一元3只,问100元钱买100只鸡,可买公鸡、母鸡、小鸡各多少只? 代码 ----------------------------------------------------------------------------- --公鸡5元一只,母鸡3元一只,小鸡一元3只,问100元钱买Golang | JWT身份认证https://zfunnily.github.io/2021/02/JWT/Wed, 24 Feb 2021 14:22:04 +0000https://zfunnily.github.io/2021/02/JWT/概述 最近要在http接口上加一个token认证,但是接口很多,有没有一个省时省力的办法来解决。token的使用流程是: 用户使用帐号密码登陆到服务器1. 服务器验证登陆成功,根据帐号密码生成token。把Lua | 调用C/C++的动态库https://zfunnily.github.io/2021/02/dynamic/Sat, 20 Feb 2021 11:11:51 +0000https://zfunnily.github.io/2021/02/dynamic/概述 最近在学习 云风的skynet库,想自定义一个模块,目标是使用lua调用C/C++所编写的库。 当我们需要在Lua里面调用c/c++函数时,所有的函数都必须满足以下函数签名: typedef int (*lua_CFunction) (lua_State *L); 换句话说,所有的汇编 | C/C++调用汇编https://zfunnily.github.io/2021/02/compilation/Mon, 01 Feb 2021 14:40:51 +0000https://zfunnily.github.io/2021/02/compilation/概述 我使用AT&amp;T的规范,在linux上完成 C和汇编的互相调用,并使用gcc编译成可执行文件。 目标:汇编函数提供输出。类似C语言的函数 void hello_world(char* value) { printf(value); } 提供给C语言调用: int main() { hello_world(&#34;hello world!\n&#34;); } 搭建AT&amp汇编 | AT&T和Intel规范的区别https://zfunnily.github.io/2021/01/attandintel/Sun, 31 Jan 2021 11:25:39 +0000https://zfunnily.github.io/2021/01/attandintel/概述 常见的指令集以及汇编语言规范: x86(IA-32)、x86-64指令集(常见于PC端),对应有2家公司发布的不同汇编语言规范: intel公司发布的汇编语言规范,称intel 汇编:Windows派系Skynet | lua-protobufhttps://zfunnily.github.io/2021/01/skynetprotobuf/Mon, 25 Jan 2021 14:25:07 +0000https://zfunnily.github.io/2021/01/skynetprotobuf/概述 在最新的skynet中我使用的是云风的pbc库来解析protobuf,该项目中的一个文件protobuf.lua 使用了module语法在lua5.1版本中已经删除,最新的skynet是lua5.4Protobuf | 请求参数为空的案例https://zfunnily.github.io/2021/01/pbempty/Fri, 22 Jan 2021 16:41:16 +0000https://zfunnily.github.io/2021/01/pbempty/参数为空的grpc请求怎么定义 google protobuf已经提供了空参数 //empty.proto message Empty {&lt;!-- --&gt;} 使用方法,在proto文件中导入empty.proto, 定义一个请求参数和返回值为空的函数emptyfunction, 函数名字Golang | C数组转化为Golang的切片类型https://zfunnily.github.io/2021/01/goslience/Fri, 22 Jan 2021 15:56:40 +0000https://zfunnily.github.io/2021/01/goslience/概述 最近在巩固cgo的基础知识,在网上看到一篇Go和C之间 字符串数组、切片类型转换的文章,让我想到我之前写的一篇在go中遍历C结构体数组的文章,让我有新的方法来解决之前的问题,把C的数组转化为Go的切Skynet | echo服务https://zfunnily.github.io/2021/01/skynetecho/Fri, 15 Jan 2021 16:07:51 +0000https://zfunnily.github.io/2021/01/skynetecho/概述 引用云风博客的话:“skynet 是一个为网络游戏服务器设计的轻量框架。但它本身并没有任何为网络游戏业务而特别设计的部分,所以尽可以把它用于其它领域。skynet 并不是一个开箱即用的引擎,使用它需要Redis源码分析 | ziplisthttps://zfunnily.github.io/2021/01/ziplist/Wed, 13 Jan 2021 17:52:27 +0000https://zfunnily.github.io/2021/01/ziplist/概述 Redis中的List是一个有序(按加入的时序排序)的数据结构,一般有序我们会采用数组或者是双向链表,其中双向链表由于有前后指针实际上会很浪费内存。3.2版本之前采用两种数据结构作为底层实现: 压缩Redis源码解析 | VScode调试https://zfunnily.github.io/2021/01/vscodedebugredis/Tue, 12 Jan 2021 14:25:29 +0000https://zfunnily.github.io/2021/01/vscodedebugredis/环境 vscode- gcc5.4 ubuntu16.04 或者 ubuntu18.04 make 下载6.2版本. 我使用的是国内github镜像地址:github.com.cnpmjs.org,速度比较快。 $ git clone https://github.com.cnpmjs.org/redis/redis.git redis $ git checkout -b 6.2 remotes/origin/6.2 vscode不参与编译,只充当可视化的调试工具。 使用VScode | 调试Redis源码,指针显示的问题https://zfunnily.github.io/2021/01/vscoderedis/Tue, 12 Jan 2021 14:17:22 +0000https://zfunnily.github.io/2021/01/vscoderedis/缘由 使用VScode的时候,断点看到指针显示的是一串地址,而不是指针指向的对象的值。上网找了一圈,没看到vscode有对应的插件来解决这个问题。vscode有对应的语法来解决这个问题。 网上几乎都在说在Cgo | 遍历C结构体数组https://zfunnily.github.io/2021/01/cgostruct/Mon, 11 Jan 2021 17:18:35 +0000https://zfunnily.github.io/2021/01/cgostruct/缘由 现在有个应用场景,我们要在go中获取C结构体数组中的值。在C语言中,对于结构体数组,我们可以利用指针的偏移量来获取我们想要的值的位置。在go中我们怎么使用C指针和偏移量进行运算呢?下面的文字中C指Redis源码解析 | sdshttps://zfunnily.github.io/2021/01/sds/Wed, 06 Jan 2021 14:20:23 +0000https://zfunnily.github.io/2021/01/sds/SDS头文件及作用 sds.h: sds声明- sdsalloc.h: 为sds分配内存 源码文件sds.h中有这样一行代码 typedef char *sds; 很清晰、明了,sds其实就是char*。 最新的6.2分支的代码: struct __attribute__ ((__packed__)) sdshdr5 {&lt;!-- --&gt; unsigned char flags; /* 3 lsb ofstruct中使用char[]https://zfunnily.github.io/2021/01/chararray/Tue, 05 Jan 2021 15:45:36 +0000https://zfunnily.github.io/2021/01/chararray/缘由 最近在看redis的源码,刚开始看sds,看到这块代码 struct __attribute__ ((__packed__)) sdshdr5 { unsigned char flags; /* 3 lsb of type, and 5 msb of string length */ char buf[]; }; 好奇为什么使用 char buf[],而不用char *buf,找到答案记录一下。 struct中的char*Lastbattle | 游戏场景服务器SS解析https://zfunnily.github.io/2021/01/lastbattle/Sat, 02 Jan 2021 23:19:58 +0000https://zfunnily.github.io/2021/01/lastbattle/游戏场景服务器概况 指令对应的处理handle的文件:SSBattleMgr.cpp 创建战场 指令: eMsgToSSFromCS_CreateBattle GC服务器发往SS fromCS 收到中心服务器CS创建站场的指令,在函数INT32 CSSBattleMgr::OnMsgFromCS_CreateBattle(const char* pData, int n32DataLengtCCnet | 单线程reactor演变为多线程https://zfunnily.github.io/2020/12/ccnet/Wed, 30 Dec 2020 09:19:41 +0000https://zfunnily.github.io/2020/12/ccnet/ccnet从单线程演变为多线程 ccnet现状: epoll linux平台 事件循环 单线程 reactor 监听和新连接的事件都在主线程中 单线程的ccnet ccnet的单线程的角色: EventLoop: 整个事件循环。 EPollPoller: 负责事件的收集。 ChannelGolang | sync.Mutex详解https://zfunnily.github.io/2020/12/syncmutex/Tue, 29 Dec 2020 13:17:18 +0000https://zfunnily.github.io/2020/12/syncmutex/概述 自己做的一个golang项目需要优化,优化方向是减少gpu内存的使用。同一个模型被重复加载多次,使用更多的gpu内存,也增加 sync.Mutex的使用。 优化的方向是: 减少代码量的改动- 减少gpu内五种网络IO模型总结https://zfunnily.github.io/2020/12/iomodels/Mon, 28 Dec 2020 11:57:04 +0000https://zfunnily.github.io/2020/12/iomodels/概述 在网络上看到很多关于阻塞IO、非阻塞IO、同步IO、异步IO的例子,总觉得写的过于复杂并且让人难以理解。于是我把我自己把这几个概念的理解写下来以供参考。 POSIX POSIX(可移植操作系统接口)把同步IOCCnet | 一个reactor单线程网络库https://zfunnily.github.io/2020/12/ccnetone/Sun, 27 Dec 2020 18:41:25 +0000https://zfunnily.github.io/2020/12/ccnetone/缘由 最近在研究陈硕的网络库muduo,是一个基于reactor架构的网络库。我对网络库的感觉是易用,但是内容庞大,依赖颇多。比如boost网络库里面的一些语法让人生畏。关于reactor和proactC++ | vector中的resize()函数 VS reserve()函数https://zfunnily.github.io/2020/12/reserve/Fri, 25 Dec 2020 11:04:29 +0000https://zfunnily.github.io/2020/12/reserve/reserve void reserve (size_type n); reserver函数用来给vector预分配存储区大小,即capacity的值 ,但是没有给这段内存进行初始化。reserve 的参数n是推荐预分配内存的大小,实际分配的可能等于或大于这个值,即Golang | 用gocolly登录B站https://zfunnily.github.io/2020/12/gocolly/Sun, 13 Dec 2020 14:51:53 +0000https://zfunnily.github.io/2020/12/gocolly/概述 gocolly是golang语言开发的爬虫包,通过gocolly来进行模拟网站的登录, 目标已经确立,开始行动。 下载 $ go get -u github.com/gocolly/colly 获取cookie 登录网站:https://www.bilibili.coProtobuf | 沾包问题https://zfunnily.github.io/2020/12/tcp/Sun, 13 Dec 2020 10:22:38 +0000https://zfunnily.github.io/2020/12/tcp/缘由 最近在研究一款游戏的源码。发现里面的通信协议是protobuf定义的,但还是自己定义了协议头部,类似 head + body。先解析头部里所存储的整个包的数据长度,然后再解析包剩余的数据,这样做的目的是为了防Grpc | 概述https://zfunnily.github.io/2020/12/grpc/Sun, 13 Dec 2020 09:10:42 +0000https://zfunnily.github.io/2020/12/grpc/OverView gRPC是由Google主导开发的RPC框架,使用HTTP/2协议并用ProtoBuf作为序列化工具。其客户端提供Objective-C、Java接口,服务器侧则有Java、Golang、C++等接Ubuntu16.04.6 | 安装Cinnamon3.0https://zfunnily.github.io/2020/12/cinnamon3.0/Tue, 01 Dec 2020 15:43:58 +0000https://zfunnily.github.io/2020/12/cinnamon3.0/概述 Cinnamon[1]是Linux Mint[2]的默认桌面环境。不同于 Ubuntu 的 Unity 桌面环境,Cinnamon 是一个更加传统而优雅的桌面环境,其带有底部面板和应用菜单。由于 Cinnamon 桌面以及它类 Windows 的用户界面,许多Ubuntu | version `GLIBC_2.27‘ not found错误https://zfunnily.github.io/2020/11/glibcnotfound/Sat, 28 Nov 2020 15:03:04 +0000https://zfunnily.github.io/2020/11/glibcnotfound/version `GLIBC_2.27’ not found错误 执行strings /lib/x86_64-linux-gnu/libc.so.6 | grep GLIBC_ 结果显示如下: GLIBC_2.2.5 GLIBC_2.2.6 GLIBC_2.3 GLIBC_2.3.2 GLIBC_2.3.3 GLIBC_2.3.4 GLIBC_2.4 GLIBC_2.5 GLIBC_2.6 GLIBC_2.7 GLIBC_2.8 GLIBC_2.9 GLIBC_2.10 GLIBC_2.11 GLIBC_2.12 GLIBC_2.13 GLIBC_2.14 GLIBC_2.15 GLIBC_2.16 GLIBC_2.17 GLIBC_2.18 GLIBC_2.22 GLIBC_2.23 GLIBC_2.24 GLIBC_PRIVATE 去清华开源站点下载glibc: https://mirrors.tuna.tsinghua.edu.cn/gnu/libc/ 下载好文件后解压 $ tar -zxvf glibc-2.27.tar.gz 进入 glibc-2.27 目录,Docker | 容器退出码详解https://zfunnily.github.io/2020/11/Docker%E5%AE%B9%E5%99%A8%E9%80%80%E5%87%BA%E7%A0%81%E8%AF%A6%E8%A7%A3/Sat, 28 Nov 2020 13:32:57 +0000https://zfunnily.github.io/2020/11/Docker%E5%AE%B9%E5%99%A8%E9%80%80%E5%87%BA%E7%A0%81%E8%AF%A6%E8%A7%A3/docker查看退出码指令 $ docker ps --filter &#34;status=exited&#34; $ docker inspect container-id --format=&#39;{&lt;!-- --&gt;{.State.ExitCode}}&#39; 常见退出码 Exit Code 0 退出代码0表示特定容器没有附加前台进程。 该退出代码是所有其他后续退出代码的例外。 这不一定意味着发生了不好的事情。如果开发人员想要在容器完Openresty二 | postman小工具https://zfunnily.github.io/2020/11/%E4%BD%BF%E7%94%A8OpenResty%E5%81%9A%E4%B8%80%E4%B8%AApostman%E5%B0%8F%E5%B7%A5%E5%85%B7/Wed, 25 Nov 2020 16:30:39 +0800https://zfunnily.github.io/2020/11/%E4%BD%BF%E7%94%A8OpenResty%E5%81%9A%E4%B8%80%E4%B8%AApostman%E5%B0%8F%E5%B7%A5%E5%85%B7/用到的知识点 mvc架构 模型渲染库:https://github.com/bungle/lua-resty-template resty http请求库: https://github.com/bungle/lua-resty-template 参照 mvc模型来做postman工具 配置文件说明 worker_processes 1; error_log logs/error.log; eventsOpenresty一 | 初探https://zfunnily.github.io/2020/11/OpenResty%E5%88%9D%E6%8E%A2/Mon, 23 Nov 2020 16:21:34 +0800https://zfunnily.github.io/2020/11/OpenResty%E5%88%9D%E6%8E%A2/概述 OpenResty®是一个基于Nginx与 Lua 的高性能 Web 平台,其内部集成了大量精良的 Lua 库、第三方模块以及大多数的依赖项。用于方便地搭建能够处理超高并发、扩展性极高的动态 Web 应用、Web 服务和动态网关。LastBattle | 登录流程(LS & BS & GS)https://zfunnily.github.io/2020/11/lastbattlelogin/Fri, 20 Nov 2020 17:27:08 +0000https://zfunnily.github.io/2020/11/lastbattlelogin/登录流程 根据上一篇文章中的登录流程,我在工程中找到了相应的代码并记录了下来 登录服务代码解析 监听端口:49997 供BS服务连接 监听端口:49996 供客户端连接 CIocpCtrl:IOCP控制类 多线程循环LastBattle | 服务架构https://zfunnily.github.io/2020/11/lastbattleserver/Fri, 20 Nov 2020 17:24:32 +0000https://zfunnily.github.io/2020/11/lastbattleserver/服务器架构简图如下: 连线说明: 实线:表示客户端登录流程,①②③④⑤表示登录流程,详细解释见下文。 虚线:表示服务器间的连接,虚线箭头指向监听方。 架构说明: |英文名称|简称|中文名称|功能简介|单个大区需LastBattle | 安装部署笔记https://zfunnily.github.io/2020/11/lastbattleone/Mon, 16 Nov 2020 06:49:49 +0000https://zfunnily.github.io/2020/11/lastbattleone/环境准备 win10 服务器:vs2010 / 数据库 mysql5.7 清华大学mysql镜像网站:https://mirrors.tuna.tsinghua.edu.cn/mysql/downloads/MySQL-5.7/ 客户端Cgo | 使用libevent库实现一个定时器https://zfunnily.github.io/2020/11/cgo%E4%BD%BF%E7%94%A8libevent%E5%BA%93%E5%AE%9E%E7%8E%B0%E4%B8%80%E4%B8%AA%E5%AE%9A%E6%97%B6%E5%99%A8/Fri, 13 Nov 2020 16:40:42 +0000https://zfunnily.github.io/2020/11/cgo%E4%BD%BF%E7%94%A8libevent%E5%BA%93%E5%AE%9E%E7%8E%B0%E4%B8%80%E4%B8%AA%E5%AE%9A%E6%97%B6%E5%99%A8/使用libevent库作为例子 下载 &amp; 编译 &amp; 安装libevent $ git clone https://github.com.cnpmjs.org/libevent/libevent.git $ cd libevent &amp;&amp; mkdir build &amp;&amp; cd build $ cmake .. $ make libevent实现的定时器 // main.cpp #include &#34;event.h&#34; struct event ev; struct timeval tv; void time_cb(evutil_socket_t fd, short event, void *argc) { printf(&#34;timer wakeup\n&#34;); event_add(&amp;ev, &amp;tv); // reschedule timer } int main() { struct event_base *base = event_base_new(); tv.tv_sec = 2;Golang | 利用指针进行数据转换https://zfunnily.github.io/2020/11/Golang-%E5%88%A9%E7%94%A8%E6%8C%87%E9%92%88%E8%BF%9B%E8%A1%8C%E6%95%B0%E6%8D%AE%E8%BD%AC%E6%8D%A2/Thu, 12 Nov 2020 17:19:07 +0000https://zfunnily.github.io/2020/11/Golang-%E5%88%A9%E7%94%A8%E6%8C%87%E9%92%88%E8%BF%9B%E8%A1%8C%E6%95%B0%E6%8D%AE%E8%BD%AC%E6%8D%A2/概述 在Go语言中,Slice本质是什么呢?是一个reflect.SliceHeader结构体和这个结构体中Data字段所指向的内存。String本质是什么呢?是一个reflect.StringHeadGolang | buildshttps://zfunnily.github.io/2020/11/go-builds/Thu, 12 Nov 2020 17:15:17 +0000https://zfunnily.github.io/2020/11/go-builds/概述 通常我们会给每个产品环境设置不同的配置,比如 redis 要在开发环境就连接 localhost:6379,测试环境可能连接某一个主机的 redis。 如果放在 go 里面是否可行?因为 go 是编译二进制包,也没有动态加载这Cgo | 简单使用https://zfunnily.github.io/2020/11/cgo%E7%9A%84%E7%AE%80%E5%8D%95%E4%BD%BF%E7%94%A8/Thu, 05 Nov 2020 09:45:23 +0000https://zfunnily.github.io/2020/11/cgo%E7%9A%84%E7%AE%80%E5%8D%95%E4%BD%BF%E7%94%A8/使用自己的C函数 文件名:testC.go package main /* #include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; void c_print(char *str) { printf(&#34;%s\n&#34;, str); } */ import &#34;C&#34; //import “C” 必须单起一行,并且紧跟在注释行之后 import &#34;unsafe&#34; func main() { s := &#34;Hello Cgo&#34; cs := C.CString(s) //字符串映射 C.c_print(cs) //调用C函数 defer C.free(unsafe.Pointer(cs)) //释放内存 } 说明: 1、gGolang | 使用Lumberjack+zap进行日志切割归档https://zfunnily.github.io/2020/11/%E4%BD%BF%E7%94%A8Lumberjack-zap%E8%BF%9B%E8%A1%8C%E6%97%A5%E5%BF%97%E5%88%87%E5%89%B2%E5%BD%92%E6%A1%A3/Wed, 04 Nov 2020 12:44:03 +0000https://zfunnily.github.io/2020/11/%E4%BD%BF%E7%94%A8Lumberjack-zap%E8%BF%9B%E8%A1%8C%E6%97%A5%E5%BF%97%E5%88%87%E5%89%B2%E5%BD%92%E6%A1%A3/使用Lumberjack+zap进行日志切割归档 为了添加日志切割归档功能,我们将使用第三方库Lumberjack来实现。 安装 执行下面的命令安装Lumberjack go get -u github.com/natefinch/lumberjack zap logger中加入LumbeVim | vimplus快捷键https://zfunnily.github.io/2020/10/vimplus%E5%BF%AB%E6%8D%B7%E9%94%AE/Wed, 28 Oct 2020 09:14:28 +0000https://zfunnily.github.io/2020/10/vimplus%E5%BF%AB%E6%8D%B7%E9%94%AE/插件相关 |快捷键|说明 |&mdash;&mdash; |,|Leader Key |&lt;leader&gt;n|打开 / 关闭代码资源管理器 |&lt;leader&gt;t|打开 / 关闭函数列表 |&lt;leader&gt;a|.h .cpp 文件切换 |&lt;leader&gt;u|转到函数声明 |&Vim | 打造编C++IDEhttps://zfunnily.github.io/2020/10/%E4%BD%BF%E7%94%A8vim%E6%89%93%E9%80%A0%E7%BC%96C-IDE/Wed, 28 Oct 2020 09:11:32 +0000https://zfunnily.github.io/2020/10/%E4%BD%BF%E7%94%A8vim%E6%89%93%E9%80%A0%E7%BC%96C-IDE/使用 vimplus 打造C++ IDE GitHub: https://github.com/chxuan/vimplus 支持平台: macos/linux 安装vimplus // 原来的链接, 国内速度较慢 $ git clone https://github.com/chxuan/vimplus.git ~/.vimplus // github修改为镜像的链接 $ git clone --depth=1 https://github.com.cnpmjs.org/chxuan/vimplus.git ~/.vimplus $ cd ~/.vimplus //不加sudo $ ./install.sh 设置Nerd Font 为防止vimpluLinux | 删除大量文件指令--rsynchttps://zfunnily.github.io/2020/10/linux%E7%B3%BB%E7%BB%9F%E5%88%A0%E9%99%A4%E5%A4%A7%E9%87%8F%E6%96%87%E4%BB%B6%E6%8C%87%E4%BB%A4--rsync/Tue, 13 Oct 2020 16:29:34 +0000https://zfunnily.github.io/2020/10/linux%E7%B3%BB%E7%BB%9F%E5%88%A0%E9%99%A4%E5%A4%A7%E9%87%8F%E6%96%87%E4%BB%B6%E6%8C%87%E4%BB%A4--rsync/rsync的安装 rsync安装,有些系统默认安装有该命令 ubuntu系统 sudo apt-get install rsync centos系统 sudo yum install rsync rsync参数详解 rsync提供了一些跟删除有关的参数 rsync --help | grep delete -del an alias for --delete-during --delete delete extraneous files from destination dirs --delete-before receiver deletes beforeCPU的核与线程-4核8线程https://zfunnily.github.io/2020/10/CPU%E7%9A%84%E6%A0%B8%E4%B8%8E%E7%BA%BF%E7%A8%8B-4%E6%A0%B88%E7%BA%BF%E7%A8%8B/Mon, 12 Oct 2020 16:29:34 +0000https://zfunnily.github.io/2020/10/CPU%E7%9A%84%E6%A0%B8%E4%B8%8E%E7%BA%BF%E7%A8%8B-4%E6%A0%B88%E7%BA%BF%E7%A8%8B/查看cpu信息 $ cat /proc/cpuinfo 物理CPU 物理CPU就是计算机上实际配置的CPU个数。 在linux上可以打开cat /proc/cpuinfo 来查看,其中的physical id就是每个物理CPU的ID,能找到几个physical id就代表TCP/IP | 大量TIME_WAIT对线上业务的影响https://zfunnily.github.io/2020/10/%E5%A4%A7%E9%87%8FTIME_WAIT%E5%AF%B9%E7%BA%BF%E4%B8%8A%E4%B8%9A%E5%8A%A1%E7%9A%84%E5%BD%B1%E5%93%8D/Sat, 10 Oct 2020 16:46:34 +0000https://zfunnily.github.io/2020/10/%E5%A4%A7%E9%87%8FTIME_WAIT%E5%AF%B9%E7%BA%BF%E4%B8%8A%E4%B8%9A%E5%8A%A1%E7%9A%84%E5%BD%B1%E5%93%8D/TCP的三次握手和四次挥手 TIME_WAIT概述 TIME_WAIT 状态: TCP 连接中,主动关闭连接的一方出现的状态;(收到 FIN 命令,进入 TIME_WAIT 状态,并返回 ACK 命令) 保持 2 个 MSL 时间,即,4 分钟 ;(MSL 为 2 分钟) TCP 连接建立后,「主Libevent | 定时器https://zfunnily.github.io/2020/09/libeventimer/Wed, 16 Sep 2020 23:20:28 +0000https://zfunnily.github.io/2020/09/libeventimer/libevent 实现定时器流程 首先初始化libevent库,并保存返回的指针 struct event_base * base = event_init(); 实际上这一步相当于初始化一个Reactor实例;在初始化libevent后,就可以注册事件了。 初始化事件event,设置回调函FFmpeg | 画中画和视频多宫格处理https://zfunnily.github.io/2020/09/ffmpegpicture/Mon, 14 Sep 2020 18:29:33 +0000https://zfunnily.github.io/2020/09/ffmpegpicture/FFmpeg生成画中画 静态画中画 将视频sub.mp4视频文件缩放成宽 480 、高 320 的视频,然后显示在 视频 input.mp4,x坐标为0,y 坐标为0 的位置 ffmpeg -re -i input.mp4 -vf &#34;movie=sub.mp4, scale=480x320[test]; [in][test]overlay [out]&#34; -vcodec libx264 output.flv 显示在画面的右下角,则需要用到FFmpeg | 给视频加文字和图片水印https://zfunnily.github.io/2020/09/ffmpegvideo/Sat, 12 Sep 2020 12:47:57 +0000https://zfunnily.github.io/2020/09/ffmpegvideo/FFmpeg给视频加上logo ffmpeg从视频中截取图像帧 ffmpeg -i inputfile.avi -r 1 -f image2 image-%05d.jpeg ffmpeg -i inputfile.avi -r 1 -s 4cif -f image2 image-%05d.jpeg ffmpeg -i inputfile.avi -r 1 -t 4 -f image2 image-%05d.jpeg ffmpeg -i inputfile.avi -r 1 -ss 01:30:14 -f image2 image-%05d.jpeg ffmpeg -i inputfile.avi -r 1 -ss 01:30:14 -vframes 120 4cif -f image2 image-%05d.jpeg -r 指定抽取的帧率,即从视频中每秒钟抽取FFmpeg | 录制摄像头和桌面数据windowshttps://zfunnily.github.io/2020/09/ffmpegvideow/Wed, 09 Sep 2020 09:36:49 +0000https://zfunnily.github.io/2020/09/ffmpegvideow/概述 FFmpeg Windows 设备操作 Windows 采集设备的主要方式是 dshow vfwcap gdigrab 其中 dshow 可以用来抓 取摄像头、采集卡、麦克风等,- vfwcap 主要用来采集摄像头类设备,- gdigrab 则是抓取 Windows 窗口程序 FFmpeg 使用 dshow 采集音视频设备 使用 dshow 枚举设备 ffmpeg -f dshow -list_devices true -i dymmy 输出 [dshow @ 000002622302e340]FFmpeg | 录制摄像头和桌面数据machttps://zfunnily.github.io/2020/08/macffmpeg/Sat, 29 Aug 2020 17:20:40 +0000https://zfunnily.github.io/2020/08/macffmpeg/设备枚举 查看设备列表 $ ffmpeg -hide_banner -devices Devices: D. = Demuxing supported .E = Muxing supported -- D avfoundation AVFoundation input device D lavfi Libavfilter virtual input device E sdl,sdl2 SDL2 output device 可以看到输入设备有:avfoundation,lavfi 输出设备有:sdl `` 设备采集举例: $ ffmpeg -f avfoundation -list_devices true -i &#34; &#34; 看到了 如下设K8S | Prometheus+Grafana监控https://zfunnily.github.io/2020/08/prometheusgrafana/Mon, 17 Aug 2020 13:58:35 +0000https://zfunnily.github.io/2020/08/prometheusgrafana/概述 作为应用与Kubernetes的监控体系,Prometheus具备诸多的优势,如: Kubernetes默认支持,非常适合容器和微服务- 无依赖,安装方便,上手容易- 社区活跃,它不仅仅是个工具,而是生Owt-server | owt-client-javascripthttps://zfunnily.github.io/2020/08/owt-client-javascript/Sun, 16 Aug 2020 23:04:13 +0000https://zfunnily.github.io/2020/08/owt-client-javascript/概述 天气燥热,不易出门。遂研究一下owt-server,从owt-client-javascript的流程开始吧。 获取一个会议室 owt-client-javascript的时候有一个初始化房间的过程 ///owt-client-javascript/src/samples/conference/samplertcservice.jsK8S | Ingress的基本使用https://zfunnily.github.io/2020/08/ingress/Sat, 15 Aug 2020 00:05:15 +0000https://zfunnily.github.io/2020/08/ingress/缘由 看了statefulset基础教程的基础教程,并且把环境搭建起来后。pod内部是可以连通了。但是我不知道怎么去从外部访问。在网上搜索一番,通过Ingress可以作为集群的入口。遂记录之。 结合StaK8S | Statefluset的持久存储PVChttps://zfunnily.github.io/2020/08/pvc/Fri, 14 Aug 2020 17:18:58 +0000https://zfunnily.github.io/2020/08/pvc/缘由 在看statefluset基础教程的时候遇到pod状态为pending kubectl describe pod web-0 日志内容是 pod has unbound immediate PersistentVolumeClaims 于是就对PV和PVC进行研究。 有给出完整的 web.yaml查看最下面的完整示例。但是我建议先把PVLinux | nsf服务的搭建和使用https://zfunnily.github.io/2020/08/nsf/Fri, 14 Aug 2020 17:17:54 +0000https://zfunnily.github.io/2020/08/nsf/搭建nsf服务 sudo apt install nfs-kernel-server 默认情况下,在Ubuntu 18.04上,NFS版本2是禁用的。版本3和版本4已启用。您可以通过运行以下cat命令来验证: sudo cat /proc/fs/nfsd/versions 写入 exports cat /etc/exports sudo echo /nfs/prometheus/data/ 192.168.84.75/24(rw,no_root_squash,no_all_squash,sync) &gt;&gt; /etc/exports sudo echo /nfs/prometheus/data/ 192.168.84.75/24(rw,no_root_squash,no_all_squash,sync) &gt;&gt; /etc/exports 可以设定的参数主要K8S | StatefulSet基本原理https://zfunnily.github.io/2020/08/statefulset/Fri, 14 Aug 2020 16:03:41 +0000https://zfunnily.github.io/2020/08/statefulset/背景 用户通过 Deployment、ReplicationController 可以方便地在 kubernetes 中部署一套高可用、可扩展的分布式无状态服务。这类应用不在本地存储数据,通过简单的负载均衡策略可实现请求分发。随K8S | coreDNS的部署安装https://zfunnily.github.io/2020/08/coredns/Thu, 13 Aug 2020 18:44:28 +0000https://zfunnily.github.io/2020/08/coredns/概述 CoreDNS可以在具有标准的Kube-DNS的Kubernetes集群中运行。作为Kubernetes 的插件使用,CoreDNS将从 Kubernetes集群中读取区(zone)数据。它实现了为KK8S | 创建第一个应用https://zfunnily.github.io/2020/08/firstk8s/Thu, 13 Aug 2020 15:28:31 +0000https://zfunnily.github.io/2020/08/firstk8s/使用k8s部署第一个应用 创建一个nginx.yaml文件 apiVersion: v1 kind: Pod metadata: name: nginx # 指定 label,便于检索 labels: app: nginx spec: containers: - name: nginx # 指定镜像 image: nginx:alpine # 指定暴露端口 ports: - containerPort: 80 --- # 创建网络服务 apiVersion: v1 kind: Service metadata: name: kube-node-service labels: name: kube-node-service spec: type: NodePort #这里代表Licod | 安装和配置https://zfunnily.github.io/2020/08/licode/Sun, 09 Aug 2020 09:34:36 +0000https://zfunnily.github.io/2020/08/licode/拉取docker镜像并运行 licode官方提供了配置好的docker镜像,使用以下命令拉下来跑就行。 docker run --name licode -p 3000:3000 -p $MIN_PORT-$MAX_PORT:30000-30050/udp -p 3001:3001 -p 8080:8080 -e &#34;MIN_PORT=30000&#34; -e &#34;MAX_PORT=30050&#34; -e &#34;PUBLIC_IP=your_ip_address&#34; lynckia/licode 注意命令里的PUBLIC_IP要改为服务器的公网IP。 配置好之Docker | 远程访问加密https://zfunnily.github.io/2020/08/dockersecret/Fri, 07 Aug 2020 07:56:52 +0000https://zfunnily.github.io/2020/08/dockersecret/docker的远程访问 方法一 :编辑docker.service文件 编辑docker.service文件 sudo vim /lib/systemd/system/docker.service 修改ExecStart行为下面内容 ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock 重新加载docker配置 sudo systemctl daemon-reload // 1,加载dockDocker | web管理界面portainerhttps://zfunnily.github.io/2020/08/dockerweb/Fri, 07 Aug 2020 07:54:43 +0000https://zfunnily.github.io/2020/08/dockerweb/拉取镜像 $ docker pull portainer/portainer 运行启动portainer docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v /home/docker/portainer:/data --name portainer --restart=always portainer/portainer admin bigant.cn 汉化 Portainer-CN.zip 百度云盘: https://pan.baidu.com/s/13ra6jXHR_7vajLLlf5GVEw 提取码: nzue 新建文件夹命名为public,把Portainer-CN.zip解压至里面。 2、public文件夹传K8S | 集群资源监控 heapsterhttps://zfunnily.github.io/2020/08/heapster/Thu, 06 Aug 2020 09:06:05 +0000https://zfunnily.github.io/2020/08/heapster/安装heapster的原因 查看dashboard状态 $ sudo kubectl get pods --all-namespaces | grep dashboard kubernetes-dashboard dashboard-metrics-scraper-6b4884c9d5-mvnb9 1/1 Running 0 40m kubernetes-dashboard kubernetes-dashboard-d7f7f565d-zhpsc 1/1 Running 0 40m 查看dashboard的日志 $ sudo kubectl logs -f -n kubernetes-dashboard kubernetes-dashboard-d7f7f565d-zhpsc 日志遇到这样的情况 No metric client provided. Skipping metrics. 2020/08/03 09:02:22 [2020-08-03T09:02:22Z] Outcoming response to 192.168.84.241:40086 with 200 status code 2020/08/03 09:02:23 Metric client healthK8S | Dashboard界面管理https://zfunnily.github.io/2020/08/dashboard/Thu, 06 Aug 2020 09:04:14 +0000https://zfunnily.github.io/2020/08/dashboard/安装部署Dashboard 通过一下命令来部署, recommended.yaml $ sudo kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deploy/recommended.yaml https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deplK8S | 安装https://zfunnily.github.io/2020/08/k8sinstall/Wed, 05 Aug 2020 10:00:40 +0000https://zfunnily.github.io/2020/08/k8sinstall/安装k8s前的准备工作 环境 ubuntu18.04 docker 关闭 swap 暂时关闭 $ swapoff -a 永久关闭 注释掉这一行 sudo vim /etc/fstab # /swapfile none swap sw 0 0 重启机器 sudo reboot docker 的配置 安装完成之后需要进行一些配置,包括 切换docker下载源为国内镜像站 以及 修改cgroupsOwt-server | 编译运行https://zfunnily.github.io/2020/08/owtservercomplie/Wed, 05 Aug 2020 09:47:22 +0000https://zfunnily.github.io/2020/08/owtservercomplie/概述 owt是一套完整的webrtc视频会议系统。包含的功能模块有: 视频会议1. p2p 服务器是owt-server通过nodejs编写的webrtc信令。依赖是licode。licode依赖webrtc。 客2024-01月https://zfunnily.github.io/1/01/30/Mon, 01 Jan 0001 00:00:00 +0000https://zfunnily.github.io/1/01/30/学习 书籍 电影 游戏 《艾尔登法环》 《Dark Soul》3 《LOL》 番&amp;剧 其他神之亵渎1https://zfunnily.github.io/1/01/blasphemous/Mon, 01 Jan 0001 00:00:00 +0000https://zfunnily.github.io/1/01/blasphemous/地图设计 非线性结构: 游戏的地图是非线性的,允许玩家在一个庞大的世界中自由探索。玩家可以决定选择不同的路径和区域,解锁新的能力以访问之前无法到达的地方。 多样化的区域: 地图中包含了多个主题区域,每个区域都血污booshttps://zfunnily.github.io/1/01/blood/Mon, 01 Jan 0001 00:00:00 +0000https://zfunnily.github.io/1/01/blood/《血污:夜之仪式》 BOSS一/猎魔斩月 挑衅 + 招架 飞镖 横砍 劈砍 冲刺 + 横砍 跳起来 + 劈砍 跳起来 + 上挑 跳起来 + 上挑 + 劈砍 钩锁 + 劈砍 刀刃,火焰附魔 + 上面的轮回 影分身 格莫瑞 最终boss 没有后续boss的分析 地图设 \ No newline at end of file diff --git a/sitemap.xml b/sitemap.xml index 9d8f0a913..cb02086b0 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -1 +1 @@ -https://zfunnily.github.io/2024/02/02/2024-03-30T00:58:35+00:00https://zfunnily.github.io/categories/2024-03-30T00:58:35+00:00https://zfunnily.github.io/post/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2024-03-30T00:58:35+00:00https://zfunnily.github.io/categories/%E6%80%BB%E7%BB%93%E6%80%BB%E7%BB%93.%E6%9C%88/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2023/12/30/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2023/11/30/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2023/11/wsl2/2024-03-30T00:58:35+00:00https://zfunnily.github.io/categories/%E8%87%AA%E5%8A%A8%E9%83%A8%E7%BD%B2/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2023/11/python/2024-03-30T00:58:35+00:00https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E7%BC%96%E8%AF%91/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2023/11/mysql/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2023/11/svn/2024-03-30T00:58:35+00:00https://zfunnily.github.io/categories/SVN%E5%90%88%E5%B9%B6/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2023/11/wsl/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2023/11/gitaction/2024-03-30T00:58:35+00:00https://zfunnily.github.io/categories/AI/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2023/11/chatglm/2024-03-30T00:58:35+00:00https://zfunnily.github.io/tags/2024-03-30T00:58:35+00:00https://zfunnily.github.io/tags/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2023/10/DDNS/2024-03-30T00:58:35+00:00https://zfunnily.github.io/categories/NAS/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2023/05/particlesystem01/2024-03-30T00:58:35+00:00https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.Unity%E7%B2%92%E5%AD%90%E7%B3%BB%E7%BB%9F/2024-03-30T00:58:35+00:00https://zfunnily.github.io/english/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/10/netch/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/10/netch/2024-03-30T00:58:35+00:00https://zfunnily.github.io/categories/%E6%B8%B8%E6%88%8F/2024-03-30T00:58:35+00:00https://zfunnily.github.io/thinking/2024-03-30T00:58:35+00:00https://zfunnily.github.io/english/xdf/04_adj/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/06/cicd/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/06/cicd/2024-03-30T00:58:35+00:00https://zfunnily.github.io/categories/IT/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/05/baidu/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/05/baidu/2024-03-30T00:58:35+00:00https://zfunnily.github.io/tags/URP/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/05/refraction/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/05/refraction/2024-03-30T00:58:35+00:00https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B/2024-03-30T00:58:35+00:00https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.UnityShader/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/05/shaderalpha/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/05/shaderalpha/2024-03-30T00:58:35+00:00https://zfunnily.github.io/tags/%E8%AF%BB%E4%B9%A6%E7%AC%94%E8%AE%B0/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/05/shaderlighting/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/05/shaderlighting/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/05/shaderbase/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/05/shaderbase/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/05/geometry/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/05/geometry/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/04/shaderfunc/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/04/shaderfunc/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/04/cginc/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/04/cginc/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/04/shadermathematic/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/04/shadermathematic/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/04/shaderbase/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/04/shaderbase/2024-03-30T00:58:35+00:00https://zfunnily.github.io/tags/shader/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/04/shaderrenderpipline/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/04/shaderrenderpipline/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/04/shaderhelloworld/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/04/shaderhelloworld/2024-03-30T00:58:35+00:00https://zfunnily.github.io/tags/shader%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/04/shader01/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/04/shader01/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/04/graphics/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/04/graphics/2024-03-30T00:58:35+00:00https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E5%9B%BE%E5%BD%A2%E5%AD%A6%E5%85%A5%E9%97%A8/2024-03-30T00:58:35+00:00https://zfunnily.github.io/tags/%E6%8A%BD%E5%8D%A1/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/03/afk/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/03/afk/2024-03-30T00:58:35+00:00https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E6%B8%B8%E6%88%8F%E5%BC%80%E5%8F%91/2024-03-30T00:58:35+00:00https://zfunnily.github.io/tags/skynet/2024-03-30T00:58:35+00:00https://zfunnily.github.io/tags/%E5%AE%9A%E6%97%B6%E5%99%A8/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/03/timerskynet/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/03/timerskynet/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/03/timer/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/03/timer/2024-03-30T00:58:35+00:00https://zfunnily.github.io/thinking/2022/03/shuowang/2024-03-30T00:58:35+00:00https://zfunnily.github.io/categories/%E9%9A%8F%E7%AC%94/2024-03-30T00:58:35+00:00https://zfunnily.github.io/categories/%E9%9A%8F%E7%AC%94.%E6%91%98%E6%8A%84/2024-03-30T00:58:35+00:00https://zfunnily.github.io/thinking/2022/03/think01/2024-03-30T00:58:35+00:00https://zfunnily.github.io/tags/weekly/2024-03-30T00:58:35+00:00https://zfunnily.github.io/thinking/2022/03/weekly01/2024-03-30T00:58:35+00:00https://zfunnily.github.io/thinking/2022/03/summarize/2024-03-30T00:58:35+00:00https://zfunnily.github.io/tags/year/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/03/blog/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/03/blog/2024-03-30T00:58:35+00:00https://zfunnily.github.io/categories/%E5%8D%9A%E5%AE%A2%E8%AE%B0%E4%BA%8B/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/03/https/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/03/https/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/03/http/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/03/http/2024-03-30T00:58:35+00:00https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.Golang/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/03/reload/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/03/reload/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/02/jwt/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/02/jwt/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/02/san/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2022/02/san/2024-03-30T00:58:35+00:00https://zfunnily.github.io/categories/%E8%BD%AC%E8%BD%BD/2024-03-30T00:58:35+00:00https://zfunnily.github.io/thinking/2022/01/jx/2024-03-30T00:58:35+00:00https://zfunnily.github.io/tags/%E9%95%BF%E5%AE%89%E5%8D%81%E6%97%A5/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/12/shortcodes/2024-03-30T00:58:35+00:00https://zfunnily.github.io/tags/shortcodes/2024-03-30T00:58:35+00:00https://zfunnily.github.io/tags/nginx/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/12/nginx/2024-03-30T00:58:35+00:00https://zfunnily.github.io/thinking/2021/12/pervert/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/12/astar/2024-03-30T00:58:35+00:00https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.Lua/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/12/music/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/12/dark/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/12/openresty-upload/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/11/webrtcdesk/2024-03-30T00:58:35+00:00https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E9%9F%B3%E8%A7%86%E9%A2%91/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/11/webrtcpeerconnection/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/11/gop2pfour/2024-03-30T00:58:35+00:00https://zfunnily.github.io/tags/p2p/2024-03-30T00:58:35+00:00https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.P2P/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/11/randomquotes/2024-03-30T00:58:35+00:00https://zfunnily.github.io/tags/randomquotes/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/10/gop2pthree/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/10/gop2ptwo/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/10/gop2pone/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/10/blogmigration/2024-03-30T00:58:35+00:00https://zfunnily.github.io/todo/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/10/four/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/10/skynetthree/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/10/skynettwo/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/10/skynetone/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/10/shell/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/09/move/2024-03-30T00:58:35+00:00https://zfunnily.github.io/tags/music/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/09/music/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/09/transform/2024-03-30T00:58:35+00:00https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.Unity3D/2024-03-30T00:58:35+00:00https://zfunnily.github.io/categories/IT.Linux/2024-03-30T00:58:35+00:00https://zfunnily.github.io/tags/vim/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/09/vimchange/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/09/screen/2024-03-30T00:58:35+00:00https://zfunnily.github.io/tags/screen/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/09/upgradegcc/2024-03-30T00:58:35+00:00https://zfunnily.github.io/tags/gcc/2024-03-30T00:58:35+00:00https://zfunnily.github.io/tags/except/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/08/except/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/08/ugui/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/06/distribute/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/06/goredis/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/05/lua_next/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/05/settopandpop/2024-03-30T00:58:35+00:00https://zfunnily.github.io/tags/hugo/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/04/hugo/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/03/gomod/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/03/sort/2024-03-30T00:58:35+00:00https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.C/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/03/gamexian/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/03/atoianditoa/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/03/coroutinetwo/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/03/coroutineone/2024-03-30T00:58:35+00:00https://zfunnily.github.io/about/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/02/timer/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/02/chicken/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/02/JWT/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/02/dynamic/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/02/compilation/2024-03-30T00:58:35+00:00https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E6%B1%87%E7%BC%96/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/01/attandintel/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/01/skynetprotobuf/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/01/pbempty/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/01/goslience/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/01/skynetecho/2024-03-30T00:58:35+00:00https://zfunnily.github.io/tags/redis/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/01/ziplist/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/01/vscodedebugredis/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/01/vscoderedis/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/01/cgostruct/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/01/sds/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/01/chararray/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2021/01/lastbattle/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/12/ccnet/2024-03-30T00:58:35+00:00https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E7%BD%91%E7%BB%9C%E7%BC%96%E7%A8%8B/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/12/syncmutex/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/12/iomodels/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/12/ccnetone/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/12/reserve/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/12/gocolly/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/12/tcp/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/12/grpc/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/12/cinnamon3.0/2024-03-30T00:58:35+00:00https://zfunnily.github.io/tags/glibc/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/11/glibcnotfound/2024-03-30T00:58:35+00:00https://zfunnily.github.io/tags/docker/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/11/Docker%E5%AE%B9%E5%99%A8%E9%80%80%E5%87%BA%E7%A0%81%E8%AF%A6%E8%A7%A3/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/11/%E4%BD%BF%E7%94%A8OpenResty%E5%81%9A%E4%B8%80%E4%B8%AApostman%E5%B0%8F%E5%B7%A5%E5%85%B7/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/11/OpenResty%E5%88%9D%E6%8E%A2/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/11/lastbattlelogin/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/11/lastbattleserver/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/11/lastbattleone/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/11/cgo%E4%BD%BF%E7%94%A8libevent%E5%BA%93%E5%AE%9E%E7%8E%B0%E4%B8%80%E4%B8%AA%E5%AE%9A%E6%97%B6%E5%99%A8/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/11/Golang-%E5%88%A9%E7%94%A8%E6%8C%87%E9%92%88%E8%BF%9B%E8%A1%8C%E6%95%B0%E6%8D%AE%E8%BD%AC%E6%8D%A2/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/11/go-builds/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/11/cgo%E7%9A%84%E7%AE%80%E5%8D%95%E4%BD%BF%E7%94%A8/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/11/%E4%BD%BF%E7%94%A8Lumberjack-zap%E8%BF%9B%E8%A1%8C%E6%97%A5%E5%BF%97%E5%88%87%E5%89%B2%E5%BD%92%E6%A1%A3/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/10/vimplus%E5%BF%AB%E6%8D%B7%E9%94%AE/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/10/%E4%BD%BF%E7%94%A8vim%E6%89%93%E9%80%A0%E7%BC%96C-IDE/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/10/linux%E7%B3%BB%E7%BB%9F%E5%88%A0%E9%99%A4%E5%A4%A7%E9%87%8F%E6%96%87%E4%BB%B6%E6%8C%87%E4%BB%A4--rsync/2024-03-30T00:58:35+00:00https://zfunnily.github.io/tags/rsync/2024-03-30T00:58:35+00:00https://zfunnily.github.io/tags/cpu/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/10/CPU%E7%9A%84%E6%A0%B8%E4%B8%8E%E7%BA%BF%E7%A8%8B-4%E6%A0%B88%E7%BA%BF%E7%A8%8B/2024-03-30T00:58:35+00:00https://zfunnily.github.io/categories/%E7%A7%91%E6%99%AE/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/10/%E5%A4%A7%E9%87%8FTIME_WAIT%E5%AF%B9%E7%BA%BF%E4%B8%8A%E4%B8%9A%E5%8A%A1%E7%9A%84%E5%BD%B1%E5%93%8D/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/09/libeventimer/2024-03-30T00:58:35+00:00https://zfunnily.github.io/tags/ffmpeg/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/09/ffmpegpicture/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/09/ffmpegvideo/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/09/ffmpegvideow/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/08/macffmpeg/2024-03-30T00:58:35+00:00https://zfunnily.github.io/tags/k8s/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/08/prometheusgrafana/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/08/owt-client-javascript/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/08/ingress/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/08/pvc/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/08/nsf/2024-03-30T00:58:35+00:00https://zfunnily.github.io/tags/nsf/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/08/statefulset/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/08/coredns/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/08/firstk8s/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/08/licode/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/08/dockersecret/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/08/dockerweb/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/08/heapster/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/08/dashboard/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/08/k8sinstall/2024-03-30T00:58:35+00:00https://zfunnily.github.io/2020/08/owtservercomplie/2024-03-30T00:58:35+00:00https://zfunnily.github.io/archives/2024-03-30T00:58:35+00:00https://zfunnily.github.io/1/01/30/2024-03-30T00:58:35+00:00https://zfunnily.github.io/search/2024-03-30T00:58:35+00:00https://zfunnily.github.io/categories/%E6%B8%B8%E6%88%8F%E6%B8%B8%E6%88%8F.boss/2024-03-30T00:58:35+00:00https://zfunnily.github.io/categories/%E6%B8%B8%E6%88%8F%E8%AE%BE%E8%AE%A1/2024-03-30T00:58:35+00:00https://zfunnily.github.io/categories/%E6%B8%B8%E6%88%8F%E8%AE%BE%E8%AE%A1.%E5%9C%B0%E5%9B%BE%E8%AE%BE%E8%AE%A1/2024-03-30T00:58:35+00:00https://zfunnily.github.io/categories/%E6%B8%B8%E6%88%8F%E8%AE%BE%E8%AE%A1.%E7%B1%BB%E9%93%B6%E6%B2%B3%E6%81%B6%E9%AD%94%E5%9F%8E/2024-03-30T00:58:35+00:00https://zfunnily.github.io/1/01/blasphemous/2024-03-30T00:58:35+00:00https://zfunnily.github.io/1/01/blood/2024-03-30T00:58:35+00:00 \ No newline at end of file +https://zfunnily.github.io/2024/02/02/2024-03-31T01:06:17+00:00https://zfunnily.github.io/categories/2024-03-31T01:06:17+00:00https://zfunnily.github.io/post/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2024-03-31T01:06:17+00:00https://zfunnily.github.io/categories/%E6%80%BB%E7%BB%93%E6%80%BB%E7%BB%93.%E6%9C%88/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2023/12/30/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2023/11/30/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2023/11/wsl2/2024-03-31T01:06:17+00:00https://zfunnily.github.io/categories/%E8%87%AA%E5%8A%A8%E9%83%A8%E7%BD%B2/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2023/11/python/2024-03-31T01:06:17+00:00https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E7%BC%96%E8%AF%91/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2023/11/mysql/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2023/11/svn/2024-03-31T01:06:17+00:00https://zfunnily.github.io/categories/SVN%E5%90%88%E5%B9%B6/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2023/11/wsl/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2023/11/gitaction/2024-03-31T01:06:17+00:00https://zfunnily.github.io/categories/AI/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2023/11/chatglm/2024-03-31T01:06:17+00:00https://zfunnily.github.io/tags/2024-03-31T01:06:17+00:00https://zfunnily.github.io/tags/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2023/10/DDNS/2024-03-31T01:06:17+00:00https://zfunnily.github.io/categories/NAS/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2023/05/particlesystem01/2024-03-31T01:06:17+00:00https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.Unity%E7%B2%92%E5%AD%90%E7%B3%BB%E7%BB%9F/2024-03-31T01:06:17+00:00https://zfunnily.github.io/english/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/10/netch/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/10/netch/2024-03-31T01:06:17+00:00https://zfunnily.github.io/categories/%E6%B8%B8%E6%88%8F/2024-03-31T01:06:17+00:00https://zfunnily.github.io/thinking/2024-03-31T01:06:17+00:00https://zfunnily.github.io/english/xdf/04_adj/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/06/cicd/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/06/cicd/2024-03-31T01:06:17+00:00https://zfunnily.github.io/categories/IT/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/05/baidu/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/05/baidu/2024-03-31T01:06:17+00:00https://zfunnily.github.io/tags/URP/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/05/refraction/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/05/refraction/2024-03-31T01:06:17+00:00https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B/2024-03-31T01:06:17+00:00https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.UnityShader/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/05/shaderalpha/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/05/shaderalpha/2024-03-31T01:06:17+00:00https://zfunnily.github.io/tags/%E8%AF%BB%E4%B9%A6%E7%AC%94%E8%AE%B0/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/05/shaderlighting/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/05/shaderlighting/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/05/shaderbase/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/05/shaderbase/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/05/geometry/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/05/geometry/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/04/shaderfunc/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/04/shaderfunc/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/04/cginc/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/04/cginc/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/04/shadermathematic/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/04/shadermathematic/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/04/shaderbase/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/04/shaderbase/2024-03-31T01:06:17+00:00https://zfunnily.github.io/tags/shader/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/04/shaderrenderpipline/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/04/shaderrenderpipline/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/04/shaderhelloworld/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/04/shaderhelloworld/2024-03-31T01:06:17+00:00https://zfunnily.github.io/tags/shader%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/04/shader01/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/04/shader01/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/04/graphics/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/04/graphics/2024-03-31T01:06:17+00:00https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E5%9B%BE%E5%BD%A2%E5%AD%A6%E5%85%A5%E9%97%A8/2024-03-31T01:06:17+00:00https://zfunnily.github.io/tags/%E6%8A%BD%E5%8D%A1/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/03/afk/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/03/afk/2024-03-31T01:06:17+00:00https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E6%B8%B8%E6%88%8F%E5%BC%80%E5%8F%91/2024-03-31T01:06:17+00:00https://zfunnily.github.io/tags/skynet/2024-03-31T01:06:17+00:00https://zfunnily.github.io/tags/%E5%AE%9A%E6%97%B6%E5%99%A8/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/03/timerskynet/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/03/timerskynet/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/03/timer/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/03/timer/2024-03-31T01:06:17+00:00https://zfunnily.github.io/thinking/2022/03/shuowang/2024-03-31T01:06:17+00:00https://zfunnily.github.io/categories/%E9%9A%8F%E7%AC%94/2024-03-31T01:06:17+00:00https://zfunnily.github.io/categories/%E9%9A%8F%E7%AC%94.%E6%91%98%E6%8A%84/2024-03-31T01:06:17+00:00https://zfunnily.github.io/thinking/2022/03/think01/2024-03-31T01:06:17+00:00https://zfunnily.github.io/tags/weekly/2024-03-31T01:06:17+00:00https://zfunnily.github.io/thinking/2022/03/weekly01/2024-03-31T01:06:17+00:00https://zfunnily.github.io/thinking/2022/03/summarize/2024-03-31T01:06:17+00:00https://zfunnily.github.io/tags/year/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/03/blog/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/03/blog/2024-03-31T01:06:17+00:00https://zfunnily.github.io/categories/%E5%8D%9A%E5%AE%A2%E8%AE%B0%E4%BA%8B/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/03/https/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/03/https/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/03/http/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/03/http/2024-03-31T01:06:17+00:00https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.Golang/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/03/reload/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/03/reload/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/02/jwt/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/02/jwt/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/02/san/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2022/02/san/2024-03-31T01:06:17+00:00https://zfunnily.github.io/categories/%E8%BD%AC%E8%BD%BD/2024-03-31T01:06:17+00:00https://zfunnily.github.io/thinking/2022/01/jx/2024-03-31T01:06:17+00:00https://zfunnily.github.io/tags/%E9%95%BF%E5%AE%89%E5%8D%81%E6%97%A5/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/12/shortcodes/2024-03-31T01:06:17+00:00https://zfunnily.github.io/tags/shortcodes/2024-03-31T01:06:17+00:00https://zfunnily.github.io/tags/nginx/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/12/nginx/2024-03-31T01:06:17+00:00https://zfunnily.github.io/thinking/2021/12/pervert/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/12/astar/2024-03-31T01:06:17+00:00https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.Lua/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/12/music/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/12/dark/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/12/openresty-upload/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/11/webrtcdesk/2024-03-31T01:06:17+00:00https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E9%9F%B3%E8%A7%86%E9%A2%91/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/11/webrtcpeerconnection/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/11/gop2pfour/2024-03-31T01:06:17+00:00https://zfunnily.github.io/tags/p2p/2024-03-31T01:06:17+00:00https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.P2P/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/11/randomquotes/2024-03-31T01:06:17+00:00https://zfunnily.github.io/tags/randomquotes/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/10/gop2pthree/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/10/gop2ptwo/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/10/gop2pone/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/10/blogmigration/2024-03-31T01:06:17+00:00https://zfunnily.github.io/todo/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/10/four/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/10/skynetthree/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/10/skynettwo/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/10/skynetone/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/10/shell/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/09/move/2024-03-31T01:06:17+00:00https://zfunnily.github.io/tags/music/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/09/music/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/09/transform/2024-03-31T01:06:17+00:00https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.Unity3D/2024-03-31T01:06:17+00:00https://zfunnily.github.io/categories/IT.Linux/2024-03-31T01:06:17+00:00https://zfunnily.github.io/tags/vim/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/09/vimchange/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/09/screen/2024-03-31T01:06:17+00:00https://zfunnily.github.io/tags/screen/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/09/upgradegcc/2024-03-31T01:06:17+00:00https://zfunnily.github.io/tags/gcc/2024-03-31T01:06:17+00:00https://zfunnily.github.io/tags/except/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/08/except/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/08/ugui/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/06/distribute/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/06/goredis/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/05/lua_next/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/05/settopandpop/2024-03-31T01:06:17+00:00https://zfunnily.github.io/tags/hugo/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/04/hugo/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/03/gomod/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/03/sort/2024-03-31T01:06:17+00:00https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.C/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/03/gamexian/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/03/atoianditoa/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/03/coroutinetwo/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/03/coroutineone/2024-03-31T01:06:17+00:00https://zfunnily.github.io/about/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/02/timer/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/02/chicken/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/02/JWT/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/02/dynamic/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/02/compilation/2024-03-31T01:06:17+00:00https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E6%B1%87%E7%BC%96/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/01/attandintel/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/01/skynetprotobuf/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/01/pbempty/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/01/goslience/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/01/skynetecho/2024-03-31T01:06:17+00:00https://zfunnily.github.io/tags/redis/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/01/ziplist/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/01/vscodedebugredis/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/01/vscoderedis/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/01/cgostruct/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/01/sds/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/01/chararray/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2021/01/lastbattle/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/12/ccnet/2024-03-31T01:06:17+00:00https://zfunnily.github.io/categories/%E7%BC%96%E7%A8%8B.%E7%BD%91%E7%BB%9C%E7%BC%96%E7%A8%8B/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/12/syncmutex/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/12/iomodels/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/12/ccnetone/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/12/reserve/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/12/gocolly/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/12/tcp/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/12/grpc/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/12/cinnamon3.0/2024-03-31T01:06:17+00:00https://zfunnily.github.io/tags/glibc/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/11/glibcnotfound/2024-03-31T01:06:17+00:00https://zfunnily.github.io/tags/docker/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/11/Docker%E5%AE%B9%E5%99%A8%E9%80%80%E5%87%BA%E7%A0%81%E8%AF%A6%E8%A7%A3/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/11/%E4%BD%BF%E7%94%A8OpenResty%E5%81%9A%E4%B8%80%E4%B8%AApostman%E5%B0%8F%E5%B7%A5%E5%85%B7/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/11/OpenResty%E5%88%9D%E6%8E%A2/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/11/lastbattlelogin/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/11/lastbattleserver/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/11/lastbattleone/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/11/cgo%E4%BD%BF%E7%94%A8libevent%E5%BA%93%E5%AE%9E%E7%8E%B0%E4%B8%80%E4%B8%AA%E5%AE%9A%E6%97%B6%E5%99%A8/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/11/Golang-%E5%88%A9%E7%94%A8%E6%8C%87%E9%92%88%E8%BF%9B%E8%A1%8C%E6%95%B0%E6%8D%AE%E8%BD%AC%E6%8D%A2/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/11/go-builds/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/11/cgo%E7%9A%84%E7%AE%80%E5%8D%95%E4%BD%BF%E7%94%A8/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/11/%E4%BD%BF%E7%94%A8Lumberjack-zap%E8%BF%9B%E8%A1%8C%E6%97%A5%E5%BF%97%E5%88%87%E5%89%B2%E5%BD%92%E6%A1%A3/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/10/vimplus%E5%BF%AB%E6%8D%B7%E9%94%AE/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/10/%E4%BD%BF%E7%94%A8vim%E6%89%93%E9%80%A0%E7%BC%96C-IDE/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/10/linux%E7%B3%BB%E7%BB%9F%E5%88%A0%E9%99%A4%E5%A4%A7%E9%87%8F%E6%96%87%E4%BB%B6%E6%8C%87%E4%BB%A4--rsync/2024-03-31T01:06:17+00:00https://zfunnily.github.io/tags/rsync/2024-03-31T01:06:17+00:00https://zfunnily.github.io/tags/cpu/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/10/CPU%E7%9A%84%E6%A0%B8%E4%B8%8E%E7%BA%BF%E7%A8%8B-4%E6%A0%B88%E7%BA%BF%E7%A8%8B/2024-03-31T01:06:17+00:00https://zfunnily.github.io/categories/%E7%A7%91%E6%99%AE/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/10/%E5%A4%A7%E9%87%8FTIME_WAIT%E5%AF%B9%E7%BA%BF%E4%B8%8A%E4%B8%9A%E5%8A%A1%E7%9A%84%E5%BD%B1%E5%93%8D/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/09/libeventimer/2024-03-31T01:06:17+00:00https://zfunnily.github.io/tags/ffmpeg/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/09/ffmpegpicture/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/09/ffmpegvideo/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/09/ffmpegvideow/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/08/macffmpeg/2024-03-31T01:06:17+00:00https://zfunnily.github.io/tags/k8s/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/08/prometheusgrafana/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/08/owt-client-javascript/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/08/ingress/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/08/pvc/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/08/nsf/2024-03-31T01:06:17+00:00https://zfunnily.github.io/tags/nsf/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/08/statefulset/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/08/coredns/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/08/firstk8s/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/08/licode/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/08/dockersecret/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/08/dockerweb/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/08/heapster/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/08/dashboard/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/08/k8sinstall/2024-03-31T01:06:17+00:00https://zfunnily.github.io/2020/08/owtservercomplie/2024-03-31T01:06:17+00:00https://zfunnily.github.io/archives/2024-03-31T01:06:17+00:00https://zfunnily.github.io/1/01/30/2024-03-31T01:06:17+00:00https://zfunnily.github.io/search/2024-03-31T01:06:17+00:00https://zfunnily.github.io/categories/%E6%B8%B8%E6%88%8F%E6%B8%B8%E6%88%8F.boss/2024-03-31T01:06:17+00:00https://zfunnily.github.io/categories/%E6%B8%B8%E6%88%8F%E8%AE%BE%E8%AE%A1/2024-03-31T01:06:17+00:00https://zfunnily.github.io/categories/%E6%B8%B8%E6%88%8F%E8%AE%BE%E8%AE%A1.%E5%9C%B0%E5%9B%BE%E8%AE%BE%E8%AE%A1/2024-03-31T01:06:17+00:00https://zfunnily.github.io/categories/%E6%B8%B8%E6%88%8F%E8%AE%BE%E8%AE%A1.%E7%B1%BB%E9%93%B6%E6%B2%B3%E6%81%B6%E9%AD%94%E5%9F%8E/2024-03-31T01:06:17+00:00https://zfunnily.github.io/1/01/blasphemous/2024-03-31T01:06:17+00:00https://zfunnily.github.io/1/01/blood/2024-03-31T01:06:17+00:00 \ No newline at end of file diff --git a/tags/URP/index.xml b/tags/URP/index.xml index 519701a18..28e573cd8 100644 --- a/tags/URP/index.xml +++ b/tags/URP/index.xml @@ -1 +1 @@ -URP on Zzz记忆https://zfunnily.github.io/tags/URP/Recent content in URP on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000URP 不透明/半透明物体的折射https://zfunnily.github.io/2022/05/refraction/Tue, 17 May 2022 11:30:48 +0800https://zfunnily.github.io/2022/05/refraction/折射 应用场景 水池 玻璃 热空气(热扭曲) GrabPass + CubeMap 《Unity3D Shader入门精要》第十章介绍了,模拟实现折射效果有两种 使用cubemap: 我认为太麻烦.需要的贴图太多。也没有找到其他合适的使用场景,遂搁URP 不透明/半透明物体的折射https://zfunnily.github.io/2022/05/refraction/Tue, 17 May 2022 11:30:48 +0800https://zfunnily.github.io/2022/05/refraction/折射 应用场景 水池 玻璃 热空气(热扭曲) GrabPass + CubeMap 《Unity3D Shader入门精要》第十章介绍了,模拟实现折射效果有两种 使用cubemap: 我认为太麻烦.需要的贴图太多。也没有找到其他合适的使用场景,遂搁 \ No newline at end of file +URP on Zzz记忆https://zfunnily.github.io/tags/URP/Recent content in URP on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000URP 不透明/半透明物体的折射https://zfunnily.github.io/2022/05/refraction/Tue, 17 May 2022 11:30:48 +0800https://zfunnily.github.io/2022/05/refraction/折射 应用场景 水池 玻璃 热空气(热扭曲) GrabPass + CubeMap 《Unity3D Shader入门精要》第十章介绍了,模拟实现折射效果有两种 使用cubemap: 我认为太麻烦.需要的贴图太多。也没有找到其他合适的使用场景,遂搁URP 不透明/半透明物体的折射https://zfunnily.github.io/2022/05/refraction/Tue, 17 May 2022 11:30:48 +0800https://zfunnily.github.io/2022/05/refraction/折射 应用场景 水池 玻璃 热空气(热扭曲) GrabPass + CubeMap 《Unity3D Shader入门精要》第十章介绍了,模拟实现折射效果有两种 使用cubemap: 我认为太麻烦.需要的贴图太多。也没有找到其他合适的使用场景,遂搁 \ No newline at end of file diff --git a/tags/cpu/index.xml b/tags/cpu/index.xml index 76b93af3d..70b344314 100644 --- a/tags/cpu/index.xml +++ b/tags/cpu/index.xml @@ -1 +1 @@ -Cpu on Zzz记忆https://zfunnily.github.io/tags/cpu/Recent content in Cpu on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000CPU的核与线程-4核8线程https://zfunnily.github.io/2020/10/CPU%E7%9A%84%E6%A0%B8%E4%B8%8E%E7%BA%BF%E7%A8%8B-4%E6%A0%B88%E7%BA%BF%E7%A8%8B/Mon, 12 Oct 2020 16:29:34 +0000https://zfunnily.github.io/2020/10/CPU%E7%9A%84%E6%A0%B8%E4%B8%8E%E7%BA%BF%E7%A8%8B-4%E6%A0%B88%E7%BA%BF%E7%A8%8B/查看cpu信息 $ cat /proc/cpuinfo 物理CPU 物理CPU就是计算机上实际配置的CPU个数。 在linux上可以打开cat /proc/cpuinfo 来查看,其中的physical id就是每个物理CPU的ID,能找到几个physical id就代表 \ No newline at end of file +Cpu on Zzz记忆https://zfunnily.github.io/tags/cpu/Recent content in Cpu on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000CPU的核与线程-4核8线程https://zfunnily.github.io/2020/10/CPU%E7%9A%84%E6%A0%B8%E4%B8%8E%E7%BA%BF%E7%A8%8B-4%E6%A0%B88%E7%BA%BF%E7%A8%8B/Mon, 12 Oct 2020 16:29:34 +0000https://zfunnily.github.io/2020/10/CPU%E7%9A%84%E6%A0%B8%E4%B8%8E%E7%BA%BF%E7%A8%8B-4%E6%A0%B88%E7%BA%BF%E7%A8%8B/查看cpu信息 $ cat /proc/cpuinfo 物理CPU 物理CPU就是计算机上实际配置的CPU个数。 在linux上可以打开cat /proc/cpuinfo 来查看,其中的physical id就是每个物理CPU的ID,能找到几个physical id就代表 \ No newline at end of file diff --git a/tags/docker/index.xml b/tags/docker/index.xml index d1f878d0d..ba61b720e 100644 --- a/tags/docker/index.xml +++ b/tags/docker/index.xml @@ -1 +1 @@ -Docker on Zzz记忆https://zfunnily.github.io/tags/docker/Recent content in Docker on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000Docker | 容器退出码详解https://zfunnily.github.io/2020/11/Docker%E5%AE%B9%E5%99%A8%E9%80%80%E5%87%BA%E7%A0%81%E8%AF%A6%E8%A7%A3/Sat, 28 Nov 2020 13:32:57 +0000https://zfunnily.github.io/2020/11/Docker%E5%AE%B9%E5%99%A8%E9%80%80%E5%87%BA%E7%A0%81%E8%AF%A6%E8%A7%A3/docker查看退出码指令 $ docker ps --filter &#34;status=exited&#34; $ docker inspect container-id --format=&#39;{&lt;!-- --&gt;{.State.ExitCode}}&#39; 常见退出码 Exit Code 0 退出代码0表示特定容器没有附加前台进程。 该退出代码是所有其他后续退出代码的例外。 这不一定意味着发生了不好的事情。如果开发人员想要在容器完Docker | 远程访问加密https://zfunnily.github.io/2020/08/dockersecret/Fri, 07 Aug 2020 07:56:52 +0000https://zfunnily.github.io/2020/08/dockersecret/docker的远程访问 方法一 :编辑docker.service文件 编辑docker.service文件 sudo vim /lib/systemd/system/docker.service 修改ExecStart行为下面内容 ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock 重新加载docker配置 sudo systemctl daemon-reload // 1,加载dockDocker | web管理界面portainerhttps://zfunnily.github.io/2020/08/dockerweb/Fri, 07 Aug 2020 07:54:43 +0000https://zfunnily.github.io/2020/08/dockerweb/拉取镜像 $ docker pull portainer/portainer 运行启动portainer docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v /home/docker/portainer:/data --name portainer --restart=always portainer/portainer admin bigant.cn 汉化 Portainer-CN.zip 百度云盘: https://pan.baidu.com/s/13ra6jXHR_7vajLLlf5GVEw 提取码: nzue 新建文件夹命名为public,把Portainer-CN.zip解压至里面。 2、public文件夹传 \ No newline at end of file +Docker on Zzz记忆https://zfunnily.github.io/tags/docker/Recent content in Docker on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000Docker | 容器退出码详解https://zfunnily.github.io/2020/11/Docker%E5%AE%B9%E5%99%A8%E9%80%80%E5%87%BA%E7%A0%81%E8%AF%A6%E8%A7%A3/Sat, 28 Nov 2020 13:32:57 +0000https://zfunnily.github.io/2020/11/Docker%E5%AE%B9%E5%99%A8%E9%80%80%E5%87%BA%E7%A0%81%E8%AF%A6%E8%A7%A3/docker查看退出码指令 $ docker ps --filter &#34;status=exited&#34; $ docker inspect container-id --format=&#39;{&lt;!-- --&gt;{.State.ExitCode}}&#39; 常见退出码 Exit Code 0 退出代码0表示特定容器没有附加前台进程。 该退出代码是所有其他后续退出代码的例外。 这不一定意味着发生了不好的事情。如果开发人员想要在容器完Docker | 远程访问加密https://zfunnily.github.io/2020/08/dockersecret/Fri, 07 Aug 2020 07:56:52 +0000https://zfunnily.github.io/2020/08/dockersecret/docker的远程访问 方法一 :编辑docker.service文件 编辑docker.service文件 sudo vim /lib/systemd/system/docker.service 修改ExecStart行为下面内容 ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock 重新加载docker配置 sudo systemctl daemon-reload // 1,加载dockDocker | web管理界面portainerhttps://zfunnily.github.io/2020/08/dockerweb/Fri, 07 Aug 2020 07:54:43 +0000https://zfunnily.github.io/2020/08/dockerweb/拉取镜像 $ docker pull portainer/portainer 运行启动portainer docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v /home/docker/portainer:/data --name portainer --restart=always portainer/portainer admin bigant.cn 汉化 Portainer-CN.zip 百度云盘: https://pan.baidu.com/s/13ra6jXHR_7vajLLlf5GVEw 提取码: nzue 新建文件夹命名为public,把Portainer-CN.zip解压至里面。 2、public文件夹传 \ No newline at end of file diff --git a/tags/except/index.xml b/tags/except/index.xml index e49681df3..a2216b478 100644 --- a/tags/except/index.xml +++ b/tags/except/index.xml @@ -1 +1 @@ -Except on Zzz记忆https://zfunnily.github.io/tags/except/Recent content in Except on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000Shell | Except 使用https://zfunnily.github.io/2021/08/except/Mon, 30 Aug 2021 17:13:33 +0800https://zfunnily.github.io/2021/08/except/Except 参数 spawn 交互程序开始后面跟命令或者指定程序 expect 获取匹配信息匹配成功则执行expect后面的程序动作 send exp_send 用于发送指定的字符串信息 exp_continue 在expect中多次匹配就需要用到 send_user 用来打印输出 相当于shell中的ech \ No newline at end of file +Except on Zzz记忆https://zfunnily.github.io/tags/except/Recent content in Except on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000Shell | Except 使用https://zfunnily.github.io/2021/08/except/Mon, 30 Aug 2021 17:13:33 +0800https://zfunnily.github.io/2021/08/except/Except 参数 spawn 交互程序开始后面跟命令或者指定程序 expect 获取匹配信息匹配成功则执行expect后面的程序动作 send exp_send 用于发送指定的字符串信息 exp_continue 在expect中多次匹配就需要用到 send_user 用来打印输出 相当于shell中的ech \ No newline at end of file diff --git a/tags/ffmpeg/index.xml b/tags/ffmpeg/index.xml index bd9730d21..65da051de 100644 --- a/tags/ffmpeg/index.xml +++ b/tags/ffmpeg/index.xml @@ -1 +1 @@ -Ffmpeg on Zzz记忆https://zfunnily.github.io/tags/ffmpeg/Recent content in Ffmpeg on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000FFmpeg | 画中画和视频多宫格处理https://zfunnily.github.io/2020/09/ffmpegpicture/Mon, 14 Sep 2020 18:29:33 +0000https://zfunnily.github.io/2020/09/ffmpegpicture/FFmpeg生成画中画 静态画中画 将视频sub.mp4视频文件缩放成宽 480 、高 320 的视频,然后显示在 视频 input.mp4,x坐标为0,y 坐标为0 的位置 ffmpeg -re -i input.mp4 -vf &#34;movie=sub.mp4, scale=480x320[test]; [in][test]overlay [out]&#34; -vcodec libx264 output.flv 显示在画面的右下角,则需要用到FFmpeg | 给视频加文字和图片水印https://zfunnily.github.io/2020/09/ffmpegvideo/Sat, 12 Sep 2020 12:47:57 +0000https://zfunnily.github.io/2020/09/ffmpegvideo/FFmpeg给视频加上logo ffmpeg从视频中截取图像帧 ffmpeg -i inputfile.avi -r 1 -f image2 image-%05d.jpeg ffmpeg -i inputfile.avi -r 1 -s 4cif -f image2 image-%05d.jpeg ffmpeg -i inputfile.avi -r 1 -t 4 -f image2 image-%05d.jpeg ffmpeg -i inputfile.avi -r 1 -ss 01:30:14 -f image2 image-%05d.jpeg ffmpeg -i inputfile.avi -r 1 -ss 01:30:14 -vframes 120 4cif -f image2 image-%05d.jpeg -r 指定抽取的帧率,即从视频中每秒钟抽取FFmpeg | 录制摄像头和桌面数据windowshttps://zfunnily.github.io/2020/09/ffmpegvideow/Wed, 09 Sep 2020 09:36:49 +0000https://zfunnily.github.io/2020/09/ffmpegvideow/概述 FFmpeg Windows 设备操作 Windows 采集设备的主要方式是 dshow vfwcap gdigrab 其中 dshow 可以用来抓 取摄像头、采集卡、麦克风等,- vfwcap 主要用来采集摄像头类设备,- gdigrab 则是抓取 Windows 窗口程序 FFmpeg 使用 dshow 采集音视频设备 使用 dshow 枚举设备 ffmpeg -f dshow -list_devices true -i dymmy 输出 [dshow @ 000002622302e340]FFmpeg | 录制摄像头和桌面数据machttps://zfunnily.github.io/2020/08/macffmpeg/Sat, 29 Aug 2020 17:20:40 +0000https://zfunnily.github.io/2020/08/macffmpeg/设备枚举 查看设备列表 $ ffmpeg -hide_banner -devices Devices: D. = Demuxing supported .E = Muxing supported -- D avfoundation AVFoundation input device D lavfi Libavfilter virtual input device E sdl,sdl2 SDL2 output device 可以看到输入设备有:avfoundation,lavfi 输出设备有:sdl `` 设备采集举例: $ ffmpeg -f avfoundation -list_devices true -i &#34; &#34; 看到了 如下设 \ No newline at end of file +Ffmpeg on Zzz记忆https://zfunnily.github.io/tags/ffmpeg/Recent content in Ffmpeg on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000FFmpeg | 画中画和视频多宫格处理https://zfunnily.github.io/2020/09/ffmpegpicture/Mon, 14 Sep 2020 18:29:33 +0000https://zfunnily.github.io/2020/09/ffmpegpicture/FFmpeg生成画中画 静态画中画 将视频sub.mp4视频文件缩放成宽 480 、高 320 的视频,然后显示在 视频 input.mp4,x坐标为0,y 坐标为0 的位置 ffmpeg -re -i input.mp4 -vf &#34;movie=sub.mp4, scale=480x320[test]; [in][test]overlay [out]&#34; -vcodec libx264 output.flv 显示在画面的右下角,则需要用到FFmpeg | 给视频加文字和图片水印https://zfunnily.github.io/2020/09/ffmpegvideo/Sat, 12 Sep 2020 12:47:57 +0000https://zfunnily.github.io/2020/09/ffmpegvideo/FFmpeg给视频加上logo ffmpeg从视频中截取图像帧 ffmpeg -i inputfile.avi -r 1 -f image2 image-%05d.jpeg ffmpeg -i inputfile.avi -r 1 -s 4cif -f image2 image-%05d.jpeg ffmpeg -i inputfile.avi -r 1 -t 4 -f image2 image-%05d.jpeg ffmpeg -i inputfile.avi -r 1 -ss 01:30:14 -f image2 image-%05d.jpeg ffmpeg -i inputfile.avi -r 1 -ss 01:30:14 -vframes 120 4cif -f image2 image-%05d.jpeg -r 指定抽取的帧率,即从视频中每秒钟抽取FFmpeg | 录制摄像头和桌面数据windowshttps://zfunnily.github.io/2020/09/ffmpegvideow/Wed, 09 Sep 2020 09:36:49 +0000https://zfunnily.github.io/2020/09/ffmpegvideow/概述 FFmpeg Windows 设备操作 Windows 采集设备的主要方式是 dshow vfwcap gdigrab 其中 dshow 可以用来抓 取摄像头、采集卡、麦克风等,- vfwcap 主要用来采集摄像头类设备,- gdigrab 则是抓取 Windows 窗口程序 FFmpeg 使用 dshow 采集音视频设备 使用 dshow 枚举设备 ffmpeg -f dshow -list_devices true -i dymmy 输出 [dshow @ 000002622302e340]FFmpeg | 录制摄像头和桌面数据machttps://zfunnily.github.io/2020/08/macffmpeg/Sat, 29 Aug 2020 17:20:40 +0000https://zfunnily.github.io/2020/08/macffmpeg/设备枚举 查看设备列表 $ ffmpeg -hide_banner -devices Devices: D. = Demuxing supported .E = Muxing supported -- D avfoundation AVFoundation input device D lavfi Libavfilter virtual input device E sdl,sdl2 SDL2 output device 可以看到输入设备有:avfoundation,lavfi 输出设备有:sdl `` 设备采集举例: $ ffmpeg -f avfoundation -list_devices true -i &#34; &#34; 看到了 如下设 \ No newline at end of file diff --git a/tags/gcc/index.xml b/tags/gcc/index.xml index fcf5c507e..fd832de14 100644 --- a/tags/gcc/index.xml +++ b/tags/gcc/index.xml @@ -1 +1 @@ -Gcc on Zzz记忆https://zfunnily.github.io/tags/gcc/Recent content in Gcc on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000Centos7.2 | gcc4.8升级为4.9https://zfunnily.github.io/2021/09/upgradegcc/Wed, 01 Sep 2021 18:13:41 +0800https://zfunnily.github.io/2021/09/upgradegcc/环境 CentOS 7.2.1511 Docker 我是用 docker 拉取镜像 CentOS 7.2.1511, 利用容器来作为我的开发环境。有条件的也可以用虚拟机或者实体机器。原理都一样。 $ docker $ yum update &amp;&amp; yum install gcc gcc-c++ make zlib-devel.x86_6 下载依赖包 升级 gcc, 下载安装包下载依赖。 $ wget http://ftp.gnu.org/gnu/gcc/gcc-4.9.3/gcc-4.9.3.tar.bz2 $ tar xfv gcc-4.9.3.tar.bz2 &amp;&amp; cd gcc-4.9.3 $ ./contrib/download_prerequisites 如果 \ No newline at end of file +Gcc on Zzz记忆https://zfunnily.github.io/tags/gcc/Recent content in Gcc on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000Centos7.2 | gcc4.8升级为4.9https://zfunnily.github.io/2021/09/upgradegcc/Wed, 01 Sep 2021 18:13:41 +0800https://zfunnily.github.io/2021/09/upgradegcc/环境 CentOS 7.2.1511 Docker 我是用 docker 拉取镜像 CentOS 7.2.1511, 利用容器来作为我的开发环境。有条件的也可以用虚拟机或者实体机器。原理都一样。 $ docker $ yum update &amp;&amp; yum install gcc gcc-c++ make zlib-devel.x86_6 下载依赖包 升级 gcc, 下载安装包下载依赖。 $ wget http://ftp.gnu.org/gnu/gcc/gcc-4.9.3/gcc-4.9.3.tar.bz2 $ tar xfv gcc-4.9.3.tar.bz2 &amp;&amp; cd gcc-4.9.3 $ ./contrib/download_prerequisites 如果 \ No newline at end of file diff --git a/tags/glibc/index.xml b/tags/glibc/index.xml index 3feeaafe6..27befb222 100644 --- a/tags/glibc/index.xml +++ b/tags/glibc/index.xml @@ -1 +1 @@ -Glibc on Zzz记忆https://zfunnily.github.io/tags/glibc/Recent content in Glibc on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000Ubuntu | version `GLIBC_2.27‘ not found错误https://zfunnily.github.io/2020/11/glibcnotfound/Sat, 28 Nov 2020 15:03:04 +0000https://zfunnily.github.io/2020/11/glibcnotfound/version `GLIBC_2.27’ not found错误 执行strings /lib/x86_64-linux-gnu/libc.so.6 | grep GLIBC_ 结果显示如下: GLIBC_2.2.5 GLIBC_2.2.6 GLIBC_2.3 GLIBC_2.3.2 GLIBC_2.3.3 GLIBC_2.3.4 GLIBC_2.4 GLIBC_2.5 GLIBC_2.6 GLIBC_2.7 GLIBC_2.8 GLIBC_2.9 GLIBC_2.10 GLIBC_2.11 GLIBC_2.12 GLIBC_2.13 GLIBC_2.14 GLIBC_2.15 GLIBC_2.16 GLIBC_2.17 GLIBC_2.18 GLIBC_2.22 GLIBC_2.23 GLIBC_2.24 GLIBC_PRIVATE 去清华开源站点下载glibc: https://mirrors.tuna.tsinghua.edu.cn/gnu/libc/ 下载好文件后解压 $ tar -zxvf glibc-2.27.tar.gz 进入 glibc-2.27 目录, \ No newline at end of file +Glibc on Zzz记忆https://zfunnily.github.io/tags/glibc/Recent content in Glibc on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000Ubuntu | version `GLIBC_2.27‘ not found错误https://zfunnily.github.io/2020/11/glibcnotfound/Sat, 28 Nov 2020 15:03:04 +0000https://zfunnily.github.io/2020/11/glibcnotfound/version `GLIBC_2.27’ not found错误 执行strings /lib/x86_64-linux-gnu/libc.so.6 | grep GLIBC_ 结果显示如下: GLIBC_2.2.5 GLIBC_2.2.6 GLIBC_2.3 GLIBC_2.3.2 GLIBC_2.3.3 GLIBC_2.3.4 GLIBC_2.4 GLIBC_2.5 GLIBC_2.6 GLIBC_2.7 GLIBC_2.8 GLIBC_2.9 GLIBC_2.10 GLIBC_2.11 GLIBC_2.12 GLIBC_2.13 GLIBC_2.14 GLIBC_2.15 GLIBC_2.16 GLIBC_2.17 GLIBC_2.18 GLIBC_2.22 GLIBC_2.23 GLIBC_2.24 GLIBC_PRIVATE 去清华开源站点下载glibc: https://mirrors.tuna.tsinghua.edu.cn/gnu/libc/ 下载好文件后解压 $ tar -zxvf glibc-2.27.tar.gz 进入 glibc-2.27 目录, \ No newline at end of file diff --git a/tags/hugo/index.xml b/tags/hugo/index.xml index e4d178455..95cd1be43 100644 --- a/tags/hugo/index.xml +++ b/tags/hugo/index.xml @@ -1 +1 @@ -Hugo on Zzz记忆https://zfunnily.github.io/tags/hugo/Recent content in Hugo on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000Hugohttps://zfunnily.github.io/2021/04/hugo/Sat, 17 Apr 2021 00:00:00 +0000https://zfunnily.github.io/2021/04/hugo/hugo 我用过的静态博客有hexo、jekyll和hugo,对比起来,hugo虽然没有hexo那样丰富的插件和主题,但是hugo生成文章的速度更快。我是一名go语言爱好者,而hugo是go语言开发的, jek \ No newline at end of file +Hugo on Zzz记忆https://zfunnily.github.io/tags/hugo/Recent content in Hugo on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000Hugohttps://zfunnily.github.io/2021/04/hugo/Sat, 17 Apr 2021 00:00:00 +0000https://zfunnily.github.io/2021/04/hugo/hugo 我用过的静态博客有hexo、jekyll和hugo,对比起来,hugo虽然没有hexo那样丰富的插件和主题,但是hugo生成文章的速度更快。我是一名go语言爱好者,而hugo是go语言开发的, jek \ No newline at end of file diff --git a/tags/index.xml b/tags/index.xml index 445368814..8fce66fff 100644 --- a/tags/index.xml +++ b/tags/index.xml @@ -1 +1 @@ -Tags on Zzz记忆https://zfunnily.github.io/tags/Recent content in Tags on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000学习笔记https://zfunnily.github.io/tags/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/Fri, 10 Nov 2023 11:21:34 +0800https://zfunnily.github.io/tags/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/URPhttps://zfunnily.github.io/tags/URP/Tue, 17 May 2022 11:30:48 +0800https://zfunnily.github.io/tags/URP/读书笔记https://zfunnily.github.io/tags/%E8%AF%BB%E4%B9%A6%E7%AC%94%E8%AE%B0/Sat, 07 May 2022 17:17:18 +0800https://zfunnily.github.io/tags/%E8%AF%BB%E4%B9%A6%E7%AC%94%E8%AE%B0/Shaderhttps://zfunnily.github.io/tags/shader/Sun, 10 Apr 2022 14:51:19 +0800https://zfunnily.github.io/tags/shader/Shader学习笔记https://zfunnily.github.io/tags/shader%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/Wed, 06 Apr 2022 11:54:02 +0800https://zfunnily.github.io/tags/shader%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/抽卡https://zfunnily.github.io/tags/%E6%8A%BD%E5%8D%A1/Wed, 30 Mar 2022 10:50:11 +0800https://zfunnily.github.io/tags/%E6%8A%BD%E5%8D%A1/Skynethttps://zfunnily.github.io/tags/skynet/Sun, 27 Mar 2022 12:39:12 +0800https://zfunnily.github.io/tags/skynet/定时器https://zfunnily.github.io/tags/%E5%AE%9A%E6%97%B6%E5%99%A8/Sun, 27 Mar 2022 12:39:12 +0800https://zfunnily.github.io/tags/%E5%AE%9A%E6%97%B6%E5%99%A8/Weeklyhttps://zfunnily.github.io/tags/weekly/Mon, 07 Mar 2022 21:36:05 +0800https://zfunnily.github.io/tags/weekly/Yearhttps://zfunnily.github.io/tags/year/Fri, 04 Mar 2022 11:03:20 +0800https://zfunnily.github.io/tags/year/长安十日https://zfunnily.github.io/tags/%E9%95%BF%E5%AE%89%E5%8D%81%E6%97%A5/Thu, 06 Jan 2022 11:32:56 +0800https://zfunnily.github.io/tags/%E9%95%BF%E5%AE%89%E5%8D%81%E6%97%A5/Shortcodeshttps://zfunnily.github.io/tags/shortcodes/Wed, 29 Dec 2021 13:50:28 +0800https://zfunnily.github.io/tags/shortcodes/Nginxhttps://zfunnily.github.io/tags/nginx/Tue, 28 Dec 2021 16:04:10 +0800https://zfunnily.github.io/tags/nginx/P2phttps://zfunnily.github.io/tags/p2p/Sun, 07 Nov 2021 15:49:46 +0800https://zfunnily.github.io/tags/p2p/Randomquoteshttps://zfunnily.github.io/tags/randomquotes/Fri, 05 Nov 2021 15:50:16 +0800https://zfunnily.github.io/tags/randomquotes/Musichttps://zfunnily.github.io/tags/music/Wed, 08 Sep 2021 14:47:14 +0800https://zfunnily.github.io/tags/music/Vimhttps://zfunnily.github.io/tags/vim/Tue, 07 Sep 2021 10:46:58 +0800https://zfunnily.github.io/tags/vim/Screenhttps://zfunnily.github.io/tags/screen/Tue, 07 Sep 2021 10:02:16 +0800https://zfunnily.github.io/tags/screen/Gcchttps://zfunnily.github.io/tags/gcc/Wed, 01 Sep 2021 18:13:41 +0800https://zfunnily.github.io/tags/gcc/Excepthttps://zfunnily.github.io/tags/except/Mon, 30 Aug 2021 17:13:33 +0800https://zfunnily.github.io/tags/except/Hugohttps://zfunnily.github.io/tags/hugo/Sat, 17 Apr 2021 00:00:00 +0000https://zfunnily.github.io/tags/hugo/Redishttps://zfunnily.github.io/tags/redis/Wed, 13 Jan 2021 17:52:27 +0000https://zfunnily.github.io/tags/redis/Glibchttps://zfunnily.github.io/tags/glibc/Sat, 28 Nov 2020 15:03:04 +0000https://zfunnily.github.io/tags/glibc/Dockerhttps://zfunnily.github.io/tags/docker/Sat, 28 Nov 2020 13:32:57 +0000https://zfunnily.github.io/tags/docker/Rsynchttps://zfunnily.github.io/tags/rsync/Tue, 13 Oct 2020 16:29:34 +0000https://zfunnily.github.io/tags/rsync/Cpuhttps://zfunnily.github.io/tags/cpu/Mon, 12 Oct 2020 16:29:34 +0000https://zfunnily.github.io/tags/cpu/Ffmpeghttps://zfunnily.github.io/tags/ffmpeg/Mon, 14 Sep 2020 18:29:33 +0000https://zfunnily.github.io/tags/ffmpeg/K8shttps://zfunnily.github.io/tags/k8s/Mon, 17 Aug 2020 13:58:35 +0000https://zfunnily.github.io/tags/k8s/Nsfhttps://zfunnily.github.io/tags/nsf/Fri, 14 Aug 2020 17:17:54 +0000https://zfunnily.github.io/tags/nsf/ \ No newline at end of file +Tags on Zzz记忆https://zfunnily.github.io/tags/Recent content in Tags on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000学习笔记https://zfunnily.github.io/tags/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/Fri, 10 Nov 2023 11:21:34 +0800https://zfunnily.github.io/tags/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/URPhttps://zfunnily.github.io/tags/URP/Tue, 17 May 2022 11:30:48 +0800https://zfunnily.github.io/tags/URP/读书笔记https://zfunnily.github.io/tags/%E8%AF%BB%E4%B9%A6%E7%AC%94%E8%AE%B0/Sat, 07 May 2022 17:17:18 +0800https://zfunnily.github.io/tags/%E8%AF%BB%E4%B9%A6%E7%AC%94%E8%AE%B0/Shaderhttps://zfunnily.github.io/tags/shader/Sun, 10 Apr 2022 14:51:19 +0800https://zfunnily.github.io/tags/shader/Shader学习笔记https://zfunnily.github.io/tags/shader%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/Wed, 06 Apr 2022 11:54:02 +0800https://zfunnily.github.io/tags/shader%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/抽卡https://zfunnily.github.io/tags/%E6%8A%BD%E5%8D%A1/Wed, 30 Mar 2022 10:50:11 +0800https://zfunnily.github.io/tags/%E6%8A%BD%E5%8D%A1/Skynethttps://zfunnily.github.io/tags/skynet/Sun, 27 Mar 2022 12:39:12 +0800https://zfunnily.github.io/tags/skynet/定时器https://zfunnily.github.io/tags/%E5%AE%9A%E6%97%B6%E5%99%A8/Sun, 27 Mar 2022 12:39:12 +0800https://zfunnily.github.io/tags/%E5%AE%9A%E6%97%B6%E5%99%A8/Weeklyhttps://zfunnily.github.io/tags/weekly/Mon, 07 Mar 2022 21:36:05 +0800https://zfunnily.github.io/tags/weekly/Yearhttps://zfunnily.github.io/tags/year/Fri, 04 Mar 2022 11:03:20 +0800https://zfunnily.github.io/tags/year/长安十日https://zfunnily.github.io/tags/%E9%95%BF%E5%AE%89%E5%8D%81%E6%97%A5/Thu, 06 Jan 2022 11:32:56 +0800https://zfunnily.github.io/tags/%E9%95%BF%E5%AE%89%E5%8D%81%E6%97%A5/Shortcodeshttps://zfunnily.github.io/tags/shortcodes/Wed, 29 Dec 2021 13:50:28 +0800https://zfunnily.github.io/tags/shortcodes/Nginxhttps://zfunnily.github.io/tags/nginx/Tue, 28 Dec 2021 16:04:10 +0800https://zfunnily.github.io/tags/nginx/P2phttps://zfunnily.github.io/tags/p2p/Sun, 07 Nov 2021 15:49:46 +0800https://zfunnily.github.io/tags/p2p/Randomquoteshttps://zfunnily.github.io/tags/randomquotes/Fri, 05 Nov 2021 15:50:16 +0800https://zfunnily.github.io/tags/randomquotes/Musichttps://zfunnily.github.io/tags/music/Wed, 08 Sep 2021 14:47:14 +0800https://zfunnily.github.io/tags/music/Vimhttps://zfunnily.github.io/tags/vim/Tue, 07 Sep 2021 10:46:58 +0800https://zfunnily.github.io/tags/vim/Screenhttps://zfunnily.github.io/tags/screen/Tue, 07 Sep 2021 10:02:16 +0800https://zfunnily.github.io/tags/screen/Gcchttps://zfunnily.github.io/tags/gcc/Wed, 01 Sep 2021 18:13:41 +0800https://zfunnily.github.io/tags/gcc/Excepthttps://zfunnily.github.io/tags/except/Mon, 30 Aug 2021 17:13:33 +0800https://zfunnily.github.io/tags/except/Hugohttps://zfunnily.github.io/tags/hugo/Sat, 17 Apr 2021 00:00:00 +0000https://zfunnily.github.io/tags/hugo/Redishttps://zfunnily.github.io/tags/redis/Wed, 13 Jan 2021 17:52:27 +0000https://zfunnily.github.io/tags/redis/Glibchttps://zfunnily.github.io/tags/glibc/Sat, 28 Nov 2020 15:03:04 +0000https://zfunnily.github.io/tags/glibc/Dockerhttps://zfunnily.github.io/tags/docker/Sat, 28 Nov 2020 13:32:57 +0000https://zfunnily.github.io/tags/docker/Rsynchttps://zfunnily.github.io/tags/rsync/Tue, 13 Oct 2020 16:29:34 +0000https://zfunnily.github.io/tags/rsync/Cpuhttps://zfunnily.github.io/tags/cpu/Mon, 12 Oct 2020 16:29:34 +0000https://zfunnily.github.io/tags/cpu/Ffmpeghttps://zfunnily.github.io/tags/ffmpeg/Mon, 14 Sep 2020 18:29:33 +0000https://zfunnily.github.io/tags/ffmpeg/K8shttps://zfunnily.github.io/tags/k8s/Mon, 17 Aug 2020 13:58:35 +0000https://zfunnily.github.io/tags/k8s/Nsfhttps://zfunnily.github.io/tags/nsf/Fri, 14 Aug 2020 17:17:54 +0000https://zfunnily.github.io/tags/nsf/ \ No newline at end of file diff --git a/tags/k8s/index.xml b/tags/k8s/index.xml index 4219cc011..faad513e8 100644 --- a/tags/k8s/index.xml +++ b/tags/k8s/index.xml @@ -1 +1 @@ -K8s on Zzz记忆https://zfunnily.github.io/tags/k8s/Recent content in K8s on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000K8S | Prometheus+Grafana监控https://zfunnily.github.io/2020/08/prometheusgrafana/Mon, 17 Aug 2020 13:58:35 +0000https://zfunnily.github.io/2020/08/prometheusgrafana/概述 作为应用与Kubernetes的监控体系,Prometheus具备诸多的优势,如: Kubernetes默认支持,非常适合容器和微服务- 无依赖,安装方便,上手容易- 社区活跃,它不仅仅是个工具,而是生K8S | Ingress的基本使用https://zfunnily.github.io/2020/08/ingress/Sat, 15 Aug 2020 00:05:15 +0000https://zfunnily.github.io/2020/08/ingress/缘由 看了statefulset基础教程的基础教程,并且把环境搭建起来后。pod内部是可以连通了。但是我不知道怎么去从外部访问。在网上搜索一番,通过Ingress可以作为集群的入口。遂记录之。 结合StaK8S | Statefluset的持久存储PVChttps://zfunnily.github.io/2020/08/pvc/Fri, 14 Aug 2020 17:18:58 +0000https://zfunnily.github.io/2020/08/pvc/缘由 在看statefluset基础教程的时候遇到pod状态为pending kubectl describe pod web-0 日志内容是 pod has unbound immediate PersistentVolumeClaims 于是就对PV和PVC进行研究。 有给出完整的 web.yaml查看最下面的完整示例。但是我建议先把PVK8S | coreDNS的部署安装https://zfunnily.github.io/2020/08/coredns/Thu, 13 Aug 2020 18:44:28 +0000https://zfunnily.github.io/2020/08/coredns/概述 CoreDNS可以在具有标准的Kube-DNS的Kubernetes集群中运行。作为Kubernetes 的插件使用,CoreDNS将从 Kubernetes集群中读取区(zone)数据。它实现了为KK8S | 创建第一个应用https://zfunnily.github.io/2020/08/firstk8s/Thu, 13 Aug 2020 15:28:31 +0000https://zfunnily.github.io/2020/08/firstk8s/使用k8s部署第一个应用 创建一个nginx.yaml文件 apiVersion: v1 kind: Pod metadata: name: nginx # 指定 label,便于检索 labels: app: nginx spec: containers: - name: nginx # 指定镜像 image: nginx:alpine # 指定暴露端口 ports: - containerPort: 80 --- # 创建网络服务 apiVersion: v1 kind: Service metadata: name: kube-node-service labels: name: kube-node-service spec: type: NodePort #这里代表K8S | 集群资源监控 heapsterhttps://zfunnily.github.io/2020/08/heapster/Thu, 06 Aug 2020 09:06:05 +0000https://zfunnily.github.io/2020/08/heapster/安装heapster的原因 查看dashboard状态 $ sudo kubectl get pods --all-namespaces | grep dashboard kubernetes-dashboard dashboard-metrics-scraper-6b4884c9d5-mvnb9 1/1 Running 0 40m kubernetes-dashboard kubernetes-dashboard-d7f7f565d-zhpsc 1/1 Running 0 40m 查看dashboard的日志 $ sudo kubectl logs -f -n kubernetes-dashboard kubernetes-dashboard-d7f7f565d-zhpsc 日志遇到这样的情况 No metric client provided. Skipping metrics. 2020/08/03 09:02:22 [2020-08-03T09:02:22Z] Outcoming response to 192.168.84.241:40086 with 200 status code 2020/08/03 09:02:23 Metric client healthK8S | Dashboard界面管理https://zfunnily.github.io/2020/08/dashboard/Thu, 06 Aug 2020 09:04:14 +0000https://zfunnily.github.io/2020/08/dashboard/安装部署Dashboard 通过一下命令来部署, recommended.yaml $ sudo kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deploy/recommended.yaml https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deplK8S | 安装https://zfunnily.github.io/2020/08/k8sinstall/Wed, 05 Aug 2020 10:00:40 +0000https://zfunnily.github.io/2020/08/k8sinstall/安装k8s前的准备工作 环境 ubuntu18.04 docker 关闭 swap 暂时关闭 $ swapoff -a 永久关闭 注释掉这一行 sudo vim /etc/fstab # /swapfile none swap sw 0 0 重启机器 sudo reboot docker 的配置 安装完成之后需要进行一些配置,包括 切换docker下载源为国内镜像站 以及 修改cgroups \ No newline at end of file +K8s on Zzz记忆https://zfunnily.github.io/tags/k8s/Recent content in K8s on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000K8S | Prometheus+Grafana监控https://zfunnily.github.io/2020/08/prometheusgrafana/Mon, 17 Aug 2020 13:58:35 +0000https://zfunnily.github.io/2020/08/prometheusgrafana/概述 作为应用与Kubernetes的监控体系,Prometheus具备诸多的优势,如: Kubernetes默认支持,非常适合容器和微服务- 无依赖,安装方便,上手容易- 社区活跃,它不仅仅是个工具,而是生K8S | Ingress的基本使用https://zfunnily.github.io/2020/08/ingress/Sat, 15 Aug 2020 00:05:15 +0000https://zfunnily.github.io/2020/08/ingress/缘由 看了statefulset基础教程的基础教程,并且把环境搭建起来后。pod内部是可以连通了。但是我不知道怎么去从外部访问。在网上搜索一番,通过Ingress可以作为集群的入口。遂记录之。 结合StaK8S | Statefluset的持久存储PVChttps://zfunnily.github.io/2020/08/pvc/Fri, 14 Aug 2020 17:18:58 +0000https://zfunnily.github.io/2020/08/pvc/缘由 在看statefluset基础教程的时候遇到pod状态为pending kubectl describe pod web-0 日志内容是 pod has unbound immediate PersistentVolumeClaims 于是就对PV和PVC进行研究。 有给出完整的 web.yaml查看最下面的完整示例。但是我建议先把PVK8S | coreDNS的部署安装https://zfunnily.github.io/2020/08/coredns/Thu, 13 Aug 2020 18:44:28 +0000https://zfunnily.github.io/2020/08/coredns/概述 CoreDNS可以在具有标准的Kube-DNS的Kubernetes集群中运行。作为Kubernetes 的插件使用,CoreDNS将从 Kubernetes集群中读取区(zone)数据。它实现了为KK8S | 创建第一个应用https://zfunnily.github.io/2020/08/firstk8s/Thu, 13 Aug 2020 15:28:31 +0000https://zfunnily.github.io/2020/08/firstk8s/使用k8s部署第一个应用 创建一个nginx.yaml文件 apiVersion: v1 kind: Pod metadata: name: nginx # 指定 label,便于检索 labels: app: nginx spec: containers: - name: nginx # 指定镜像 image: nginx:alpine # 指定暴露端口 ports: - containerPort: 80 --- # 创建网络服务 apiVersion: v1 kind: Service metadata: name: kube-node-service labels: name: kube-node-service spec: type: NodePort #这里代表K8S | 集群资源监控 heapsterhttps://zfunnily.github.io/2020/08/heapster/Thu, 06 Aug 2020 09:06:05 +0000https://zfunnily.github.io/2020/08/heapster/安装heapster的原因 查看dashboard状态 $ sudo kubectl get pods --all-namespaces | grep dashboard kubernetes-dashboard dashboard-metrics-scraper-6b4884c9d5-mvnb9 1/1 Running 0 40m kubernetes-dashboard kubernetes-dashboard-d7f7f565d-zhpsc 1/1 Running 0 40m 查看dashboard的日志 $ sudo kubectl logs -f -n kubernetes-dashboard kubernetes-dashboard-d7f7f565d-zhpsc 日志遇到这样的情况 No metric client provided. Skipping metrics. 2020/08/03 09:02:22 [2020-08-03T09:02:22Z] Outcoming response to 192.168.84.241:40086 with 200 status code 2020/08/03 09:02:23 Metric client healthK8S | Dashboard界面管理https://zfunnily.github.io/2020/08/dashboard/Thu, 06 Aug 2020 09:04:14 +0000https://zfunnily.github.io/2020/08/dashboard/安装部署Dashboard 通过一下命令来部署, recommended.yaml $ sudo kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deploy/recommended.yaml https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deplK8S | 安装https://zfunnily.github.io/2020/08/k8sinstall/Wed, 05 Aug 2020 10:00:40 +0000https://zfunnily.github.io/2020/08/k8sinstall/安装k8s前的准备工作 环境 ubuntu18.04 docker 关闭 swap 暂时关闭 $ swapoff -a 永久关闭 注释掉这一行 sudo vim /etc/fstab # /swapfile none swap sw 0 0 重启机器 sudo reboot docker 的配置 安装完成之后需要进行一些配置,包括 切换docker下载源为国内镜像站 以及 修改cgroups \ No newline at end of file diff --git a/tags/music/index.xml b/tags/music/index.xml index d9fb82021..1f3821512 100644 --- a/tags/music/index.xml +++ b/tags/music/index.xml @@ -1 +1 @@ -Music on Zzz记忆https://zfunnily.github.io/tags/music/Recent content in Music on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000免费Musichttps://zfunnily.github.io/2021/09/music/Wed, 08 Sep 2021 14:47:14 +0800https://zfunnily.github.io/2021/09/music/介绍一个可以免费听音乐的方法 环境 docker mac 安装 $ docker run -d -p 264:264 -p 9000:9000 -v $dir_name:/var/www/html/cache --name music oldiy/music-player-docker $dir_name 是 你自己宿主机的目录。可以自定义 访问:127.0.0.1:264 就可以放心使用, 同事推荐的,贼好用。 \ No newline at end of file +Music on Zzz记忆https://zfunnily.github.io/tags/music/Recent content in Music on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000免费Musichttps://zfunnily.github.io/2021/09/music/Wed, 08 Sep 2021 14:47:14 +0800https://zfunnily.github.io/2021/09/music/介绍一个可以免费听音乐的方法 环境 docker mac 安装 $ docker run -d -p 264:264 -p 9000:9000 -v $dir_name:/var/www/html/cache --name music oldiy/music-player-docker $dir_name 是 你自己宿主机的目录。可以自定义 访问:127.0.0.1:264 就可以放心使用, 同事推荐的,贼好用。 \ No newline at end of file diff --git a/tags/nginx/index.xml b/tags/nginx/index.xml index 733cecb97..3de2b2c17 100644 --- a/tags/nginx/index.xml +++ b/tags/nginx/index.xml @@ -1 +1 @@ -Nginx on Zzz记忆https://zfunnily.github.io/tags/nginx/Recent content in Nginx on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000Nginx的一些配置https://zfunnily.github.io/2021/12/nginx/Tue, 28 Dec 2021 16:04:10 +0800https://zfunnily.github.io/2021/12/nginx/静态网站 应用场景 文件服务 静态网站 &hellip; 静态网站的配置 配置如下: nginx.conf worker_processes 1; pid nginx.pid; events { worker_connections 1024; multi_accept on; } http { default_type application/octet-stream; sendfile on; keepalive_timeout 100; server { listen 80; charset utf-8,gbk; server_name localhost; location /{ root /opt/; autoindex on; autoindex_localtime on; } index index.html; # 显示首页 #静态文件访问 location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|js|pdf|txt) { root /opt; } } } root: 表示网站根目录 autoindex: on 显 \ No newline at end of file +Nginx on Zzz记忆https://zfunnily.github.io/tags/nginx/Recent content in Nginx on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000Nginx的一些配置https://zfunnily.github.io/2021/12/nginx/Tue, 28 Dec 2021 16:04:10 +0800https://zfunnily.github.io/2021/12/nginx/静态网站 应用场景 文件服务 静态网站 &hellip; 静态网站的配置 配置如下: nginx.conf worker_processes 1; pid nginx.pid; events { worker_connections 1024; multi_accept on; } http { default_type application/octet-stream; sendfile on; keepalive_timeout 100; server { listen 80; charset utf-8,gbk; server_name localhost; location /{ root /opt/; autoindex on; autoindex_localtime on; } index index.html; # 显示首页 #静态文件访问 location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|js|pdf|txt) { root /opt; } } } root: 表示网站根目录 autoindex: on 显 \ No newline at end of file diff --git a/tags/nsf/index.xml b/tags/nsf/index.xml index 8af3d972a..75cb58555 100644 --- a/tags/nsf/index.xml +++ b/tags/nsf/index.xml @@ -1 +1 @@ -Nsf on Zzz记忆https://zfunnily.github.io/tags/nsf/Recent content in Nsf on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000Linux | nsf服务的搭建和使用https://zfunnily.github.io/2020/08/nsf/Fri, 14 Aug 2020 17:17:54 +0000https://zfunnily.github.io/2020/08/nsf/搭建nsf服务 sudo apt install nfs-kernel-server 默认情况下,在Ubuntu 18.04上,NFS版本2是禁用的。版本3和版本4已启用。您可以通过运行以下cat命令来验证: sudo cat /proc/fs/nfsd/versions 写入 exports cat /etc/exports sudo echo /nfs/prometheus/data/ 192.168.84.75/24(rw,no_root_squash,no_all_squash,sync) &gt;&gt; /etc/exports sudo echo /nfs/prometheus/data/ 192.168.84.75/24(rw,no_root_squash,no_all_squash,sync) &gt;&gt; /etc/exports 可以设定的参数主要 \ No newline at end of file +Nsf on Zzz记忆https://zfunnily.github.io/tags/nsf/Recent content in Nsf on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000Linux | nsf服务的搭建和使用https://zfunnily.github.io/2020/08/nsf/Fri, 14 Aug 2020 17:17:54 +0000https://zfunnily.github.io/2020/08/nsf/搭建nsf服务 sudo apt install nfs-kernel-server 默认情况下,在Ubuntu 18.04上,NFS版本2是禁用的。版本3和版本4已启用。您可以通过运行以下cat命令来验证: sudo cat /proc/fs/nfsd/versions 写入 exports cat /etc/exports sudo echo /nfs/prometheus/data/ 192.168.84.75/24(rw,no_root_squash,no_all_squash,sync) &gt;&gt; /etc/exports sudo echo /nfs/prometheus/data/ 192.168.84.75/24(rw,no_root_squash,no_all_squash,sync) &gt;&gt; /etc/exports 可以设定的参数主要 \ No newline at end of file diff --git a/tags/p2p/index.xml b/tags/p2p/index.xml index 625462a77..13e4d11d3 100644 --- a/tags/p2p/index.xml +++ b/tags/p2p/index.xml @@ -1 +1 @@ -P2p on Zzz记忆https://zfunnily.github.io/tags/p2p/Recent content in P2p on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000Go-libp2p四 | 穿透NAThttps://zfunnily.github.io/2021/11/gop2pfour/Sun, 07 Nov 2021 15:49:46 +0800https://zfunnily.github.io/2021/11/gop2pfour/本文目的 上文Go-libp2p三 | relay例子已经分析过relay例子,并解释了两个节点如果通过中继服务进行通信。本文改造relay例子 并让这个服务做如下两件事: 交换两个节点的在交换机上的信息,帮助Go-libp2p三 | relay例子https://zfunnily.github.io/2021/10/gop2pthree/Sun, 31 Oct 2021 10:13:40 +0800https://zfunnily.github.io/2021/10/gop2pthree/我想做什么 chat和echo两个例子,说明了两个节点之间的通信需要两节点在同一个局域网内,或者有一个节点有公网。 如果我两个节点分别在两个NAT下面, 都在各自的局域网内,则需要有一个中继服务,这个服务做Go-libp2p二 | echo例子https://zfunnily.github.io/2021/10/gop2ptwo/Fri, 29 Oct 2021 11:15:42 +0800https://zfunnily.github.io/2021/10/gop2ptwo/go-libp2p的echo例子分析 进入目录go-libp2p/examples/echo/, 编译 go build 先看README.md, 可以了解到使用echo的方式: 终端B $ ./echo -l 3001 2021/10/28 11:25:33 I am /ip4/127.0.0.1/tcp/3001/p2p/QmTu8sxDi3fSjz9ZMvkAj3qA9YAoGskroEnyLz2ZvfTBhX 2021/10/28 11:25:33 listening for connections 2021/10/28 11:25:33 Now run &#34;./echoGo-libp2p一 | chat例子https://zfunnily.github.io/2021/10/gop2pone/Thu, 28 Oct 2021 14:40:02 +0800https://zfunnily.github.io/2021/10/gop2pone/代码下载 git clone https://github.com/libp2p/go-libp2p.git chat实例分析 进入目录go-libp2p/examples/chat/, 编译 go build 先看README.md, 可以了解到使用chat的方式 在节点 B $ ./chat -sp 3001 2021/10/28 11:01:25 Run &#39;./chat -d /ip4/127.0.0.1/tcp/3001/p2p/QmXgEXt4CiqmVmDhPPQnyVkoj3Bsx3Nggq57PPsk5tLNTs&#39; on another console. 2021/10/28 11:01:25 You can replace 127.0.0.1 with public IP \ No newline at end of file +P2p on Zzz记忆https://zfunnily.github.io/tags/p2p/Recent content in P2p on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000Go-libp2p四 | 穿透NAThttps://zfunnily.github.io/2021/11/gop2pfour/Sun, 07 Nov 2021 15:49:46 +0800https://zfunnily.github.io/2021/11/gop2pfour/本文目的 上文Go-libp2p三 | relay例子已经分析过relay例子,并解释了两个节点如果通过中继服务进行通信。本文改造relay例子 并让这个服务做如下两件事: 交换两个节点的在交换机上的信息,帮助Go-libp2p三 | relay例子https://zfunnily.github.io/2021/10/gop2pthree/Sun, 31 Oct 2021 10:13:40 +0800https://zfunnily.github.io/2021/10/gop2pthree/我想做什么 chat和echo两个例子,说明了两个节点之间的通信需要两节点在同一个局域网内,或者有一个节点有公网。 如果我两个节点分别在两个NAT下面, 都在各自的局域网内,则需要有一个中继服务,这个服务做Go-libp2p二 | echo例子https://zfunnily.github.io/2021/10/gop2ptwo/Fri, 29 Oct 2021 11:15:42 +0800https://zfunnily.github.io/2021/10/gop2ptwo/go-libp2p的echo例子分析 进入目录go-libp2p/examples/echo/, 编译 go build 先看README.md, 可以了解到使用echo的方式: 终端B $ ./echo -l 3001 2021/10/28 11:25:33 I am /ip4/127.0.0.1/tcp/3001/p2p/QmTu8sxDi3fSjz9ZMvkAj3qA9YAoGskroEnyLz2ZvfTBhX 2021/10/28 11:25:33 listening for connections 2021/10/28 11:25:33 Now run &#34;./echoGo-libp2p一 | chat例子https://zfunnily.github.io/2021/10/gop2pone/Thu, 28 Oct 2021 14:40:02 +0800https://zfunnily.github.io/2021/10/gop2pone/代码下载 git clone https://github.com/libp2p/go-libp2p.git chat实例分析 进入目录go-libp2p/examples/chat/, 编译 go build 先看README.md, 可以了解到使用chat的方式 在节点 B $ ./chat -sp 3001 2021/10/28 11:01:25 Run &#39;./chat -d /ip4/127.0.0.1/tcp/3001/p2p/QmXgEXt4CiqmVmDhPPQnyVkoj3Bsx3Nggq57PPsk5tLNTs&#39; on another console. 2021/10/28 11:01:25 You can replace 127.0.0.1 with public IP \ No newline at end of file diff --git a/tags/randomquotes/index.xml b/tags/randomquotes/index.xml index 41885f4c3..dc147b4eb 100644 --- a/tags/randomquotes/index.xml +++ b/tags/randomquotes/index.xml @@ -1 +1 @@ -Randomquotes on Zzz记忆https://zfunnily.github.io/tags/randomquotes/Recent content in Randomquotes on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000Blog | 随机名人名言https://zfunnily.github.io/2021/11/randomquotes/Fri, 05 Nov 2021 15:50:16 +0800https://zfunnily.github.io/2021/11/randomquotes/本文目的 我的个人博客已经搭建好了,使用的hugo+飞雪的主题。我看到有些博客上有些随机的名人名言,但是这个主题没有。遂自己写一个。 根据飞雪的主题自定义 飞雪主题的github: https://github.com/flysnow-org/maupassant-hugo 复制主题里的文件them \ No newline at end of file +Randomquotes on Zzz记忆https://zfunnily.github.io/tags/randomquotes/Recent content in Randomquotes on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000Blog | 随机名人名言https://zfunnily.github.io/2021/11/randomquotes/Fri, 05 Nov 2021 15:50:16 +0800https://zfunnily.github.io/2021/11/randomquotes/本文目的 我的个人博客已经搭建好了,使用的hugo+飞雪的主题。我看到有些博客上有些随机的名人名言,但是这个主题没有。遂自己写一个。 根据飞雪的主题自定义 飞雪主题的github: https://github.com/flysnow-org/maupassant-hugo 复制主题里的文件them \ No newline at end of file diff --git a/tags/redis/index.xml b/tags/redis/index.xml index 7514dee8a..070e781c7 100644 --- a/tags/redis/index.xml +++ b/tags/redis/index.xml @@ -1 +1 @@ -Redis on Zzz记忆https://zfunnily.github.io/tags/redis/Recent content in Redis on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000Redis源码分析 | ziplisthttps://zfunnily.github.io/2021/01/ziplist/Wed, 13 Jan 2021 17:52:27 +0000https://zfunnily.github.io/2021/01/ziplist/概述 Redis中的List是一个有序(按加入的时序排序)的数据结构,一般有序我们会采用数组或者是双向链表,其中双向链表由于有前后指针实际上会很浪费内存。3.2版本之前采用两种数据结构作为底层实现: 压缩Redis源码解析 | VScode调试https://zfunnily.github.io/2021/01/vscodedebugredis/Tue, 12 Jan 2021 14:25:29 +0000https://zfunnily.github.io/2021/01/vscodedebugredis/环境 vscode- gcc5.4 ubuntu16.04 或者 ubuntu18.04 make 下载6.2版本. 我使用的是国内github镜像地址:github.com.cnpmjs.org,速度比较快。 $ git clone https://github.com.cnpmjs.org/redis/redis.git redis $ git checkout -b 6.2 remotes/origin/6.2 vscode不参与编译,只充当可视化的调试工具。 使用VScode | 调试Redis源码,指针显示的问题https://zfunnily.github.io/2021/01/vscoderedis/Tue, 12 Jan 2021 14:17:22 +0000https://zfunnily.github.io/2021/01/vscoderedis/缘由 使用VScode的时候,断点看到指针显示的是一串地址,而不是指针指向的对象的值。上网找了一圈,没看到vscode有对应的插件来解决这个问题。vscode有对应的语法来解决这个问题。 网上几乎都在说在Redis源码解析 | sdshttps://zfunnily.github.io/2021/01/sds/Wed, 06 Jan 2021 14:20:23 +0000https://zfunnily.github.io/2021/01/sds/SDS头文件及作用 sds.h: sds声明- sdsalloc.h: 为sds分配内存 源码文件sds.h中有这样一行代码 typedef char *sds; 很清晰、明了,sds其实就是char*。 最新的6.2分支的代码: struct __attribute__ ((__packed__)) sdshdr5 {&lt;!-- --&gt; unsigned char flags; /* 3 lsb of \ No newline at end of file +Redis on Zzz记忆https://zfunnily.github.io/tags/redis/Recent content in Redis on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000Redis源码分析 | ziplisthttps://zfunnily.github.io/2021/01/ziplist/Wed, 13 Jan 2021 17:52:27 +0000https://zfunnily.github.io/2021/01/ziplist/概述 Redis中的List是一个有序(按加入的时序排序)的数据结构,一般有序我们会采用数组或者是双向链表,其中双向链表由于有前后指针实际上会很浪费内存。3.2版本之前采用两种数据结构作为底层实现: 压缩Redis源码解析 | VScode调试https://zfunnily.github.io/2021/01/vscodedebugredis/Tue, 12 Jan 2021 14:25:29 +0000https://zfunnily.github.io/2021/01/vscodedebugredis/环境 vscode- gcc5.4 ubuntu16.04 或者 ubuntu18.04 make 下载6.2版本. 我使用的是国内github镜像地址:github.com.cnpmjs.org,速度比较快。 $ git clone https://github.com.cnpmjs.org/redis/redis.git redis $ git checkout -b 6.2 remotes/origin/6.2 vscode不参与编译,只充当可视化的调试工具。 使用VScode | 调试Redis源码,指针显示的问题https://zfunnily.github.io/2021/01/vscoderedis/Tue, 12 Jan 2021 14:17:22 +0000https://zfunnily.github.io/2021/01/vscoderedis/缘由 使用VScode的时候,断点看到指针显示的是一串地址,而不是指针指向的对象的值。上网找了一圈,没看到vscode有对应的插件来解决这个问题。vscode有对应的语法来解决这个问题。 网上几乎都在说在Redis源码解析 | sdshttps://zfunnily.github.io/2021/01/sds/Wed, 06 Jan 2021 14:20:23 +0000https://zfunnily.github.io/2021/01/sds/SDS头文件及作用 sds.h: sds声明- sdsalloc.h: 为sds分配内存 源码文件sds.h中有这样一行代码 typedef char *sds; 很清晰、明了,sds其实就是char*。 最新的6.2分支的代码: struct __attribute__ ((__packed__)) sdshdr5 {&lt;!-- --&gt; unsigned char flags; /* 3 lsb of \ No newline at end of file diff --git a/tags/rsync/index.xml b/tags/rsync/index.xml index f787297a6..728d6a6a9 100644 --- a/tags/rsync/index.xml +++ b/tags/rsync/index.xml @@ -1 +1 @@ -Rsync on Zzz记忆https://zfunnily.github.io/tags/rsync/Recent content in Rsync on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000Linux | 删除大量文件指令--rsynchttps://zfunnily.github.io/2020/10/linux%E7%B3%BB%E7%BB%9F%E5%88%A0%E9%99%A4%E5%A4%A7%E9%87%8F%E6%96%87%E4%BB%B6%E6%8C%87%E4%BB%A4--rsync/Tue, 13 Oct 2020 16:29:34 +0000https://zfunnily.github.io/2020/10/linux%E7%B3%BB%E7%BB%9F%E5%88%A0%E9%99%A4%E5%A4%A7%E9%87%8F%E6%96%87%E4%BB%B6%E6%8C%87%E4%BB%A4--rsync/rsync的安装 rsync安装,有些系统默认安装有该命令 ubuntu系统 sudo apt-get install rsync centos系统 sudo yum install rsync rsync参数详解 rsync提供了一些跟删除有关的参数 rsync --help | grep delete -del an alias for --delete-during --delete delete extraneous files from destination dirs --delete-before receiver deletes before \ No newline at end of file +Rsync on Zzz记忆https://zfunnily.github.io/tags/rsync/Recent content in Rsync on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000Linux | 删除大量文件指令--rsynchttps://zfunnily.github.io/2020/10/linux%E7%B3%BB%E7%BB%9F%E5%88%A0%E9%99%A4%E5%A4%A7%E9%87%8F%E6%96%87%E4%BB%B6%E6%8C%87%E4%BB%A4--rsync/Tue, 13 Oct 2020 16:29:34 +0000https://zfunnily.github.io/2020/10/linux%E7%B3%BB%E7%BB%9F%E5%88%A0%E9%99%A4%E5%A4%A7%E9%87%8F%E6%96%87%E4%BB%B6%E6%8C%87%E4%BB%A4--rsync/rsync的安装 rsync安装,有些系统默认安装有该命令 ubuntu系统 sudo apt-get install rsync centos系统 sudo yum install rsync rsync参数详解 rsync提供了一些跟删除有关的参数 rsync --help | grep delete -del an alias for --delete-during --delete delete extraneous files from destination dirs --delete-before receiver deletes before \ No newline at end of file diff --git a/tags/screen/index.xml b/tags/screen/index.xml index 1d81bdc06..f029c3a8d 100644 --- a/tags/screen/index.xml +++ b/tags/screen/index.xml @@ -1 +1 @@ -Screen on Zzz记忆https://zfunnily.github.io/tags/screen/Recent content in Screen on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000Linux | Screenhttps://zfunnily.github.io/2021/09/screen/Tue, 07 Sep 2021 10:02:16 +0800https://zfunnily.github.io/2021/09/screen/screen命令 screen 是一个非常有用的命令。应用场景: 单个 SSH 会话中使用多个 shell 窗口(会话)的能力 服务器开发,一个单独运行进程的窗口。可以避免单独再开一个窗口。 &hellip; screen使用 创建一个窗口 $ screen -S name 执行自己需 \ No newline at end of file +Screen on Zzz记忆https://zfunnily.github.io/tags/screen/Recent content in Screen on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000Linux | Screenhttps://zfunnily.github.io/2021/09/screen/Tue, 07 Sep 2021 10:02:16 +0800https://zfunnily.github.io/2021/09/screen/screen命令 screen 是一个非常有用的命令。应用场景: 单个 SSH 会话中使用多个 shell 窗口(会话)的能力 服务器开发,一个单独运行进程的窗口。可以避免单独再开一个窗口。 &hellip; screen使用 创建一个窗口 $ screen -S name 执行自己需 \ No newline at end of file diff --git a/tags/shader/index.xml b/tags/shader/index.xml index c7710d8d0..9986be4ea 100644 --- a/tags/shader/index.xml +++ b/tags/shader/index.xml @@ -1 +1 @@ -Shader on Zzz记忆https://zfunnily.github.io/tags/shader/Recent content in Shader on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000《Unity Shader入门精要》第三章笔记| UnityShader基础https://zfunnily.github.io/2022/04/shaderbase/Sun, 10 Apr 2022 14:51:19 +0800https://zfunnily.github.io/2022/04/shaderbase/材质 在Unity中我们需要配合使用材质 (Material) 和Unity Shader才能达到需要的效果。一个最常见的流程是 创建一个材质;活着导入一个材质 创建一个Unity Shader,并把它赋给上一步中《Unity Shader入门精要》第三章笔记| UnityShader基础https://zfunnily.github.io/2022/04/shaderbase/Sun, 10 Apr 2022 14:51:19 +0800https://zfunnily.github.io/2022/04/shaderbase/材质 在Unity中我们需要配合使用材质 (Material) 和Unity Shader才能达到需要的效果。一个最常见的流程是 创建一个材质;活着导入一个材质 创建一个Unity Shader,并把它赋给上一步中《Unity Shader入门精要》第二章笔记 | 渲染流水线https://zfunnily.github.io/2022/04/shaderrenderpipline/Sat, 09 Apr 2022 11:55:55 +0800https://zfunnily.github.io/2022/04/shaderrenderpipline/渲染流水线 Render-Time Rendering, Third Edition》一书中将一个渲染流程分成3个阶段:应用阶段(Application Stage) 、几何阶段(Geometry Stage) 、光栅化阶段(Rasterizer Stage) 。 应《Unity Shader入门精要》第二章笔记 | 渲染流水线https://zfunnily.github.io/2022/04/shaderrenderpipline/Sat, 09 Apr 2022 11:55:55 +0800https://zfunnily.github.io/2022/04/shaderrenderpipline/渲染流水线 Render-Time Rendering, Third Edition》一书中将一个渲染流程分成3个阶段:应用阶段(Application Stage) 、几何阶段(Geometry Stage) 、光栅化阶段(Rasterizer Stage) 。 应shader初尝试 | 给石头覆盖一层雪景(Hello World)https://zfunnily.github.io/2022/04/shaderhelloworld/Sat, 09 Apr 2022 10:34:56 +0800https://zfunnily.github.io/2022/04/shaderhelloworld/给石头覆盖一层雪景 资源准备 石头模型 Unity2021.2.3f1c1 Mac &amp; Windows 在Unity中创建一个项目,导入石头模型,下面就开始利用shader给石头做一个雪景覆盖. 实现效果 未覆盖雪景的样子 覆盖了雪景的样子 开始代码 我在代码中标注了1,shader初尝试 | 给石头覆盖一层雪景(Hello World)https://zfunnily.github.io/2022/04/shaderhelloworld/Sat, 09 Apr 2022 10:34:56 +0800https://zfunnily.github.io/2022/04/shaderhelloworld/给石头覆盖一层雪景 资源准备 石头模型 Unity2021.2.3f1c1 Mac &amp; Windows 在Unity中创建一个项目,导入石头模型,下面就开始利用shader给石头做一个雪景覆盖. 实现效果 未覆盖雪景的样子 覆盖了雪景的样子 开始代码 我在代码中标注了1, \ No newline at end of file +Shader on Zzz记忆https://zfunnily.github.io/tags/shader/Recent content in Shader on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000《Unity Shader入门精要》第三章笔记| UnityShader基础https://zfunnily.github.io/2022/04/shaderbase/Sun, 10 Apr 2022 14:51:19 +0800https://zfunnily.github.io/2022/04/shaderbase/材质 在Unity中我们需要配合使用材质 (Material) 和Unity Shader才能达到需要的效果。一个最常见的流程是 创建一个材质;活着导入一个材质 创建一个Unity Shader,并把它赋给上一步中《Unity Shader入门精要》第三章笔记| UnityShader基础https://zfunnily.github.io/2022/04/shaderbase/Sun, 10 Apr 2022 14:51:19 +0800https://zfunnily.github.io/2022/04/shaderbase/材质 在Unity中我们需要配合使用材质 (Material) 和Unity Shader才能达到需要的效果。一个最常见的流程是 创建一个材质;活着导入一个材质 创建一个Unity Shader,并把它赋给上一步中《Unity Shader入门精要》第二章笔记 | 渲染流水线https://zfunnily.github.io/2022/04/shaderrenderpipline/Sat, 09 Apr 2022 11:55:55 +0800https://zfunnily.github.io/2022/04/shaderrenderpipline/渲染流水线 Render-Time Rendering, Third Edition》一书中将一个渲染流程分成3个阶段:应用阶段(Application Stage) 、几何阶段(Geometry Stage) 、光栅化阶段(Rasterizer Stage) 。 应《Unity Shader入门精要》第二章笔记 | 渲染流水线https://zfunnily.github.io/2022/04/shaderrenderpipline/Sat, 09 Apr 2022 11:55:55 +0800https://zfunnily.github.io/2022/04/shaderrenderpipline/渲染流水线 Render-Time Rendering, Third Edition》一书中将一个渲染流程分成3个阶段:应用阶段(Application Stage) 、几何阶段(Geometry Stage) 、光栅化阶段(Rasterizer Stage) 。 应shader初尝试 | 给石头覆盖一层雪景(Hello World)https://zfunnily.github.io/2022/04/shaderhelloworld/Sat, 09 Apr 2022 10:34:56 +0800https://zfunnily.github.io/2022/04/shaderhelloworld/给石头覆盖一层雪景 资源准备 石头模型 Unity2021.2.3f1c1 Mac &amp; Windows 在Unity中创建一个项目,导入石头模型,下面就开始利用shader给石头做一个雪景覆盖. 实现效果 未覆盖雪景的样子 覆盖了雪景的样子 开始代码 我在代码中标注了1,shader初尝试 | 给石头覆盖一层雪景(Hello World)https://zfunnily.github.io/2022/04/shaderhelloworld/Sat, 09 Apr 2022 10:34:56 +0800https://zfunnily.github.io/2022/04/shaderhelloworld/给石头覆盖一层雪景 资源准备 石头模型 Unity2021.2.3f1c1 Mac &amp; Windows 在Unity中创建一个项目,导入石头模型,下面就开始利用shader给石头做一个雪景覆盖. 实现效果 未覆盖雪景的样子 覆盖了雪景的样子 开始代码 我在代码中标注了1, \ No newline at end of file diff --git "a/tags/shader\345\255\246\344\271\240\347\254\224\350\256\260/index.xml" "b/tags/shader\345\255\246\344\271\240\347\254\224\350\256\260/index.xml" index 88fbc5dcf..641eb85cd 100644 --- "a/tags/shader\345\255\246\344\271\240\347\254\224\350\256\260/index.xml" +++ "b/tags/shader\345\255\246\344\271\240\347\254\224\350\256\260/index.xml" @@ -1 +1 @@ -Shader学习笔记 on Zzz记忆https://zfunnily.github.io/tags/shader%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/Recent content in Shader学习笔记 on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000UnityShader基本概念https://zfunnily.github.io/2022/04/shader01/Wed, 06 Apr 2022 11:54:02 +0800https://zfunnily.github.io/2022/04/shader01/何为shader shader中文翻译为着色器,其实是一种用来渲染图形的技术,我们可以通过shader编程,来自定义显卡渲染画面的算法,显示我们所期望的结果。 shader种类 顶点着色器: 处理每个顶点,将UnityShader基本概念https://zfunnily.github.io/2022/04/shader01/Wed, 06 Apr 2022 11:54:02 +0800https://zfunnily.github.io/2022/04/shader01/何为shader shader中文翻译为着色器,其实是一种用来渲染图形的技术,我们可以通过shader编程,来自定义显卡渲染画面的算法,显示我们所期望的结果。 shader种类 顶点着色器: 处理每个顶点,将 \ No newline at end of file +Shader学习笔记 on Zzz记忆https://zfunnily.github.io/tags/shader%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/Recent content in Shader学习笔记 on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000UnityShader基本概念https://zfunnily.github.io/2022/04/shader01/Wed, 06 Apr 2022 11:54:02 +0800https://zfunnily.github.io/2022/04/shader01/何为shader shader中文翻译为着色器,其实是一种用来渲染图形的技术,我们可以通过shader编程,来自定义显卡渲染画面的算法,显示我们所期望的结果。 shader种类 顶点着色器: 处理每个顶点,将UnityShader基本概念https://zfunnily.github.io/2022/04/shader01/Wed, 06 Apr 2022 11:54:02 +0800https://zfunnily.github.io/2022/04/shader01/何为shader shader中文翻译为着色器,其实是一种用来渲染图形的技术,我们可以通过shader编程,来自定义显卡渲染画面的算法,显示我们所期望的结果。 shader种类 顶点着色器: 处理每个顶点,将 \ No newline at end of file diff --git a/tags/shortcodes/index.xml b/tags/shortcodes/index.xml index 896a60840..d58b3d8ec 100644 --- a/tags/shortcodes/index.xml +++ b/tags/shortcodes/index.xml @@ -1 +1 @@ -Shortcodes on Zzz记忆https://zfunnily.github.io/tags/shortcodes/Recent content in Shortcodes on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000Blog | 代码显示/隐藏https://zfunnily.github.io/2021/12/shortcodes/Wed, 29 Dec 2021 13:50:28 +0800https://zfunnily.github.io/2021/12/shortcodes/缘由 最近在写技术博客时,引入的代码太多,影响观感。 在尽力减少代码量,还是有些不可或缺的代码,代码量很惊人,已经占满整个屏幕. 因为个人博客是使用hugo生成的静态博客,我刚开始想的使用原生的js和css \ No newline at end of file +Shortcodes on Zzz记忆https://zfunnily.github.io/tags/shortcodes/Recent content in Shortcodes on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000Blog | 代码显示/隐藏https://zfunnily.github.io/2021/12/shortcodes/Wed, 29 Dec 2021 13:50:28 +0800https://zfunnily.github.io/2021/12/shortcodes/缘由 最近在写技术博客时,引入的代码太多,影响观感。 在尽力减少代码量,还是有些不可或缺的代码,代码量很惊人,已经占满整个屏幕. 因为个人博客是使用hugo生成的静态博客,我刚开始想的使用原生的js和css \ No newline at end of file diff --git a/tags/skynet/index.xml b/tags/skynet/index.xml index 4e4a75173..78537238a 100644 --- a/tags/skynet/index.xml +++ b/tags/skynet/index.xml @@ -1 +1 @@ -Skynet on Zzz记忆https://zfunnily.github.io/tags/skynet/Recent content in Skynet on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000层级时间轮 | skynet 定时器https://zfunnily.github.io/2022/03/timerskynet/Sun, 27 Mar 2022 12:39:12 +0800https://zfunnily.github.io/2022/03/timerskynet/skynet定时器 要解析一个程序代码,先了解数据结构,这是基础,再看函数。 拿skynet定时器举例子。 数据结构 //定时器事件 用于抛出定时器事件到消息队列里。理解这个数据结构需要先了解skynet的框架层级时间轮 | skynet 定时器https://zfunnily.github.io/2022/03/timerskynet/Sun, 27 Mar 2022 12:39:12 +0800https://zfunnily.github.io/2022/03/timerskynet/skynet定时器 要解析一个程序代码,先了解数据结构,这是基础,再看函数。 拿skynet定时器举例子。 数据结构 //定时器事件 用于抛出定时器事件到消息队列里。理解这个数据结构需要先了解skynet的框架Skynet源码赏析四 | 消息调度https://zfunnily.github.io/2021/10/four/Thu, 21 Oct 2021 10:06:39 +0800https://zfunnily.github.io/2021/10/four/服务间消息流转 发送消息 数据结构message_queue *q是次级消息队列,每个服务都有与之绑定的唯一一个次级消息队列。当我们在lua层,调用skynet.send(...), 或者调用skynet.cSkynet源码赏析三 | 服务启动https://zfunnily.github.io/2021/10/skynetthree/Wed, 20 Oct 2021 11:26:07 +0800https://zfunnily.github.io/2021/10/skynetthree/skynet启动一个C服务 查看怎么启动C服务的最好的办法是打断点,看源码。 启动logger日志服务 我拿日志服务来举例子,怎么启动日志服务的呢? 传参数name = &quot;logger&quot;, param = null, struct skynet_context *ctx = skynet_context_new(config-&gt;logservice, config-&gt;logger);; 从moduleSkynet源码赏析二 | 基础数据结构https://zfunnily.github.io/2021/10/skynettwo/Tue, 19 Oct 2021 18:47:45 +0800https://zfunnily.github.io/2021/10/skynettwo/module管理模块 我们所写的C服务编译成.so文件后放在cpath变量路径下,程序会加载路径cpath = root..&quot;cservice/?.so&quot;下的.so文件,通过staticSkynet源码赏析一 | 启动初始化的过程https://zfunnily.github.io/2021/10/skynetone/Tue, 19 Oct 2021 17:28:45 +0800https://zfunnily.github.io/2021/10/skynetone/入口文件 skynet_main.c 加载配置 struct skynet_config config; config.thread = optint(&#34;thread&#34;,8); config.module_path = optstring(&#34;cpath&#34;,&#34;./cservice/?.so&#34;); config.harbor = optint(&#34;harbor&#34;, 1); config.bootstrap = optstring(&#34;bootstrap&#34;,&#34;snlua bootstrap&#34;); config.daemon = optstring(&#34;daemon&#34;, NULL); config.logger = optstring(&#34;logger&#34;, NULL); config.logservice = optstring(&#34;logservice&#34;, &#34;logger&#34;); config.profile = optboolean(&#34;profile&#34;, 1); 从上述代码可以看到,配置都已经加载到变量struct skynet_config config;中了。 初始化 初始化skynet_context管Skynet | lua-protobufhttps://zfunnily.github.io/2021/01/skynetprotobuf/Mon, 25 Jan 2021 14:25:07 +0000https://zfunnily.github.io/2021/01/skynetprotobuf/概述 在最新的skynet中我使用的是云风的pbc库来解析protobuf,该项目中的一个文件protobuf.lua 使用了module语法在lua5.1版本中已经删除,最新的skynet是lua5.4 \ No newline at end of file +Skynet on Zzz记忆https://zfunnily.github.io/tags/skynet/Recent content in Skynet on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000层级时间轮 | skynet 定时器https://zfunnily.github.io/2022/03/timerskynet/Sun, 27 Mar 2022 12:39:12 +0800https://zfunnily.github.io/2022/03/timerskynet/skynet定时器 要解析一个程序代码,先了解数据结构,这是基础,再看函数。 拿skynet定时器举例子。 数据结构 //定时器事件 用于抛出定时器事件到消息队列里。理解这个数据结构需要先了解skynet的框架层级时间轮 | skynet 定时器https://zfunnily.github.io/2022/03/timerskynet/Sun, 27 Mar 2022 12:39:12 +0800https://zfunnily.github.io/2022/03/timerskynet/skynet定时器 要解析一个程序代码,先了解数据结构,这是基础,再看函数。 拿skynet定时器举例子。 数据结构 //定时器事件 用于抛出定时器事件到消息队列里。理解这个数据结构需要先了解skynet的框架Skynet源码赏析四 | 消息调度https://zfunnily.github.io/2021/10/four/Thu, 21 Oct 2021 10:06:39 +0800https://zfunnily.github.io/2021/10/four/服务间消息流转 发送消息 数据结构message_queue *q是次级消息队列,每个服务都有与之绑定的唯一一个次级消息队列。当我们在lua层,调用skynet.send(...), 或者调用skynet.cSkynet源码赏析三 | 服务启动https://zfunnily.github.io/2021/10/skynetthree/Wed, 20 Oct 2021 11:26:07 +0800https://zfunnily.github.io/2021/10/skynetthree/skynet启动一个C服务 查看怎么启动C服务的最好的办法是打断点,看源码。 启动logger日志服务 我拿日志服务来举例子,怎么启动日志服务的呢? 传参数name = &quot;logger&quot;, param = null, struct skynet_context *ctx = skynet_context_new(config-&gt;logservice, config-&gt;logger);; 从moduleSkynet源码赏析二 | 基础数据结构https://zfunnily.github.io/2021/10/skynettwo/Tue, 19 Oct 2021 18:47:45 +0800https://zfunnily.github.io/2021/10/skynettwo/module管理模块 我们所写的C服务编译成.so文件后放在cpath变量路径下,程序会加载路径cpath = root..&quot;cservice/?.so&quot;下的.so文件,通过staticSkynet源码赏析一 | 启动初始化的过程https://zfunnily.github.io/2021/10/skynetone/Tue, 19 Oct 2021 17:28:45 +0800https://zfunnily.github.io/2021/10/skynetone/入口文件 skynet_main.c 加载配置 struct skynet_config config; config.thread = optint(&#34;thread&#34;,8); config.module_path = optstring(&#34;cpath&#34;,&#34;./cservice/?.so&#34;); config.harbor = optint(&#34;harbor&#34;, 1); config.bootstrap = optstring(&#34;bootstrap&#34;,&#34;snlua bootstrap&#34;); config.daemon = optstring(&#34;daemon&#34;, NULL); config.logger = optstring(&#34;logger&#34;, NULL); config.logservice = optstring(&#34;logservice&#34;, &#34;logger&#34;); config.profile = optboolean(&#34;profile&#34;, 1); 从上述代码可以看到,配置都已经加载到变量struct skynet_config config;中了。 初始化 初始化skynet_context管Skynet | lua-protobufhttps://zfunnily.github.io/2021/01/skynetprotobuf/Mon, 25 Jan 2021 14:25:07 +0000https://zfunnily.github.io/2021/01/skynetprotobuf/概述 在最新的skynet中我使用的是云风的pbc库来解析protobuf,该项目中的一个文件protobuf.lua 使用了module语法在lua5.1版本中已经删除,最新的skynet是lua5.4 \ No newline at end of file diff --git a/tags/vim/index.xml b/tags/vim/index.xml index 75d2746ad..84f3fdef7 100644 --- a/tags/vim/index.xml +++ b/tags/vim/index.xml @@ -1 +1 @@ -Vim on Zzz记忆https://zfunnily.github.io/tags/vim/Recent content in Vim on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000Vim | 切换模式/输入法https://zfunnily.github.io/2021/09/vimchange/Tue, 07 Sep 2021 10:46:58 +0800https://zfunnily.github.io/2021/09/vimchange/vim 在退出输入模式的时候切换为原来的输入法 在敲代码的时候使用我们使用的英文,当遇到问题,我们需要搜索引擎的时候需要中文输入法,这个时候,自动切换输入法可以帮助我们节省手动切换输入法的时间。 跟编辑器结合,Vim | vimplus快捷键https://zfunnily.github.io/2020/10/vimplus%E5%BF%AB%E6%8D%B7%E9%94%AE/Wed, 28 Oct 2020 09:14:28 +0000https://zfunnily.github.io/2020/10/vimplus%E5%BF%AB%E6%8D%B7%E9%94%AE/插件相关 |快捷键|说明 |&mdash;&mdash; |,|Leader Key |&lt;leader&gt;n|打开 / 关闭代码资源管理器 |&lt;leader&gt;t|打开 / 关闭函数列表 |&lt;leader&gt;a|.h .cpp 文件切换 |&lt;leader&gt;u|转到函数声明 |&Vim | 打造编C++IDEhttps://zfunnily.github.io/2020/10/%E4%BD%BF%E7%94%A8vim%E6%89%93%E9%80%A0%E7%BC%96C-IDE/Wed, 28 Oct 2020 09:11:32 +0000https://zfunnily.github.io/2020/10/%E4%BD%BF%E7%94%A8vim%E6%89%93%E9%80%A0%E7%BC%96C-IDE/使用 vimplus 打造C++ IDE GitHub: https://github.com/chxuan/vimplus 支持平台: macos/linux 安装vimplus // 原来的链接, 国内速度较慢 $ git clone https://github.com/chxuan/vimplus.git ~/.vimplus // github修改为镜像的链接 $ git clone --depth=1 https://github.com.cnpmjs.org/chxuan/vimplus.git ~/.vimplus $ cd ~/.vimplus //不加sudo $ ./install.sh 设置Nerd Font 为防止vimplu \ No newline at end of file +Vim on Zzz记忆https://zfunnily.github.io/tags/vim/Recent content in Vim on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000Vim | 切换模式/输入法https://zfunnily.github.io/2021/09/vimchange/Tue, 07 Sep 2021 10:46:58 +0800https://zfunnily.github.io/2021/09/vimchange/vim 在退出输入模式的时候切换为原来的输入法 在敲代码的时候使用我们使用的英文,当遇到问题,我们需要搜索引擎的时候需要中文输入法,这个时候,自动切换输入法可以帮助我们节省手动切换输入法的时间。 跟编辑器结合,Vim | vimplus快捷键https://zfunnily.github.io/2020/10/vimplus%E5%BF%AB%E6%8D%B7%E9%94%AE/Wed, 28 Oct 2020 09:14:28 +0000https://zfunnily.github.io/2020/10/vimplus%E5%BF%AB%E6%8D%B7%E9%94%AE/插件相关 |快捷键|说明 |&mdash;&mdash; |,|Leader Key |&lt;leader&gt;n|打开 / 关闭代码资源管理器 |&lt;leader&gt;t|打开 / 关闭函数列表 |&lt;leader&gt;a|.h .cpp 文件切换 |&lt;leader&gt;u|转到函数声明 |&Vim | 打造编C++IDEhttps://zfunnily.github.io/2020/10/%E4%BD%BF%E7%94%A8vim%E6%89%93%E9%80%A0%E7%BC%96C-IDE/Wed, 28 Oct 2020 09:11:32 +0000https://zfunnily.github.io/2020/10/%E4%BD%BF%E7%94%A8vim%E6%89%93%E9%80%A0%E7%BC%96C-IDE/使用 vimplus 打造C++ IDE GitHub: https://github.com/chxuan/vimplus 支持平台: macos/linux 安装vimplus // 原来的链接, 国内速度较慢 $ git clone https://github.com/chxuan/vimplus.git ~/.vimplus // github修改为镜像的链接 $ git clone --depth=1 https://github.com.cnpmjs.org/chxuan/vimplus.git ~/.vimplus $ cd ~/.vimplus //不加sudo $ ./install.sh 设置Nerd Font 为防止vimplu \ No newline at end of file diff --git a/tags/weekly/index.xml b/tags/weekly/index.xml index c484d2c9c..a76cfb276 100644 --- a/tags/weekly/index.xml +++ b/tags/weekly/index.xml @@ -1 +1 @@ -Weekly on Zzz记忆https://zfunnily.github.io/tags/weekly/Recent content in Weekly on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000老纪https://zfunnily.github.io/thinking/2022/03/weekly01/Mon, 07 Mar 2022 21:36:05 +0800https://zfunnily.github.io/thinking/2022/03/weekly01/周末看了《铁齿铜牙纪晓岚》,对这样经典的剧,百看不厌。 这个剧我来来回回看了很多遍了,剧集内容越来越熟悉,但是对里面的人物却又有不一样的理解。 以前觉得纪晓岚清官,好人。和珅贪官,坏人。 现在看到了那一集和 \ No newline at end of file +Weekly on Zzz记忆https://zfunnily.github.io/tags/weekly/Recent content in Weekly on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000老纪https://zfunnily.github.io/thinking/2022/03/weekly01/Mon, 07 Mar 2022 21:36:05 +0800https://zfunnily.github.io/thinking/2022/03/weekly01/周末看了《铁齿铜牙纪晓岚》,对这样经典的剧,百看不厌。 这个剧我来来回回看了很多遍了,剧集内容越来越熟悉,但是对里面的人物却又有不一样的理解。 以前觉得纪晓岚清官,好人。和珅贪官,坏人。 现在看到了那一集和 \ No newline at end of file diff --git a/tags/year/index.xml b/tags/year/index.xml index f7c7c5b7f..584da5f13 100644 --- a/tags/year/index.xml +++ b/tags/year/index.xml @@ -1 +1 @@ -Year on Zzz记忆https://zfunnily.github.io/tags/year/Recent content in Year on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +00002021焦虑总结https://zfunnily.github.io/thinking/2022/03/summarize/Fri, 04 Mar 2022 11:03:20 +0800https://zfunnily.github.io/thinking/2022/03/summarize/2021 已经22年3月份了,这份总结才出来,我这是拖延症晚期了。 去年一年总的来说不错, 但还是有些计划性的东西没做 我结婚了,24岁 我转行做游戏了 买车了 读了3本书 健身 无 时间太快,从我19年开始记笔记开始,已经过 \ No newline at end of file +Year on Zzz记忆https://zfunnily.github.io/tags/year/Recent content in Year on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +00002021焦虑总结https://zfunnily.github.io/thinking/2022/03/summarize/Fri, 04 Mar 2022 11:03:20 +0800https://zfunnily.github.io/thinking/2022/03/summarize/2021 已经22年3月份了,这份总结才出来,我这是拖延症晚期了。 去年一年总的来说不错, 但还是有些计划性的东西没做 我结婚了,24岁 我转行做游戏了 买车了 读了3本书 健身 无 时间太快,从我19年开始记笔记开始,已经过 \ No newline at end of file diff --git "a/tags/\345\255\246\344\271\240\347\254\224\350\256\260/index.xml" "b/tags/\345\255\246\344\271\240\347\254\224\350\256\260/index.xml" index 58cb95cef..5e050fe95 100644 --- "a/tags/\345\255\246\344\271\240\347\254\224\350\256\260/index.xml" +++ "b/tags/\345\255\246\344\271\240\347\254\224\350\256\260/index.xml" @@ -1 +1 @@ -学习笔记 on Zzz记忆https://zfunnily.github.io/tags/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/Recent content in 学习笔记 on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000ChatGLM & LangChainhttps://zfunnily.github.io/2023/11/chatglm/Fri, 10 Nov 2023 11:21:34 +0800https://zfunnily.github.io/2023/11/chatglm/参考: 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 DockerDDNS配置https://zfunnily.github.io/2023/10/DDNS/Mon, 30 Oct 2023 11:21:34 +0800https://zfunnily.github.io/2023/10/DDNS/参考: https://www.sakamoto.blog/synology-nas-cloudflare-ddns/ Cloudflare 获取 区域 ID 创建 API 令牌 群晖设置 开启并登陆群晖NAS终端 下载 Cloudflare DDNS 脚本 下载 Cloudflare 的 DDNS 脚本文件,官方推荐存放于/sbin/cloudflareddns.sh并赋予执行权限. # 下载脚本 $ wget https://raw.githubusercontent.com/joshuaavalon/SynologyCloudflareDDNS/master/cloudflareddns.sh -O /sbin/cloudflareddns.sh # 赋予执行粒子系统01-概述https://zfunnily.github.io/2023/05/particlesystem01/Wed, 24 May 2023 11:21:34 +0800https://zfunnily.github.io/2023/05/particlesystem01/参考视频 参考播客 一、两种解决方案 区别 Particle System(内置粒子系统) Visual Effect Graph(VFX Graph) 基于XX运行 CPU GPU 粒子数量 数千 数百万 渲染管线 支持全部渲染管线 不支持内置渲染管线 物理系统 可与Unity物理系统交互 特定元素交互 创作 \ No newline at end of file +学习笔记 on Zzz记忆https://zfunnily.github.io/tags/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/Recent content in 学习笔记 on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000ChatGLM & LangChainhttps://zfunnily.github.io/2023/11/chatglm/Fri, 10 Nov 2023 11:21:34 +0800https://zfunnily.github.io/2023/11/chatglm/参考: 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 DockerDDNS配置https://zfunnily.github.io/2023/10/DDNS/Mon, 30 Oct 2023 11:21:34 +0800https://zfunnily.github.io/2023/10/DDNS/参考: https://www.sakamoto.blog/synology-nas-cloudflare-ddns/ Cloudflare 获取 区域 ID 创建 API 令牌 群晖设置 开启并登陆群晖NAS终端 下载 Cloudflare DDNS 脚本 下载 Cloudflare 的 DDNS 脚本文件,官方推荐存放于/sbin/cloudflareddns.sh并赋予执行权限. # 下载脚本 $ wget https://raw.githubusercontent.com/joshuaavalon/SynologyCloudflareDDNS/master/cloudflareddns.sh -O /sbin/cloudflareddns.sh # 赋予执行粒子系统01-概述https://zfunnily.github.io/2023/05/particlesystem01/Wed, 24 May 2023 11:21:34 +0800https://zfunnily.github.io/2023/05/particlesystem01/参考视频 参考播客 一、两种解决方案 区别 Particle System(内置粒子系统) Visual Effect Graph(VFX Graph) 基于XX运行 CPU GPU 粒子数量 数千 数百万 渲染管线 支持全部渲染管线 不支持内置渲染管线 物理系统 可与Unity物理系统交互 特定元素交互 创作 \ No newline at end of file diff --git "a/tags/\345\256\232\346\227\266\345\231\250/index.xml" "b/tags/\345\256\232\346\227\266\345\231\250/index.xml" index 8cfe7ac03..f04ca2e63 100644 --- "a/tags/\345\256\232\346\227\266\345\231\250/index.xml" +++ "b/tags/\345\256\232\346\227\266\345\231\250/index.xml" @@ -1 +1 @@ -定时器 on Zzz记忆https://zfunnily.github.io/tags/%E5%AE%9A%E6%97%B6%E5%99%A8/Recent content in 定时器 on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000层级时间轮 | skynet 定时器https://zfunnily.github.io/2022/03/timerskynet/Sun, 27 Mar 2022 12:39:12 +0800https://zfunnily.github.io/2022/03/timerskynet/skynet定时器 要解析一个程序代码,先了解数据结构,这是基础,再看函数。 拿skynet定时器举例子。 数据结构 //定时器事件 用于抛出定时器事件到消息队列里。理解这个数据结构需要先了解skynet的框架层级时间轮 | skynet 定时器https://zfunnily.github.io/2022/03/timerskynet/Sun, 27 Mar 2022 12:39:12 +0800https://zfunnily.github.io/2022/03/timerskynet/skynet定时器 要解析一个程序代码,先了解数据结构,这是基础,再看函数。 拿skynet定时器举例子。 数据结构 //定时器事件 用于抛出定时器事件到消息队列里。理解这个数据结构需要先了解skynet的框架利用时间轮实现定时器https://zfunnily.github.io/2022/03/timer/Thu, 10 Mar 2022 14:38:23 +0800https://zfunnily.github.io/2022/03/timer/理解定时器 适用场景 定时任务(每隔1s钟打印一次数据) 超时控制(xx分钟没有动作就断开连接) 频率限制(最快只能每5s调用一次API) 定时器常用的数据结构有如下几种: 链表 双向有序链表 最小堆 时间轮 层级时间轮利用时间轮实现定时器https://zfunnily.github.io/2022/03/timer/Thu, 10 Mar 2022 14:38:23 +0800https://zfunnily.github.io/2022/03/timer/理解定时器 适用场景 定时任务(每隔1s钟打印一次数据) 超时控制(xx分钟没有动作就断开连接) 频率限制(最快只能每5s调用一次API) 定时器常用的数据结构有如下几种: 链表 双向有序链表 最小堆 时间轮 层级时间轮 \ No newline at end of file +定时器 on Zzz记忆https://zfunnily.github.io/tags/%E5%AE%9A%E6%97%B6%E5%99%A8/Recent content in 定时器 on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000层级时间轮 | skynet 定时器https://zfunnily.github.io/2022/03/timerskynet/Sun, 27 Mar 2022 12:39:12 +0800https://zfunnily.github.io/2022/03/timerskynet/skynet定时器 要解析一个程序代码,先了解数据结构,这是基础,再看函数。 拿skynet定时器举例子。 数据结构 //定时器事件 用于抛出定时器事件到消息队列里。理解这个数据结构需要先了解skynet的框架层级时间轮 | skynet 定时器https://zfunnily.github.io/2022/03/timerskynet/Sun, 27 Mar 2022 12:39:12 +0800https://zfunnily.github.io/2022/03/timerskynet/skynet定时器 要解析一个程序代码,先了解数据结构,这是基础,再看函数。 拿skynet定时器举例子。 数据结构 //定时器事件 用于抛出定时器事件到消息队列里。理解这个数据结构需要先了解skynet的框架利用时间轮实现定时器https://zfunnily.github.io/2022/03/timer/Thu, 10 Mar 2022 14:38:23 +0800https://zfunnily.github.io/2022/03/timer/理解定时器 适用场景 定时任务(每隔1s钟打印一次数据) 超时控制(xx分钟没有动作就断开连接) 频率限制(最快只能每5s调用一次API) 定时器常用的数据结构有如下几种: 链表 双向有序链表 最小堆 时间轮 层级时间轮利用时间轮实现定时器https://zfunnily.github.io/2022/03/timer/Thu, 10 Mar 2022 14:38:23 +0800https://zfunnily.github.io/2022/03/timer/理解定时器 适用场景 定时任务(每隔1s钟打印一次数据) 超时控制(xx分钟没有动作就断开连接) 频率限制(最快只能每5s调用一次API) 定时器常用的数据结构有如下几种: 链表 双向有序链表 最小堆 时间轮 层级时间轮 \ No newline at end of file diff --git "a/tags/\346\212\275\345\215\241/index.xml" "b/tags/\346\212\275\345\215\241/index.xml" index f385dc4fc..0b536b47a 100644 --- "a/tags/\346\212\275\345\215\241/index.xml" +++ "b/tags/\346\212\275\345\215\241/index.xml" @@ -1 +1 @@ -抽卡 on Zzz记忆https://zfunnily.github.io/tags/%E6%8A%BD%E5%8D%A1/Recent content in 抽卡 on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000抽卡逻辑自述https://zfunnily.github.io/2022/03/afk/Wed, 30 Mar 2022 10:50:11 +0800https://zfunnily.github.io/2022/03/afk/抽卡逻辑自述 参考《剑与远征》 卡牌颜色以及合成 颜色 合成 绿色 可分解,得到粉尘和银瓜子, 最基础的卡 蓝 蓝+ 同样的三张蓝色可合成一张蓝+ 紫 同种族的三张蓝+可以合成一张紫(可以选择合成其中蓝+的某个紫色) 紫+ 同英抽卡逻辑自述https://zfunnily.github.io/2022/03/afk/Wed, 30 Mar 2022 10:50:11 +0800https://zfunnily.github.io/2022/03/afk/抽卡逻辑自述 参考《剑与远征》 卡牌颜色以及合成 颜色 合成 绿色 可分解,得到粉尘和银瓜子, 最基础的卡 蓝 蓝+ 同样的三张蓝色可合成一张蓝+ 紫 同种族的三张蓝+可以合成一张紫(可以选择合成其中蓝+的某个紫色) 紫+ 同英 \ No newline at end of file +抽卡 on Zzz记忆https://zfunnily.github.io/tags/%E6%8A%BD%E5%8D%A1/Recent content in 抽卡 on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000抽卡逻辑自述https://zfunnily.github.io/2022/03/afk/Wed, 30 Mar 2022 10:50:11 +0800https://zfunnily.github.io/2022/03/afk/抽卡逻辑自述 参考《剑与远征》 卡牌颜色以及合成 颜色 合成 绿色 可分解,得到粉尘和银瓜子, 最基础的卡 蓝 蓝+ 同样的三张蓝色可合成一张蓝+ 紫 同种族的三张蓝+可以合成一张紫(可以选择合成其中蓝+的某个紫色) 紫+ 同英抽卡逻辑自述https://zfunnily.github.io/2022/03/afk/Wed, 30 Mar 2022 10:50:11 +0800https://zfunnily.github.io/2022/03/afk/抽卡逻辑自述 参考《剑与远征》 卡牌颜色以及合成 颜色 合成 绿色 可分解,得到粉尘和银瓜子, 最基础的卡 蓝 蓝+ 同样的三张蓝色可合成一张蓝+ 紫 同种族的三张蓝+可以合成一张紫(可以选择合成其中蓝+的某个紫色) 紫+ 同英 \ No newline at end of file diff --git "a/tags/\350\257\273\344\271\246\347\254\224\350\256\260/index.xml" "b/tags/\350\257\273\344\271\246\347\254\224\350\256\260/index.xml" index 701ad439c..823fc347c 100644 --- "a/tags/\350\257\273\344\271\246\347\254\224\350\256\260/index.xml" +++ "b/tags/\350\257\273\344\271\246\347\254\224\350\256\260/index.xml" @@ -1 +1 @@ -读书笔记 on Zzz记忆https://zfunnily.github.io/tags/%E8%AF%BB%E4%B9%A6%E7%AC%94%E8%AE%B0/Recent content in 读书笔记 on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000《Unity Shader入门精要》第八章笔记 | 透明度https://zfunnily.github.io/2022/05/shaderalpha/Sat, 07 May 2022 17:17:18 +0800https://zfunnily.github.io/2022/05/shaderalpha/渲染顺序 名称 队列索引号 描 述 Background 1000 这个渲染队列会在任何其他队列之前被渲染,我们通常使用该队列来渲染那些需要绘制在背景上的物体 Geometry 2000 默认的渲染队列,大多数物体都使用这个队列。不透明物体使用这个队列 AlphaTest 2450 需要透明《Unity Shader入门精要》第八章笔记 | 透明度https://zfunnily.github.io/2022/05/shaderalpha/Sat, 07 May 2022 17:17:18 +0800https://zfunnily.github.io/2022/05/shaderalpha/渲染顺序 名称 队列索引号 描 述 Background 1000 这个渲染队列会在任何其他队列之前被渲染,我们通常使用该队列来渲染那些需要绘制在背景上的物体 Geometry 2000 默认的渲染队列,大多数物体都使用这个队列。不透明物体使用这个队列 AlphaTest 2450 需要透明《Unity Shader入门精要》第六章笔记 | 基础光照https://zfunnily.github.io/2022/05/shaderlighting/Sat, 07 May 2022 16:22:40 +0800https://zfunnily.github.io/2022/05/shaderlighting/我们是如何看到这个世界的 光源: 在光学里,我们使用辐照度 (irradiance) 来量化光 物体的吸收和散射: 光线由光源发射出来后,就会与一些物体相交 着色: 根据材质属性(如漫反射属性等)、光源信息(如光源方《Unity Shader入门精要》第六章笔记 | 基础光照https://zfunnily.github.io/2022/05/shaderlighting/Sat, 07 May 2022 16:22:40 +0800https://zfunnily.github.io/2022/05/shaderlighting/我们是如何看到这个世界的 光源: 在光学里,我们使用辐照度 (irradiance) 来量化光 物体的吸收和散射: 光线由光源发射出来后,就会与一些物体相交 着色: 根据材质属性(如漫反射属性等)、光源信息(如光源方《Unity Shader入门精要》第五章笔记 | 开始shader练习https://zfunnily.github.io/2022/05/shaderbase/Sat, 07 May 2022 10:22:33 +0800https://zfunnily.github.io/2022/05/shaderbase/一个简单的顶点/片元着色器 代码 Shader &#34;Unity Shaders Book/Chapter 5/Simple Shader&#34; { Properties { // 声明一个Color类型的属性 _Color (&#34;Color Tint&#34;, Color) = (1.0,1.0,1.0,1.0) } SubShader { Pass { CGPROGRAM #pragma vertex vert #pragma fragment frag // 在Cg代码中,我们需要定义一个与属性名称和类型都匹配的变量 fixed4 _Color; // 使用一个结构体来定义《Unity Shader入门精要》第五章笔记 | 开始shader练习https://zfunnily.github.io/2022/05/shaderbase/Sat, 07 May 2022 10:22:33 +0800https://zfunnily.github.io/2022/05/shaderbase/一个简单的顶点/片元着色器 代码 Shader &#34;Unity Shaders Book/Chapter 5/Simple Shader&#34; { Properties { // 声明一个Color类型的属性 _Color (&#34;Color Tint&#34;, Color) = (1.0,1.0,1.0,1.0) } SubShader { Pass { CGPROGRAM #pragma vertex vert #pragma fragment frag // 在Cg代码中,我们需要定义一个与属性名称和类型都匹配的变量 fixed4 _Color; // 使用一个结构体来定义《Unity Shader入门精要》第四章笔记 | 学习Shader所需的数学基础https://zfunnily.github.io/2022/04/shadermathematic/Sun, 10 Apr 2022 15:42:33 +0800https://zfunnily.github.io/2022/04/shadermathematic/概述 在学习Shader的过程中,我们最常使用的就是矢量和矩阵(即数学的分支之一——线性代数)。 笛卡儿坐标系 我们使用数学绝大部分都是为了计算位置、距离和角度等变量。而这些计算大部分都是在笛卡儿坐标系 (C《Unity Shader入门精要》第四章笔记 | 学习Shader所需的数学基础https://zfunnily.github.io/2022/04/shadermathematic/Sun, 10 Apr 2022 15:42:33 +0800https://zfunnily.github.io/2022/04/shadermathematic/概述 在学习Shader的过程中,我们最常使用的就是矢量和矩阵(即数学的分支之一——线性代数)。 笛卡儿坐标系 我们使用数学绝大部分都是为了计算位置、距离和角度等变量。而这些计算大部分都是在笛卡儿坐标系 (C《Unity Shader入门精要》第三章笔记| UnityShader基础https://zfunnily.github.io/2022/04/shaderbase/Sun, 10 Apr 2022 14:51:19 +0800https://zfunnily.github.io/2022/04/shaderbase/材质 在Unity中我们需要配合使用材质 (Material) 和Unity Shader才能达到需要的效果。一个最常见的流程是 创建一个材质;活着导入一个材质 创建一个Unity Shader,并把它赋给上一步中《Unity Shader入门精要》第三章笔记| UnityShader基础https://zfunnily.github.io/2022/04/shaderbase/Sun, 10 Apr 2022 14:51:19 +0800https://zfunnily.github.io/2022/04/shaderbase/材质 在Unity中我们需要配合使用材质 (Material) 和Unity Shader才能达到需要的效果。一个最常见的流程是 创建一个材质;活着导入一个材质 创建一个Unity Shader,并把它赋给上一步中《Unity Shader入门精要》第二章笔记 | 渲染流水线https://zfunnily.github.io/2022/04/shaderrenderpipline/Sat, 09 Apr 2022 11:55:55 +0800https://zfunnily.github.io/2022/04/shaderrenderpipline/渲染流水线 Render-Time Rendering, Third Edition》一书中将一个渲染流程分成3个阶段:应用阶段(Application Stage) 、几何阶段(Geometry Stage) 、光栅化阶段(Rasterizer Stage) 。 应《Unity Shader入门精要》第二章笔记 | 渲染流水线https://zfunnily.github.io/2022/04/shaderrenderpipline/Sat, 09 Apr 2022 11:55:55 +0800https://zfunnily.github.io/2022/04/shaderrenderpipline/渲染流水线 Render-Time Rendering, Third Edition》一书中将一个渲染流程分成3个阶段:应用阶段(Application Stage) 、几何阶段(Geometry Stage) 、光栅化阶段(Rasterizer Stage) 。 应 \ No newline at end of file +读书笔记 on Zzz记忆https://zfunnily.github.io/tags/%E8%AF%BB%E4%B9%A6%E7%AC%94%E8%AE%B0/Recent content in 读书笔记 on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000《Unity Shader入门精要》第八章笔记 | 透明度https://zfunnily.github.io/2022/05/shaderalpha/Sat, 07 May 2022 17:17:18 +0800https://zfunnily.github.io/2022/05/shaderalpha/渲染顺序 名称 队列索引号 描 述 Background 1000 这个渲染队列会在任何其他队列之前被渲染,我们通常使用该队列来渲染那些需要绘制在背景上的物体 Geometry 2000 默认的渲染队列,大多数物体都使用这个队列。不透明物体使用这个队列 AlphaTest 2450 需要透明《Unity Shader入门精要》第八章笔记 | 透明度https://zfunnily.github.io/2022/05/shaderalpha/Sat, 07 May 2022 17:17:18 +0800https://zfunnily.github.io/2022/05/shaderalpha/渲染顺序 名称 队列索引号 描 述 Background 1000 这个渲染队列会在任何其他队列之前被渲染,我们通常使用该队列来渲染那些需要绘制在背景上的物体 Geometry 2000 默认的渲染队列,大多数物体都使用这个队列。不透明物体使用这个队列 AlphaTest 2450 需要透明《Unity Shader入门精要》第六章笔记 | 基础光照https://zfunnily.github.io/2022/05/shaderlighting/Sat, 07 May 2022 16:22:40 +0800https://zfunnily.github.io/2022/05/shaderlighting/我们是如何看到这个世界的 光源: 在光学里,我们使用辐照度 (irradiance) 来量化光 物体的吸收和散射: 光线由光源发射出来后,就会与一些物体相交 着色: 根据材质属性(如漫反射属性等)、光源信息(如光源方《Unity Shader入门精要》第六章笔记 | 基础光照https://zfunnily.github.io/2022/05/shaderlighting/Sat, 07 May 2022 16:22:40 +0800https://zfunnily.github.io/2022/05/shaderlighting/我们是如何看到这个世界的 光源: 在光学里,我们使用辐照度 (irradiance) 来量化光 物体的吸收和散射: 光线由光源发射出来后,就会与一些物体相交 着色: 根据材质属性(如漫反射属性等)、光源信息(如光源方《Unity Shader入门精要》第五章笔记 | 开始shader练习https://zfunnily.github.io/2022/05/shaderbase/Sat, 07 May 2022 10:22:33 +0800https://zfunnily.github.io/2022/05/shaderbase/一个简单的顶点/片元着色器 代码 Shader &#34;Unity Shaders Book/Chapter 5/Simple Shader&#34; { Properties { // 声明一个Color类型的属性 _Color (&#34;Color Tint&#34;, Color) = (1.0,1.0,1.0,1.0) } SubShader { Pass { CGPROGRAM #pragma vertex vert #pragma fragment frag // 在Cg代码中,我们需要定义一个与属性名称和类型都匹配的变量 fixed4 _Color; // 使用一个结构体来定义《Unity Shader入门精要》第五章笔记 | 开始shader练习https://zfunnily.github.io/2022/05/shaderbase/Sat, 07 May 2022 10:22:33 +0800https://zfunnily.github.io/2022/05/shaderbase/一个简单的顶点/片元着色器 代码 Shader &#34;Unity Shaders Book/Chapter 5/Simple Shader&#34; { Properties { // 声明一个Color类型的属性 _Color (&#34;Color Tint&#34;, Color) = (1.0,1.0,1.0,1.0) } SubShader { Pass { CGPROGRAM #pragma vertex vert #pragma fragment frag // 在Cg代码中,我们需要定义一个与属性名称和类型都匹配的变量 fixed4 _Color; // 使用一个结构体来定义《Unity Shader入门精要》第四章笔记 | 学习Shader所需的数学基础https://zfunnily.github.io/2022/04/shadermathematic/Sun, 10 Apr 2022 15:42:33 +0800https://zfunnily.github.io/2022/04/shadermathematic/概述 在学习Shader的过程中,我们最常使用的就是矢量和矩阵(即数学的分支之一——线性代数)。 笛卡儿坐标系 我们使用数学绝大部分都是为了计算位置、距离和角度等变量。而这些计算大部分都是在笛卡儿坐标系 (C《Unity Shader入门精要》第四章笔记 | 学习Shader所需的数学基础https://zfunnily.github.io/2022/04/shadermathematic/Sun, 10 Apr 2022 15:42:33 +0800https://zfunnily.github.io/2022/04/shadermathematic/概述 在学习Shader的过程中,我们最常使用的就是矢量和矩阵(即数学的分支之一——线性代数)。 笛卡儿坐标系 我们使用数学绝大部分都是为了计算位置、距离和角度等变量。而这些计算大部分都是在笛卡儿坐标系 (C《Unity Shader入门精要》第三章笔记| UnityShader基础https://zfunnily.github.io/2022/04/shaderbase/Sun, 10 Apr 2022 14:51:19 +0800https://zfunnily.github.io/2022/04/shaderbase/材质 在Unity中我们需要配合使用材质 (Material) 和Unity Shader才能达到需要的效果。一个最常见的流程是 创建一个材质;活着导入一个材质 创建一个Unity Shader,并把它赋给上一步中《Unity Shader入门精要》第三章笔记| UnityShader基础https://zfunnily.github.io/2022/04/shaderbase/Sun, 10 Apr 2022 14:51:19 +0800https://zfunnily.github.io/2022/04/shaderbase/材质 在Unity中我们需要配合使用材质 (Material) 和Unity Shader才能达到需要的效果。一个最常见的流程是 创建一个材质;活着导入一个材质 创建一个Unity Shader,并把它赋给上一步中《Unity Shader入门精要》第二章笔记 | 渲染流水线https://zfunnily.github.io/2022/04/shaderrenderpipline/Sat, 09 Apr 2022 11:55:55 +0800https://zfunnily.github.io/2022/04/shaderrenderpipline/渲染流水线 Render-Time Rendering, Third Edition》一书中将一个渲染流程分成3个阶段:应用阶段(Application Stage) 、几何阶段(Geometry Stage) 、光栅化阶段(Rasterizer Stage) 。 应《Unity Shader入门精要》第二章笔记 | 渲染流水线https://zfunnily.github.io/2022/04/shaderrenderpipline/Sat, 09 Apr 2022 11:55:55 +0800https://zfunnily.github.io/2022/04/shaderrenderpipline/渲染流水线 Render-Time Rendering, Third Edition》一书中将一个渲染流程分成3个阶段:应用阶段(Application Stage) 、几何阶段(Geometry Stage) 、光栅化阶段(Rasterizer Stage) 。 应 \ No newline at end of file diff --git "a/tags/\351\225\277\345\256\211\345\215\201\346\227\245/index.xml" "b/tags/\351\225\277\345\256\211\345\215\201\346\227\245/index.xml" index 3cebc7aae..f6e5a77fd 100644 --- "a/tags/\351\225\277\345\256\211\345\215\201\346\227\245/index.xml" +++ "b/tags/\351\225\277\345\256\211\345\215\201\346\227\245/index.xml" @@ -1 +1 @@ -长安十日 on Zzz记忆https://zfunnily.github.io/tags/%E9%95%BF%E5%AE%89%E5%8D%81%E6%97%A5/Recent content in 长安十日 on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000转载|江雪:长安十日https://zfunnily.github.io/thinking/2022/01/jx/Thu, 06 Jan 2022 11:32:56 +0800https://zfunnily.github.io/thinking/2022/01/jx/转载 https://chinadigitaltimes.net/chinese/675386.html(需科学上网) 01/03/2022 文:江雪 小区里的大喇叭又响了起来,一遍遍重复着,喊人们下楼做核酸。队排了很长。测核 \ No newline at end of file +长安十日 on Zzz记忆https://zfunnily.github.io/tags/%E9%95%BF%E5%AE%89%E5%8D%81%E6%97%A5/Recent content in 长安十日 on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000转载|江雪:长安十日https://zfunnily.github.io/thinking/2022/01/jx/Thu, 06 Jan 2022 11:32:56 +0800https://zfunnily.github.io/thinking/2022/01/jx/转载 https://chinadigitaltimes.net/chinese/675386.html(需科学上网) 01/03/2022 文:江雪 小区里的大喇叭又响了起来,一遍遍重复着,喊人们下楼做核酸。队排了很长。测核 \ No newline at end of file diff --git a/thinking/index.xml b/thinking/index.xml index f269df6e2..720e3c5db 100644 --- a/thinking/index.xml +++ b/thinking/index.xml @@ -1 +1 @@ -Thinkings on Zzz记忆https://zfunnily.github.io/thinking/Recent content in Thinkings on Zzz记忆Hugo -- gohugo.iozh-CNSat, 30 Mar 2024 00:58:35 +0000无聊 & 痛苦https://zfunnily.github.io/thinking/2022/03/shuowang/Wed, 09 Mar 2022 12:03:36 +0800https://zfunnily.github.io/thinking/2022/03/shuowang/每天晚上我都睡得很晚,不是不困,而是不想睡,强迫自己不要睡。我似乎得了强迫症,我很忧郁。 因为我总觉得一天什么都没干就这么过去了,实在不甘心!于是我就尽量延长这一天的时间。我真是个有志气的人,我很欣慰。爬楼有感https://zfunnily.github.io/thinking/2022/03/think01/Tue, 08 Mar 2022 21:54:25 +0800https://zfunnily.github.io/thinking/2022/03/think01/28楼 今天放弃了常用乘电梯回家,决定爬楼。28楼真高呀。我还记得上次是和阿芳一起爬的。 那会爬的很轻松,还有功夫教她 &ldquo;核心收紧,抬腿的时候膝盖沿着脚尖方向歪曲&rdquo;。 一个人爬楼让我又老纪https://zfunnily.github.io/thinking/2022/03/weekly01/Mon, 07 Mar 2022 21:36:05 +0800https://zfunnily.github.io/thinking/2022/03/weekly01/周末看了《铁齿铜牙纪晓岚》,对这样经典的剧,百看不厌。 这个剧我来来回回看了很多遍了,剧集内容越来越熟悉,但是对里面的人物却又有不一样的理解。 以前觉得纪晓岚清官,好人。和珅贪官,坏人。 现在看到了那一集和2021焦虑总结https://zfunnily.github.io/thinking/2022/03/summarize/Fri, 04 Mar 2022 11:03:20 +0800https://zfunnily.github.io/thinking/2022/03/summarize/2021 已经22年3月份了,这份总结才出来,我这是拖延症晚期了。 去年一年总的来说不错, 但还是有些计划性的东西没做 我结婚了,24岁 我转行做游戏了 买车了 读了3本书 健身 无 时间太快,从我19年开始记笔记开始,已经过转载|江雪:长安十日https://zfunnily.github.io/thinking/2022/01/jx/Thu, 06 Jan 2022 11:32:56 +0800https://zfunnily.github.io/thinking/2022/01/jx/转载 https://chinadigitaltimes.net/chinese/675386.html(需科学上网) 01/03/2022 文:江雪 小区里的大喇叭又响了起来,一遍遍重复着,喊人们下楼做核酸。队排了很长。测核摘抄 | 我的精神家园https://zfunnily.github.io/thinking/2021/12/pervert/Mon, 27 Dec 2021 21:44:21 +0800https://zfunnily.github.io/thinking/2021/12/pervert/另一种文化 假如有个pervert站出来说:我就是个pervert,那他就不是个pervert。 当且仅当一个人声称:我就不知道pervert是什么时,他才是个pervert。 假如我说,我们这里有种per \ No newline at end of file +Thinkings on Zzz记忆https://zfunnily.github.io/thinking/Recent content in Thinkings on Zzz记忆Hugo -- gohugo.iozh-CNSun, 31 Mar 2024 01:06:17 +0000无聊 & 痛苦https://zfunnily.github.io/thinking/2022/03/shuowang/Wed, 09 Mar 2022 12:03:36 +0800https://zfunnily.github.io/thinking/2022/03/shuowang/每天晚上我都睡得很晚,不是不困,而是不想睡,强迫自己不要睡。我似乎得了强迫症,我很忧郁。 因为我总觉得一天什么都没干就这么过去了,实在不甘心!于是我就尽量延长这一天的时间。我真是个有志气的人,我很欣慰。爬楼有感https://zfunnily.github.io/thinking/2022/03/think01/Tue, 08 Mar 2022 21:54:25 +0800https://zfunnily.github.io/thinking/2022/03/think01/28楼 今天放弃了常用乘电梯回家,决定爬楼。28楼真高呀。我还记得上次是和阿芳一起爬的。 那会爬的很轻松,还有功夫教她 &ldquo;核心收紧,抬腿的时候膝盖沿着脚尖方向歪曲&rdquo;。 一个人爬楼让我又老纪https://zfunnily.github.io/thinking/2022/03/weekly01/Mon, 07 Mar 2022 21:36:05 +0800https://zfunnily.github.io/thinking/2022/03/weekly01/周末看了《铁齿铜牙纪晓岚》,对这样经典的剧,百看不厌。 这个剧我来来回回看了很多遍了,剧集内容越来越熟悉,但是对里面的人物却又有不一样的理解。 以前觉得纪晓岚清官,好人。和珅贪官,坏人。 现在看到了那一集和2021焦虑总结https://zfunnily.github.io/thinking/2022/03/summarize/Fri, 04 Mar 2022 11:03:20 +0800https://zfunnily.github.io/thinking/2022/03/summarize/2021 已经22年3月份了,这份总结才出来,我这是拖延症晚期了。 去年一年总的来说不错, 但还是有些计划性的东西没做 我结婚了,24岁 我转行做游戏了 买车了 读了3本书 健身 无 时间太快,从我19年开始记笔记开始,已经过转载|江雪:长安十日https://zfunnily.github.io/thinking/2022/01/jx/Thu, 06 Jan 2022 11:32:56 +0800https://zfunnily.github.io/thinking/2022/01/jx/转载 https://chinadigitaltimes.net/chinese/675386.html(需科学上网) 01/03/2022 文:江雪 小区里的大喇叭又响了起来,一遍遍重复着,喊人们下楼做核酸。队排了很长。测核摘抄 | 我的精神家园https://zfunnily.github.io/thinking/2021/12/pervert/Mon, 27 Dec 2021 21:44:21 +0800https://zfunnily.github.io/thinking/2021/12/pervert/另一种文化 假如有个pervert站出来说:我就是个pervert,那他就不是个pervert。 当且仅当一个人声称:我就不知道pervert是什么时,他才是个pervert。 假如我说,我们这里有种per \ No newline at end of file