Cloudera CDH 大数据集成环境搭建,第一部分: 制作 Ubuntu 16.04 xenial cloudera CDH 5.12.1可安装ISO镜像文件
一.集群信息 1.1 主机/虚拟机/版本配置信息 宿主机 宿主机macOS Sierra 10.12.6 (MacBook Pro 16G/512G) 虚拟机 VirtualBox 5.1.24 r117012 虚拟机操作系统 CentOS 7 x64 5G/2CPU JDK jdk-8u144-linux-x64 Scala 2.10.6 Hadoop 2.7.4 Spark sp...
最近开发symfony3项目的时候,发现当使用brew安装的PHP7.1版本运行,总是会提示var目录下 failed to open stream: Permission denied 错误,当把PHP的php-fpm运行权限改对后,又发现Wordpress项目的后台打开总是出现504错误. 反正就是两个项目不能同时正确的运行,结果搞了很久都没搞定,去官网找了找才发现有这么一篇文章 Using...
WordPress 自定义post/page metabox,有时候需要自定义一些样式,在 wp-admin/includes/post.php 的 postbox_classes 函数中有如图所示的过滤器: 所以自定义metabox的class可以使用以下方法:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
/** * * @param array $classes * @return array */ function ks_add_excerpt_metabox_custom_class($classes = array()) { $classes[] = 'ks-metabox'; $classes[] = 'ks-post-metabox'; return $classes; } add_filter('postbox_classes_post_post-metabox-id', 'ks_add_excerpt_metabox_custom_class'); add_filter('postbox_classes_page_post-metabox-id', 'ks_add_excerpt_metabox_custom_class'); |
其中 post-metabox-id 就是使用 add_meta_b...
当静态资源文件和主站域名不一样时,字体文件之类的会爆如下错误: Font from origin 'http://www.typenter.com' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on ...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
/** * * @param string $str */ function ks_tolower_ucfirst($str) { return join('', array_map(function ($s) { return ucfirst(strtolower($s)); }, explode('_', $str))); } |
实现以下功能: 字符串"user_name" 转换成 "UserName", "display_name" 转换成 "DisplayName"
nginx禁止直接使用IP访问服务器:
1 2 3 4 5 6 7 8 9 10 11 |
server { listen 80 default; server_name _; server_name www.typenter.com typenter.com #除开允许的域名 return 500; } |
macOS Sierra 上的ruby版本为 ruby 2.0.0p648, 但是在安装cocoapods的时候,提示 activesupport requires Ruby version >= 2.2.2。 有两种办法安装新版本的ruby: 一: 使用Homebrew来安装,如果没有安装Homebrew的话,首先安装
1 |
$ sudo ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" |
安装...
拒绝掉所有ip访问本地的8080端口,除开本地ip:
1 2 3 4 5 6 7 |
iptables -I INPUT -p tcp --dport 8080 -j DROP iptables -I INPUT -s 127.0.0.1 -p tcp --dport 8080 -j ACCEPT service iptables save service iptables restart |
最近使用 Symfony3.0 开发项目的时候,发现在之前的 Symfony 2.x 版本的,在注入服务的时候可以使用下列方法:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> |
结果到了使用 Symfony 3.0 的时候,使用同样的方法进行注入的时候,会报一下错误:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
InvalidArgumentException in XmlUtils.php line 96: [ERROR 1866] Element '{http://symfony.com/schema/dic/services}service', attribute 'factory-service': The attribute 'factory-service' is not allowed. (in file:///E:/webroot/blog/web/ - line 19, column 0) [ERROR 1866] Element '{http://symfony.com/schema/dic/services}service', attribute 'factory-method': The attribute 'factory-method' is not allowed. (in file:///E:/webroot/blog/web/ - line 19, column 0) |
结果仔细看文档,才发现 3.0版本已经没有这种...