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 / 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 / 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 / .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 / 反向代理.md
Last active December 7, 2017 02:34
nginx

怎么多分支多环境测试。

我的方式:

方式1

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

1. 部署不同分支到web服务器下的不同目录
@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 / prefer.md
Last active July 1, 2018 19:44
mac

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

@sursir
sursir / 一件郁闷的环境修复.md
Last active December 12, 2017 13:49
vagrant homestead

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

结果连接失败。

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

@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 / php-strace.sh
Created December 27, 2017 01:54
php-strace
#!/bin/bash
additional_strace_args="$1"
MASTER_PID=$(ps auwx | grep php-fpm | grep -v grep | grep 'master process' | cut -d ' ' -f 6)
while read -r pid;
do
if [[ $pid != $MASTER_PID ]]; then
nohup strace -r -p "$pid" $additional_strace_args >"$pid.trc" 2>&1 &
@sursir
sursir / php-proxy.txt
Last active January 5, 2018 09:12
php proxy ssh socks5 http
// ssh 代理
$connection = ssh2_connect(ip-address-of-ssh-server, 22);
ssh2_auth_pubkey_file($connection, 'username', 'id_dsa.pub', 'id_dsa');
$tunnel = ssh2_tunnel($connection, 本地公网ID, 9999);
curl_setopt($ch, CURLOPT_PROXY, '127.0.0.1:9999');
// perform curl operations
// The connection and tunnel will die at the and of the session.