贝贝爸爸的程序人生

关注Seam、BPM
posts - 23, comments - 10, trackbacks - 0, articles - 32
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

2012年3月17日

今天兴致来了,说要在家搞搞平台的东西,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 贝贝爸爸 阅读(752) | 评论 (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 贝贝爸爸 阅读(1054) | 评论 (1)编辑 收藏

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

posted @ 2012-04-26 14:45 贝贝爸爸 阅读(367) | 评论 (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 贝贝爸爸 阅读(1298) | 评论 (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 贝贝爸爸 阅读(352) | 评论 (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 贝贝爸爸 阅读(832) | 评论 (0)编辑 收藏

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

posted @ 2012-03-29 05:05 贝贝爸爸 阅读(184) | 评论 (0)编辑 收藏

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

posted @ 2012-03-21 17:22 贝贝爸爸 阅读(268) | 评论 (0)编辑 收藏

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



posted @ 2012-03-19 17:25 贝贝爸爸 阅读(308) | 评论 (0)编辑 收藏

今天调试了一天,所有的步骤都正确,可最后到了web下载,却总是404错误,好心zzq网友帮着一起定位和解决问题,可依然没有找到原因,偶尔的一个google搜索,发现是因为没有sudo启动nginx。。。。
真tmd扯淡了。

posted @ 2012-03-18 20:13 贝贝爸爸 阅读(348) | 评论 (0)编辑 收藏

https://gist.github.com/2066974

posted @ 2012-03-18 08:26 贝贝爸爸 阅读(240) | 评论 (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 贝贝爸爸 阅读(742) | 评论 (0)编辑 收藏