首页
友情链接
关于
Search
1
欢迎使用 Typecho
13,185 阅读
2
Playwright使用记录
3,234 阅读
3
Windows上GCC安装
2,094 阅读
4
Unity独立安装后添加IL2CPP等编译组件
2,048 阅读
5
(Windows)以一种访问权限不允许的方式做了一个访问套接字的尝试处理
1,741 阅读
全部博文
游戏开发
Unity
Godot Engine
GDScript
编程代码
C#编程
GoLang编程
PowerShell
开发工具
Git
笔记备忘
登录
Search
标签搜索
docker
Godot
GCC
CMS
Proto.Actor
Actor模型
winpty
msys2
Unity
IL2CPP
package
golang
ssh
proxy
proxychains
minikube
k8s
n2n
PowerShell
ChatGPT
玖亖伍
累计撰写
29
篇文章
累计收到
216
条评论
首页
栏目
全部博文
游戏开发
Unity
Godot Engine
GDScript
编程代码
C#编程
GoLang编程
PowerShell
开发工具
Git
笔记备忘
页面
友情链接
关于
搜索到
29
篇与
的结果
2023-10-26
自定义 node.js Docker 镜像
Dockerfile:FROM ghcr.io/linuxserver/baseimage-alpine:3.18 SHELL ["/bin/bash", "-c"] RUN echo $'#!/bin/bash \n\ set -e \n\ \n\ # Run command with node if the first argument contains a "-" or is not a system command. The last \n\ # part inside the "{}" is a workaround for the following bug in ash/dash: \n\ # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=874264 \n\ if [ "${1#-}" != "${1}" ] || [ -z "$(command -v "${1}")" ] || { [ -f "${1}" ] && ! [ -x "${1}" ]; }; then \n\ set -- node "$@" \n\ fi \n\ \n\ exec "$@"' > /usr/local/bin/docker-entrypoint.sh RUN chmod a+x /usr/local/bin/docker-entrypoint.sh RUN groups RUN users RUN whoami RUN groupadd --non-unique --gid 1000 node RUN useradd --non-unique --uid 1000 --gid node --shell /bin/bash --create-home node ENV NODE_VERSION 21.1.0 ENV ARCH x64 RUN curl -fsSLO --compressed "https://unofficial-builds.nodejs.org/download/release/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz" RUN ls -lha RUN tar -xJf "node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz" -C /usr/local --strip-components=1 --no-same-owner RUN rm -f "node-v$NODE_VERSION-linux-$ARCH-musl.tar.xz" RUN ln -s /usr/local/bin/node /usr/local/bin/nodejs RUN apk add --no-cache libstdc++ RUN node --version RUN npm --version # RUN wget -qO- https://get.pnpm.io/install.sh | ENV="$HOME/.bashrc" SHELL="$(which bash)" bash - RUN npm config set registry https://registry.npmmirror.com RUN npm install -g pm2 RUN npm install -g pnpm RUN pnpm --version RUN rm -rf /tmp/* $HOME/.cache ENTRYPOINT ["docker-entrypoint.sh"] CMD [ "node" ]build:docker build --progress plain --rm --tag gsw945/node:v0.0.1 .参考安装 | pnpm - 使用 npm 安装https://github.com/nodejs/docker-node/blob/main/21/alpine3.18/Dockerfilehttps://github.com/linuxserver/docker-baseimage-alpine/pkgs/container/baseimage-alpine/137430303?tag=3.18How to write commands with multiple lines in Dockerfile while preserving the new lines?Dockerfile replicate the host user UID and GID to the image
2023年10月26日
26 阅读
0 评论
0 点赞
2023-10-09
有用的几条Git命令
git fsckgit fsck 命令用于检查 Git 数据库内部的完整性,找出问题对象。这3个选项具体用法如下:git fsck --dangling:显示悬空对象(dangling object),即孤立的提交/树/blobs,不被任何其他对象引用。git fsck --unreachable:显示不可达对象(unreachable object),即不可到达的对象,不被任何一个分支或标签引用。git fsck --lost-found:显示遗失的对象(lost found), 位于 .git/lost-found/ 其他 commit 引用了的对象。总结:dangling 对象不被任何对象引用,但仍在数据库中。unreachable 对象不被任何分支或标签引用,可能在重写历史后出现。lost-found 对象被其他 commit 引用,但不在当前分支或标签中。这3个选项可以帮助我们发现和恢复在重写历史时“丢失”的对象,修复问题。git log示例命令: git log --format="hash: %H%nauthor: %an%ndate: %aI%n%n%B"--fromat参数解释:%H - commit hash (hash 值)%an - author name (作者用户名)%aI - author date, ISO 8601 格式 (提交时间)%B - commit message body (提交信息)%n - 换行符实际应用显示不可达的Commit信息git fsck --unreachable | grep commit | cut -d' ' -f3 | xargs -I {} git log --format="hash: %H%nauthor: %an%ndate: %aI%n%n%B" -n 1 {}参考Look up commit log for commit ID in GitHow can I view a git log of just one user's commits?git fsck: how --dangling vs. --unreachable vs. --lost-found differ?How can I find an unreachable commit hash in a GIT repository by keywords?
2023年10月09日
21 阅读
0 评论
0 点赞
2023-03-27
Ubuntu配置clang环境并编译示例程序
操作步骤添加 gpg 秘钥:wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -添加源 vim /etc/apt/sources.list.d/llvm.list# Focal (20.04) LTS deb http://apt.llvm.org/focal/ llvm-toolchain-focal main deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal main更新 apt 包信息: sudo apt update安装 clang、lld 和 libc++:sudo apt install install clang-17 clang-tools-17 clang-17-doc libclang-common-17-dev libclang-17-dev libclang1-17 clang-format-17 python3-clang-17 clangd-17 clang-tidy-17 sudo apt install lld-17 sudo apt install libc++-17-dev libc++abi-17-devLinux 程序编译:clang++ --std=c++17 -o main main.cppWindows 程序(交叉)编译:clang++ --std=c++17 -target x86_64-pc-windows-gnu -mconsole -o main.exe main.cpp示例程序目录结构:. ├── main.cpp └── pocketpy.hmain.cpp内容:#include <iostream> #include "pocketpy.h" using namespace pkpy; using namespace std; int main(int argc, char** argv) { cout << "C++: hello world!" << endl; VM* vm = new VM(true); // Hello world! vm->exec("print('Python: Hello world!')", "main.py", EXEC_MODE); // Create a list vm->exec("a = [1, 2, 3]", "main.py", EXEC_MODE); // Eval the sum of the list PyVar result = vm->exec("sum(a)", "<eval>", EVAL_MODE); std::cout << py_cast<i64>(vm, result) << endl; // 6 pkpy_delete(vm); return 0; }pocketpy.h 来自项目 blueloveTH/pocketpy:PocketPy is a lightweight(~6000 LOC) Python interpreter for game engines.PocketPy是一个轻量级的Python解释器,为嵌入至游戏引擎而设计。参考LLVM Debian/Ubuntu nightly packagesWelcome to PocketPyPocketPy issues | c example #41
2023年03月27日
236 阅读
1 评论
1 点赞
2023-03-14
windows上docker运行nextcloud
端口映射: 58080 --> 80挂载路径: D:\nextcloud-data --> :/var/www/html环境变量:使用的数据库: SQLITE_DATABASE: nextcloud默认管理员账户: NEXTCLOUD_ADMIN_USER: admin默认管理员密码: NEXTCLOUD_ADMIN_PASSWORD: admin完整命令docker run -d -p 58080:80 -v //d/nextcloud-data:/var/www/html -e SQLITE_DATABASE=nextcloud -e NEXTCLOUD_ADMIN_USER=admin -e NEXTCLOUD_ADMIN_PASSWORD=admin nextcloud:production运行成功后,浏览器打开 http://localhost:58080/ 等待一会儿就会看到如下的页面:<!--参考:https://app.pluralsight.com/library/courses/docker-web-development/table-of-contentshttps://hub.docker.com/_/nextcloud-->
2023年03月14日
109 阅读
0 评论
0 点赞
2023-03-10
ChatGPT用Python实现一个一元二次方程求解的程序
我: Python实现一个一元二次方程求解的程序ChatGPT: 以下是 Python 实现一元二次方程求解的程序:import math def solve_quadratic_equation(a, b, c): """Solve the quadratic equation ax^2 + bx + c = 0.""" # 计算判别式 discriminant = b**2 - 4*a*c # 根据判别式的正负性分类讨论 if discriminant > 0: # 有两个实根 x1 = (-b + math.sqrt(discriminant)) / (2*a) x2 = (-b - math.sqrt(discriminant)) / (2*a) return x1, x2 elif discriminant == 0: # 有一个实根 x = -b / (2*a) return x else: # 无实根 return None # 测试 # 现有方程: y^2 + 10*y = 144 a = 1 b = 10 c = -144 print(solve_quadratic_equation(a, b, c)) # 输出 (8.0, -18.0)该程序定义了一个名为 solve_quadratic_equation 的函数,接受三个参数:方程的系数 a、b 和 c。函数根据判别式的正负性分类讨论,给出方程的解。最后,程序测试了方程 y^2 + 10y - 144 = 0 的解,并输出结果 (8.0, -18.0)。以下是运行程序验证的结果:
2023年03月10日
162 阅读
0 评论
0 点赞
2023-03-06
文件检索相关命令行工具
BATA cat(1) clone with wings.特性:语法高亮Git 集成不可打印(non-printable)字符可视化自动分页fzfA command-line fuzzy finderfdA simple, fast and user-friendly alternative to 'find'ripgrep((rg))ripgrep recursively searches directories for a regex pattern while respecting your gitignoreripgrep 常用命令示例:# 查看支持的类型(type)列表 rg --type-list # 添加一个自定义的类型 mmkkdd, 后缀名为 *.md, 排除.git、bin、obj、node_modules文件夹,搜索 babel rg --type-add "mmkkdd:*.md" -g "!**/.git" -g "!**/bin" -g "!**/obj" -g "!**/node_modules" --type mmkkdd -- babel # 添加一个自定义的类型 myscript, 后缀名包含 *.ps1,*.cmd,*.bat, 排除.git、bin、obj、node_modules文件夹,搜索 dotnet rg --type-add "myscript:*.{ps1,cmd,bat}" -g "!**/.git" -g "!**/bin" -g "!**/obj" -g "!**/node_modules" --type myscript -- dotnet注意: 参数用引号包裹时,windows上用双引号 ", 类Unix 上用单引号 '。
2023年03月06日
98 阅读
0 评论
0 点赞
2023-01-18
PowerShell片段
简单片段查找命令(示例: 包含Module的命令)Get-Command | Out-String -Stream | Select-String -Pattern "Module" -SimpleMatch -CaseSensitive查看帮助(示例: 查看命令Get-InstalledModule的帮助)Get-Help -Name Get-InstalledModule在线查找模块(示例: 搜索模块Pode)Find-Module -Filter Pode信任仓库PSGallery# 查看仓库 Get-PSRepository # 信任仓库 Set-PSRepository -Name 'PSGallery' -InstallationPolicy Trusted安装包(示例: 安装模块Pode)Install-Module -Name Pode -AllowClobber -Force自定义对象(类似于 C# 的 匿名类型)[PSCustomObject]@{ 'Command' = [string]'git' }查看对象成员# 实例化对象 $obj = [PSCustomObject]@{ 'Command' = [string]'git' } # 查看全部对象 $obj | Get-Member # 仅查看属性 $obj | Get-Member -MemberType NoteProperty定义类并使用# 定义类 ClassDemo class ClassDemo { [int]$One [string]$Two ClassDemo() {} ClassDemo([int]$one, [string]$two) { $this.One = $one $this.Two = $two } [string]ToString(){ return ("ClassDemo(One={0},Two={1})" -f $this.One, $this.Two) } } # 3种方式实例化 ClassDemo # 1. 使用 ::new() $object1 = [ClassDemo]::new(1,"2") # 2. 使用 New-Object $object2 = New-Object ClassDemo -Property @{ One = 1; Two = "2" } # 3. 使用类型转换 $object3 = [ClassDemo]@{ One = 1; Two = "2" }功能封装判断命令行命令是否存在function IsCommandExists { <# .SYNOPSIS 判断命令行命令是否存在 .DESCRIPTION 判断命令行命令是否存在 .PARAMETER Command 命令 .EXAMPLE PS> IsCommandExists -Command git .EXAMPLE PS> 'git' | IsCommandExists .EXAMPLE PS> [PSCustomObject]@{ 'Command' = [string]'git' } | IsCommandExists .LINK https://learn.microsoft.com/zh-cn/powershell/module/microsoft.powershell.core/about/about_automatic_variables #> [OutputType([bool])] param( [Parameter(Mandatory=$true, ValueFromPipeline=$True, ValueFromPipelineByPropertyName=$True)] [string] $Command ) Get-Command -ErrorAction SilentlyContinue "$Command" | Out-Null if ($?) { return $True } return $False }外部命令行调用# 命令行调用 pwsh 执行 PowerShell 命令 Get-InstalledModule pwsh -NoLogo -Command "& {Get-InstalledModule}"参考PowerShell 文档The PowerShell Best Practices and Style Guide关于基于注释的帮助Strongly type PS custom object propertiesIncorporating Pipelined Input into PowerShell Functions关于类
2023年01月18日
113 阅读
0 评论
0 点赞
2022-12-08
nvm替代者——fnm
fnm 介绍Schniz/fnmGitHub描述: Fast and simple Node.js version manager, built in Rust自译: Rust实现的,迅捷而简单的Node.js版本管理器。fnm 特性nvm 只支持类 Unix 系统,而 fnm 跨平台支持更好,在 macOS、Windows、Linux 均可使用。可完全替代 nvm, fnm 支持 .node-version 和 .nvmrc 文件。fnm 安装macOS: brew install fnmWindows: scoop install fnm 或 choco install fnmLinux: 在 Releases 页面 下载压缩包,解压后将路径添加到环境变量PATH, 这种方式对 macOS 和 Windows 也适用macOS 和 Linux 还支持脚本安装: curl -fsSL https://fnm.vercel.app/install | bashfnm 使用fnm help 可查看帮助和详细命令
2022年12月08日
431 阅读
0 评论
0 点赞
2022-08-13
Ubuntu上nvm和最新版本nodejs(加速)安装
操作-- 下载nvm安装脚本 wget -c -O nvm-install.sh https://ghproxy.com/https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh -- 将nvm-install.sh中的下载链接前添加 https://ghproxy/ 安装nvm bash nvm-install.sh # 重新加载 ~/.bashrc, 使nvm命令可用 source ~/.bashrc # 设置nodejs国内源 export NVM_NODEJS_ORG_MIRROR=https://npmmirror.com/mirrors/node/ # 安装nodejs nvm install --ltsnvm-install.sh修改Diff@@ -59,14 +59,14 @@ nvm_source() { local NVM_SOURCE_URL NVM_SOURCE_URL="$NVM_SOURCE" if [ "_$NVM_METHOD" = "_script-nvm-exec" ]; then - NVM_SOURCE_URL="https://raw.githubusercontent.com/${NVM_GITHUB_REPO}/${NVM_VERSION}/nvm-exec" + NVM_SOURCE_URL="https://ghproxy.com/https://raw.githubusercontent.com/${NVM_GITHUB_REPO}/${NVM_VERSION}/nvm-exec" elif [ "_$NVM_METHOD" = "_script-nvm-bash-completion" ]; then - NVM_SOURCE_URL="https://raw.githubusercontent.com/${NVM_GITHUB_REPO}/${NVM_VERSION}/bash_completion" + NVM_SOURCE_URL="https://ghproxy.com/https://raw.githubusercontent.com/${NVM_GITHUB_REPO}/${NVM_VERSION}/bash_completion" elif [ -z "$NVM_SOURCE_URL" ]; then if [ "_$NVM_METHOD" = "_script" ]; then - NVM_SOURCE_URL="https://raw.githubusercontent.com/${NVM_GITHUB_REPO}/${NVM_VERSION}/nvm.sh" + NVM_SOURCE_URL="https://ghproxy.com/https://raw.githubusercontent.com/${NVM_GITHUB_REPO}/${NVM_VERSION}/nvm.sh" elif [ "_$NVM_METHOD" = "_git" ] || [ -z "$NVM_METHOD" ]; then - NVM_SOURCE_URL="https://github.com/${NVM_GITHUB_REPO}.git" + NVM_SOURCE_URL="https://ghproxy.com/https://github.com/${NVM_GITHUB_REPO}.git" else nvm_echo >&2 "Unexpected value \"$NVM_METHOD\" for \$NVM_METHOD" return 1
2022年08月13日
477 阅读
0 评论
0 点赞
2022-06-29
虚拟组网工具n2n源码编译记录
操作环境: Ubuntu 20.4 LTS系统需要安装的编译相关的工具sudo apt install gcc g++ make git vim autoconf -y# clone源码(使用 https://ghproxy.com/ 加速) git clone https://ghproxy.com/https://github.com/ntop/n2n.git n2n-src # 编译配置 cd n2n-src/ ./autogen.sh ./configure # 编译 make # 安装 sudo make install
2022年06月29日
201 阅读
0 评论
0 点赞
1
2
3