// ssh 不会自动遍历目录下的密钥进行配对(不安全),只会默认提供 id_rsa.pub 公钥
// 所以需要针对指定 Host 提供指定密钥的话 就需要添加配置
// 配置方法
1. 创建 ~/.ssh/config 文件
2. 写入如下字段:
# gitlab
Host gitlab.hs.app
HostName gitlab.hs.app
User git
# 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
-- 关闭 dock 图标提醒 defaults write com.apple.dock no-bouncing -bool FALSE killall Dock
-- 关闭 dock 图标提醒:
defaults write com.apple.dock no-bouncing -bool FALSE
killall Dock
本来 vagrant homestead 用的好好的。
但是我需要 虚拟机中 docker 使用 虚拟机的 ssh
所以就为 docker 只读挂载了主机的 ~/.ssh 到 容器的 ~/.ssh
结果连接失败。
因为需要输入密钥密码。
所以就想重置密钥对
结果就造成了 homestead ssh 都连接失败。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 当使用源错误时处理, | |
| ``` | |
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 & |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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. |