博文
NPM 常用命令
· ☕ 1 分钟
** 默认执行命名时,针对的是当前目录环境。如果加上 -g 参数,则表示针对的是全局生效。** npm 升级 1 npm install npm -g 查看当前版本 1 npm -v 查看 npm 源配置 1 npm config get registry 修改 npm 源 1 2 npm config set registry http://registry.npm.taobao.org/ # npm config set registry https://registry.npmjs.org/ 临时指定 npm 安装源 1 npm install [package name] --registry=https://registry.npm.taobao.org 设置 proxy 1 npm config set proxy http://proxy.example.com:8080 查看 proxy 1 npm config get proxy 删除

战略思考与表达学习笔记
· ☕ 2 分钟
主要记录的是分析方法。 1. 战略分析 麦肯锡七步成诗法 陈述问题 分析问题 优先排序 指定详细的工作计划 进行关键分析 综合结果并建立有结构的结论 讲故事 2. 认识问题 大部分的问题是不能认识问题,unknown unknown。能够认识到问题、陈述问题,是解决问题的

GitLab CI 配置 Runner
· ☕ 2 分钟
1. 下载并配置 Runner 1.1 下载 Runner GitLab-CI 的 Runner 是一个 Go 写的程序包,可以去官网下载到本地。 1 2 yum install -y wget wget -O /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64 增加执行权限 1 chmod +x /usr/local/bin/gitlab-runner 1.2 新增 runner 用户 运行 Runner 时,以 runner:runner 账户运行。 1 2 groupadd -g 1234 runner useradd runner -u 1234 -g 1234 1.3 修改 pip 源 1 2 3 4 cat /etc/pip.conf [global] index-url= http://pypi.doubanio.com/simple/ trusted-host = pypi.doubanio.com 1.4 创建工作目录 1 mkdir -p /data/gitlab-data 2 注册 Runner 在项目

如何同步备份 Git 仓库
· ☕ 1 分钟
由于目前使用的 Git 仓库即将无法使用,需要将仓库代码迁移到新的 Git 仓库。具体操作方法如下: 1.登录新的仓库,然后创建仓库。 创建后,新仓库地址: http://gitlab.your-new-domain.com/project.git 2.克隆旧仓库镜像到本地: 1 2 3 git clone --mirror http://gitlab.your-old-domain.com/project.git # 如果仅需要克隆 Branch 和 Tag,可以使用 --bare 参数替换 --mirror

Nginx 配置问题记录
· ☕ 1 分钟
1. server_name 无效 现象:Nginx 反向代理了两个应用,配置详情如下。发现访问 b.chenshaowen.com 和 a.chenshaowen.com 时,返回的都是 A 服务的请求。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 server { listen 80; server_name a.chenshaowen.com; location / { proxy_pass http://A; } } server { listen 8080; server_name b.chenshaowen.com; location / { proxy_pass http://B; } } 原因:当所有 server 的规则都不匹配时,Nginx 会采用第一条