Guides

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

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

          2011年12月14日 #


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


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

           2. Spring3MVC 在JSP中使用@ModelAttribute

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

           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 的請求轉至 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 閱讀(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('復制完成');
          }

           

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

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

          set JAVA_OPTS=-Xms256m -Xmx512m

          如圖


          設置后tomcat manage中查看status效果




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

          主站蜘蛛池模板: 麻栗坡县| 吉林省| 内丘县| 马尔康县| 温州市| 馆陶县| 平原县| 波密县| 长葛市| 通州市| 莆田市| 左贡县| 若尔盖县| 全州县| 定结县| 广州市| 临清市| 惠水县| 河南省| 孙吴县| 土默特右旗| 黄山市| 普陀区| 右玉县| 兴安县| 黄浦区| 刚察县| 郓城县| 桃园市| 涟源市| 新闻| 淅川县| 突泉县| 竹溪县| 藁城市| 含山县| 原阳县| 民权县| 北海市| 疏勒县| 读书|