貝貝爸爸的程序人生

          關注Seam、BPM
          posts - 23, comments - 10, trackbacks - 0, articles - 32
            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

          2011年8月6日

          今天興致來了,說要在家搞搞平臺的東西,nnd,竟然遇到了莫名其妙的mysql亂碼問題,其實不是mysql的問題,是jdbc數據源的鏈接沒有指明字符集的問題,記下來備用:<datasource jta="false" jndi-name="java:jboss/datasources/MySqlDS" pool-name="bdp" enabled="true" use-java-context="true" use-ccm="true">
                              <connection-url>jdbc:mysql://localhost:3306/bdp-dev?useUnicode=true&amp;characterEncoding=utf8</connection-url>
                              <driver>com.mysql</driver>
                              <pool>
                                  <min-pool-size>10</min-pool-size>
                                  <max-pool-size>100</max-pool-size>
                                  <prefill>true</prefill>
                                  <use-strict-min>false</use-strict-min>
                                  <flush-strategy>FailingConnectionOnly</flush-strategy>
                              </pool>
                              <security>
                                  <user-name>root</user-name>
                              </security>
                              <statement>
                                  <prepared-statement-cache-size>32</prepared-statement-cache-size>
                                  <share-prepared-statements>true</share-prepared-statements>
                              </statement>
                          </datasource>

          posted @ 2012-05-19 01:40 貝貝爸爸 閱讀(774) | 評論 (0)編輯 收藏

          今天在處理zTree的時候,無意間遇到一個很好的插件,可以將array對象轉換為json對象,真的很好用哦,呵呵。
          var thing = {plugin: 'jquery-json', version: 2.3};

          var encoded = $.toJSON( thing );
          // '{"plugin":"jquery-json","version":2.3}'
          var name = $.evalJSON( encoded ).plugin;
          // "jquery-json"
          var version = $.evalJSON(encoded).version;
          // 2.3
          像上面那樣用就行了,很容易進行請求間的參數傳遞。
          項目地址為:http://code.google.com/p/jquery-json/

          posted @ 2012-05-10 13:45 貝貝爸爸 閱讀(1081) | 評論 (1)編輯 收藏

           cat /tmp/id_rsa.john.pub >> ~/.ssh/authorized_keys

          posted @ 2012-04-26 14:45 貝貝爸爸 閱讀(393) | 評論 (0)編輯 收藏

          nnd,今天搞了快2個小時,總是無法解決ldap支持的其他屬性返回問題,因為之前配置的是3.3.5版本,現在最新的版本是3.4.11,原來的配置竟然無法使用了,原來是因為增加服務:
          <bean id="serviceRegistryDao" class="org.jasig.cas.services.InMemoryServiceRegistryDaoImpl">
          導致無法返回principal的其他屬性到客戶端,其實象這樣配置即可:<bean id="attributeRepository"
            class="org.jasig.services.persondir.support.ldap.LdapPersonAttributeDao">
            <property name="contextSource" ref="contextSource" />
            <property name="baseDN" value="ou=users,${ldap.basePath}" />
            <property name="requireAllQueryAttributes" value="true" />
            <!--
            Attribute mapping beetween principal (key) and LDAP (value) names
            used to perform the LDAP search.  By default, multiple search criteria
            are ANDed together.  Set the queryType property to change to OR.
            
          -->
            <property name="queryAttributeMapping">
              <map>
                <entry key="username" value="uid" />
              </map>
            </property>
           
            <property name="resultAttributeMapping">
              <map>
              <!-- Mapping beetween LDAP entry attributes (key) and Principal's (value) -->
              <entry key="name" value="userName"/>
              <entry key="uid" value="userId"/>
              </map>
            </property>
          </bean>

              <bean id="serviceRegistryDao" class="org.jasig.cas.services.InMemoryServiceRegistryDaoImpl">
                  <property name="registeredServices">
                      <list>
                          <bean class="org.jasig.cas.services.RegisteredServiceImpl">
                              <property name="id" value="0" />
                              <property name="name" value="HTTP" />
                              <property name="description" value="Only Allows HTTP Urls" />
                              <property name="serviceId" value="http://**" />
                              <property name="evaluationOrder" value="10000001" />
                              <property name="ignoreAttributes" value="true" />
                          </bean>
                                          ………………
                                  </list>
                          </property>
                  </bean>
          如上所示,其中注冊的服務registeredServices
          默認是不允許返回其他屬性到客戶端的!!!!!,真的是很坑爹啊,不過,配置一下ignoreAttributes即可,也可以指定allowedAttributes
          如下:
          <property name="allowedAttributes">
              <list>
                      <value><!-- your attribute key --></value>
              </list>
          </property>

          posted @ 2012-04-25 23:12 貝貝爸爸 閱讀(1334) | 評論 (0)編輯 收藏


          cat /boot/grub2/grub.cfg |grep Fedora
          grub2-set-default "Fedora Linux, with Linux 3.1.0-5.fc16.i686"
          grub2-editenv list
          grub2-mkconfig -o /boot/grub2/grub.cfg

          posted @ 2012-04-20 08:50 貝貝爸爸 閱讀(374) | 評論 (0)編輯 收藏

          #
          contrib / completion / git-completion.bash

          #
           Source the git bash completion file
          if [ -f ~/.git-completion.bash ]; then
              source ~/.git-completion.bash
              GIT_PS1_SHOWDIRTYSTATE=true
              PS1='[\u@\h:\W $(__git_ps1 "(%s)")]$ '
          fi

          posted @ 2012-04-04 09:26 貝貝爸爸 閱讀(849) | 評論 (0)編輯 收藏

          http://www.secondpersonplural.ca/jqgriddocs/index.htm

          posted @ 2012-03-29 05:05 貝貝爸爸 閱讀(197) | 評論 (0)編輯 收藏

          http://junv.sinaapp.com/1955.html

          posted @ 2012-03-21 17:22 貝貝爸爸 閱讀(283) | 評論 (0)編輯 收藏

          http://www.navicat.com/en/download/download.html
          NAVJ-W56S-3YUU-MVHV



          posted @ 2012-03-19 17:25 貝貝爸爸 閱讀(325) | 評論 (0)編輯 收藏

          今天調試了一天,所有的步驟都正確,可最后到了web下載,卻總是404錯誤,好心zzq網友幫著一起定位和解決問題,可依然沒有找到原因,偶爾的一個google搜索,發現是因為沒有sudo啟動nginx。。。。
          真tmd扯淡了。

          posted @ 2012-03-18 20:13 貝貝爸爸 閱讀(363) | 評論 (0)編輯 收藏

          https://gist.github.com/2066974

          posted @ 2012-03-18 08:26 貝貝爸爸 閱讀(262) | 評論 (0)編輯 收藏

          系統環境
          CentOS6.2
          #step 1. download libevent https://github.com/downloads/libevent/libevent/libevent-2.0.17-stable.tar.gz
          $ ./configure
          $ make
          $ make verify   # (optional)
          $ sudo make install
          $ln -s /usr/local/lib/libevent-2.0.so.5 /usr/lib64/libevent-2.0.so.5
          #step 2. download FastDFS source package and unpack it,
          $ ./make.sh
          $ ./make.sh install
          #step 3. edit/modify the config file of tracker and storage
          #step 3.1.
          $ vim /etc/fdfs/tracker.conf
          ## base_path=??
          ## reserved_storage_space = 1GB
          #step 3.2
          $ vim /etc/fdfs/storage.conf
          ## base_path=/home/yuan/fastdfs/storage
          ## path(disk or mount point) count, default value is 1
          ## store_path_count=1
          ## store_path#, based 0, if store_path0 not exists, it's value is base_path
          ## the paths must be exist
          ## store_path0=/home/yuan/fastdfs0
          ## tracker_server=host:port
          #step 4 cp the start shell into /etc/init.d
          $ cd FastDFS
          $ cp init.d/fdfs_trackerd /etc/init.d
          $ cp init.d/fdfs_storaged /etc/init.d
          #step 5 mkdir the trackerd base path and storaged base path
          $ mkdir /home/yuan/fastdfs
          $ mkdir /home/yuan/fastdfs0
          #step 6 start trackerd service
          $/sbin/service fdfs_trackerd start
          ###$/sbin/service fdfs_trackerd status
          ###$fdfs_trackerd (pid 11441) is running...
          #step 7 start storaged service
          $/sbin/service fdfs_storaged start
          ###$/sbin/service fdfs_storaged status
          ###$fdfs_storaged (pid 11553) is running...
          #step 8. run test program
          #step 8.1. vim /etc/fdfs/client.conf
          ###base_path=/home/yuan/fastdfs
          ###tracker_server=192.168.0.197:22122
          #step 8.2 run test program
          $/usr/local/bin/fdfs_test /etc/fdfs/client.conf upload /usr/include/stdlib.h
          #step 9 monitor fdfs
          $/usr/local/bin/fdfs_monitor /etc/fdfs/client.conf

          posted @ 2012-03-17 16:38 貝貝爸爸 閱讀(768) | 評論 (0)編輯 收藏

          可能后面會遇到同一臺服務器,安裝多個jboss實例的問題,那顯然的問題可能就是端口沖突問題,怎么辦?
          1、修改各個配置文件的端口配置
          2、最簡單的方法是,啟動是指明端口綁定步長,例如:-Djboss.socket.binding.port-offset=100

          posted @ 2012-03-04 20:40 貝貝爸爸 閱讀(465) | 評論 (0)編輯 收藏

          mvn deploy:deploy-file -Dfile=target/web-3.1.0-SNAPSHOT-api.jar -Durl=http://repo.yongtai.com.cn/nexus/content/repositories/snapshots/ -DrepositoryId=nexus-snapshots -DpomFile=pom.xml -Dpackaging=jar -Dclassifier=api

          posted @ 2012-02-22 12:02 貝貝爸爸 閱讀(228) | 評論 (0)編輯 收藏

          今天又在centos下折騰呢,呵呵,不過這次的環境是mac下安裝centos的虛擬機,mac環境和linux環境還是很大區別,至少無法安裝我想要的FastDFS環境,著實有點無法接受,所以只能安裝虛擬機了。
          ssh centos后,主要安裝遇到了如下問題:
          1、gcc-c++沒有安裝,會導致安裝pcre的時候,報c++編譯器沒找到,直接安裝:yum install gcc-c++即可
          2、zlib包無法找到,安裝:yum install zlib-devel即可
          3、error while loading shared libraries: libpcre.so.1:[root@bogon nginx-1.0.12]# ldd $(which /usr/local/nginx/sbin/nginx)
              linux-vdso.so.1 =>  (0x00007fff7e9db000)
              libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fe4629d0000)
              libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007fe462799000)
              libpcre.so.1 => not found//確實沒找到
              libz.so.1 => /lib64/libz.so.1 (0x00007fe462582000)
              libc.so.6 => /lib64/libc.so.6 (0x00007fe4621e1000)
              /lib64/ld-linux-x86-64.so.2 (0x00007fe462bfa000)
              libfreebl3.so => /lib64/libfreebl3.so (0x00007fe461f7e000)
              libdl.so.2 => /lib64/libdl.so.2 (0x00007fe461d7a000)
          [root@bogon nginx-1.0.12]# cd /lib64/

          [root@bogon lib64]# ln -s libpcre.so.0.0.1 libpcre.so.1
          [root@bogon lib64]# ldd $(which /usr/local/nginx/sbin/nginx)
              linux-vdso.so.1 =>  (0x00007fff4d7ff000)
              libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fb06f13e000)
              libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007fb06ef07000)
              libpcre.so.1 => /lib64/libpcre.so.1 (0x00007fb06ecda000)
              libz.so.1 => /lib64/libz.so.1 (0x00007fb06eac4000)
              libc.so.6 => /lib64/libc.so.6 (0x00007fb06e723000)
              /lib64/ld-linux-x86-64.so.2 (0x00007fb06f368000)
              libfreebl3.so => /lib64/libfreebl3.so (0x00007fb06e4c0000)
              libdl.so.2 => /lib64/libdl.so.2 (0x00007fb06e2bc000)

          posted @ 2012-02-19 07:49 貝貝爸爸 閱讀(2107) | 評論 (0)編輯 收藏

          這篇文章獻給天下兒童的父母。
               老農民的智慧和知識分子的尷尬:
              很多沒有上過學的老農民培養出了優秀的孩子,不少有知識、高學歷的城里人卻把孩子管出諸多毛病,甚至培養出問題孩子,為什么?老農民沒知識但有智慧,城里人有知識但沒智慧。(知識不等于智慧。)
              智慧的老農民三句話就培養出了好孩子:
              第一句話:“孩子,爸媽沒本事,你要靠自己了。”不包辦,把責任還給孩子,讓孩子擁有了責任心。
              第二句話:“孩子,做事先做人,一定不能做傷害別人的事情。”講德行,告訴孩子做人的標準。
              第三句話:“孩子,撒開手闖吧,實在不行,回家來還有口飯吃。”無私的愛,無盡的愛!
              看看一些城里人怎么把孩子教育出問題的:
              第一句話:“寶貝,你 好好學習就行了,其他的事情爸爸媽媽來辦!”剝奪了孩子負責任的權利,培養出了沒有責任心的孩子。
              第二句話:“寶貝,出去不能吃虧,別人打你一定要還手!”基本的做人準則都沒有教對,可能培養出“缺德”的孩子。
              第三句話:“我告訴你,你要是再不好好學習,長大沒飯吃別來找我!”有條件的愛,根本不是真愛。
              只要擁有智慧,每一位家長都能把孩子培養成才,而智慧與知識和學歷并不相關!

          posted @ 2011-08-06 22:47 貝貝爸爸 閱讀(275) | 評論 (0)編輯 收藏

          主站蜘蛛池模板: 什邡市| 亳州市| 郁南县| 沾益县| 延庆县| 卓尼县| 前郭尔| 饶平县| 长岛县| 五寨县| 铜川市| 来安县| 泸水县| 城口县| 巴东县| 金华市| 菏泽市| 科尔| 锦州市| 望城县| 盐池县| 社旗县| 大竹县| 玉屏| 七台河市| 巴塘县| 靖州| 民和| 杭锦后旗| 武夷山市| 通海县| 江孜县| 新丰县| 当阳市| 四会市| 涿州市| 连南| 新蔡县| 鹤壁市| 手游| 正安县|