以下步骤可在ubuntu/raspbian下执行
需要有一个可ssh访问境外节点账号。
需要创建本地账号的密钥(如果没有~/.ssh/id_rsa
):
[From: http://hanxue-it.blogspot.com/2018/08/macos-homebrew-installing-older-version-of-software.html - just created a copy to keep it for long term] | |
Homebrew always wants to install the latest version of the Formula (software). This is by design, because every time there is an update to a formula, it wants to be tested against all the other formulas that it depends on. Mixing new and old versions of software is a recipe for incompatibility disaster. | |
But sometimes there are situations where you need an older version of software. In my specific case, Yarn was compiled against an older version of icu4c, and I want that older version instead of recompiling Yarn. | |
$ yarn install | |
dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.61.dylib | |
Referenced from: /usr/local/bin/node |
Dockerfile
that is based on your production image and
simply install xdebug
into it. Exemple:FROM php:5
RUN yes | pecl install xdebug \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
# Hello, and welcome to makefile basics. | |
# | |
# You will learn why `make` is so great, and why, despite its "weird" syntax, | |
# it is actually a highly expressive, efficient, and powerful way to build | |
# programs. | |
# | |
# Once you're done here, go to | |
# http://www.gnu.org/software/make/manual/make.html | |
# to learn SOOOO much more. |
<?php | |
$class = get_called_class(); | |
$class = explode( '\\', $class ); | |
end( $class ); | |
$last = key( $class ); | |
$class = $class[ $last ]; | |
/** |
我的话:
前阵子用PHP的上传功能貌似是能自动从文件头信息判断文件类型的而不是简单得从后缀名,因为最近在处理一个百度文库功能,需要处理上传文档功能,发现就算其他文件只要改后缀名就能伪装成文档的格式
下面是我在网上找到的所谓能判断文件类型,但是经过试验,不是很精准,因为OFFICE新出文件类型实际上是一个ZIP的压缩包,而07前版本的文件类型是srorage方式储存,可见,要实现完全正确的文件类型判断是一件很困难的事情...
在用PHP上传文件时一般要限制可上传的文件类型,以保证系统的安全。文件类型通常通过文件的后缀进行判断,但这样只要用户把文件的后缀名修改一下就可以绕过检查而实现上传,但如果我们在判断文件名后缀的同时通过分析文件头信息判断文件类型,那些不怀好意的鸟人们再想捣乱可能就没那么简单了: 要分析文件头信息肯定要先读取文件,在PHP中,可以先用fopen()打开文件,然后通过fread()读取文件内容,不用全部读取,因为要判断文件类型我们只需要得到文件的前2个字节就足够了。得到的内容是二进制的,为了能在程序代码中做判断,需要把二进制数据转换成十进制数字的字符串,这时最关键的 unpack() 函数就派上用场了,unpack()函数主要用于二进制操作,我了解的也不多,看起来比较深奥,有时间好好研究下。 OK,还是把示例代码放上来吧: