随笔-295  评论-26  文章-1  trackbacks-0
  2020年6月13日



            //允许输入字母、点、回退键、数字
            if (((int)e.keychar >= (int)'a' && (int)e.keychar <= (int)'z') || (((int)e.keychar > 48 && (int)e.keychar < 57) || (int)e.keychar == 8 || (int)e.keychar == 46))
            {
                e.handled = false;
            }
            else e.handled = true;



      //允许输入字母、回退键、数字
            if (((int)e.keychar >= (int)'a' && (int)e.keychar <= (int)'z') || (((int)e.keychar > 48 && (int)e.keychar < 57) || (int)e.keychar == 8))
            {
                e.handled = false;
            }
            else e.handled = true; 


// 只能输入字母数字以及中文字
  if ((e.keychar != '\b') && (!char.isletter(e.keychar)) && (!char.isdigit(e.keychar)))
            {
                e.handled = true;
            }

//只输入数字
 if (e.keychar != 8 && (!char.isdigit(e.keychar)))
            {
                e.handled = true;
            }

只能输入数字以及字母x

  if (e.keychar != 88 && e.keychar != 8 && (!char.isdigit(e.keychar)))
            {
                e.handled = true;
            }
posted @ 华梦行 阅读(141) | |  
  2020年1月6日
install-package nlog.config -version 3.2.1



install-package nlog -version 3.2.1
posted @ 华梦行 阅读(109) | |  
  2019年9月15日
posted @ 华梦行 阅读(129) | |  
  2019年9月14日

mysql_home     解压路径   c:\developtool\mysql\mysql-5.7.25-winx64    

 

 

 path     %mysql_home%\bin



>mysqld --initialize --user=mysql --console
mysqld -install 

先启动服务:

net start mysql【或者是mysql57】

修改密码
mysqladmin -uroot -p123456 password 123 


sc delete 服务名例如: sc delete mysql





远程访问
use mysql;
grant all on *.* to root@'%' identified by '密码' with grant option;
flush privileges;
posted @ 华梦行 阅读(109) | |  
  2019年5月18日
需要添加一个环境变量postman_disable_gpu = true。
posted @ 华梦行 阅读(471) | |  
  2017年6月26日

在了解rest api uri设计的规则之前,让我们快速浏览一些我们将要讨论的术语。

uris

rest api使用统一资源标识符(uri)来寻址资源。在当今互联网上,充斥着各种各样的uri设计规则,既有像这样能够清楚的传达api资源模型的文章,也有很难理解的文章,例如: ;tim berners-lee在他的“axioms of web architecture”一文中将uri的不透明度总结成一句话:

唯一可以使用标识符的是引用对象。在不取消引用时,就不应该查看uri字符串的内容以获取其他信息。 
——

客户端必须遵循web的链接范例,将uri视为不透明标识符。

rest api设计人员应该在考虑将rest api资源模型传达给潜在的客户端开发者的前提下,创造uri。在这篇文章中,我将尝试为rest api uri 引入一套。

先跳过规则,uri的通用语法也适用与本文中的uri。定义了通用uri语法,如下所示:

uri = scheme “://” authority “/” path [ “?” query ][ “#” fragment ]

规则1:uri结尾不应包含(/)

这是作为uri路径中处理中最重要的规则之一,正斜杠(/)不会增加语义值,且可能导致混淆。rest api不允许一个尾部的斜杠,不应该将它们包含在提供给客户端的链接的结尾处。

许多web组件和框架将平等对待以下两个uri: 

但是,实际上uri中的每个字符都会计入资源的唯一身份的识别中。

两个不同的uri映射到两个不同的资源。如果uri不同,那么资源也是如此,反之亦然。因此,rest api必须生成和传递精确的uri,不能容忍任何的客户端尝试不精确的资源定位。

有些api碰到这种情况,可能设计为让客户端重定向到相应没有尾斜杠的uri(也有可能会返回301 - 用来资源重定向)。

规则2:正斜杠分隔符(/)必须用来指示层级关系

uri的路径中的正斜杠(/)字符用于指示资源之间的层次关系。

例如: 
 ;

规则3:应使用连字符( - )来提高uri的可读性

为了使您的uri容易让人们理解,请使用连字符( - )字符来提高长路径中名称的可读性。在路径中,应该使用连字符代空格连接两个单词 。

例如: 

规则4:不得在uri中使用下划线(_)

一些文本查看器为了区分强调uri,常常会在uri下加上下划线。这样下划线(_)字符可能被文本查看器中默认的下划线部分地遮蔽或完全隐藏。

为避免这种混淆,请使用连字符( - )而不是下划线

规则5:uri路径中首选小写字母

方便时,uri路径中首选小写字母,因为大写字母有时会导致一些问题。rfc 3986将uri定义为区分大小写,但scheme 和 host components除外。

例如: 

 
这个uri很好。uri格式规范(rfc 3986)认为该uri与uri#1相同。

 
而这个uri与uri 1和2不同,这可能会导致不必要的混淆。

规则6:文件扩展名不应包含在uri中

在web上,(.)字符通常用于分隔uri的文件名和扩展名。 
rest api不应在uri中包含人造文件扩展名,来指示邮件实体的格式。相反,他们应该依赖通过content-type中的header传递media type,来确定如何处理正文的内容。


如上所示:不应使用文件扩展名来表示格式。

应鼓励rest api客户端使用http提供的格式选择机制accept request header。

为了是链接和调试更简单,rest api应该支持通过查询参数来支持媒体类型的选择。

规则7:端点名称是单数还是复数?

keep-it-simple的原则在这里同样适用。虽然一些”语法学家”会告诉你使用复数来描述资源的单个实例是错误的,但实际上为了保持uri格式的一致性建议使用复数形式。

本着api提供商更容易实施和api使用者更容易操作的原则,可以不必纠结一些奇怪的复数(person/people,goose/geese)。

但是应该怎么处理层级关系呢?如果一个关系只能存在于另一个资源中,restful原则就会提供有用的指导。我们来看一下这个例子。学生有一些课程。这些课程在逻辑上映射到学生终端,如下所示:

 - 检索id为3248234的学生学习的所有课程的清单。 
 -检索该学生的物理课程

结论

当你在服务时,您必须注意这些由uri定义的资源。

正在构建的服务中的每个资源将至少有一个uri标识它。这个uri最好是有意义的,且能充分描述资源。uri应遵循可预测的层次结构,用来提高其可理解性,可用性:可预测的意义在于它们是一致的,它的层次结构在数据关系上是有意义的。

restful api是为使用者编写的。uri的名称和结构应该能够向使用者传达更清晰的含义。通过遵循上述规则,您将创建一个更清晰的的rest api与更友好的客户端。这些并不是rest的规则或约束,仅仅是api的增强和补充。

我也建议你来看看这篇文章。

最后,望大家牢记:你在为你的客户端设计api uri,而不仅仅是为你的数据。

posted @ 华梦行 阅读(203) | |  
  2017年6月19日

* this.getclass().getclassloader().getresourceasstream("testvariables.bpmn")

       classpath根目录下加载指定名称的文件

 * this.getclass().getresourceasstream("testvariables.bpmn")   

       从当前包下加载指定名称的文件

 * this.getclass().getresourceasstream("/testvariables.bpmn") 

       从classpath根目录下加载指定名称的文件

posted @ 华梦行 阅读(103) | |  
  2017年5月26日
package org.gdharley.activiti.integration.rest;

import com.fasterxml.jackson.annotation.jsonproperty;
import com.fasterxml.jackson.databind.jsonnode;
import com.fasterxml.jackson.databind.objectmapper;
import org.activiti.engine.activitiexception;
import org.activiti.engine.delegate.delegateexecution;
import org.activiti.engine.delegate.expression;
import org.activiti.engine.delegate.javadelegate;
import org.apache.commons.lang3.stringutils;
import org.apache.http.httpresponse;
import org.apache.http.namevaluepair;
import org.apache.http.client.methods.*;
import org.apache.http.client.utils.uribuilder;
import org.apache.http.client.utils.urlencodedutils;
import org.apache.http.conn.ssl.sslconnectionsocketfactory;
import org.apache.http.conn.ssl.sslcontextbuilder;
import org.apache.http.conn.ssl.trustselfsignedstrategy;
import org.apache.http.entity.stringentity;
import org.apache.http.impl.client.closeablehttpclient;
import org.apache.http.impl.client.httpclientbuilder;
import org.apache.http.message.basicnamevaluepair;
import org.apache.http.protocol.http;
import org.apache.http.util.entityutils;
import org.slf4j.logger;
import org.slf4j.loggerfactory;
import org.springframework.http.httpmethod;

import java.io.ioexception;
import java.net.uri;
import java.net.urisyntaxexception;
import java.util.list;


/**
 * created by gharley on 5/2/17.
 
*/
public class simplerestdelegate implements javadelegate {
    private static final logger logger = loggerfactory.getlogger(simplerestdelegate.class);

    protected expression endpointurl;
    protected expression httpmethod;
    protected expression issecure;
    protected expression payload;

//    一个content-type是application/json的请求,具体看起来是这样的:
//    post /some-path http/1.1
//    content-type: application/json
//
//    { "foo" : "bar", "name" : "john" }
//
//
//    { "foo" : "bar", "name" : "john" } 就是这个请求的payload



    protected expression headers;
    protected expression responsemapping;

    protected objectmapper objectmapper = new objectmapper();

    // create a mixin to force the basicnamevaluepair constructor
    protected static abstract class basicnamevaluepairmixin {
        private basicnamevaluepairmixin(@jsonproperty("name") string name, @jsonproperty("value") string value) {
        }
    }

    public void execute(delegateexecution execution) throws exception {
        logger.info("started generic rest call delegate");

        if (endpointurl == null || httpmethod == null) {
            throw new illegalargumentexception("an endpoint url and http method are required");
        }

        string resturl = getexpressionasstring(endpointurl, execution);
        string payloadstr = getexpressionasstring(payload, execution);
        string headersjson = getexpressionasstring(headers, execution); // [{"name":"headername", "value":"headervalue"}]
        string method = getexpressionasstring(httpmethod, execution);
        string rmapping = getexpressionasstring(responsemapping, execution);
        string secure = getexpressionasstring(issecure, execution);
        string scheme = secure == "true" ? "https" : "http";

        // validate uri and create create request
        uri restendpointuri = composeuri(resturl, execution);

        logger.info("using generic rest uri "   restendpointuri.tostring());

        httprequestbase httprequest = createhttprequest(restendpointuri, scheme, method, headersjson, payloadstr, rmapping);

        // create http client
        closeablehttpclient httpclient = createhttpclient(httprequest, scheme, execution);

        // execute request
        httpresponse response = executehttprequest(httpclient, httprequest);

        // map response to process instance variables
        if (responsemapping != null) {
            mapresponse(response, rmapping, execution);
        }

        logger.info("ended generic rest call delegate");

    }

    protected uri composeuri(string resturl, delegateexecution execution)
            throws urisyntaxexception {

        uribuilder uribuilder = null;
        uribuilder = encodepath(resturl, uribuilder);
        return uribuilder.build();
    }

    protected uribuilder encodepath(string resturl, uribuilder uribuilder) throws urisyntaxexception {

        if (stringutils.isnotempty(resturl)) {

            // check if there are url params
            if (resturl.indexof('?') > -1) {

                list params = urlencodedutils.parse(new uri(resturl), "utf-8");

                if (params != null && !params.isempty()) {
                    resturl = resturl.substring(0, resturl.indexof('?'));
                    uribuilder = new uribuilder(resturl);
                    uribuilder.addparameters(params);

                }
            } else {
                uribuilder = new uribuilder(resturl);
            }
        }

        return uribuilder;
    }

    protected httprequestbase createhttprequest(uri restendpointuri, string scheme, string httpmethod, string headers, string payload, string responsemapping) {

        if (stringutils.isempty(httpmethod)) {
            throw new activitiexception("no http method provided");
        }
        if (restendpointuri == null) {
            throw new activitiexception("no rest endpoint uri provided");
        }

        httprequestbase httprequest = null;
        httpmethod parsedmethod = httpmethod.valueof(httpmethod.touppercase());
        stringentity input;
        uribuilder builder = new uribuilder(restendpointuri);

        switch (parsedmethod) {
            case get:
                try {
                    httprequest = new httpget(builder.build());
                    httprequest = addheaderstorequest(httprequest, headers);
                } catch (urisyntaxexception use) {
                    throw new activitiexception("error while building get request", use);
                }
                break;
            case post:
                try {
                    httprequest = new httppost(builder.build());
                    input = new stringentity(payload);
//                input.setcontenttype(new basicheader(http.content_type, "application/json"));
                    ((httppost) httprequest).setentity(input);
                    httprequest = addheaderstorequest(httprequest, headers);
                    break;
                } catch (exception e) {
                    throw new activitiexception("error while building post request", e);
                }
            case put:
                try {
                    httprequest = new httpput(builder.build());
                    input = new stringentity(payload);
//                input.setcontenttype(new basicheader(http.content_type, "application/json"));
                    ((httpput) httprequest).setentity(input);
                    httprequest = addheaderstorequest(httprequest, headers);
                    break;
                } catch (exception e) {
                    throw new activitiexception("error while building put request", e);
                }
            case delete:
                try {
                    httprequest = new httpdelete(builder.build());
                    httprequest = addheaderstorequest(httprequest, headers);
                } catch (urisyntaxexception use) {
                    throw new activitiexception("error while building delete request", use);
                }
                break;
            default:
                throw new activitiexception("unknown http method provided");
        }

        return httprequest;
    }


    protected closeablehttpclient createhttpclient(httprequestbase request, string scheme, delegateexecution execution) {

        sslconnectionsocketfactory sslsf = null;

        // allow self signed certificates and hostname mismatches.
        if (stringutils.equalsignorecase(scheme, "https")) {
            try {
                sslcontextbuilder builder = new sslcontextbuilder();
                builder.loadtrustmaterial(nullnew trustselfsignedstrategy());
                sslsf = new sslconnectionsocketfactory(builder.build(), sslconnectionsocketfactory.allow_all_hostname_verifier);
            } catch (exception e) {
                logger.warn("could not configure http client to use ssl", e);
            }
        }

        httpclientbuilder httpclientbuilder = httpclientbuilder.create();

        if (sslsf != null) {
            httpclientbuilder.setsslsocketfactory(sslsf);
        }

        return httpclientbuilder.build();
    }

    protected httpresponse executehttprequest(closeablehttpclient httpclient, httprequestbase httprequest) {

        closeablehttpresponse response = null;
        try {
            response = httpclient.execute(httprequest);
        } catch (ioexception e) {
            throw new activitiexception("error while executing http request: "   httprequest.geturi(), e);
        }

        if (response.getstatusline().getstatuscode() >= 400) {
            throw new activitiexception("error while executing http request "   httprequest.geturi()   " with status code: "
                      response.getstatusline().getstatuscode());
        }

        return response;
    }

    protected void mapresponse(httpresponse response, string responsemapping, delegateexecution execution) {

        if (responsemapping == null || responsemapping.trim().length() == 0) {
            return;
        }

        jsonnode jsonnode = null;
        try {
            string jsonstring = entityutils.tostring(response.getentity());
            jsonnode = objectmapper.readtree(jsonstring);

        } catch (exception e) {
            throw new activitiexception("error while parsing response", e);
        }

        if (jsonnode == null) {
            throw new activitiexception("didn't expect an empty response body");
        }
        execution.setvariable(responsemapping, jsonnode.tostring());
    }

    protected httprequestbase addheaderstorequest(httprequestbase httprequest, string headerjson) {
        boolean contenttypedetected = false;
        if (headerjson != null) {
            // convert json to array
            try {
                // configuration for jackson/fasterxml
                objectmapper.addmixinannotations(basicnamevaluepair.class, basicnamevaluepairmixin.class);
                namevaluepair[] headers = objectmapper.readvalue(headerjson, basicnamevaluepair[].class);
                for (namevaluepair header : headers) {
                    httprequest.addheader(header.getname(), header.getvalue());
                    if (header.getname().equals(http.content_type)) {
                        contenttypedetected = true;
                    }
                }
            } catch (exception e) {
                throw new activitiexception("unable to parse json header array", e);
            }
        }
        // now add content type if necessary
        if (!contenttypedetected) {
            httprequest.addheader(http.content_type, "application/json");
        }
        return httprequest;
    }

    /**
     * 
@return string value of expression.
     * 
@throws {@link illegalargumentexception} when the expression resolves to a value which is not a string
     *                or if the value is null.
     
*/
    protected string getexpressionasstring(expression expression, delegateexecution execution) {
        if (expression == null) {
            return null;
        } else {
            object value = expression.getvalue(execution);
            if (value instanceof string) {
                return (string) value;
            } else {
                throw new illegalargumentexception("expression does not resolve to a string or is null: "   expression.getexpressiontext());
            }
        }
    }
}
posted @ 华梦行 阅读(212) | |  
  2017年5月16日

1、概述

activiti系统一共有23个表,包括流程定义表、一般数据信息表、流程运行实例表、流程历史记录表、用户用户组表。

2、activiti 流程定义表

流程定义表,流程定义表也可以叫做是静态资源库,静态资源包括图片、定义规则等。它有部署信息表、流程模型表、流程定义表

1、act_re_deployment(部署信息表)

包括:部署流程名称、类型、部署时间

2、act_re_model(模型表)

名称,key、类型、创建时间、最后修改时间、版本、数据源信息、部署id、编辑源值id、编辑源额外值id(外键act_ge_bytearray )

3、act_re_procdef(流程定义表) 

包括流程定义、类型、流程名称、流程key、版本号、部署id、资源名称、图片资源名称、描述信息、是否从key启动、暂停状态。

3、activiti 运行实例表

运行实例表记录流程流转过程中产生的数据,一般数据分为两个部分流程数据、业务数据。流程数据是指activiti流程引擎流转过程中的数据,包括流程执行实例数据接、任务数据、执行任务人员信息、变量信息。业务数据则是流程过程中保存的表单数据,例如:如请假的请假单数据、报销单数据、审批意见信息等,此部分数据一般需要自己建数据表进行保存,在之前的jbpm4中没有保存业务数据。

1、act_ru_event_subscr(事件子脚本)作用未知

事件名称(event_name_)、事件类型(event_type_)、流程执行id(execution_id_)、流程实例id(proc_inst_id_)、活动id(activity_id_)、配置信息(configuration_)、创建时间(created_)

2、act_ru_execution(执行中流程执行)核心我的代办任务查询表

流程实例id(proc_inst_id_),业务key(business_key_)、父执行流程(parent_id_)、流程定义id(外键proc_def_id_)、实例id(act_id_)、激活状态(is_active_)、并发状态(is_concurrent)、is_scope、is_evnet_scope、暂停状态(suspension_state)、缓存结束状态(cached_end_state)

3、act_ru_identitylink(身份联系)

用户组id(group_id_)、用户组类型(type_)、用户id(user_id_)、任务id(外键:task_id_)、流程实例id(外键:proc_inst_id_)、流程定义id(外键:proc_def_id_)

4、act_ru_job(运行中的任务)

5、act_ru_task(执行中实时任务)代办任务查询表

实例id(外键execution_id_)、流程实例id(外键proc_inst_id_)、流程定义id(proc_def_id_)、任务名称(name_)、父节任务id(parent_task_id_)

、任务描述(description_)、任务定义key(task_def_key_)、所属人(owner_)、代理人员 (assignee_)、代理团(delegation_)、优先权(priority_)、创建时间(create_time_)、执行时间(due_date_)、暂停状态(suspension_state_)

6、act_ru_variable(实时变量)

变量名称(name_)、编码类型(type_)、执行实例id(execution_id_)、流程实例id(proc_inst_id_)、任务id(task_id_)、字节组id(bytearray_id_)、double_、long_、text_、text2_

3、流程历史记录

流程历史信息表,activiti历史记录表包括节点信息表、附件信息表、历史审批记录表、理想详细信息表、历史身份信息表、流程实例历史表、任务历史表、历史变量表。(节点信息表、附件信息表、历史审批记录表、理想详细信息表、历史身份信息表)这些表目前还未知是如何用的。(流程实例历史表、任务历史表、历史变量)三个表可以查询我已完成任务、任务追踪等。

1、act_hi_actinst(活动实例信息)

流程定义id(proc_def_id_)、流程实例id(proc_inst_id_)、流程执行id(execution_id_)、活动id(act_id_)、活动名称(task_id_)、活动类型(act_type_)、任务id、(task_id_)、请求流程实例id(call_proc_inst_id_)、代理人员(assignee_)、开始时间(start_time_)、结束时间(end_time_)、时长(duration_)

2、act_hi_attachment(附件信息)

用户id(user_id_)、名称(name_)、描述(description_)、类型(type_)、任务id(task_id_)、流程实例id(proc_inst_id_)、连接(url_)、内容id(content_id_)

3、act_hi_comment(历史审批信息)

类型(type_)、时间(time_)、用户id(user_id_)、任务id(task_id_)、流程实例id(proc_inst_id_)、活动(action_)、消息(message_)、全部消息(full_msg_)

4、act_hi_detail(历史详细信息)

数据类型(type_)、创建时间(time_)、名称(name_)、流程实例id(proc_inst_id_)、执行实例id(execution_id_)、任务id(task_id_)、活动实例id(act_inst_id_)、变量类型(var_type_)、字节数组id、double_、long_、值(text_)、值2(text2_)

5、act_hi_identitylink(历史身份信息)

任务id(task_id_)、流程实例id(proc_inst_id_)、userid(user_id_)、用户组类型type(type_)、用户组id(group_id_)

6、act_hi_procinst(历史流程实例信息)核心表

流程实例id(proc_inst_id_)、业务key(business_key_)、流程定义id(proc_def_id_)、开始时间(start_time_)、结束时间(end_time_)、时长(duration_)、发起人员id(start_user_id_)、开始节点(start_act_id_)、结束节点(end_act_id_)、超级流程实例id(super_process_instance_id_)、删除理由(delete_reason_)

7、act_hi_taskinst(历史任务流程实例信息)核心表

流程实例id(proc_inst_id_)、任务定义key(business_key_)、流程定义id(proc_def_id_)、执行id(execution_id_)、名称(name_)、父任务id(parent_task_id_)、描述(description_)、所属人(owner_)、代理人(assignee_)、开始时间(start_time_)、结束时间(end_time_)、时长(duration_)、删除理由(delete_reason__)、优先级(priority_)、应完成时间(due_date_)、表单key(form_key_)

8、act_hi_varinst(历史变量信息)

流程实例id(proc_inst_id_)、执行id(execution_id_)、任务id、名称(name_)、变量(task_id_)、类型(var_type_)、字节数组id(bytearray_id_)、double_、long_、text_、text2_

4、一般数据

1、act_ge_bytearray(字节数据表)

名称(name_)、部署id(deployment_id_)、字节数据(bytes_)、发生的(generated_)

2、act_ge_property(一般属性表)

名称(name_)、值(value_)

5、用户用户组表

activit 的用户用户组表,包括用户信息、用户组信息、用户与用户组间的关系、用户信息与用户之间的关系。在实际开发中未采用,用的实际系统中用户。

1、act_id_group(用户组表)

名称(name_)、类型(type_)

2、act_id_user(用户表)

姓(first_)、名称(last_)、邮件(email_)、密码(pwd_)、头像id (picture_id_)

3、act_id_info(用户信息表)

用户id(user_id_)、类型(type_)、forminput名称(key_)、值(value_)、密码(password_)、父节点(parent_id_)

4、act_id_membership(用户用户组关联表)

用户id(user_id_)、用户组id(group_id)

activiti表结构分析完成,花了5个小时,还有很多问题不明白。后续慢慢开发过程中再理一次表之间关系吧,初步想法在系统中需要扩建表,把业务数据和流程数据分开。

posted @ 华梦行 阅读(1929) | |  
  2017年5月15日
     摘要: activiti工作流引擎数据库表结构 数据库表的命名 acitiviti数据库中表的命名都是以act_开头的。第二部分是一个两个字符用例表的标识。此用例大体与服务api是匹配的。 l  act_re_*:’re’表示repository。带此前缀的表包含的是静态信息,如,流程定义,流程的资源(图片,规则等)。 l  act_ru_*:̵...  
posted @ 华梦行 阅读(208) | |  
  2017年5月10日
@transient 可选 @transient表示该属性并非一个到数据库表的字段的映射,orm框架将忽略该属性. 如果一个属性并非数据库表的字段映射,就务必将其标示为@transient,否则,orm框架默认其注解为@basic 示例: //根据birth计算出age属性 @transient public int getage() { return getyear(new date()) - getyear(birth); } 注意是加在get方法上的
posted @ 华梦行 阅读(1044) | |  
  2017年3月22日
snmpwalk –v 2 –c public 192.168.20.114 1.3.6.1.2.1.2.2.1.3
snmpget -r:127.0.0.1 -o:.1.3.6.1.2.1.25.3.3.1.2
e:\>snmpget -r:127.0.0.1 -o:.1.3.6.1.2.1.1.1.0
snmpget v1.01 - 凯发天生赢家一触即发官网 copyright (c) 2009 snmpsoft company
[ more useful network tools on http://www.snmpsoft.com ]
oid=.1.3.6.1.2.1.1.1.0
type=octetstring
value=hardware: intel64 family 6 model 60 stepping 3 at/at compatible - software
: windows version 6.1 (build 7601 multiprocessor free)
snmpwalk -v:2c -c:public -r:127.0.0.1
posted @ 华梦行 阅读(114) | |  
  2017年3月21日

druid是什么?

druid是一个jdbc组件,它包括四个部分:

http://download.csdn.net/download/feelnature/1580901
http://tomcat.apache.org/tomcat-8.5-doc/monitoring.html#enabling_jmx_remote

http://download.csdn.net/detail/qq_21163257/9695557

 

  • druiddriver 代理driver,能够提供基于filter-chain模式的插件体系。
  • druiddatasource 高效可管理的数据库连接池。
  • sqlparser
  • 扩展组件
  • binary: http://code.alibabatech.com/mvn/releases/com/alibaba/druid/0.1.2/druid-0.1.2.jar
  • source: http://code.alibabatech.com/mvn/releases/com/alibaba/druid/0.1.2/druid-0.1.2-sources.jar

druid可以做什么?

  • 可以监控数据库访问性能,druid内置提供了一个功能强大的statfilter插件,能够详细统计sql的执行性能,这对于线上分析数据库访问性能有帮助。
  • 替换dbcp和c3p0。druid提供了一个高效、功能强大、可扩展性好的数据库连接池。
  • 数据库密码加密。直接把数据库密码写在配置文件中,这是不好的行为,容易导致安全问题。druiddruiver和druiddatasource都支持passwordcallback。
  • sql执行日志,druid提供了不同的logfilter,能够支持common-logging、log4j和jdklog,你可以按需要选择相应的logfilter,监控你应用的数据库访问情况。
  • 扩展jdbc,如果你要对jdbc层有编程的需求,可以通过druid提供的filter机制,很方便编写jdbc层的扩展插件。

druiddriver,是一个proxyjdbcdriver,它提供了filter-chain模式的扩展机制,使得在jdbc扩展编程特别方便。

druid提供了一些内置的扩展机制,包括statlogtrace、ha等扩展。


druiddatasource是一个数据库连接池的实现,它的设计目标是提供一个当前最好的数据库连接池,在性能、扩展性等方面取得最合适的平衡,取代dbcp、c3p0等连接池。

  • 高性能。测试数据表明,druid比dbcp、c3p0、bonecp的性能都好很多。具体请看测试数据
  • 可管理性,druiddatasource本身提供了很多监控属性,具体看这里。druiddatasource支持statfilter,具体配置看 这里
  • 可扩展性,提供基于filter-chain模式的扩展机制。具体自定义扩展的例子看这里
  • 替换dbcp,配置和dbcp兼容,可以方便替换dbcp。
  • 适合大规模应用。结合alibaba使用数据库连接池的经验,避免一些已知问题,例如数据库不可用恢复之后产生的连接风暴问题等。

设计

这是druiddatasource的设计图示:
http://code.alibabatech.com/svn/druid/trunk/doc/druid-pool.txt
如果发现有乱码,请选择utf-8的编码方式查看。

druid提供一个手工编写的高性能的方便扩展的sql parser。将会支持mysql、oracle等流行关系数据库的sql parser。

parser组件包括如下几个部分:

  • lexer 词法解析
  • parser,parser包括exprparser,各种statementparser。
  • ast, abstract syntax tree。parserparse出来的结果就是ast。
  • visitor。对ast做各种处理,比如formatoutput,遍历等等。

简介

 

druid提供了强大的监控功能,能够监控连接池行为和sql执行情况,让你能够详细了解应用的数据库访问行为。

监控对象

  • druid的统计信息定义代码实现在com/alibaba/druid/stat下。所有的stat都全局静态变量的方式保存,这样做使得外部获取监控信息更容易。
  • 获取druid监控信息的入口是com.alibaba.druid.stat.jdbcstatmanager
  • druid的监控统计信息都是通过statfilter来实现的,如果你需要数据源进行监控,那你需要启用statfilter
 
posted @ 华梦行 阅读(252) | |  
  2017年3月19日
http://repo.spring.io/release/org/springframework/spring/4.3.6.release/
http://spring.io/tools/sts http://www.loveweir.com/posts/view/19
https://github.com/rahulyewale/springmvcjpa
http://download.csdn.net/download/jiuqiyuliang/8640621
http://blog.csdn.net/suzunshou/article/details/49949005
https://repo1.maven.org/maven2/org/mybatis/mybatis/
http://blog.csdn.net/jiuqiyuliang/article/details/45132493/
https://github.com/mybatis/generator/releases
posted @ 华梦行 阅读(128) | |  
  2016年7月21日
今天从windows上导出一个sql执行文件,再倒入到unbutn中,结果出现乱码,折腾7-8分钟, 
解决方式 
在导出mysql sql执行文件的时候,指定一下编码格式: 
复制代码 代码如下:
mysqldump -uroot -p --default-character-set=utf8 mo(dbname) > e://xxxx.sql 
导入的时候ok了 
执行如下 
复制代码 代码如下:
mysql -u root -p --default-character-set=utf8 
use dbname 
source /root/newsdata.sql 
posted @ 华梦行 阅读(116) | |  
  2016年6月27日
centos
1、备份
mv /etc/yum.repos.d/centos-base.repo /etc/yum.repos.d/centos-base.repo.backup 
2、下载新的centos-base.repo 到/etc/yum.repos.d/
centos 5
 wget -o /etc/yum.repos.d/centos-base.repo http://mirrors.aliyun.com/repo/centos-5.repo  
centos 6
 wget -o /etc/yum.repos.d/centos-base.repo http://mirrors.aliyun.com/repo/centos-6.repo  
centos 7
 wget -o /etc/yum.repos.d/centos-base.repo http://mirrors.aliyun.com/repo/centos-7.repo  
3、之后运行yum makecache生成缓存
相关链接
##官方凯发k8网页登录主页: http://www.centos.org/
##邮件列表: http://www.centos.org/modules/tinycontent/index.php?id=16
##论坛: http://www.centos.org/modules/newbb/
##文档: http://www.centos.org/docs/
##wiki: http://wiki.centos.org/
    posted @ 华梦行 阅读(131) | |  
      2016年5月11日

    对输入数据进行正态化

     

    为了使神经网络有效,我们必须对数据进行正态化。这是激活函数的正确计算所需要的。正态化是一种数学处理,将数据转换为 0..1 或 -1..1 的范围。正态化后的数据可以进行去正态化,即转换回原来的范围。

    要将神经网络输出解码为人类可读的形式,需要对数据进行去正态化。谢天谢地,负责标准化和去标准化,因此不需要实施它。如果您对它的工作原理感到好奇,您可以分析以下代码:  


    public static double input_low = -20;
        public static double input_high = 20;
        public static double output_high = 1;
        public static double output_low = -1;
        public static double normalize(final double value) {
            return ((value - input_low) / (input_high - input_low))
                    * (output_high - output_low) output_low;
            // return ((10f 20f) / (40f)) * (2f) output_low;
        }
        public static double denormalize(final double data) {
            double result = ((input_low - input_high) * data - output_high
                    * input_low input_high * output_low)
                    / (output_low - output_high);
            return result;
        }

    x=-5:.01:5;
       plot(x,tanh(x)),grid on;
    posted @ 华梦行 阅读(216) | |  
      2016年5月7日

    1. quickstart

    the cron4j main entity is the scheduler. with a instance you can execute tasks at fixed moments, during all the year. a scheduler can execute a task once a minute, once every five minutes, friday at 10:00, on february the 16th at 12:30 but only if it is saturday, and so on.

    the use of the cron4j scheduler is a four steps operation:

    1. create your scheduler instance.
    2. schedule your actions. to schedule an action you have to tell the scheduler what it has to do and when. you can specify what using a java.lang.runnable or a instance, and you can specify when using a scheduling pattern, which can be represented with a string or with a instance.
    3. starts the scheduler.
    4. stops the scheduler, when you don't need it anymore.

    consider this simple example:

    import it.sauronsoftware.cron4j.scheduler;  public class quickstart {  	public static void main(string[] args) { 		// creates a scheduler instance. 		scheduler s = new scheduler(); 		// schedule a once-a-minute task. 		s.schedule("* * * * *", new runnable() { 			public void run() { 				system.out.println("another minute ticked away..."); 			} 		}); 		// starts the scheduler. 		s.start(); 		// will run for ten minutes. 		try { 			thread.sleep(1000l * 60l * 10l); 		} catch (interruptedexception e) { 			; 		} 		// stops the scheduler. 		s.stop(); 	}  }

    this example runs for ten minutes. at every minute change it will print the sad (but true) message "another minute ticked away...".

    some other key concepts:

    • you can schedule how many tasks you want.
    • you can schedule a task when you want, also after the scheduler has been started.
    • you can change the scheduling pattern of an already scheduled task, also while the scheduler is running (reschedule operation).
    • you can remove a previously scheduled task, also while the scheduler is running (deschedule operation).
    • you can start and stop a scheduler how many times you want.
    • you can schedule from a file.
    • you can schedule from any source you want.
    • you can supply listeners to the scheduler in order to receive events about the executed task.
    • you can control any ongoing task.
    • you can manually launch a task, without using a scheduling pattern.
    • you can change the scheduler working time zone.
    • you can validate your scheduling patterns before using them with the scheduler.
    • you can predict when a scheduling pattern will cause a task execution.

    2. scheduling patterns

    a unix crontab-like pattern is a string split in five space separated parts. each part is intended as:

    1. minutes sub-pattern. during which minutes of the hour should the task been launched? the values range is from 0 to 59.
    2. hours sub-pattern. during which hours of the day should the task been launched? the values range is from 0 to 23.
    3. days of month sub-pattern. during which days of the month should the task been launched? the values range is from 1 to 31. the special value "l" can be used to recognize the last day of month.
    4. months sub-pattern. during which months of the year should the task been launched? the values range is from 1 (january) to 12 (december), otherwise this sub-pattern allows the aliases "jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov" and "dec".
    5. days of week sub-pattern. during which days of the week should the task been launched? the values range is from 0 (sunday) to 6 (saturday), otherwise this sub-pattern allows the aliases "sun", "mon", "tue", "wed", "thu", "fri" and "sat".

    the star wildcard character is also admitted, indicating "every minute of the hour", "every hour of the day", "every day of the month", "every month of the year" and "every day of the week", according to the sub-pattern in which it is used.

    once the scheduler is started, a task will be launched when the five parts in its scheduling pattern will be true at the same time.

    scheduling patterns can be represented with instances. invalid scheduling patterns are cause of s. the schedulingpattern class offers also a static method, that can be used to validate a string before using it as a scheduling pattern.

    some examples:

    5 * * * *
    this pattern causes a task to be launched once every hour, at the begin of the fifth minute (00:05, 01:05, 02:05 etc.).

    * * * * *
    this pattern causes a task to be launched every minute.

    * 12 * * mon
    this pattern causes a task to be launched every minute during the 12th hour of monday.

    * 12 16 * mon
    this pattern causes a task to be launched every minute during the 12th hour of monday, 16th, but only if the day is the 16th of the month.

    every sub-pattern can contain two or more comma separated values.

    59 11 * * 1,2,3,4,5
    this pattern causes a task to be launched at 11:59am on monday, tuesday, wednesday, thursday and friday.

    values intervals are admitted and defined using the minus character.

    59 11 * * 1-5
    this pattern is equivalent to the previous one.

    the slash character can be used to identify step values within a range. it can be used both in the form */c and a-b/c. the subpattern is matched every c values of the range 0,maxvalue or a-b.

    */5 * * * *
    this pattern causes a task to be launched every 5 minutes (0:00, 0:05, 0:10, 0:15 and so on).

    3-18/5 * * * *
    this pattern causes a task to be launched every 5 minutes starting from the third minute of the hour, up to the 18th (0:03, 0:08, 0:13, 0:18, 1:03, 1:08 and so on).

    */15 9-17 * * *
    this pattern causes a task to be launched every 15 minutes between the 9th and 17th hour of the day (9:00, 9:15, 9:30, 9:45 and so on... note that the last execution will be at 17:45).

    all the fresh described syntax rules can be used together.

    * 12 10-16/2 * *
    this pattern causes a task to be launched every minute during the 12th hour of the day, but only if the day is the 10th, the 12th, the 14th or the 16th of the month.

    * 12 1-15,17,20-25 * *
    this pattern causes a task to be launched every minute during the 12th hour of the day, but the day of the month must be between the 1st and the 15th, the 20th and the 25, or at least it must be the 17th.

    finally cron4j lets you combine more scheduling patterns into one, with the pipe character:

    0 5 * * *|8 10 * * *|22 17 * * *
    this pattern causes a task to be launched every day at 05:00, 10:08 and 17:22.

    3. how to schedule, reschedule and deschedule a task

    the simplest manner to build a task is to implement the well-known java.lang.runnable interface. once the task is ready, it can be scheduled with the . method. this method throws an when the supplied string does not represent a valid scheduling pattern.

    another way to build a task is to extend the abstract class, which is more powerful and let the developer access some other cron4j features. this is better discussed in the "" paragraph. task instances can be scheduled with the and the methods.

    scheduling methods available in the scheduler always return an id used to recognize and retrieve the scheduled operation. this id can be used later to reschedule the task (changing its scheduling pattern) with the or the methods, and to deschedule the task (remove the task from the scheduler) with the method.

    the same id can also be used to retrieve the scheduling pattern associated with a scheduled task, with the method, or to retrieve the task itself, with the method.

    4. how to schedule a system process

    system processes can be easily scheduled using the class:

    processtask task = new processtask("c:\\windows\\system32\\notepad.exe"); scheduler scheduler = new scheduler(); scheduler.schedule("* * * * *", task); scheduler.start(); // ... 

    arguments for the process can be supplied by using a string array instead of a single command string:

    string[] command = { "c:\\windows\\system32\\notepad.exe", "c:\\file.txt" }; processtask task = new processtask(command); // ...

    environment variables for the process can be supplied using a second string array, whose elements have to be in the name=value form:

    string[] command = { "c:\\tomcat\\bin\\catalina.bat", "start" }; string[] envs = { "catalina_home=c:\\tomcat", "java_home=c:\\jdks\\jdk5" }; processtask task = new processtask(command, envs); // ...

    the default working directory for the process can be changed using a third parameter in the constructor:

    string[] command = { "c:\\tomcat\\bin\\catalina.bat", "start" }; string[] envs = { "catalina_home=c:\\tomcat", "java_home=c:\\jdks\\jdk5" }; file directory = "c:\\mydirectory"; processtask task = new processtask(command, envs, directory); // ...

    if you want to change the default working directory but you have not any environment variable, the envs parameter of the constructor can be set to null:

    processtask task = new processtask(command, null, directory);

    when envs is null the process inherits every environment variable of the current jvm:

    environment variables and the working directory can also be set by calling the and methods.

    the process standard output and standard error channels can be redirected to files by using the and methods:

    processtask task = new processtask(command, envs, directory); task.setstdoutfile(new file("out.txt")); task.setstderrfile(new file("err.txt"));

    in a siminal manner, the standard input channel can be read from an existing file, calling the method:

    processtask task = new processtask(command, envs, directory); task.setstdinfile(new file("in.txt"));

    5. how to schedule processes from a file

    the cron4j scheduler can also schedule a set of processes from a file.

    you have to prepare a file, very similar to the ones used by the unix crontab, and register it in the scheduler calling the method. the file can be descheduled by calling the method. scheduled files can be retrieved by calling the method.

    scheduled files are parsed every minute. the scheduler will launch every process declared in the file whose scheduling pattern matches the current system time.

    syntax rules for cron4j scheduling files are reported in the "" paragraph.

    6. building your own task

    a java.lang.runnable object is the simplest task ever possible, but to gain control you need to extend the class. in the plainest form, implementing runnable or extending task are very similar operations: while the first requires a run() method, the latter requires the implementation of . the execute(taskexecutioncontext) method provides a instance, which the runnable.run() method does not provide. the context can be used in the following ways:

    • a task can communicate with its executor, by notifying its internal state with a textual description. this is called status tracking. if you are interested in supporting status tracking in your task, you have to override the method, which should return true. once this has been done, within the execute(taskexecutioncontext) method you are enabled to call the context method. this will propagate your task status message to its executor. the status message, through the executor, can be retrieved by an external user (see the "" paragraph).

    • a task can communicate with its executor, by notifying its completeness level with a numeric value. this is called completeness tracking. if you are interested in supporting completeness tracking in your task, you have to override the method, which should return true. once this has been done, within the execute(taskexecutioncontext) method you are enabled to call the context method, with a value between 0 and 1. this will propagate your task completeness level to its executor. the completeness level, through the executor, can be retrieved by an external user (see the "" paragraph).

    • a task can be optionally paused. if you are interested in supporting pausing and resuming in your task, you have to override the method, which should return true. once this has been done, within the execute(taskexecutioncontext) method you have to periodically call the context method. this will pause the task execution until it will be resumed (or stopped) by an external user (see the "" paragraph).

    • a task can be optionally stopped. if you are interested in supporting stopping in your task, you have to override the method, which should return true. once this has been done, within the execute(taskexecutioncontext) method you have to periodically call the context method. this will return true when the execution has be demanded to be stopped by an external user (see the "" paragraph). then it's your responsibility to handle the event, by letting your task gently stop its ongoing activities.

    • through the context, the task can retrieve the scheduler, calling .

    • through the context, the task can retrieve its executor, calling .

    a custom task can be , or returned by a .

    7. building your own collector

    you can build and plug within the scheduler your own task source, via the task collector api.

    the cron4j scheduler supports the registration of one or more instances, with the method. registered collectors can be retrieved with the scheduler method. a previously registered collector can be removed from the scheduler with the method. collectors can be added, queried or removed at every moment, also when the scheduler is started and it is running.

    each registered task collector is queried by the scheduler once a minute. the scheduler calls the collector method. the implementation must return a instance. a tasktable is a table that associates tasks and scheduling patterns. the scheduler, once the table has been retrieved, will examine the reported entries, and it will execute every task whose scheduling pattern matches the current system time.

    a custom collector can be used to tie the scheduler with an external task source, i.e. a database or a xml file, which can be managed and changed in its contents also at run time.

    8. building your own scheduler listener

    the api can be used to listen to scheduler events.

    the schedulerlistener interface requires the implementation of the following methods:


    • this one is called every time a task is launched by the scheduler.


    • this one is called every time a task execution has been successfully completed.


    • this one is called every time a task execution fails due to an uncaught exception.

    see the "" paragraph for more info about task executors.

    once your schedulerlistener instance is ready, you can register it on a scheduler object by calling its method. already registered listeners can be removed by calling the method. the scheduler can also give back any registered listener, with the method.

    schedulerlisteners can be added and removed at every moment, also while the scheduler is running.

    9. executors

    the scheduler, once it has been started and it is running, can be queried to give back its executors. an executor is similar to a thread. executors is used by the scheduler to execute tasks.

    by calling the . method you can obtain the currently ongoing executors.

    you can also obtain an executor through a instance (see the "" paragraph).

    each executor, represented by a instance, performs a different task execution.

    the task can be retrieved with the method.

    the executor status can be checked with the method: it returns true if the executor is currently running.

    if the executor is running, the current thread can be paused until the execution will be completed, calling the method.

    the method returns true if the currently executing task supports status tracking. it means that the task communicates to the executor its status, represented by a string. the current status message can be retrieved by calling the executor method.

    the method returns true if the currently executing task supports completeness tracking. it means that the task communicates to the executor its own completeness level. the current completeness level can be retrieved by calling the executor method. returned values are between 0 (task just started and still nothing done) and 1 (task completed).

    the method returns true if the currently executing task supports execution pausing. it means that the task execution can be paused by calling the executor method. the pause status of the executor can be checked with the method. a paused executor can be resumed by calling its method.

    the method returns true if the currently executing task supports execution interruption. it means that the task execution can be stopped by calling the executor method. the interruption status of the executor can be checked with the method. stopped executors cannot be resumed.

    the method returns a time stamp reporting the start time of the executor, or a value less than 0 if the executor has not been yet started.

    the method returns the scheduler which is the owner of the executor.

    the method returns a textual guid for the executor.

    executors offer also an event-driven api, through the class. a taskexecutorlistener can be added to a taskexecutor with its method. listeners can be removed with the method, and they can also be retrieved with the method. a taskexecutorlistener must implement the following methods:


    • called when the executor is requested to pause the ongoing task. the given parameter represents the source taskexecutor instance.


    • called when the executor is requested to resume the execution of the previously paused task. the given parameter represents the source taskexecutor instance.


    • called when the executor is requested to stop the task execution. the given parameter represents the source taskexecutor instance.


    • called when the executor has completed the task execution. the first parameter represents the source taskexecutor instance, while the second is the optional exception that has caused the task to be terminated. if the task has been completed successfully, the given value is null.


    • called every time the execution status message changes. the first parameter represents the source taskexecutor instance, while the second is the new message issued by the task.


    • called every time the execution completeness value changes. the first parameter represents the source taskexecutor instance, while the second is the new completeness value (between 0 and 1) issued by the task.

    10. manual task launch

    if the scheduler is started and running, it is possible to manually launch a task, without scheduling it with a pattern. the method is .. the task will be immediately launched, and a instace is returned to the caller. the returned object can be used to control the task execution (see the "" paragraph).

    11. working with time zones

    scheduler instances, by default, work with the system default time zone. i.e. a scheduling pattern whose value is 0 2 * * * will activate its task at 02:00 am according to the default system time zone. the scheduler can be requested to work with a different time zone, which is not the system default one. call . and . to control this feature.

    once the default time zone has been changed, system current time is adapted to the supplied zone before comparing it with registered scheduling patterns. the result is that any supplied scheduling pattern is treated according to the specified time zone. suppose this situation:

    • system time: 10:00
    • system time zone: gmt 1
    • scheduler time zone: gmt 3

    the scheduler, before comparing system time with patterns, translates 10:00 from gmt 1 to gmt 3. it means that 10:00 becomes 12:00. the resulted time is then used by the scheduler to activate tasks. so, in the given configuration at the given moment, any task scheduled as 0 12 * * * will be executed, while any 0 10 * * * will not.

    12. daemon threads

    the java virtual machine exits when the only threads running are all daemon threads. the cron4j scheduler can be configured to spawn only daemon threads. to control this feature call the . method. this method must be called before the scheduler is started. default value is false. to check the scheduler current daemon status call the . method.

    13. predictor

    the class is able to predict when a scheduling pattern will be matched.

    suppose you want to know when the scheduler will execute a task scheduled with the pattern 0 3 * jan-jun,sep-dec mon-fri. you can predict the next n execution of the task using a predictor instance:

    string pattern = "0 3 * jan-jun,sep-dec mon-fri"; predictor p = new predictor(pattern); for (int i = 0; i < n; i  ) { 	system.out.println(p.nextmatchingdate()); }

    14. cron parser

    the class can be used to parse crontab-like formatted file and character streams.

    if you want to schedule a list of tasks declared in a crontab-like file you don't need the cronparser, since you can do it by adding the file to the scheduler, with the . method.

    consider to use the cronparser if the scheduler.schedulefile(file) method is not enough for you. in example, you may need to fetch the task list from a remote source which is not representable as a java.io.file object (a document on a remote server, a dbms result set and so on). to solve the problem you can implement your own , getting the advantage of the cronparser to easily parse any crontab-like content.

    you can parse a whole file/stream, but you can also parse a single line.

    a line can be empty, can contain a comment or it can be a scheduling line.

    a line containing no characters or a line with only space characters is considered an empty line.

    a line whose first non-space character is a number sign (#) is considered a comment.

    empty lines and comment lines are ignored by the parser.

    any other kind of line is parsed as a scheduling line.

    a valid scheduling line respects the following structure:

    scheduling-pattern [options] command [args]
    • scheduling-pattern is a valid scheduling pattern, according with the definition given by the class.
    • options is a list of optional information used by cron4j to prepare the task execution environment. see below for a more detailed description.
    • command is a system valid command, such an executable call.
    • args is a list of optional arguments for the command.

    after the scheduling pattern item, other tokens in each line are space separated or delimited with double quotation marks (").

    double quotation marks delimited items can take advantage of the following escape sequences:

    • \" - quotation mark
    • \\ - back slash
    • \/ - slash
    • \b - back space
    • \f - form feed
    • \n - new line
    • \r - carriage return
    • \t - horizontal tab
    • \ufour-hex-digits - the character at the given unicode index

    the options token collection can include one or more of the following elements:

    • in:file-path - redirects the command standard input channel to the specified file.
    • out:file-path - redirects the command standard output channel to the specified file.
    • err:file-path - redirects the command standard error channel to the specified file.
    • env:name=value - defines an environment variable in the scope of the command.
    • dir:directory-path - sets the path of the working directory for the command. this feature is not supported if the executing jvm is less than 1.3.

    it is also possible to schedule the invocation of a method of a java class in the scope of the parser classloader. the method has to be static and it must accept an array of strings as its sole argument. to invoke a method of this kind the syntax is:

    scheduling-pattern java:classname#methodname [args]

    the #methodname part can be omitted: in this case the main(string[]) method will be assumed.

    please note that static methods are invoked within the scheduler same jvm, without spawning any external process. thus in, out, err, env and dir options can't be applied.

    invalid scheduling lines are discarded without blocking the parsing procedure, but an error message is sent to the application standard error channel.

    valid examples:

    0 5 * * * sol.exe 0,30 * * * * out:c:\ping.txt ping 10.9.43.55 0,30 4 * * * "out:c:\documents and settings\carlo\ping.txt" ping 10.9.43.55 0 3 * * * env:java_home=c:\jdks\1.4.2_15 dir:c:\myproject out:c:\myproject\build.log c:\myproject\build.bat "nightly build" 0 4 * * * java:mypackage.myclass#startapplication myoption1 myoption2
    posted @ 华梦行 阅读(1953) | |  
      2016年4月30日

    阿里云linux安装软件镜像源

    阿里云是最近新出的一个镜像源。得益与阿里云的高速发展,这么大的需求,肯定会推出自己的镜像源。
    阿里云linux安装镜像源地址:http://mirrors.aliyun.com/

    centos系统更换软件安装源
    第一步:备份你的原镜像文件,以免出错后可以恢复。

    mv /etc/yum.repos.d/centos-base.repo /etc/yum.repos.d/centos-base.repo.backup
    第二步:下载新的centos-base.repo 到/etc/yum.repos.d/
    centos 5

    wget -o /etc/yum.repos.d/centos-base.repo http://mirrors.aliyun.com/repo/centos-5.repo
    centos 6

    wget -o /etc/yum.repos.d/centos-base.repo http://mirrors.aliyun.com/repo/centos-6.repo
    第三步:运行yum makecache生成缓存

    yum clean all

    yum makecache

    posted @ 华梦行 阅读(196) | |  
      2016年3月23日
     yum -y update
    centos6 mysql5.5 yum安装
      
     
    默认使用centos yum安装的mysql不是5.5版本的,我们需要增加两个新的repo
    rpm -uvh http://mirror.steadfast.net/epel/6/i386/epel-release-6-8.noarch.rpm
    rpm -uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
    centos6下php php-fpm的yum安装
    查看一下是不是有mysql 5.5了
    yum --enablerepo=remi,remi-test list mysql mysql-server
    安装mysql5.5
    yum --enablerepo=remi,remi-test install mysql mysql-server
    启动mysql5.5
    /etc/init.d/mysqld start
    设置开机启动
    chkconfig --levels 345 mysqld on
    要启用mysql 安全设置请输入以下命令
    /usr/bin/mysql_secure_installation


    centos/rhel 7.x:

    rpm -uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm rpm -uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

    centos/rhel 6.x:

    rpm -uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm rpm -uvh https://mirror.webtatic.com/yum/el6/latest.rpm

    centos/rhel 5.x:

    rpm -uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-5.noarch.rpm rpm -uvh http://mirror.webtatic.com/yum/el5/latest.rpm

    now you can install php 5.5’s mod_php sapi (along with an opcode cache) by doing:

    yum install php55w php55w-opcache

    you can alternatively install php 5.5’s php-fpm sapi (along with an opcode cache by doing:





      rpm -uvh http://mirror.webtatic.com/yum/el6/latest.rpm
      

    rpm -uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
    rpm -uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
    如果想删除上面安装的包,重新安装
    rpm -qa | grep webstatic
    rpm -e  上面搜索到的包即可
    3.运行yum install
      yum install php55w php55w-cli php55w-common php55w-gd php55w-ldap php55w-mbstring php55w-mcrypt php55w-mysql php55w-pdo php55w-xml
    yum install php56w php56w-cli php56w-common php56w-gd php56w-ldap php56w-mbstring php56w-mcrypt php56w-mysql php56w-pdo php56w-xml

    php 另外一种方式
     remi官方网站:http://rpms.famillecollet.com/
    添加remi源,不管32位还是64位的系统,运行下面命令:
    rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
     remi源默认是没有启用的,我们来启用remi源,修改 /etc/yum.repos.d/remi.repo 文件,把文件内的 enabled=0 改为 enabled=1 ,注意:改文件内有2个 enabled=0 我们修改 [remi]下面的,不要修改[remi-test]下面的。
     到这里yum源的配置结束,下面安装软件就简单了。安装时候有询问y/n的时候都是y
    安装php,php-fpm以及php扩展:
    yum install php php-fpm php-bcmatch php-gd php-mbstring php-mcrypt php-mysql php-pdo   php-dom


    wget https://files.phpmyadmin.net/phpmyadmin/4.0.10.15/phpmyadmin-4.0.10.15-english.zip
     
    posted @ 华梦行 阅读(255) | |  
    仅列出标题  下一页
    网站地图