| yang's profile如山岿然,如风啸然,如林静然~~PhotosBlogLists | Help |
|
如山岿然,如风啸然,如林静然~~October 23 安装sleepycat步骤备忘安装sleepycat步骤备忘:
从下面的URL下载zlib 1.2.3的源代码:http://www.sleepycat.com
tar zvxf db-4.3.29.tar.gz cd db-4.3.29 cd build_unix/ ../dist/configure \ CHOST="i686-pc-linux-gnu" CFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer" CXXFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer" make make install env
export LD_LIBRARY_PATH=/usr/local/BerkeleyDB.4.3/lib
September 05 what's up--一首好歌的中文译本-奋进!25年的生命已经过去 我仍在竭力登攀那座希望的山脊 为了人生有一个目的。 我早就看透 这个世界是一张网 它由权贵的裙带所编织 随你爱怎么解释都可以。 我有时躺在床上哭泣 想把所有乱七八糟的念头从头脑里驱逐 于是有一天出现了奇迹。 早晨醒来,我走出户外 深深地吸了一口气 我兴奋异常,我大声喊叫 用尽全身的力气 这是什么回事? 我说:嘿,这是为什么? 我说:嘿,这是什么回事!! 我说:嘿,这到底是什么回事!!! 我努力,我挣扎,哦,我的老天,我从不偷懒 我每时每刻都努力 在这弱肉强食的体制的牢笼里。 我祷告,我祈求,哦,我的上帝,我真的祷告 我每日每夜都祈求上帝 快来一次翻天覆地的革命! 25年的人生已经过去, 我仍然竭力登攀那座希望的山脊 为了人生有一个目的 为了生命有一点意义。 June 27 老黄有点二!尤其是这一句:“意大利万岁!”----用得着么???
几近疯狂的语无伦次,傻了吧唧的滥用激情,老黄真的有点不知所措了!
即便喜欢意大利,也不用在全国人民面前表达自己那点所谓的热情和热爱,喜欢马尔蒂尼也不用说人家神灵附体,喜欢历史上各个年代的意大利左后卫也不用把他们说的如此完美,甚至外貌都评价的宛如天仙般……况且个人认为意大利踢得确实不怎么的,这是事实,在我看来,意大利队应该被击败,无论是从战术还是技术角度,都不是一个成熟的球队。
naive的老黄! June 26 老了,我真的老了!
May 12 给我一点爱你告诉我,别问你从哪来 你告诉我,一切听天安排 也许是我从前错过太多 所以我不敢对你有所依赖 你告诉我,男人应该象海 你告诉我,只需学 会忍耐 把所有悲伤都统统丢掉让他过去 你要塑造一个新的我,虽然现在我还有点无奈 给我一点爱,让我站起来 给我一点亮,让我看明白 你到底是谁,在为谁而奔忙你到底是谁,是不是为我而来 梦当太阳收起了温暖的光滑 疲惫的我想要休息一下 含着泪水闭上沉重的眼帘 一个人默默走向梦的天崖 梦中的世界象一幅画 梦中的自己是那么高大 梦里梦到了你梦到个笑话 梦到了所有的美好和我的家 于是我就可以让你留下 于是我就可以等你回答 于是我就可以不再流浪 于是我就可以陪你回家 你说梦中的我有一点傻 你说梦中的你不会害怕 千万别把我唤醒让我去吧 梦里不再有忧伤没有牵挂 梦中的世界象一幅画 梦中的自己是那麽高大 梦里梦到了你梦到个笑话 梦到了所有的美好和我的家 April 10 Proxool连接池连oracle数据库配置。ricky
jdbc:oracle:thin:QXTERM/QXTERM@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=61.135.154.156)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=QXTERM)))
oracle.jdbc.driver.OracleDriver
500
select CURRENT_DATE 技术日志:用于备份mysql数据库脚本文件以下的脚本文件专门用于备份mysql数据库,放在/etc/cron.daily下每天自动执行一次。 #!/bin/bash echo "-------------------------------------------" >> $LogFile if [ -f $NewFile ] echo "-------------------------------------------" >> $LogFile March 16 照镜子和照相哪个又接近于人最真实的相貌呢?发现了一个问题:
对于一个人,照镜子和照相会呈现不同的相貌,这个现象不仅发生在我身上,而且广大的同志们也有此感,因为在天涯上看到这么一个帖子,大家探讨的就是这个问题,很深入,很激烈啊!
很多人都会觉得自己照镜子更好看些,因为不上相,所以照相的感觉很差,出来的样子自己都把自己否认掉了:这哪是自己啊?这么丑!看看这位网友问得:我一直想问个问题,在其他人眼里的自己应该是镜子里那样还是相机那样呢?是啊,由此我想到了超女,比如李宇春,我就觉得她不好看,但她出名了啊!很多女孩甚至女青年都像看到劳勃迪尼诺,莱昂纳多,布拉德皮特,城武这样的帅哥般一样迷上了这位看似男女都不太分明的小女孩,但我不能肯定的是,这些迷上她的人看到李宇春的相貌是不是和我看到的不一样呢?他们看到的是否是男人味十足,吸引女人青睐的一个帅女人?反正我的眼睛看来李宇春没有达到这样的程度,看来每个人的眼睛看同一个人的相貌确实有别啊! 技术日志:mysql数据库表的字符编码设置方法。这个问题困扰过我,现在已经知道怎么设置了:
Alter Table tablename convert to character set 'utf8';
真正领略到了mysql的变态之处,写成'utf-8'中间多一杠不行,必须原样照搬,严谨。 技术日志:-jar参数运行应用时classpath的设置方法(引用)当用java -jar yourJarExe.jar来运行一个经过打包的应用程序的时候,你会发现如何设置-classpath参数应用程序都找不到相应的第三方类,报ClassNotFound错误。实际上这是由于当使用-jar参数运行的时候,java VM会屏蔽所有的外部classpath,而只以本身yourJarExe.jar的内部class作为类的寻找范围。 **解决方案** 一 BootStrap class扩展方案 Java 命令行提供了如何扩展bootStrap 级别class的简单方法. 语法如下: 二 extend class 扩展方案 Java exten class 存放在{Java_home}\jre\lib\ext目录下.当调用Java时,对扩展class路径的搜索是自动的.总会搜索的.这样,解决的方案就很简单了,将所有要使用的第三方的jar包都复制到ext 目录下. 三 User class扩展方案 当使用-jar执行可执行Jar包时,JVM将Jar包所在目录设置为codebase目录,所有的class搜索都在这个目录下开始.所以如果使用了其他第三方的jar包,一个比较可以接受的可配置方案,就是利用jar包的Manifest扩展机制. 1.将需要的第三方的jar包,复制在同可执行jar所在的目录或某个子目录下. 比如:jar 包在 /usrhome/yourJarExe.jar 那么你可以把所有jar包复制到/usrhome目录下或/usrhome/lib 等类似的子目录下. 2.修改Manifest 文件 在Manifest.mf文件里加入如下行 Class-Path:classes12.jar lib/thirdlib.jar Class-Path 是可执行jar包运行依赖的关键词.详细内容可以参考 http://java.sun.com/docs/books/tutorial/ext/index.html
Java的安全机制随不同的JDK版本有不同的变化,会影响很多核心CLASS,比如Thread,所以很多大型商业软件,要求JDK的版本很严格.部分原因也在此.这也要求在发布自己编写的应用时候,不管大小,都要说明开发和测试的JDK版本.
---------------------------------------------------------------------------------------------- 附:背景知识 自JDK 1.2以后,JVM采用了委托(delegate)模式来载入class.采用这种设计的原因可以参考http://java.sun.com/docs/books/tutorial/ext/basics/load.html 归纳来讲:是基于JVM sandbox(沙盒)安装模型上提供应用层的可定制的安全机制.
1. Bootstrap classes 属于Java 平台核心的class,比如java.lang.String等.及rt.jar等重要的核心级别的class.这是由JVM Bootstrap class loader来载入的.一般是放置在{java_home}\jre\lib目录下 2. Extension classes 基于Java扩展机制,用来扩展Java核心功能模块.比如Java串口通讯模块comm.jar.一般放置在{Java_home}\jre\lib\ext目录下 3. User classes 开发人员或其他第三方开发的Java程序包.通过命令行的-classpath或-cp,或者通过设置CLASSPATH环境变量来引用.JVM通过放置在{java_home}\lib\tools.jar来寻找和调用用户级的class.常用的javac也是通过调用tools.jar来寻找用户指定的路径来编译Java源程序.这样就引出了User class路径搜索的顺序或优先级别的问题. 3.1 缺省值:调用Java或javawa的当前路径(.),是开发的class所存在的当前目录 这也是为什么应用程序打包成可执行的jar包后,不管你怎么设置classpath都不能引用到第三方jar包的东西了. 技术日志:积累察看日志的两个命令1,实时察看日志,日志文件1.log
tail -f 1.log|grep 过滤内容
实时的,最新的日志在最后
2,查询日志,搜索错误404记录,打印,排序,唯一性排选,取字段,去冒号集于一身:
grep "/freetry/java_wappush/gamecity.jsp" access_log.0927 | grep " 404 " | awk '{print $13}' | sort | uniq | awk -F\" '{print $2}' 多看看,记得牢:) 技术日志:执行脚本,还是关于发邮件工具的脚本放在服务器上/home/yangruijun/目录下md.sh的脚本如下,chmod +x md.sh 获取该文件的执行权限,那么即可执行,例如:
参数格式:h welcome 20051119.html /home/yangruijun/file/ yangruijun@kongzhong.com
说明:
* @String h 邮件格式(分为“t“ or ”h“); * @String welcome 标题; * @String 20051119.html 邮件内容(文件形式 or 字符串); * @String /home/yangruijun/file/ 如果是文件,那么就写成路径; * @String yangruijun@kongzhong.com 目的地址(多个,用”,“隔开); md.sh的内容:
#!/bin/bash
PATH=/bin:/usr/bin:/usr/sbin:/usr/local/bin:/sbin:/usr/local/sbin:/home/yangruijun
export PATH export LANG=en_US export NLS_LANG=simplified chinese java -Xbootclasspath/a:activation.jar:mail.jar: -jar ddd.jar $* 如此,需要把activation.jar,mail.jar两个jar包放置于:/home/yangruijun/路径下 技术日志:javax mail发邮件程序的设计apahce封装了一个可用的包org.apache.commons.mail.*;
这个包可以很容易的收发邮件,但是我尝试了一下,觉得乱码问题依旧是个困扰人的麻烦问题;于是直接用javax.mail包写这个工具:
/*
* Created on 2006-3-15 * * TODO To change the template for this generated file go to * Window - Preferences - Java - Code Style - Code Templates */ package util; /**
* @author Ricky Yang * 发邮件工具(发送txt,html,字符串内容类型) * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */ import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.InputStreamReader; import java.util.*; import javax.mail.*; import javax.mail.internet.*; import javax.activation.*; public class sendMail { //MIME邮件对象 private MimeMessage mimeMsg; //邮件会话对象 private Session session; //系统属性 private Properties props; //smtp是否需要认证 private boolean needAuth = false; //smtp认证用户名和密码,假如需要的话,得设置 private String username = ""; private String password = ""; //Multipart对象,邮件内容,标题,附件等内容均添加到其中后再生成MimeMessage对象 private Multipart mp; //单例模式构造单一对象 private static sendMail sendmail = null; //本例取mail.kongzhong.com作为邮件服务器 private static String smtps = "mail.kongzhong.com"; /** * 生成该类对象 */ public static sendMail getInstance(){ if(sendmail == null) sendmail = new sendMail(smtps); return sendmail; } /** * 初始化邮件服务器,需要邮件服务器地址 */ public sendMail(String smtp){ this.setSmtpHost(smtp); this.createMimeMessage(); } /** * 主函数入口 */ public static void main(String[] args) { if(args!= null && args.length == 5) { String format = analFormat(args[0]); String title = analTitle(args[1]); String path = analPath(args[3]); String content = analContent(args[2],path); String address[] = analAddress(args[4]); if(format.equals("t"))
{ sendMail email = sendMail.getInstance(); String copyto = ""; try { for(int i = 0;i<address.length;i++) { if(!address[i].equals("")) { if(i > 0) copyto = copyto + "," + address[i]; if(i == 0) copyto = copyto + address[i]; } } email.setTo(copyto); email.setFrom("root@kongzhong.com"); email.setSubject(title); email.setBodys(content); email.sendout(); } catch(Exception e){ System.err.print("在构造文本邮件时错误发生: "+e); } } if(format.equals("h")) { sendMail email = sendMail.getInstance(); String copyto = ""; try { for(int i = 0;i<address.length;i++) { if(!address[i].equals("")) { if(i > 0) copyto = copyto + "," + address[i]; if(i == 0) copyto = copyto + address[i]; } } email.setTo(copyto); email.setFrom("root@kongzhong.com"); email.setSubject(title); email.setBody(content); email.sendout(); } catch(Exception e) { System.err.print("在构造html文件是错误发生:"+e); } } } else System.out.println("对不起,没有参数无法发送!"); } /** * 设置stmphost */ public void setSmtpHost(String hostName) { if(props == null) props = System.getProperties(); props.put("mail.smtp.host",hostName); } /**
* 创建MimeMessage,MimeMultipart */ public void createMimeMessage() { try { session = Session.getDefaultInstance(props,null); } catch(Exception e) { System.err.println("获取邮件会话对象时发生错误!"+e); } try { mimeMsg = new MimeMessage(session); mp = new MimeMultipart(); } catch(Exception e) { System.err.println("创建MIME邮件对象失败!"+e); } } /** * 设置权限属性 */ public void setNeedAuth(boolean need) { if(props == null) props = System.getProperties(); if(need) { props.put("mail.smtp.auth","true"); } else { props.put("mail.smtp.auth","false"); } } /** * 设置邮件服务器用户名密码 */ public void setNamePass(String name,String pass) { username = name; password = pass; } /**
* 设置主题 */ public void setSubject(String mailSubject) { try { mimeMsg.setSubject(mailSubject); } catch(Exception e) { System.err.println("设置邮件主题发生错误!"); } } /** * 设置邮件内容(html) */ public void setBody(String mailBody) { try { BodyPart bp = new MimeBodyPart(); bp.setContent("<meta http-equiv=Content-Type content=text/html; charset=gb2312>"+mailBody,"text/html;charset=GB2312"); mp.addBodyPart(bp); } catch(Exception e) { System.err.println("设置邮件正文时发生错误!"+e); } } /** * 设置邮件内容(txt) */ public void setBodys(String mailBody) { try { BodyPart bp = new MimeBodyPart(); bp.setContent(mailBody,"text/plain;charset=GB2312"); mp.addBodyPart(bp); } catch(Exception e) { System.err.println("设置邮件正文时发生错误!"+e); } } /**
* 设置邮件附件 */ public void addFileAffix(String filename) { try { BodyPart bp = new MimeBodyPart(); FileDataSource fileds = new FileDataSource(filename); bp.setDataHandler(new DataHandler(fileds)); bp.setFileName(fileds.getName()); mp.addBodyPart(bp); } catch(Exception e) { System.err.println("增加邮件附件:"+filename+"发生错误!"+e); } } /** * 设置发信人 */ public void setFrom(String from) { try { mimeMsg.setFrom(new InternetAddress(from)); } catch(Exception e) { System.err.println("设置发信地址错误:"+e); } } /**
* 设置收信人 */ public void setTo(String to) { if(to == null) return; try { mimeMsg.setRecipients(Message.RecipientType.TO,InternetAddress.parse(to)); } catch(Exception e) { System.err.println("收信地址错误!"+e); } } /** * 设置抄送地址 */ public void setCopyTo(String copyto) { if(copyto == null) return; try{ mimeMsg.setRecipients(Message.RecipientType.CC,(Address[])InternetAddress.parse(copyto)); } catch(Exception e) { System.err.println("抄送地址错误!"+e); } } /** * 发送邮件的函数 */ public void sendout() { try { mimeMsg.setContent(mp); mimeMsg.saveChanges(); Session mailSession = Session.getInstance(props,null); Transport transport = mailSession.getTransport("smtp"); if(transport == null) System.exit(-1); transport.connect((String)props.get("mail.smtp.host"),username,password); transport.sendMessage(mimeMsg,mimeMsg.getRecipients(Message.RecipientType.TO)); transport.close(); } catch(Exception e) { System.err.println("邮件发送失败!"+e); } } /** * 分析邮件格式 */ private static String analFormat(String input) { if(null != input) { input = input.trim(); if("t".equals(input)||"h".equals(input)) return input; else return "t"; } else return "t"; } /** * 分析邮件标题 */ private static String analTitle(String title) { if(null != title) { title = title.trim(); return title; } else return ""; } /** * 分析邮件内容 */ private static String analContent(String content,String path) { if(null != content) { content = content.trim(); if(content.endsWith(".html") || content.endsWith(".txt")) { File fe = new File(path + content); if(fe.isFile() && fe != null) { String lastline = ""; try { FileInputStream fis = new FileInputStream(fe); if(fis != null) { InputStreamReader isr = new InputStreamReader(fis,"gb2312"); if(isr != null) { BufferedReader br = new BufferedReader(isr); String newlines = ""; while((newlines = br.readLine())!= null) { lastline = lastline + newlines +"\n"; if(content.endsWith(".html")) lastline = lastline.replaceAll(""","\""); } br.close(); } } } catch(Exception e) { System.err.println("when read file,error occured : "+e); } return lastline; } else return ""; } else { try { content = new String(content.getBytes("ISO-8859-1"),"gb2312"); } catch(Exception e) { System.out.println("Sorry, a translate is wrong "+e); } return content; } } else return ""; } /** * 分析发送文件的路径 */ private static String analPath(String path) { if(null != path) { path = path.trim(); return path; } else return ""; } /** * 分析邮件发送的目的地址 */ private static String[] analAddress(String address) { if(null != address) { address = address.trim(); if(address.indexOf(",") >0) { String[] newadd = address.split(","); for(int i =0;i < newadd.length;i++) { if(newadd[i].indexOf("@")< 0) newadd[i] = ""; } return newadd; } else { if(address.indexOf("@")< 0) address = ""; String[] lastadd = {address}; return lastadd; } } else { String[] lastadd = {}; return lastadd; } } } 这个到目前为止已经能运行了,放在了服务器上 收录一下三首好听的英文歌的歌词,经常听Better Man(Robbie Williams)
send someone to love me
i need to rest in arms keep me safe from harm in pouring rain give me endless summer lord i fear the cold feel i'm getting old before my time as my soul heals the shame i will grow through this pain lord i'm doing all i can to be a better man go easy on my conscience 'cause it's not my fault i know i've been taught to take the blame rest assured my angels will catch my tears walk me out of here i'm in pain as my soul heals the shame i will grow through this pain lord i'm doing all i can to be a better man once you've found that lover you're homeward bound love is all around love is all around i know some have fallen on stony ground but love is all around send someone to love me i need to rest in arms keep me safe from harm in pouring rain give me endless summer lord i fear the cold feel i'm getting old before my time as my soul heals the shame i will grow through this pain lord i'm doing all i can to be a better man Yellow(ColdPlay)
Look at the stars; look how they shine for you
And everything you do Yeah, they were all yellow I came along; I wrote a song for you And all the things you do And it was called yellow So then I took my turn Oh what a thing to have done And it was all yellow Your skin, oh yeah your skin and bones Turn into something beautiful D'you know? You know I love you so You know I love you so I swam across; I jumped across for you Oh what a thing to do 'Cos you were all yellow I drew a line; I drew a line for you Oh what a thing to do And it was all yellow And your skin, oh yeah your skin and bones Turn into something beautiful D'you know? For you I bleed myself dry For you I bleed myself dry It's true Look how they shine for you Look how they shine for you Look how they shine for? Look how they shine for you Look how they shine for you Look how they shine Look at the starsLook how they shine for you And all the things that you do Beautiful Day(U2)
the heart is a bloom
shoots up through the stony ground there's no room no space to rent in this town you're out of luck and the reason that you had to care the traffic is stuck and you're not moving anywhere you thought you'd found a friend to take you out of this place someone you could lend a hand in return for grace it's a beautiful day sky falls, you feel like it's a beautiful day don't let it get away you're on the road but you've got no destination you're in the mud in the maze of her imagination you love this town even if that doesn't ring true you've been all over and it's been all over you it's a beautiful day don't let it get away it's a beautiful day touch me take me to that other place teach me i know i'm not a hopeless case see the world in green and blue see china right in front of you see the canyons broken by cloud see the tuna fleets clearing the sea out see the bedouin fires at night see the oil fields at first light and see the bird with a leaf in her mouth after the flood all the colors came out it was a beautiful day don't let it get away beautiful day touch me take me to that other place reach me i know i'm not a hopeless case what you don't have you don't need it now what you don't know you can feel it somehow what you don't have you don't need it now don't need it now was a beautiful day March 15 开始写点,好有点不白活一回的感觉:)我也觉得应该写点什么了……这似乎是个潮流--msn上自己自己有个空间还不错,放一些自己的情感文字,琐碎记忆以及片刻感想。有时候丰收了,有时候苦闷了,有时候激动了,有时候nnd心痛了……大家经历过的都是人生的冷暖,岁月的洗礼,冷暖自知,洗礼自觉,生命是什么?大家都或许有过这么一问,或思索良久未曾有一个恰到好处的答案,或脱口而出给了一个可载入史册的语录,或如涓涓流水般的每天制造一个不同的答案……毛主席这位领袖说得贴切:只争朝夕!早上到晚上,每天就这么周而复始,该争的就得争,争啊!不同的是有的人就像是争着做点坏事,争着去死!有的人争了半天也还是默默无闻的过着普通的生活,而有的人也争成了人上人,争得很舒坦,也有与世无争的--和尚and尼姑,想想他们也很爽啊!怎么过不是一辈子呢?从活这到死亡,不可能死亡了再活,反正要是那样可够累,我可不干,以免再活过来被人另眼相看--哪儿出来的二次人?——想开了就好啊!许巍《两天》里不时唱过么?--我只有两天:一天用来出生,一天用来死亡。咱也先别说死亡这个凄惨的事情了,当下也有两天:一天用来挣钱买张好床,一天用来灭蟑螂。 |
|
|||
|
|