业界良心!用开源项目免费申请JetBrains的 license 一天内通过

我这里的 License 是 All PACK 的,意味着目前我可以使用 jetbrains 的所有 IDE 一年,包括但不限于 PHPstorm, IDEA, PyCharm, GOLand。

光一个 PHPStorm 原价都要1200一年,曾经打半价活动时花了600买了一年,后来用的某个前同事给的教育版账号,恰好今天过期了,就想尝试一下使用开源项目申请,没想到处理速度这么快!

我用的这个项目申请的: https://github.com/yeskn-studio/vmoex-framework

非常感谢 JB,PHPstorm 真的非常好用!有空我将会在自己的博客和其他项目上加上 jb 的logo和链接,算是支持吧!

截图纪念:image-20200826213743480

如果你也有认为比较满意的项目,也可以在 jb 的官网申请试试~ 申请链接:https://www.jetbrains.com/shop/eform/opensource

不再用114DNS

最近用 postman 调试外部的一些 API,发现经常会失败,提示cant’t resole host 啥的,想想似乎是 DNS 解析干的事,于是看了一下自己 mac 上的 DNS,把114优先换成阿里云的:

image-20200825132831468

从上到下分别是:阿里DNS,上海电信 DNS,CF,谷歌。

使用 dig 命令测试发现效果还不错(关键信息已经打码):

➔ dig @223.5.5.5 myhost.com

; <<>> DiG 9.10.6 <<>> @223.5.5.5 myhost.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 64554
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;myhost.com.    IN  A

;; AUTHORITY SECTION:
com.            443 IN  SOA a.gtld-servers.net. nstld.verisign-grs.com. 1598332825 1800 900 604800 86400

;; Query time: 14 msec
;; SERVER: 223.5.5.5#53(223.5.5.5)
;; WHEN: Tue Aug 25 13:24:21 CST 2020
;; MSG SIZE  rcvd: 118

systemd 清理不必要的service

执行systemctl status时,发现如下输出:

➔ systemctl status
● hostname
    State: degraded
     Jobs: 0 queued
   Failed: 1 units
    Since: Tue 2018-10-30 06:51:31 CST; 1 years 9 months ago
   CGroup: /
           ├─1 /usr/lib/systemd/systemd --system --deserialize 21

state的状态是degraded,查了一下发现是由于我的nginx service未启动,因为前几天手动编译安装了nginx,并且新建了一个nginx@1.18.service,所以这个service其实没用到了,把它清理掉吧:

systemctl stop [servicename]
systemctl disable [servicename]
rm /etc/systemd/system/[servicename]
rm /etc/systemd/system/[servicename] # and symlinks that might be related
rm /usr/lib/systemd/system/[servicename] 
rm /usr/lib/systemd/system/[servicename] # and symlinks that might be related
systemctl daemon-reload
systemctl reset-failed

记几次面试他人的经历

最近这段时间由于领导没空,让我临时当面试官👀,虽然我也不是什么大牛,但是还算读得起我这4、5年的工作经验吧,记录一下我当面试官的一些经历,可能由于我出的面试题是真正我自己出的,而不是网上copy的那些,导致很多面试者表现不是特别好。出于某些原因,所有人名字均用字母表示。

Continue reading "记几次面试他人的经历"

brew update灾难来了!

我以前用brew 安装了多个php的版本,早上执行了brew update后php就用不了了

# openssl版本不对了
➔ /usr/local/opt/php@5.6/bin/php -v
dyld: Library not loaded: /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib
  Referenced from: /usr/local/opt/php@5.6/bin/php
  Reason: image not found
[1]    16051 abort      /usr/local/opt/php@5.6/bin/php -v
# 把我的xdebug.so删掉了
➔ /usr/local/opt/php@7.2/bin/php -v
Failed loading /usr/local/opt/php@7.2/lib/php/20170718/xdebug.so:  dlopen(/usr/local/opt/php@7.2/lib/php/20170718/xdebug.so, 9): image not found
PHP 7.2.32 (cli) (built: Jul 10 2020 00:06:00) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.32, Copyright (c) 1999-2018, by Zend Technologies
# 又不知道缺了啥
➔ /usr/local/opt/php@7.4/bin/php -v
dyld: Library not loaded: /usr/local/opt/libffi/lib/libffi.6.dylib
  Referenced from: /usr/local/opt/php@7.4/bin/php
  Reason: image not found
[1]    16126 abort      /usr/local/opt/php@7.4/bin/php -v

我真的是太难了!!!

php5.6解决办法

其实可能我的电脑里已经有openssl@1.0,只是软链接指向变了,你也可以先直接修改软链接试试。

# 安装openssl@1.0
brew install rbenv/tap/openssl@1.0

# 修改symlink
ln -sf /usr/local/opt/openssl@1.0 /usr/local/opt/openssl

继续尝试:

➔ /usr/local/opt/php@5.6/bin/php -v
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.64.dylib
  Referenced from: /usr/local/opt/php@5.6/bin/php
  Reason: image not found
[1]    52151 abort      /usr/local/opt/php@5.6/bin/php -v

看看是否icu4c的老版本在不在吧:

➔ ll /usr/local/opt/icu4c
lrwxr-xr-x  1 jake  admin    20B Jul 22 11:36 /usr/local/opt/icu4c -> ../Cellar/icu4c/67.1

ll /usr/local/Cellar/icu4c/
total 0
drwxr-xr-x  12 jake  staff   384B Jun 28  2019 64.2
drwxr-xr-x  12 jake  staff   384B Jul 22 11:36 67.1

可能是64.2,试试:

ln -sf /usr/local/Cellar/icu4c/64.2 /usr/local/opt/icu4c

这一次php5.6就复活了!

➔ /usr/local/opt/php@5.6/bin/php -v                                                     
PHP 5.6.40 (cli) (built: Apr 23 2019 11:14:34) 
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
    with Xdebug v2.5.5, Copyright (c) 2002-2017, by Derick Rethans

php7.2那还能怎么办,选择原谅她啦

去这里:https://xdebug.org/wizard 把phpinfo的信息粘进去,重新build一个吧。

但是其实更严重的问题来了,php7.2依赖/usr/local/Cellar/icu4c/67.1,而php5.6依赖/usr/local/Cellar/icu4c/64.2,(php7.4却可以正常,神奇!)那只好把/usr/local/Cellar/icu4c/67.1的内容复制到/usr/local/Cellar/icu4c/64.2去吧:

# 复制以下两种文件似乎就可以了
➔ cp /usr/local/Cellar/icu4c/67.1/lib/*.67.1.dylib /usr/local/Cellar/icu4c/64.2/lib/
➔ cp /usr/local/Cellar/icu4c/67.1/lib/*.67.dylib /usr/local/Cellar/icu4c/64.2/lib/

➔ /usr/local/opt/php@7.2/bin/php -v
Failed loading /usr/local/opt/php@7.2/lib/php/20170718/xdebug.so:  dlopen(/usr/local/opt/php@7.2/lib/php/20170718/xdebug.so, 9): image not found
PHP 7.2.32 (cli) (built: Jul 10 2020 00:06:00) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.32, Copyright (c) 1999-2018, by Zend Technologies

可以了,稍后去把xdebug.so build出来。

php7.4如法炮制

➔ rm /usr/local/opt/libffi
➔ ln -s /usr/local/Cellar/libffi/3.2.1 /usr/local/opt/libffi

➔ /usr/local/opt/php@7.4/bin/php -v
PHP 7.4.4 (cli) (built: Mar 19 2020 20:12:27) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.4, Copyright (c), by Zend Technologies
    with Xdebug v2.9.6, Copyright (c) 2002-2020, by Derick Rethans