Skip to content

Instantly share code, notes, and snippets.

View sursir's full-sized avatar
💥
COME BACK

Heisenberg sursir

💥
COME BACK
View GitHub Profile
@sursir
sursir / install.md
Last active December 4, 2018 02:11
php7 centos
当使用源错误时处理,
```
yum remove epel-release
rm -rf /var/cache/yum/x86_64/6/epel/*
yum clean all
# 重新安装6的源
rpm -Uvh http://mirrors.ustc.edu.cn/epel/epel-release-latest-6.noarch.rpm
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
@sursir
sursir / 一件郁闷的环境修复.md
Last active December 12, 2017 13:49
vagrant homestead

本来 vagrant homestead 用的好好的。
但是我需要 虚拟机中 docker 使用 虚拟机的 ssh
所以就为 docker 只读挂载了主机的 ~/.ssh 到 容器的 ~/.ssh

结果连接失败。

因为需要输入密钥密码。
所以就想重置密钥对
结果就造成了 homestead ssh 都连接失败。

@sursir
sursir / prefer.md
Last active July 1, 2018 19:44
mac

-- 关闭 dock 图标提醒: defaults write com.apple.dock no-bouncing -bool FALSE killall Dock

@sursir
sursir / prefer.md
Created December 11, 2017 06:31
mac

-- 关闭 dock 图标提醒 defaults write com.apple.dock no-bouncing -bool FALSE killall Dock

@sursir
sursir / 反向代理.md
Last active December 7, 2017 02:34
nginx

怎么多分支多环境测试。

我的方式:

方式1

(直接通过子目录实现。(在公司的项目中完全可以这样实现))

1. 部署不同分支到web服务器下的不同目录
@sursir
sursir / .gitlab-ci.yml
Last active December 19, 2017 02:42
gitlab-ci
# Select image from https://hub.docker.com/_/php/
image: ci/ci
# Select what we should cache between builds
cache:
key: ${CI_PROJECT_ID}
paths:
- vendor/
- composer.lock.prev
- .env
@sursir
sursir / composer.md
Last active December 5, 2017 05:27
php composer
# composer install 以 composer.lock 为依据

# 存在 composer.lock 时,手动修改 composer.json 之后
# 1. 重新 composer install 会产生警告 并不会更新依赖 (⚠️:Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.)
# 2. composer update 则会重新加载依赖并重新生成 composer.lock 文件


# 指定为开发所需要的依赖 生产环境不需要的依赖
 composer require --dev
@sursir
sursir / ssh.md
Last active December 11, 2017 03:20
ssh
// ssh 不会自动遍历目录下的密钥进行配对(不安全),只会默认提供 id_rsa.pub 公钥
// 所以需要针对指定 Host 提供指定密钥的话 就需要添加配置
// 配置方法
  1. 创建 ~/.ssh/config 文件
  2. 写入如下字段:  
    # gitlab
    Host gitlab.hs.app
    HostName gitlab.hs.app
 User git
@sursir
sursir / commitizen.md
Last active November 29, 2017 08:05
commit message, changelog, commitizen

首先必须安装 commitizen (全局)

npm install commitizen -g

添加使用格式

1. 个人全局安装

// 安装 conventional-changelog 格式 (全局)

Fixing npm permissions

Change npm's default directory to another directory

There are times when you do not want to change ownership of the default directory that npm uses (i.e. /usr) as this could cause some problems, for example if you are sharing the system with other users. Instead, you can configure npm to use a different directory altogether. In our case, this will be a hidden directory in our home folder.

  1. Make a directory for global installations: