ann
冰是没有未来的,因为它的永恒
posts - 107,comments - 34,trackbacks - 0
     摘要: 1. 安装vnc
rpm -ivh vnc-server-4.1.2-14.el5_3.1.i386.rpm
rpm -ivh vnc-4.1.2-14.el5_3.1.i386.rpm


3. 设置vnc server的访问密码
[ann@ecdev1 ~]# vncpasswd

3. 执行vncserver,第一次执行后会生产一些配置文件

4. 修改/home/ann/.vnc/xstart(如果无此文件,就运行vncserver)
#!/bin/sh
# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xsta  阅读全文
posted @ 2010-05-19 09:49 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: I tried the Build and Deployment tool in Commerce version 7. I followed the tutorial for the same found here:
http://publib.boulder.ibm.com/infocenter/wchelp/v7r0m0/topic/com.ibm.commerce.developer.doc/concepts/cdewcbdbuild.htm

When I start the build process it extracts the projects from the CVS successfully, but while buildingarchiving the ejb jar the build fails with the following error:
java.io.IOException: Cannot run program "D:\Programs\RAD75\SDP\runtimes\base_v7\java\jre\b  阅读全文
posted @ 2010-05-17 10:56 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要:

SQL like子句的另一种实现方法,速度比like快


一般来说使用模糊查询,大家都会想到LIKE
select * from table where a like '%字符%'

如果一个SQL语句中用多个 like模糊查询,并且记录条数很大,那速度一定会很慢。
下面两种方法也可实现模糊查询:
select * from table where patindex('%字符%',a)>0
select * from table where charindex('字符',a)>0
经测试这两种方法比LIKE速度要快。

  阅读全文
posted @ 2010-05-04 12:58 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: #!/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
#################################
# application: test
# DFILE : pid file
# GDIR : application webapp
# LOGDIR : logs dir
######################
NAME=et-play
TestDIR="/data/webapps/play/test"
GDIR="${TestDIR}/test"
PIDFILE="${TestDIR}/${NAME}.pid"
LOGDIR="${GDIR}/logs"
APP_USER=test
# Timeout in seconds for the shutdown of webapps
APP_SHUTDOWN=30 <  阅读全文
posted @ 2010-03-19 13:22 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: 1.备份表中的数据


D:\Program Files\PostgreSQL-8.3.7\bin\pg_dump.exe -h *.*.*.* -p 5432 -U username -F c -v -f "D:\Program Files\PostgreSQL-8.3.7\bin\sss.backup" -t "\"public\".\"tablename\"" databasename

2. 创建表

CREATE TABLE tablename
(
id bigint,
createtime timestamp without time zone,
modifyname character varying(255),
modify_date timestamp without time zone,
modify_detail character varying(100000),
"name" character varying(255  阅读全文
posted @ 2010-03-11 10:02 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: 一.linux 监控数据库活动
$ ps auxww | grep ^postgres

postgres 3424 0.0 1.2 42708 26588 ? Ss Jan29 0:00 postgres: writer process
postgres 3425 0.0 0.0 42576 1284 ? Ss Jan29 0:00 postgres: wal writer process
postgres 3426 0.0 0.0 43364 1972 ? Ss J  阅读全文
posted @ 2010-02-09 15:30 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: 1、对于第一种重复,比较容易解决,使用

select distinct * from tableName

  就可以得到无重复记录的结果集。

   如果该表需要删除重复的记录(重复记录保留1条),可以按以下方法删除

select distinct * into #Tmp from tableName
drop table tableName
select * into tableName from #Tmp
drop table #Tmp


  阅读全文
posted @ 2010-02-08 16:22 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: Well, there's second places I set the proxy on a new Linux install.
1) in /etc/profile:
code:


export http_proxy="http://user:pass@xxx.xxx.xxx.xxx:port/"
export ftp_proxy="http://user:pass@xxx.xxx.xxx.xxx:port/"

2) in /etc/apt/apt.conf
code:

Acquire::http::Proxy "http://user:pass@xxx.xxx.xxx.xxx:port/";
Acquire::ftp::Proxy "http://user:pass@xxx.xxx.xxx.xxx:port/";


  阅读全文
posted @ 2010-02-02 15:16 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: Add the following line to either /etc/apt/apt.conf or /etc/apt/apt.conf.d/70debconf
code:

APT::Cache-Limit 50000000;
  阅读全文
posted @ 2010-02-02 15:13 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要:
1. 用命令行创建新的project
#>: play new test

输入 test(会有What is the application name?提示)
注:一定要输入test 否则在导入到eclipse中就要手动改配置文件

2. 导入eclipse
>play eclipsify test
打开eclipse 在import 就ok了.

如果在创建project时候未输入test。
就要手动修改test.launch文件,也就是查找,得出 E:"project"eclipse"play1 ,然后把文件中所有的E:"project"eclipse"play1替换为test
修改前:

posted @ 2010-02-01 13:38 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要:
intellj 编码设置 ,project编码设置 这两个编码必须统一。
例如: intellj设置的是系统默认的编码gbk,而project是utf8。

  阅读全文
posted @ 2010-01-15 18:04 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: 按照我写的目录结构来放置。
下载地址:
http://www.apache.org/dist/tomcat/tomcat-6/v6.0.18/bin/extras/tomcat-juli.jar
http://www.apache.org/dist/tomcat/tomcat-6/v6.0.18/bin/extras/tomcat-juli-adapters.jar

tomcat6-------lib
| |--------tomcat-juli-adapters.jar
| |--------log4j.jar
| |--------log4j.properites
|
|----bin
|--------tomcat-juli.jar
阅读全文
posted @ 2010-01-14 18:10 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: Bulk close all in lucene2.9.1 issues.   阅读全文
posted @ 2010-01-14 16:06 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: 找到启动用户目录
比如是/home/hudson/下面
.hudson/nodeMonitors.xml 加入


false


false



  阅读全文
posted @ 2010-01-12 13:22 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要:

Jetty's default configuration has a limitation on POST data (200000 bytes)that
prevents Hudson from reading the Update Center data (available
plugins). Jetty gets an error like java.lang.IllegalStateException: Form too large. To resolve this, add something like this to jetty.xml:

Jetty 6:

在jetty.xml中设置该参数



org.mortbay.jetty.Request.maxFormContentSize

-1阅读全文
posted @ 2010-01-12 11:09 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: 地址:http://code.google.com/apis/chart/  阅读全文
posted @ 2010-01-12 10:33 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: server:

package com.test.web.resources;

import javax.ws.rs.Consumes;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;

import org.springframework.stereotype.Component;


/**
* 测试
* @author ann
*
*/
@Path("/test")
@Component
public class Test {

@POST
@Path("/formTest")
  阅读全文
posted @ 2010-01-11 17:02 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: 同步的集合类Hashtable和Vector,以及同步的包装器类Collections.synchronizedMap和Collections.synchronizedList,为Map和List提供了基本的有条件的线程安全的实现。然而,某些因素使得它们并不适用于具有高度并发性的应用程序中――它们的集合范围的单锁特性对于可伸缩性来说是一个障碍,而且,很多时候还必须在一段较长的时间内锁定一个集合,以防止出现ConcurrentModificationExceptions异常。

ConcurrentHashMap和CopyOnWriteArrayList实现提供了更高的并发性,同时还保住了线程安全性,只不过在对其调用者的承诺上打了点折扣。ConcurrentHashMap和CopyOnWriteArrayList并不是在您使用HashMap或ArrayList的任何地方都一定有用,但是它们是设计用来优化某些特定的公用解决方案的。许多并发应用程序将从对它们的使用中获得好处。

总结:在多线程并发情况下,为了避免ConcurrentModificati  阅读全文
posted @ 2010-01-07 18:04 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要:

数据库服务器,应对是高并发的访问,每天都有大量的读写删除操作。因此,时间一长服务器的内存就耗尽,数据库的占的空间也很大。为了应对这个情况,我制定两个常用的维护操作。

一、注重日常清理(VACUUM;)。因为有大量的更新(update)"删除(delete)操作,会有大量的空间需要释放。

每日执行一次VACUUM,每周访问量低的时候执行VACUUM FULL;

语法结构;

VACUUM [ FULL | FREEZE ] [ VERBOSE ] [ table ]
VACUUM [ FULL | FREEZE ] [ VERBOSE ] ANALYZE [ table [ (column [, ...] ) ] ]

FULL ------选择"完全"清理,这样可以恢复更多的空间, 但是花的时间更多并且在表上施加了排它锁。
FREEZE ---------选择激进的元组"冻结"。
VERBOSE --------- 为每个表打印一份详细的清理工作报告。 <  阅读全文
posted @ 2010-01-07 15:55 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: grails 升级到1.2.0 版本之后需要注意的

1.默认的webserver是tomcat.
如果想切换为jetty。grails uninstall-plugin tomcat
grails install-plugin jetty

2. 有了很多标准的规范,比如 :
1). 必须放入
标签之内。
2).urlmap中 "/test_$guid?"(controller:"test",action:"list")
"/" (controller:"index",action:"list")
  阅读全文
posted @ 2010-01-05 16:55 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: CREATE INDEX 在指定的表上构造一个名为 index_name 的索引。索引主要用来提高数据库性能。但是如果不恰当的使用将导致性能的下降。

PostgreSQL 为从索引提供 B-tree,R-tree,hash(散列) 和 GiST 索引方法。 B-tree 索引方法是一个 Lehman-Yao 高并发 B-trees 的实 现。R-tree 索引方法用 Guttman 的二次分裂算法实现了标准的 R-trees。 hash(散列)索引方法是 Litwin 的线性散列的一个实现。 用户也可以定义它们自己的索引方法,但这个工作相当复杂。
如果出现了 WHERE 子句,则创建一个部分索引。 部分索引是一个只包含表的一部分记录的索引,通常是该表中比其它部分数据更有用的部分。

在 WHERE 子句里用的表达式只能引用下层表的字段,但是它可以使用所有字段,而不仅仅是被索引的字段。 目前,子查询和聚集表达式也不能出现在WHERE里。

索引定义里的所有函数和操作符都必须是immutable,(不  阅读全文
posted @ 2009-12-22 10:00 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: java -cp "./WEB-INF/lib/*:./WEB-INF/classes" bran.RestaurantCenterJettyStarter  阅读全文
posted @ 2009-12-22 09:47 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: 一个登录用户在页面访问的时候如何充分利用 cache?

页面静态化的一个大问题是登录用户访问页面如何静态化。 例如首页, 大部分的页面内容需要缓存但是用户登录后的个人信息是动态信息, 不能缓存。 那么如何解决这个"页面部分缓存"问题?

现有的方案是利用 SSI - Server Side include.

Nginx SSI 实现是 http://wiki.nginx.org/NginxHttpSsiModule

这里最关键的就是静态文件可以包含一个动态的网页的 URL.

这里有一篇文章对这个问题进行了深入的讨论:

http://jimmyg.org/blog/2009/ssi-memcached-nginx.html

文章用了 memcache. 我关心的是 SSI 和 Nginx 自身的 cache 的协同工作。


模块分析:

1. http://hi.baidu.com/langwan/blog/item/  阅读全文
posted @ 2009-12-22 09:35 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: 一 . Adding Brokers to a Conventional Cluster

1. To Add a New Broker to a Conventional Cluster Using a Cluster Configuration File
1).Add the new broker to the imq.cluster.brokerlist property in the cluster configuration file.
2).Issue the following command to any broker in the cluster: imqcmd reload cls
3).(Optional) Set the value of the imq.cluster.url property in the new broker’s instance configuration file (config.properties) to point to the clu  阅读全文
posted @ 2009-12-22 09:32 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: http://svn.codehaus.org/grails-plugins/grails-quartz/tags/RELEASE_0_4_1/  阅读全文
posted @ 2009-12-11 15:56 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: http://lucene.apache.org/solr/tutorial.html  阅读全文
posted @ 2009-12-11 12:43 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: user-agent 收集:http://www.developershome.com/wap/detection/detection.asp?page=userAgentHeader

http://search.cpan.org/~cmanley/Mobile-UserAgent-1.05/lib/Mobile/UserAgent.pm

http://www.zytrax.com/tech/web/mobile_ids.html

http://en.wikipedia.org/wiki/List_of_user_agents_for_mobile_phones

nginx

location = / {

root /var/www/path;
if ($http_user_agent ~* "Nokia") { rewrite . /index.html break; }

if ($http_user_agent ~* "Mobile") { r  阅读全文
posted @ 2009-12-08 09:22 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: 原理简介

安装运行

特殊介绍

1.iptables的3个表:

filter: 顾名思义,用于过滤的时候

nat: 顾名思义,用于做NAT 的时候

manager:见下

2.iptables的5条链

INPUT: 匹配目的IP 是本机的数据包

OUPUT: 匹配源IP是本机的数据包

FORWARD: 匹配穿过本机的数据包

PREROUTING: 用于修改目的地址(DNAT)

POSTROUTING:用于修改源地址(SNAT)

3.manager简介

这个表主要用来mangle数据包。我们可以改变不同的包及包头的内容,比如 TTL,TOS或MARK。 注意MARK并没有真正地改动数据包,
它只是在内核空间为包设了一个标记。防火墙内的其他的规则或程序(如tc)可以使用这种标记对包进行过滤或高级路由。这个表有五  阅读全文
posted @ 2009-12-04 13:42 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: 1. 限制 client 每秒访问次数
限制連 80 port 的次數 = 60 秒 2次 , 超過就 drop
iptables -I INPUT -p tcp –dport 80 -i eth0 -m state –state NEW -m recent –set
iptables -I INPUT -p tcp –dport 80 -i eth0 -m state –state NEW -m recent –update –seconds 60 –hitcount 2 -j DROP

2. 控制client访问特定的port
只允许114.80.192.18 和 127.0.0.1 访问8080-8099的端口
iptables -A INPUT -p tcp -s 114.80.192.18 --dport 8080:8099 -j ACCEPT
iptables -A INPUT -p tcp -s ! 127.0.0.1 --dport 808  阅读全文
posted @ 2009-12-04 11:52 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: nginx 聊天室模块  阅读全文
posted @ 2009-11-20 11:29 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: nginx 重启之后 用purge 会出现以上错误
nginx log :
2009/11/17 15:03:52 [crit] 1553#0: *1 cache file "/data/nginx_cache/etwebservice/a/2b/b3a2527b6f3a38d63663ee436e7d82ba" is too small, client: 222.66.142.229, server: localhost, request: "HEAD /purge/RestTakeoutServer/dish/B10I24R57547/list?commentCount=5 HTTP/1.1", host: "222.66.142.229"

客户端请求出错

HTTP/1.1 500 Internal Server Error
Server: nginx/0.8.24
Date: Tue, 17 Nov 2009 07:03:52 GMT
Content-Type: text/html
Content  阅读全文
posted @ 2009-11-17 17:59 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: nginx0.8.26 加入 purge_cache module  阅读全文
posted @ 2009-11-17 17:45 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: 下一站,考虑中......  阅读全文
posted @ 2009-11-06 14:31 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: 1. 安装openvpn
2. CA证书  阅读全文
posted @ 2009-11-05 15:49 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要:
1.创建repo sudo -u subversion svnadmin create TestRepo

2.备份svn version
sudo -u subversion svnadmin dump TestRepo> /data/downloads/TestRepo-file

3.恢复
sudo -u subversion svnadmin load --force-uuid TestRepo1/ < /data/downloads/TestRepo-file

4.客户端转换Repository
例如:
从 svn://etch1/TestRepo/TakeoutServer 到 svn://etch1/TestRepo1/TakeoutServer
svn switch --force --relocate svn://etch1/TestRepo/TakeoutServer svn://etch1/TestRepo1/TakeoutS  阅读全文
posted @ 2009-11-05 15:41 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: 目前大多数使用gson的还要求在java类中使用java annotation,不完全支持POJO。
Gson这个Java类库可以把Java对象转换成JSON,也可以把JSON字符串转换成一个相等的Java对象。Gson支持任意复杂Java对象包括没有源代码的对象。

下载地址
http://code.google.com/p/google-gson/downloads/list  阅读全文
posted @ 2009-11-05 15:31 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: 1. 下载最新的nucleus
http://nucleuscms.org/download.php



2. 解压
unzip *.zip
移动到:/data/blog/nucleus

3. 创建数据库
mysql -u root -p
提示输入密码
create database nucleus_db;
创建数据库用户
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON nucleus_db.* TO 'username'@'localhost' IDENTIFIED BY 'password';




4. 配置nginx
server {
listen 80;
server_name www.myblog.com;
access_log /var/log/ngi  阅读全文
posted @ 2009-10-30 13:13 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: 1. 下载最新的drupal
wget http://drupal.org/files/projects/drupal-x.x.tar.gz



2. 解压
tar -zxvf drupal-x.x.tar.gz
移动到:/data/blog/drupal

3. 创建数据库
mysql -u root -p
提示输入密码
create database drupal_db;
创建数据库用户
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON drupal_db.* TO 'username'@'localhost' IDENTIFIED BY 'password';

4. 创建文件
cp sites/default/default.settings.php sites/default/settings.php
chmod o+w s  阅读全文
posted @ 2009-10-30 12:02 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: 1. 下载最新的wordpress-mu
wget http://mu.wordpress.org/latest.tar.gz

2. 解压
tar -xzvf latest.tar.gz
移动到:/data/wpmu

3. 创建数据库
mysql -u root -p
提示输入密码
create database wordpress_mu_db;
创建数据库用户
GRANT ALL ON wordpress_mu_db.* TO user@localhost identified by "password";



4. 配置nginx
server {
listen 80;
server_name www.myblog.com;
access_log /var/log/nginx/myblog.com-access.log;

location / {
  阅读全文
posted @ 2009-10-30 11:55 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: 1. 下载最新的wordpress
wget http://wordpress.org/latest.tar.gz

2. 解压
tar -xzvf latest.tar.gz
移动到:/data/wordpress

3. 创建数据库
mysql -u root -p
提示输入密码
create database wordpress_db;
创建数据库用户
GRANT ALL ON wordpress_db.* TO user@localhost identified by "password";

4. 修改配置文件
cd /opt/webapps/www/wp/wp
mv wp-config-sample.php wp-config.php.

5. 配置nginx
server {
listen 80;
server_name www.myblog.com;
access_l  阅读全文
posted @ 2009-10-30 11:49 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: 这个错误信息通常在你更新工作拷贝时出现,可能的原因有两个:

* 版本库中有两个文件的名字只是大小写不同,这在Windows下是不允许签出的,因为Windows的文件系统是大小写不敏感的。很可能其中一个文件是误添加的,所以你要找出是哪一个,然后删除它,以确保不会把更改提交到错误的文件。
* 某个文件的文件名是非法的(对Windows来说非法),比如,"con", "lpr", "com"都是非法的,因为这些都是设备名。当然,含有"/\*?:|"和其它特殊字符在Windows(NTFS 和 FAT)也是不允许的。

是,我们知道这个错误信息对解决问题没什么实质性的帮助,但这个错误信息是来自Subversion库的,我们改不了。

有几个办法可以避免这个问题:

Subversion 是针对大小写敏感的文件系统(比如 Linux )设计的,这在大小写不敏感的Windows下有时就会有问题。一个典型的例子是,重命名文件时,如果文件名仅有大小写不一样,如Makefile改成 MAKEFILE。在工作拷贝中要  阅读全文
posted @ 2009-10-22 12:11 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: 在测试发现 当数组返回json格式的String的时候,如果数组中只有一个,则返回的json格式不是数组形式,而是单一对象格式。  阅读全文
posted @ 2009-10-15 09:28 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: 这里面用的是jersey

1. 创建一个project

2. 建立返回的model

这里面的model例子

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

package com.test.webservice.model;

/**
*
* @author ann
*/
import com.fg114.model.People;
import java.util.Date;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax  阅读全文
posted @ 2009-09-27 15:19 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: java.lang.LinkageError: loader constraint violation: when resolving overridden method "com.sun.xml.ws.message.jaxb.AttachmentMarshallerImpl.addMtomAttachment(Ljavax/activation/DataHandler;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;" the class loader (instance of org/mortbay/jetty/webapp/WebAppClassLoader) of the current class, com/sun/xml/ws/message/jaxb/AttachmentMarshallerImpl, and its superclass loader (instance of ), have different Class objects for the type javax/act  阅读全文
posted @ 2009-09-18 16:13 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: 在 Linux 系统中,
要将代理连接为群集,有一个特殊的前提条件。某些 Linux 安装程序自动将 localhost 条目设置为网络回送 IP 地址 (127.0.0.1)。您必须设置系统的 IP 地址,以便为群集中的所有代理设置正确的地址。
也即修改/etc/hosts
把hostname的配置文件为你的静态ip(linux 查看hostname命令: hostname)

例如: hostname == etch1
修改/etc/hosts中
etch1 192.168.1.18  阅读全文
posted @ 2009-09-17 11:32 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: url :http://efforts.embedded.ufcg.edu.br/web/?p=7  阅读全文
posted @ 2009-09-01 09:28 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: 例子 class Hotel{
static constraints = {
name()
crTime(nullable:true)
upTime(nullable:true)
}

String name
Date crTime
Date upTime

def beforeInsert = {
crTime = new Date()
}

def beforeUpdate = {
upTime = new Date()
}
}
crTime(nullable:true)
upTime(nullable:true)不设 保存或更新静默失败(beforeInsert或beforeUpdate 不起作用)
  阅读全文
posted @ 2009-08-28 15:50 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: 测试了grails时候 在新创建domain class之后 测试 ,发现老是提示is not domain class 错误,
解决的办法就是grails clean 在重启app就可以了  阅读全文
posted @ 2009-08-26 16:00 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: 1. 修改role密码
alter role postgres password 'postgres';

2. 设置postgres远程连接

1). 修改listen addresses
sudo vim /etc/postgresql/8.3/main/pg_hba.conf
# listen_addresses = 'localhost'
设置为 listen_addresses = '*'

2). 添加ip

sudo vim /etc/postgresql/8.3/main/postgresql.conf
在 最后一行添加
host all all 192.168.0.0/16 md5

3  阅读全文
posted @ 2009-07-31 14:23 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: 1. 修改 ${postgres_install}/data/postgresql.conf
将listen_address = 'localhost' 改为 listen_address = '*'

2. ${postgres_install}/data/pg_hba.conf
在文件最后加入:
host  all  all  192.168.1.0/24  password

3. 重新启动数据库
${postgres_install}/bin/pg_ctl stop -D ${postgres_install}/data
${postgres_install}/bin/postmaster -i -D ${postgres_install}/data>logfile 2>&1 &

4. 这样就可以远程访问数据库了,如下边的命令:
$ psql -h 192.168.1.216 -p 5432   阅读全文
posted @ 2009-07-24 10:37 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: jvm调优总结

由于应用服务器本身对内存消耗比较大,所以遇到不同配置的机器时经常要对suite的启动脚本进行修改
来调整内存参数,尤其是在虚拟机分配内存过小的情况
于是想总结一下内存参数相关的内容,但搜索之后发现unixboy已经很好的总结了
于是转载过来以供自己学习参考。
声明:本文一下内容转自:http://unixboy.javaeye.com/blog/174173
堆大小设置
JVM 中最大堆大小有三方面限制:相关操作系统的数据模型(32-bt还是64-bit)限制;系统的可用虚拟内存限制;系统的可用物理内存限制。32位系统下,一般限制在1.5G~2G;64为操作系统对内存无限制。我在Windows Server 2003 系统,3.5G物理内存,JDK5.0下测试,最大可设置为1478m。
典型设置:
java -Xmx3550m -Xms3550m -Xmn2g -Xss128k
-Xmx3550m:设置JVM最大可用内存为3550M。
-Xms3550m:设置JVM促使内存  阅读全文
posted @ 2009-07-15 14:26 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: @Column(name="columnName";boolean unique() default false;boolean nullable() default true;
boolean insertable() default true;boolean updatable() default true;
String columnDefinition() default "";
String table() default "";
int length() default 255;
int precision() default 0; // decimal precision
int scale() default 0; // decimal scale
name 可选,字段名(默认值是属性名)

unique 可选,是否在该字段上设置唯一约束(默认值false)

nullable 可选,是否设置该字段的值可以为空(默认值false)

insertable 可选,该字段  阅读全文
posted @ 2009-07-15 13:17 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: http://www.pixelbeat.org/cmdline_zh_CN.html
http://www.linuxfromscratch.org/blfs/edguide/chapter03.html

基于SSH密钥对的自动登录
xiao@xiao .ssh]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/xiao/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/xiao/.ssh/id_rsa.
Your public key has been saved in /home/xiao/.ssh/id_rsa.pub.
The  阅读全文
posted @ 2009-07-07 09:54 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: 1.备份
>pg_dump -h 192.168.4.217 --username admin RestaurantCenter >restaurantcenter1.sql

2.执行sql
>psql -h 192.168.1.18 --username postgres RestaurantCenter < restaurantcenter1.sql

  阅读全文
posted @ 2009-07-02 13:43 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: Manipulating the start and stop order of Linux servicesThis document (7002295) is provided subject to the disclaimer at the end of this document.

Environment
Novell SUSE Linux
Novell SUSE Linux Enterprise Server 9
Novell SUSE Linux Enterprise Server 10
Novell SUSE Linux Enterprise Desktop 10

Situation
In some circumstances, the start and stop order of a service needs to be manipulated.
How to add start and stop orders to a custom service

Resolu  阅读全文
posted @ 2009-06-30 17:05 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: 1. 下载openMQ安装文件 openmq4_3-installer-Unix.zip 到/home/zhshp

2. 解压zip文件
1) . 复制zip文件到opt/
cp /home/zhshp/openmq4_3-installer-Unix.zip /opt/
2) . 解压zip
cd /opt/
unzip openmq4_3-installer-Unix.zip
3. 安装
1) . 创建answerfile
在 /opt/mq4_3-zip-installer/ 创建answerfile 例如 :见/home/zhshp/nswerfile
2) . 安装 installer -s -a answerfile
3) 修改imqbroker配置文件:sudo vim etc/mq/imqbro  阅读全文
posted @ 2009-06-23 15:20 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: ln -s /data/tomcat /opt/tomcat  阅读全文
posted @ 2009-06-17 14:21 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: :> domains/domain1/logs/server.log   阅读全文
posted @ 2009-06-17 13:59 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: 例子 修改$


user syncher syncher;
worker_processes 2;
events {
use epoll; # for linux
worker_connections 1024;
}


http {
include mime.types;
default_type application/octet-stream;


#access_log logs/access.log main;

sendfile on;
#tcp_nopush on;

#keepalive_timeout 0;
keepalive_timeout 65;

gzip on;

upstream tomcats {
  阅读全文
posted @ 2009-06-17 13:38 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: df -hl 查看磁盘剩余空间

du -sm 文件夹
返回该文件夹总M数  阅读全文
posted @ 2009-06-17 11:26 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: 解决的方案:部署在不同的domain中,并控制domain启动的顺序

例子:applications: RestaurantCenter (比mobile先load);mobile。

服务器: 内网192.168.1.18上
glassfish的路径:/opt/glassfish2.1

1.首先,创建两个domain :domain1,domain2
创建domain1 :ant -f setup1.xml



posted @ 2009-06-16 15:23 冰是没有未来的,因为它的永恒| 编辑 收藏
glassfish 已知问题和限制
     摘要: 已知问题和限制
http://docs.sun.com/app/docs/doc/820-7430/knownissuessges?a=view
  阅读全文
posted @ 2009-06-16 11:01 冰是没有未来的,因为它的永恒| 编辑 收藏
升级后启动域时,您会在日志中看到以下异常。(6774663)
     摘要: 说明
可能会抛出以下异常:

#|2008-11-19T01:44:37.422+0530|SEVERE|sun-appserver9.1|org.apache.catalina.session.ManagerBase|_ThreadID=17;_ThreadName=pool-1-thread-3;_Req uestID=cc0ddf54-a42e-400a-9788-e30d79a25d88;|PWC2768: IOException while loading persisted sessions: java.io.InvalidClassException: org.apache .catalina.session.StandardSession; local class incompatible: stream classdesc serialVersionUID = 8647852380089530442, local class serialVersi onUID = -8515037662877107054 java.io.InvalidClas  阅读全文
posted @ 2009-06-16 11:00 冰是没有未来的,因为它的永恒| 编辑 收藏
特定于 INTERNET EXPLORER 6.0/7.0 浏览器:导出负载平衡器配置文件会抛出错误 (6516068)
     摘要: 说明
(仅 Internet Explorer 6 和 7)当尝试从 Internet Explorer 6 或 7 导出负载平衡器配置文件 (loadbalancer.xml) 时,浏览器会显示错误消息,表示找不到 sun-loadbalancer_1_2.dtd DTD 文件。
解决方法
要保存此文件,请使用以下解决方法:
在 Internet Explorer 中,在“负载平衡器”页上单击“导出”。
将显示“XML page cannot be displayed”消息。
单击错误框,然后从 Internet Explorer 中选择“文件”->“另存为”。
将 loadbalancer.xml 文件保存到所选目录中。

  阅读全文
posted @ 2009-06-16 10:53 冰是没有未来的,因为它的永恒| 编辑 收藏
glassfish启动 --java.rmi.server.ExportException
     摘要: glassfish启动的时候:

.1|javax.enterprise.system.core|_ThreadID=10;_ThreadName=main;|UnknownException during st
artup. Disable quick startup by setting system property com.sun.enterprise.server.ss.ASQuickStartup to false
com.sun.appserv.server.ServerLifecycleException: java.rmi.server.ExportException: Port already in use: 0; nested exception is:
java.net.BindException: Can't assign requested address
at com.sun.enterprise.admin.server.core.channel.AdminChannel.createRMIChannel(  阅读全文
posted @ 2009-06-16 09:26 冰是没有未来的,因为它的永恒| 编辑 收藏
linux java main函数启动的例子
     摘要: java -cp "./WEB-INF/lib/*:./WEB-INF/classes" bran.RestaurantCenterJettyStarter
nohup java -cp "./WEB-INF/lib/*:./WEB-INF/classes" bran.RestaurantCenterJettyStarter >log.log & 退出时候,不中断  阅读全文
posted @ 2009-06-15 18:02 冰是没有未来的,因为它的永恒| 编辑 收藏
solr int Querying Ranges Problem
     摘要: Ensure that the fieldType maps back to solr.SortableIntField rather
than solr.IntField  阅读全文
posted @ 2009-06-13 17:45 冰是没有未来的,因为它的永恒| 编辑 收藏
unconpilable exception code in netbeans
     摘要: have a little testcase:

Class enumClass = TestEnum.class;
System.out.println(TestEnum.我);
Method method = null;
method = enumClass.getDeclaredMethod("values", new Class[0]);
Object[] values = (Object[]) method.invoke(null, new Object[0]);
Assert.assertTrue(values.length > 0);
System.out.println(values[0]);

The method invocation blows out and complains uncompilable code

The reason seems to   阅读全文
posted @ 2009-06-13 14:38 冰是没有未来的,因为它的永恒| 编辑 收藏
glassfish linux 安装
     摘要: 1.下载- ref : https://glassfish.dev.java.net/downloads/v2.1-b60e.html

-
2.解压下载的jar # java -Xmx256m -jar glassxxx.jar
3.复制到安装的路径下 copy th glassfish to /opt/glasfish2.1

# cd glassfish2.1
如果系统没安装ant # chmod -R +x lib/ant/bin

make sure tomcat is not running on 8080, I changed to run on 18080



4. 安装 # lib/ant/bin/ant -f setup.xml

cannot move the dir after the above step.


ends results:

create.domain:
[exe  阅读全文
posted @ 2009-06-13 12:11 冰是没有未来的,因为它的永恒| 编辑 收藏
jetty starter 不检查 端口是否被占用
     摘要: jetty starter 不检查 端口是否被占用

connector.setReuseAddress(false);

这样就不能重复启动同一个 jetty 了.
  阅读全文
posted @ 2009-06-12 15:15 冰是没有未来的,因为它的永恒| 编辑 收藏
solrj的相关网址
     摘要: http://mxsfengg.javaeye.com/?show_full=true
http://clayz.javaeye.com/?page=2&show_full=true
http://mxsfengg.javaeye.com/blog/277913  阅读全文
posted @ 2009-06-03 11:55 冰是没有未来的,因为它的永恒| 编辑 收藏
Google geo API
     摘要: http://ditu.google.com/maps/geo?output=json&oe=utf-8&q=要查的地址

/**
* a positive response:
*
*
{
"name": "上海金桥开发区",
"Status": {
"code": 200,
"request": "geocode"
},
"Placemark": [
{
"id": "p1",
"address": "中国上海市浦东新区金桥开发\r\r\n区",
"AddressDetails": {
"Country": {
"CountryNameCode": "CN",
"  阅读全文
posted @ 2009-06-03 09:57 冰是没有未来的,因为它的永恒| 编辑 收藏
为已经存在的数据库添加GIS功能
     摘要: PgAdmin, open up the SQL window by clicking the SQL button (the one with the pencil).
Choose “File  Open…” and navigate to

C:\Program Files\PostgreSQL\8.3\share\contrib\lwpostgis.sql

Press the “Run” button. (The green triangle.) The lwpostgis.sql file will execute, loading the PostGIS functions and objects into the “postgis” database.

Choose “File  Open…” and navigate to

C:\Program Files\PostgreSQL\8.3\share\contrib\spatial_ref_sys.sql  阅读全文
posted @ 2009-06-03 09:55 冰是没有未来的,因为它的永恒| 编辑 收藏
成批转换java 文件的编码
     摘要: netbeans项目中缺省使用 utf-8. 这要求所有的源文件使用 utf8 编码有些源文件是从别的文件系统中拷贝出来, 可能使用别的编码方式, 例如 iso-8859-1. 如果其中有 Ascii 扩展字符, 则 编译的时候会抱怨有 并不认识的 unicode 编码. (ummapped unicode characters)

解决方法: 使用 GNU iconv 工具进行批处理转换.

- iconv 在 cygwin 中有发布, 需要 iconv2 包. 也有单独的 windows 版本.

- 在 一个临时文件目录两种建立和源目录相同的目录结构: 拷贝过去以后, find . -name "*.*" | xargs rm, find . -name ".svn" | xargs rm -R
- 在源文件目录中: $ for a in `find . -name "*.java"`; do iconv -f iso-8859-1 -t utf-8 <"$a" > /tmp/"$a" ; done
阅读全文
posted @ 2009-06-03 09:52 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: JTS Geometry 对象不能被 JAXB 映射成xml.

可使用一下的方法避免指定的 java bean property 不被 xml 话

在 bean 的class级别:

@XmlAccessorType(XmlAccessType.FIELD) // for jaxb to ananlyze the object

然后在 field 上面

@XmlTransient


如果没有 XmlAccessorType, 则需要把 @XmlTransient 放在getter 上面.  阅读全文
posted @ 2009-06-03 09:44 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: 1. putty:
http://the.earth.li/~sgtatham/putty/latest/x86/pscp.exe

2.使用 rsync, 能后进行差额同步, 大大减少文件传输量, 例如下面的命令本地的 dist 目录下面的 TakeoutServer.war 同步到远程服务器 etch1 的 ~ 目录 (home 目录)

rsync -avz --delete --progress -e "ssh" dist/TakeoutServer.war etch1:~/
  阅读全文
posted @ 2009-05-22 16:55 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: 数据库映射为实体:http://resources.visual-paradigm.com/index.php/dbm-tut/42-tut/129-db-reverse-sc.html
实体映射为数据库:http://resources.visual-paradigm.com/index.php/dbm-tut/42-tut/129-db-reverse-sc.html

  阅读全文
posted @ 2009-05-22 10:24 冰是没有未来的,因为它的永恒| 编辑 收藏
     摘要: 1. log4j的配置

### direct log messages to stdout ###
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n

### direct messages to file hibernate.log ###
#log4j.appender.file=org.apache.log4j.FileAppender
#log4j.appender.file.File=hibernate.log
#log4j.appender.file.layout=or  阅读全文
posted @ 2009-05-14 14:45 冰是没有未来的,因为它的永恒| 编辑 收藏

当下,把心放下 放下如果是可能的,那一定是在当下,
不在过去,也不在未来。
当下放下。唯有活在当下,你的问题才能放下。