Guides

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

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

          2011年12月8日 #


          1.配置網(wǎng)絡(luò)參數(shù) /etc/sysconfig/network-scripts/ifcfg-eth0
          請記得,這個 ifcfg-eth0 與文件內(nèi)的 DEVICE 名稱配置需相同,并且,在這個文件內(nèi)的所有配置, 基本上就是 bash 的變量配置守則啦!
          [root@linux ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
          DEVICE
          =eth0                <== 網(wǎng)絡(luò)卡代號,必須要 ifcfg-eth0 相對應(yīng)
          BOOTPROTO
          =static           <== 啟動協(xié)議,有 dhcp 及 static 這里是 static
          BROADCAST
          =192.168.1.255    <== 就是廣播位址羅
          HWADDR
          =00:40:D0:13:C3:46   <== 就是網(wǎng)絡(luò)卡位址
          IPADDR
          =192.168.1.13        <== 就是 IP 啊
          NETMASK
          =255.255.255.0      <== 就是子遮罩網(wǎng)絡(luò)
          NETWORK
          =192.168.1.0        <== 就是網(wǎng)域啊!該網(wǎng)段的第一個 IP
          GATEWAY
          =192.168.1.2        <== 就是默認路由!
          ONBOOT
          =yes                 <== 是否啟動啟動的意思
          MTU
          =1500                   <== 就是最大傳輸單元的配置值。
          #GATEWAYDEV
          =eth0           <== 主要路由的裝置為那個,通常不用配置
          配置完成后啟動網(wǎng)卡,ifup eth0 。此時可以ping通局域網(wǎng)內(nèi)的計算機。

          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


          三步配置下來,內(nèi)網(wǎng)和外網(wǎng)ping 成功!

           《靜態(tài)路由詳細介紹》
            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 閱讀(229) | 評論 (0)編輯 收藏


          1.查看當前系統(tǒng)中的用戶
          select user,host,password from mysql.user

           2.為用戶設(shè)置密碼
          set password for root@localhost=password('在這里填入root密碼');


          3.開戶數(shù)據(jù)庫遠程訪問功能(下面是授予root用戶訪問所有數(shù)據(jù)庫和表的權(quán)限并且設(shè)置訪問密碼為root)
          grant all on *.* to root@'%' identified by 'root';




          posted @ 2012-02-21 17:12 Guides 閱讀(185) | 評論 (0)編輯 收藏


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

           2. Spring3MVC 在JSP中使用@ModelAttribute

           3. [學(xué)習(xí)筆記]基于注解的spring3.0.x MVC學(xué)習(xí)筆記

           4. Spring3 MVC 深入研究
          posted @ 2012-02-02 16:51 Guides 閱讀(218) | 評論 (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 閱讀(300) | 評論 (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 閱讀(199) | 評論 (0)編輯 收藏

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

          自定義二級域名的需求
          http://guides.network.com 的請求轉(zhuǎn)至 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就是拿不到值。最后發(fā)現(xiàn)把name="id"漏掉了.............................




          更新日志
          2011-12-31 17:48:14
          按照這個配置會出現(xiàn)一個問題,在oschina上問了下,不好解決。
          http://www.oschina.net/question/208700_35450
          posted @ 2011-12-22 17:01 Guides 閱讀(4740) | 評論 (2)編輯 收藏


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

          String subject = new String(request.getParameter("subject").getBytes("ISO-8859-1"),"utf-8");
          posted @ 2011-12-20 16:23 Guides 閱讀(212) | 評論 (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('復(fù)制完成');
          }

           

          posted @ 2011-12-17 11:04 Guides 閱讀(457) | 評論 (0)編輯 收藏

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

          set JAVA_OPTS=-Xms256m -Xmx512m

          如圖


          設(shè)置后tomcat manage中查看status效果




          posted @ 2011-12-14 17:39 Guides 閱讀(388) | 評論 (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 閱讀(2026) | 評論 (1)編輯 收藏

               摘要: 在做身份證驗證的時候,補習(xí)了一下身份證組成規(guī)則。突然想到把這些規(guī)則組成一個程序。

          先看看下面一段簡介,人人上看到的 http://blog.renren.com/blog/200883456/730064313,介紹挺全的。

          身份證號碼的編排規(guī)則
          身份證號碼中這些數(shù)字是怎樣排列的,每個數(shù)字表示什么意思呢?下面就讓我們一起來探索其中的規(guī)律吧!新的身份證號碼是由18位數(shù)字組成的,它們分別表示:

          (1)前1、2位數(shù)字表示:所在省份的代碼;
          (2)第3、4位數(shù)字表示:所在城市的代碼;
          (3)第5、6位數(shù)字表示:所在區(qū)縣的代碼;
          (4)第7~14位數(shù)字表示:出生年、月、日;
          (5)第15、16位數(shù)字表示:所在地的派出所的代碼;
          (6)第17位數(shù)字表示性別:奇數(shù)表示男性,偶數(shù)表示女性;
          (7)第18位數(shù)字是校檢碼:也有的說是個人信息碼,一般是隨計算機的隨機產(chǎn)生,
          看看下面的格式

            閱讀全文
          posted @ 2011-12-08 15:41 Guides 閱讀(1460) | 評論 (1)編輯 收藏

          主站蜘蛛池模板: 靖宇县| 平乡县| 定边县| 普陀区| 平凉市| 德兴市| 蒙自县| 西青区| 丰顺县| 策勒县| 南溪县| 黄大仙区| 安福县| 潞城市| 永安市| 汤原县| 都昌县| 烟台市| 沅陵县| 武穴市| 翁源县| 封丘县| 合肥市| 和静县| 邯郸县| 马边| 丁青县| 利川市| 云梦县| 靖宇县| 营山县| 龙江县| 古丈县| 藁城市| 聊城市| 湟源县| 舞钢市| 商南县| 娄烦县| 洪泽县| 福建省|