Guides

          對guides這個詞認識源于struts文檔,參考、指南,這里是sfilyh 關于CODE的guides。

            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
            21 隨筆 :: 1 文章 :: 5 評論 :: 0 Trackbacks

          #


          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 閱讀(230) | 評論 (0)編輯 收藏


          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 閱讀(186) | 評論 (0)編輯 收藏


           1.  Spring3.0中的異常處理配置方法

           2. Spring3MVC 在JSP中使用@ModelAttribute

           3. [學習筆記]基于注解的spring3.0.x MVC學習筆記

           4. Spring3 MVC 深入研究
          posted @ 2012-02-02 16:51 Guides 閱讀(219) | 評論 (0)編輯 收藏

          使用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 閱讀(302) | 評論 (0)編輯 收藏

          從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 閱讀(200) | 評論 (0)編輯 收藏

          配置的時候,犯了個很大的錯誤,疏忽了。

          自定義二級域名的需求
          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 閱讀(4741) | 評論 (2)編輯 收藏


          支付寶接口(java版)里摘下來的。

          String subject = new String(request.getParameter("subject").getBytes("ISO-8859-1"),"utf-8");
          posted @ 2011-12-20 16:23 Guides 閱讀(213) | 評論 (0)編輯 收藏

           

          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 閱讀(458) | 評論 (0)編輯 收藏

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

          set JAVA_OPTS=-Xms256m -Xmx512m

          如圖


          設置后tomcat manage中查看status效果




          posted @ 2011-12-14 17:39 Guides 閱讀(389) | 評論 (0)編輯 收藏

          參考代碼,直接貼上。

          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 閱讀(2027) | 評論 (1)編輯 收藏

          僅列出標題
          共3頁: 1 2 3 下一頁 
          主站蜘蛛池模板: 西昌市| 峨眉山市| 通化市| 西充县| 固镇县| 神木县| 高淳县| 固始县| 乾安县| 潜江市| 江川县| 西乌| 金坛市| 麻城市| 白水县| 墨江| 新竹县| 东乌| 哈密市| 察雅县| 宜都市| 开江县| 西昌市| 虞城县| 苏尼特左旗| 华坪县| 内黄县| 浑源县| 华阴市| 讷河市| 高州市| 体育| 建始县| 改则县| 灌南县| 英德市| 塔城市| 文水县| 麻城市| 夹江县| 县级市|