2016年1月28日星期四

form, component


控件
* @property {Object} $error An object hash with all failing validator ids as keys.
* @property {Object} $pending An object hash with all pending validator ids as keys.
*
* @property {boolean} $untouched True if control has not lost focus yet.没摸过
* @property {boolean} $touched True if control has lost focus.摸过,并失去了。
* @property {boolean} $pristine Truerol if user has not interacted with the cont yet.没交互过
* @property {boolean} $dirty True if user has already interacted with the control.交互过
* @property {boolean} $valid True if there is no error.合法
* @property {boolean} $invalid True if at least one error on the control.非法
* @property {string} $name The name attribute of the control.


form
 * @property {boolean} $pristine True if user has not interacted with the form yet.没交互
 * @property {boolean} $dirty True if user has already interacted with the form.已交互
 * @property {boolean} $valid True if all of the containing forms and controls are valid.合法
 * @property {boolean} $invalid True if at least one containing control or form is invalid.非法
 * @property {boolean} $submitted True if user has submitted the form even if its invalid.已提交,就算没提交成功也是已提交。



区分一下






 $dirty和$pristine是相反的
 $dirty是交互过,比如获得了焦点,并且输入了东西(比如输入A,然后删掉A)。
 $touched只是获得过焦点。

2016年1月27日星期三

babel输出deafult时,不要带default

https://www.npmjs.com/package/babel-plugin-add-module-exports

看了这个文章解决的

2016年1月26日星期二

做了一个dmz,用了selinux,比起没用selinux一堆麻烦

1。apache启动时,没法监听端口。
[root@dmz conf]# service httpd start
(13)Permission denied: make_sock: could not bind to address [::]:8085

这是因为selinux没有让8085运行。
semanage port -l命令可以看到,默认是
http_port_t                    tcp      80, 443, 488, 8008, 8009, 8443
需要追加上我的8085
semanage port -a -t http_port_t -p tcp 8085
追加上后,ok。

另外,rhel 6l里,默认semanage是没安装的。需要yum -y install policycoreutils-python
可以用
yum whatprovides /usr/sbin/semanage找到哪个包里有这个命令。

但是奇怪的是tomcat缺可以启动监听其他端口,不需要selinux,原因不知道,估计和用户所属组有关。

2.反向代理没法用
[Tue Jan 26 16:51:41 2016] [error] (13)Permission denied: proxy: HTTP: attempt to connect to 192.168.101.41:8080 (192.168.101.41) failed
[Tue Jan 26 16:51:41 2016] [error] ap_proxy_connect_backend disabling worker for (192.168.101.41)


需要执行
/usr/sbin/setsebool -P httpd_can_network_connect 1
才可以。 

2016年1月20日星期三

非root用户执行crontab时的环境变量

crontab -e,编辑完后,以为会按照指定的执行,结果发现crontab 执行虽然是以用户权限执行的,但是用户的环境根本没加载。

解决法子
1。最笨自然是用root用户里面crontab 然后 su - user -c "script.sh"咯
2。其实写script的时候,最前面加上-l就可以啦,#!/bin/bash -l这样子。也可以放job前面
* * * * * bash -l script.sh
3。要不然就是job的前面,加载也可以 . ~/.bash_profile;script.sh

2016年1月19日星期二

Invalid password while logging 12c ASM instance

12c的grid里


sqlplus / as sysdb ok
sqlplus / as sysasm ok
sqlplus sys/sys_pw as sysdba ok
sqlplus sys/sys_pw as sysasm NG


解决法子在这里
http://www.sqlplus.ca/blog/?p=1142


[grid@orasrv ~]$  ls -l $ORACLE_HOME/dbs
total 12
-rw-rw----. 1 grid oinstall 1328 Jan 19 15:41 ab_+ASM.dat
-rw-rw----. 1 grid oinstall 1544 Jan 19 15:41 hc_+ASM.dat
-rw-r--r--. 1 grid oinstall 2992 Feb  3  2012 init.ora


SQL> select * from v$pwfile_users;                              

USERNAME                       SYSDB SYSOP SYSAS SYSBA SYSDG SYSKM     CON_ID
------------------------------ ----- ----- ----- ----- ----- ----- ----------
SYS                            TRUE  TRUE  TRUE  FALSE FALSE FALSE          0
ASMSNMP                        TRUE  FALSE FALSE FALSE FALSE FALSE          0

[grid@orasrv ~]$ srvctl config asm -a
ASM home: <CRS home>
Password file: +DG_GRID/orapwasm
ASM listener: LISTENERASM
Spfile: +DG_GRID/ASM/ASMPARAMETERFILE/REGISTRY.253.865375963
ASM diskgroup discovery string: /dev/raw/*
ASM is enabled.
ASM is individually enabled on nodes:
ASM is individually disabled on nodes:

我的orapwasm缺是有的。sys也已经有了 SYSAS =true,想不通。
后来,connect / as sysasm后修改sys密码,alter user sys identified by oracle居然过了。
莫非asm实例的sys密码还有两份?一份给sysdba一份给sysasm?莫名其妙。