Guides

对guides这个词认识源于struts文档,参考、指南,这里是sfilyh 关于CODE的guides。

  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  21 随笔 :: 1 文章 :: 5 评论 :: 0 Trackbacks

2012年2月28日 #


1.配置网络参数 /etc/sysconfig/network-scripts/ifcfg-eth0
请记得,这个 ifcfg-eth0 与文件内的 DEVICE 名称配置需相同,并且,在这个文件内的所有配置, 基本上就是 bash 的变量配置守则啦!
[root@linux ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE
=eth0                <== 网络卡代号,必须要 ifcfg-eth0 相对应
BOOTPROTO
=static           <== 启动协议,有 dhcp 及 static 这里是 static
BROADCAST
=192.168.1.255    <== 就是广播位址罗
HWADDR
=00:40:D0:13:C3:46   <== 就是网络卡位址
IPADDR
=192.168.1.13        <== 就是 IP 啊
NETMASK
=255.255.255.0      <== 就是子遮罩网络
NETWORK
=192.168.1.0        <== 就是网域啊!该网段的第一个 IP
GATEWAY
=192.168.1.2        <== 就是默认路由!
ONBOOT
=yes                 <== 是否启动启动的意思
MTU
=1500                   <== 就是最大传输单元的配置值。
#GATEWAYDEV
=eth0           <== 主要路由的装置为那个,通常不用配置
配置完成后启动网卡,ifup eth0 。此时可以ping通局域网内的计算机。

2.配置 DNS 的 IP: /etc/resolv.conf
[root@linux ~]# vi /etc/resolv.conf
nameserver 
168.95.1.1
nameserver 
139.175.10.20


3.配置默认路由   /etc/sysconfig/static-routes
[root@linux sysconfig]# vi /etc/sysconfig/static-routes
any net 
0.0.0.0 gw 192.168.1.1


三步配置下来,内网和外网ping 成功!

 《静态路由详细介绍》
  http://my.oschina.net/qichang/blog/33458

 《鸟哥的 Linux 私房菜笔记》在线版
  http://vbird.dic.ksu.edu.tw/linux_basic/linux_basic.php
posted @ 2012-02-28 16:46 Guides 阅读(208) | 评论 (0)编辑 收藏

2012年2月21日 #


1.查看当前系统中的用户
select user,host,password from mysql.user

 2.为用户设置密码
set password for root@localhost=password('在这里填入root密码');


3.开户数据库远程访问功能(下面是授予root用户访问所有数据库和表的权限并且设置访问密码为root)
grant all on *.* to root@'%' identified by 'root';




posted @ 2012-02-21 17:12 Guides 阅读(167) | 评论 (0)编辑 收藏

2012年2月2日 #


 1.  Spring3.0中的异常处理配置方法

 2. Spring3MVC 在JSP中使用@ModelAttribute

 3. [学习笔记]基于注解的spring3.0.x MVC学习笔记

 4. Spring3 MVC 深入研究
posted @ 2012-02-02 16:51 Guides 阅读(202) | 评论 (0)编辑 收藏

2012年1月5日 #

使用apache comments Codec 这个jar


代码如下
    public static void main(String[] args) {        
        String s 
= "guides";        
        System.out.println(DigestUtils.md5Hex(s.getBytes()));
    }



posted @ 2012-01-05 15:04 Guides 阅读(286) | 评论 (0)编辑 收藏

2011年12月31日 #

从struts validator中提取出来的。这种东西写起来麻烦,还是直接拷吧!

\b(^['_A-Za-z0-9-]+(\.['_A-Za-z0-9-]+)*@([A-Za-z0-9-])+(\.[A-Za-z0-9-]+)*((\.[A-Za-z0-9]{2,})|(\.[A-Za-z0-9]{2,}\.[A-Za-z0-9]{2,}))$)\b


posted @ 2011-12-31 17:52 Guides 阅读(182) | 评论 (0)编辑 收藏

2011年12月22日 #

配置的时候,犯了个很大的错误,疏忽了。

自定义二级域名的需求
http://guides.network.com 的请求转至 http://www.network.com/guides 而且域名保持不变

nginx配置代码
server {
        server_name  *.network.com
;        
        
        if ( $http_host ~* 
"^(.*?)\.network\.com$")
        {
            set $domain $
1;              
        }
        
        location / {            
            proxy_pass   http://network
;
            
            if ($domain !~* ^www$)
            {
                rewrite ^/(.*)    /$domain/$
1 break;
            }                         
            
            proxy_set_header Host $host:
80;
            proxy_set_header X_Forwarded_For $remote_addr;
            index  index.html index.htm;
        }

}

当时用php测试,用get方式可以拿到值,用post就是拿不到值。最后发现把name="id"漏掉了.............................




更新日志
2011-12-31 17:48:14
按照这个配置会出现一个问题,在oschina上问了下,不好解决。
http://www.oschina.net/question/208700_35450
posted @ 2011-12-22 17:01 Guides 阅读(4720) | 评论 (2)编辑 收藏

2011年12月20日 #


支付宝接口(java版)里摘下来的。

String subject = new String(request.getParameter("subject").getBytes("ISO-8859-1"),"utf-8");
posted @ 2011-12-20 16:23 Guides 阅读(192) | 评论 (0)编辑 收藏

2011年12月17日 #

 

function CopyById(id) {
    
if (!document.body.createControlRange){
        
return//只支持IE哦
    }      
    
var ctrl = document.body.createControlRange();
    
var domid=document.getElementById(id);
    domid.contentEditable 
= true;
    ctrl.addElement(domid);
    ctrl.execCommand('Copy');
    domid.contentEditable 
= false;
    alert('复制完成');
}

 

posted @ 2011-12-17 11:04 Guides 阅读(435) | 评论 (0)编辑 收藏

2011年12月14日 #

在bin/catalina.bat中添加一句代码

set JAVA_OPTS=-Xms256m -Xmx512m

如图


设置后tomcat manage中查看status效果




posted @ 2011-12-14 17:39 Guides 阅读(367) | 评论 (0)编辑 收藏

2011年12月8日 #

参考代码,直接贴上。

jQuery("#productForm").validate({
    rules:{
        // ....
    },
    messages:{
      // ....
    },
    showErrors: 
function(errorMap, errorList) {
            
if(errorList.length > 0){
            alert(errorList[
0].message);
            
return false;
            }
    },
    ignore:
"", // 验证所有元素,包括隐藏input
    onfocusout: 
false,
    onkeyup: 
false
});

posted @ 2011-12-08 16:54 Guides 阅读(2001) | 评论 (1)编辑 收藏

仅列出标题  下一页