首页
友情链接
关于
推荐
工具
Search
1
欢迎使用 Typecho
16,433 阅读
2
Playwright使用记录
3,345 阅读
3
Unity独立安装后添加IL2CPP等编译组件
2,398 阅读
4
(Windows)以一种访问权限不允许的方式做了一个访问套接字的尝试处理
2,361 阅读
5
Windows上GCC安装
2,233 阅读
全部博文
游戏开发
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
玖亖伍
累计撰写
30
篇文章
累计收到
217
条评论
首页
栏目
全部博文
游戏开发
Unity
Godot Engine
GDScript
编程代码
C#编程
GoLang编程
PowerShell
开发工具
Git
笔记备忘
页面
友情链接
关于
推荐
工具
搜索到
17
篇与
的结果
2024-04-07
Windows上非安装方式配置MySQL
MySQL官方下载MySQL压缩包文件https://dev.mysql.com/downloads/mysql/下载后得到的zip文件(比如 mysql-8.3.0-winx64.zip)解压到电脑上(比如 D:\portable\mysql-8.3.0-winx64),得到如下目录内容:初始化, 终端(比如 cmd.exe) 中,进入上图的 bin 目录,执行如下初始化命令mysqld --initialize等待上一步执行完成后,创建一个文件(比如 mysql-init.txt)用来设置 root 用户的密码,内容如下:ALTER USER 'root'@'localhost' IDENTIFIED BY 'root666';将root用户的密码设置为root666启动 MySQL服务器,并加载初始化文件:mysqld --init-file=D:\portable\mysql-8.3.0-winx64\bin\mysql-init.txt --console等待上一步启动后,停止 MySQL 服务器,同时验证上一步执行的修改操作是否成功:mysqladmin -u root -p shutdown至此,MySQL配置已完成,可以正常启动 MySQL了:mysqld --console--console 参数指示将日志输出到控制台, 不加则会将日志输出到文件MySQL 正式启动后,可以连接验证:mysql -uroot -p
2024年04月07日
14 阅读
0 评论
0 点赞
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日
138 阅读
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日
81 阅读
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日
173 阅读
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日
620 阅读
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日
274 阅读
0 评论
0 点赞
2022-06-02
Ubuntu使用minikube搭建K8S环境
操作记录安装docker# 清理旧的docker(如果安装过的话) sudo apt-get remove docker docker-engine docker.io containerd runc # 安装需要的基础软件(一般都已经存在了) sudo apt-get install ca-certificates curl gnupg lsb-release # 添加GPG curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg # 添加apt源 echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null # 更新本地apt源信息 sudo apt-get update # 安装 sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin -y # 将当前用户添加到docker组 sudo usermod -aG docker $USER # 登录到docker组 newgrp docker # 验证 docker run hello-world安装 kubectl# 安装 sudo snap install kubectl --classic # 验证 kubectl version --client安装并启动minikube# 下载 wget -c https://ghproxy.com/https://github.com/kubernetes/minikube/releases/download/v1.25.2/minikube_1.25.2-0_amd64.deb # 安装 sudo dpkg -i minikube_1.25.2-0_amd64.deb rm minikube_1.25.2-0_amd64.deb # 设置使用docker作为驱动 minikube config set driver docker # 启动minikube集群 minikube start --driver=docker --image-mirror-country='cn'配置minikube仪表盘(监听127.0.0.1只能本机访问)以supervisor为例, 如果未安装,请用命令sudo apt install supervisor 安装。minikube dashboard 配置sudo vim /etc/supervisor/conf.d/minikube_dashboard.conf/etc/supervisor/conf.d/minikube_dashboard.conf:[program:minikube_dashboard] user=xxx directory=/home/xxx command=/usr/bin/minikube dashboard --url autostart=true autorestart=true startsecs=5 stopsignal=HUP stopasgroup=true stopwaitsecs=5 stdout_logfile_maxbytes=20MB stdout_logfile=/var/log/supervisor/%(program_name)s-out.log stderr_logfile_maxbytes=20MB stderr_logfile=/var/log/supervisor/%(program_name)s-err.logkubectl proxy 配置(开放端口允许外部访问)sudo vim /etc/supervisor/conf.d/kubectl_proxy.confsudo vim /etc/supervisor/conf.d/kubectl_proxy.conf:[program:kubectl_proxy] user=xxx directory=/home/xxx command=/snap/bin/kubectl proxy --port=8090 --address=0.0.0.0 --accept-hosts='.*' autostart=true autorestart=true startsecs=5 stopsignal=HUP stopasgroup=true stopwaitsecs=5 stdout_logfile_maxbytes=20MB stdout_logfile=/var/log/supervisor/%(program_name)s-out.log stderr_logfile_maxbytes=20MB stderr_logfile=/var/log/supervisor/%(program_name)s-err.log启动dashboard# 进入 supervisor sudo supervisorctlsupervisorctl内操作# 应用配置更新 update # 查看minikube dashboard输出 tail -f minikube_dashboardminikube_dashboard输出如下:supervisor> tail -f minikube_dashboard ==> Press Ctrl-C to exit <== - Using image kubernetesui/metrics-scraper:v1.0.7 - Using image kubernetesui/dashboard:v2.3.1 http://127.0.0.1:42213/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/复制url, 将其中的ip换为机器ip(假设为192.168.1.3), 端口换为代理端口(此处为8090), 即可实现外部访问:http://192.168.1.3:8090/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/参考Install Docker Engine on UbuntuMinikube - Kubernetes本地实验环境minikube startdockerGitHub Proxy 代理加速
2022年06月02日
374 阅读
0 评论
1 点赞
2022-05-24
SSH反向代理的使用
准备工作说明:12.34.56.78 为公网服务器, ssh端口为22192.168.1.2 为内网服务器(未开放访问公网), ssh端口为10022192.168.1.5 为本机, 可访问192.168.1.2和12.34.56.78涉及到的命令# 设置SOCKS5代理 ssh -o StrictHostKeyChecking=no 12.34.56.78 -l user0 -p 22 -D 0.0.0.0:12080 -N -v # 设置反向隧道到代理 ssh -o StrictHostKeyChecking=no 192.168.1.2 -l devops -p 10022 -R 8051:127.0.0.1:12080 -N -v # 本机连接到私域服务器,下面的命令在其上执行 ssh 192.168.1.2 -l devops -p 100221. 修改hosts,绕过DNS解析编辑hosts文件,按需设置: sudo vim /etc/hosts119.84.77.214 mirrors.aliyun.com 140.83.35.89 ghproxy.com 65.52.183.205 packages.microsoft.com2. 安装proxychains获取proxychains源码# 临时设置代理 export ALL_PROXY=socks5://127.0.0.1:8051 # 获取proxychains源码 git clone https://ghproxy.com/https://github.com/rofl0r/proxychains-ng.git proxychains-ng-src # 取消临时代理 unset ALL_PROXYproxychains编译和安装cd proxychains-ng-src/ ./configure make sudo make install sudo make install-config修改proxychains配置添加代理: sudo vim /usr/local/etc/proxychains.conf[ProxyList] socks5 127.0.0.1 80513. 使用示例通过proxychains安装.NET6和Powershellproxychains4 wget -c https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb sudo proxychains4 apt update # 安装常用和必要软件 sudo proxychains4 apt install -y apt-transport-https software-properties-common w3m tree # 安装 .NET6和pwsh sudo proxychains4 apt install -y dotnet-sdk-6.0 powershell # 验证 dotnet --info pwsh --version运行filebrowserproxychains4 wget -c https://ghproxy.com/https://github.com/filebrowser/filebrowser/releases/download/v2.21.1/linux-amd64-filebrowser.tar.gz tar -zxvf linux-amd64-filebrowser.tar.gz mkdir data-store /home/devops/filebrowser/filebrowser --address "0.0.0.0" --port "2554" --root /home/devops/filebrowser/data-store # 本地代理(本地访问: http://127.0.0.1:2554/) ssh -o StrictHostKeyChecking=no 192.168.1.2 -l devops -p 10022 -L 2554:127.0.0.1:2554 -N -v
2022年05月24日
248 阅读
0 评论
0 点赞
2022-05-20
Ubuntu上MySQL8备忘
安装mysql# 服务器 sudo apt install mysql-server -y # 客户端 sudo apt install mysql-client -y设置密码并开启远程连接修改mysql配置vim /etc/mysql/mysql.conf.d/mysqld.cnf主要配置内容[mysqld] # mysql 监听主机 bind-address = 0.0.0.0 # mysql X插件 监听主机(如果启用了的话) mysqlx-bind-address = 0.0.0.0修改mysql内部设置超管方式运行mysql# Ubuntu上全新安装的mysql8没有默认启用密码插件 sudo mysql执行如下sql操作-- 修改默认root@localhost使用密码插件并设置密码 ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your password'; -- 添加root允许远程主机访问(如果有必要,务必确保安全) CREATE USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'your password'; -- 授予远程访问全部权限 GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'; -- 刷新权限 FLUSH PRIVILEGES; exit安装mysql后需要修改忽略表名大小写Windows上,MySQL默认是忽略表名大小写的;Linux上,MySQL默认是区分表名大小写的,且MySQL初始化之后是不允许修改忽略表名大小写配置的,而MySQL安装过程会自动初始化。如下操作参考: How to install MySQL 8.0 with lower_case_table_names=1 on Ubuntu Server 20.04 LTS successfully?如果需要在MySQL安装后修改为忽略表名大小写,则需要删除MySQL数据,重新初始化,所以,如下操作前请备份数据;修改mysql配置vim /etc/mysql/mysql.conf.d/mysqld.cnf主要配置内容[mysqld] lower_case_table_names = 1清理数据(操作前务必备份数据)# 停止服务 sudo service mysql stop # 删除mysql数据文件夹及内部数据 sudo rm -rf /var/lib/mysql # 重新创建mysql数据文件夹并赋予合适的权限 sudo mkdir /var/lib/mysql sudo chown mysql:mysql /var/lib/mysql sudo chmod 700 /var/lib/mysql # 重新初始化mysql sudo mysqld --defaults-file=/etc/mysql/my.cnf --initialize --lower_case_table_names=1 --user=mysql --console # 启动服务 sudo service mysql start # 查看mysql临时密码 sudo grep 'temporary password' /var/log/mysql/error.log # 使用(临时密码)登录mysql sudo mysql -u root -p # 参考前面允许远程配置部分,修改密码可参考的mysql语句-- 查看用户、认证方式、主机等信息 SELECT user,authentication_string,plugin,host FROM mysql.user; -- 是否启用了ssl SHOW VARIABLES LIKE 'have_ssl'; -- 是否忽略大小写 SHOW VARIABLES LIKE 'lower_case_%';
2022年05月20日
377 阅读
0 评论
0 点赞
2022-05-02
克隆PyTorch源码失败替换Git镜像
背景服务器已安装CUDA 11.6, 但是 PyTorch 已公开的包只兼容到 CUDA 11.3, 于是考虑从源码自行编译。但是在clone代码这一步,遇到了大量连接超时问题。过程clone PyTorch 代码:git clone --recursive https://github.com/pytorch/pytorch这一步遇到连接超时问题比较好解决, 直接使用FastGit镜像替换即可:FastGit 仅仅是 GitHub 的代理,所以我们仅需要替换远程地址。于是,将 仓库URL由 https://github.com/pytorch/pytorch 替换为 https://hub.fastgit.xyz/pytorch/pytorch 即可。但是PyTorch使用了大量的第三方库都是以 submodule 方式导入的, 所以需要根据如下描述直接全局替换GitHub源。可以直接修改 git 的配置,使用 FastGit 替换所有指向 GitHub 的链接:git config --global url."https://hub.fastgit.xyz/".insteadOf "https://github.com/" git config protocol.https.allow always重新拉取前面失败的 submodule, 进入源码目录,执行如下操作:git submodule sync git submodule update --init --recursive --jobs 0但是有少量 submodule 却不是在GitHub上:到这里就卡住了,经过一番搜索,从声网的一篇文章得到了启发:WebRTC 镜像源运行以下脚本,替换 git 源git config --global url.http://120.92.49.206:3232/chromiumsrc/linux-syscall-support.git.insteadOf https://chromium.googlesource.com/linux-syscall-support.git与前面替换源思路相同,只需要针对极个别的 submodule 源替换即可, 只是这里时针对具体仓库,而非域名。而且 linux-syscall-support 是在浏览器中科学上网可以正常访问的:首先浏览器尝试访问 http://120.92.49.206:3232/chromiumsrc/linux-syscall-support 发现无法访问。似乎到这里卡住了......稍作思索,想到了曲线救国的方案————利用码云(Gitee)导入 linux-syscall-support 仓库,再将Git地址换为码云的地址:经过尝试,发现不得行,虽然之前实践过,Gitee 可以导入 Github 的仓库,但是此刻发现 googlesource 的仓库它却无能为力。我们通过 FastGit 已经可以畅通无阻地访问 Github 了,那么是否可以利用 Github 导入外部仓库呢? 虽然从没用过 Github 的导入功能, 但是猜测它因该是有这功能的。很快找到了它的导入:稍等几秒就导入完成了:接着就替换地址:git config --global url.https://github.com/gsw945/linux-syscall-support.insteadOf https://chromium.googlesource.com/linux-syscall-support然后重复前面的操作,更新代码git submodule update --init --recursive --jobs 很顺利(下图中将github.com替换为了hub.fastgit.xyz):至此, PyTorch 源码全部 clone 完成。参考PyTorch - Start LocallyFastGit 使用指南
2022年05月02日
696 阅读
0 评论
2 点赞
1
2