Skip to content


Godaddy最新0.99刀域名优惠码

godaddy域名优惠码: INDY2010

这个Godaddy优惠码可以用来注册和转移.com, .net, .mobi, .biz, .us, .org, .ca, .co.uk, 和 .in域名 同样,这个Godaddy优惠码只支持信用卡支付

好像还送.info域名一个。

刚刚买了个com域名,加上要交0.18美分的手续费,全价是1.17美分

原文: http://godaddy.mrooo.com/godaddy-new-0-99-coupon-domain.html

2010-6-22 此优惠码已过期

Posted in 其它, 网站建设.

Tagged with , .


Linux 的 Out-of-Memory (OOM) Killer

这个也让咱遇上了。

top – 10:53:30 up 111 days, 16:49, 1 user, load average: 2.68, 2.98, 3.39 Tasks: 131 total, 1 running, 130 sleeping, 0 stopped, 0 zombie Cpu(s): 20.6%us, 8.9%sy, 0.0%ni, 69.7%id, 0.3%wa, 0.0%hi, 0.4%si, 0.0%st Mem: 8168412k total, 7844888k used, 323524k free, 106604k buffers Swap: 2097144k total, 88664k used, 2008480k free, 6534044k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
13596 mysql 15 0 2325m 1.0g 4060 S 283.3 13.0 574:16.15 mysqld
1 root 15 0 10348 88 56 S 0.0 0.0 12:35.68 init
2 root RT -5 0 0 0 S 0.0 0.0 0:02.39 migration/0

#cat /var/log/messages |grep ‘May 26 03’ May 26 03:29:35 touareg kernel: Node 1 Normal per-cpu: empty May 26 03:29:35 touareg kernel: Node 1 HighMem per-cpu: empty May 26 03:29:36 touareg kernel: Free pages: 12980kB (0kB HighMem) May 26 03:29:36 touareg kernel: Active:612100 inactive:1406689 dirty:0 writeback:0 unstable:0 free:3245 slab:6346 mapped-file:1004 mapped-anon:2018482 pagetables:6473 May 26 03:29:37 touareg kernel: Node 0 DMA free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB present:0kB pages_scanned:0 all_unreclaimable? no May 26 03:29:38 touareg kernel: lowmem_reserve[]: 0 1242 6040 6040 May 26 03:29:38 touareg kernel: Node 0 DMA32 free:1876kB min:1768kB low:2208kB high:2652kB active:1092684kB inactive:196800kB present:1272420kB pages_scanned:3346160 all_unreclaimable? yes May 26 03:29:39 touareg kernel: lowmem_reserve[]: 0 0 4797 4797 May 26 03:29:39 touareg kernel: Node 0 Normal free:6548kB min:6836kB low:8544kB high:10252kB active:514812kB inactive:4318496kB present:4912640kB pages_scanned:17304011 all_unreclaimable? yes May 26 03:29:40 touareg kernel: lowmem_reserve[]: 0 0 0 0 May 26 03:29:41 touareg kernel: Node 0 HighMem free:0kB min:128kB low:128kB high:128kB active:0kB inactive:0kB present:0kB pages_scanned:0 all_unreclaimable? no May 26 03:29:42 touareg kernel: lowmem_reserve[]: 0 0 0 0 May 26 03:29:43 touareg kernel: Node 1 DMA free:1736kB min:12kB low:12kB high:16kB active:0kB inactive:0kB present:10696kB pages_scanned:0 all_unreclaimable? yes May 26 03:29:43 touareg kernel: lowmem_reserve[]: 0 2004 2004 2004 May 26 03:29:43 touareg kernel: Node 1 DMA32 free:2820kB min:2856kB low:3568kB high:4284kB active:845864kB inactive:1106756kB present:2052320kB pages_scanned:4059828 all_unreclaimable? yes May 26 03:29:44 touareg kernel: lowmem_reserve[]: 0 0 0 0 May 26 03:29:45 touareg kernel: Node 1 Normal free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB present:0kB pages_scanned:0 all_unreclaimable? no May 26 03:29:45 touareg kernel: lowmem_reserve[]: 0 0 0 0 May 26 03:29:46 touareg kernel: Node 1 HighMem free:0kB min:128kB low:128kB high:128kB active:0kB inactive:0kB present:0kB pages_scanned:0 all_unreclaimable? no May 26 03:29:46 touareg kernel: lowmem_reserve[]: 0 0 0 0 May 26 03:29:47 touareg kernel: Node 0 DMA: empty May 26 03:29:47 touareg kernel: Node 0 DMA32: 314kB 78kB 416kB 132kB 164kB 0128kB 0256kB 1512kB 11024kB 02048kB 04096kB = 1876kB May 26 03:29:47 touareg kernel: Node 0 Normal: 1154kB 38kB 1116kB 832kB 464kB 2128kB 2256kB 1512kB 01024kB 02048kB 14096kB = 6548kB May 26 03:29:48 touareg kernel: Node 0 HighMem: empty May 26 03:29:48 touareg kernel: Node 1 DMA: 24kB 28kB 116kB 532kB 464kB 0128kB 1256kB 0512kB 11024kB 02048kB 04096kB = 1736kB May 26 03:29:48 touareg kernel: Node 1 DMA32: 634kB 78kB 1716kB 232kB 264kB 6128kB 1256kB 0512kB 11024kB 02048kB 04096kB = 2820kB May 26 03:29:49 touareg kernel: Node 1 Normal: empty May 26 03:29:49 touareg kernel: Node 1 HighMem: empty May 26 03:29:50 touareg kernel: 1339 pagecache pages May 26 03:29:50 touareg kernel: Swap cache: add 1051209, delete 1051023, find 5464906/5502739, race 0+41 May 26 03:29:50 touareg kernel: Free swap = 0kB May 26 03:29:51 touareg kernel: Total swap = 2097144kB May 26 03:29:51 touareg kernel: Free swap: 0kB May 26 03:29:51 touareg kernel: 2293760 pages of RAM May 26 03:29:52 touareg kernel: 251657 reserved pages May 26 03:29:52 touareg kernel: 6005 pages shared May 26 03:29:53 touareg kernel: 263 pages swap cached May 26 03:29:54 touareg kernel: Out of memory: Killed process 13285 (mysqld). May 26 03:29:54 touareg kernel: sshd invoked oom-killer: gfp_mask=0x200d2, order=0, oomkilladj=0 May 26 03:29:55 touareg kernel: May 26 03:29:55 touareg kernel: Call Trace: May 26 03:29:56 touareg kernel: [

] out_of_memory+0x8e/0x2f5 May 26 03:29:57 touareg kernel: [ ] __alloc_pages+0x245/0x2ce May 26 03:29:57 touareg kernel: [ ] read_swap_cache_async+0x45/0xd8 May 26 03:29:57 touareg kernel: [ ] wake_bit_function+0x0/0x23 May 26 03:29:58 touareg kernel: [ ] swapin_readahead+0x60/0xd3 May 26 03:29:58 touareg kernel: [ ] __handle_mm_fault+0x9bc/0xe5c May 26 03:29:59 touareg kernel: [ ] do_page_fault+0x4cb/0x830 May 26 03:29:59 touareg kernel: [ ] skb_dequeue+0x48/0x50 May 26 03:30:00 touareg kernel: [ ] unix_release_sock+0x19e/0x1fa May 26 03:30:00 touareg kernel: [ ] dput+0x2c/0x114 May 26 03:30:00 touareg kernel: [ ] error_exit+0x0/0x84 May 26 03:30:01 touareg kernel: May 26 03:30:01 touareg kernel: Mem-info: May 26 03:30:01 touareg kernel: Node 0 DMA per-cpu: empty May 26 03:30:02 touareg kernel: Node 0 DMA32 per-cpu: May 26 03:30:03 touareg kernel: cpu 0 hot: high 186, batch 31 used:89 May 26 03:30:03 touareg kernel: cpu 0 cold: high 62, batch 15 used:57 May 26 03:30:03 touareg kernel: cpu 1 hot: high 186, batch 31 used:0 May 26 03:30:04 touareg kernel: cpu 1 cold: high 62, batch 15 used:0 May 26 03:30:04 touareg kernel: cpu 2 hot: high 186, batch 31 used:180 May 26 03:30:04 touareg kernel: cpu 2 cold: high 62, batch 15 used:61 May 26 03:30:05 touareg kernel: cpu 3 hot: high 186, batch 31 used:0 May 26 03:30:05 touareg kernel: cpu 3 cold: high 62, batch 15 used:29 May 26 03:30:05 touareg kernel: cpu 4 hot: high 186, batch 31 used:155 May 26 03:30:05 touareg kernel: cpu 4 cold: high 62, batch 15 used:48 May 26 03:30:05 touareg kernel: cpu 5 hot: high 186, batch 31 used:0 May 26 03:30:05 touareg kernel: cpu 5 cold: high 62, batch 15 used:14 May 26 03:30:06 touareg kernel: cpu 6 hot: high 186, batch 31 used:98 May 26 03:30:06 touareg kernel: cpu 6 cold: high 62, batch 15 used:54 May 26 03:30:06 touareg kernel: cpu 7 hot: high 186, batch 31 used:0 May 26 03:30:06 touareg kernel: cpu 7 cold: high 62, batch 15 used:2 May 26 03:30:06 touareg kernel: Node 0 Normal per-cpu: May 26 03:30:06 touareg kernel: cpu 0 hot: high 186, batch 31 used:3 May 26 03:30:07 touareg kernel: cpu 0 cold: high 62, batch 15 used:56 May 26 03:30:07 touareg kernel: cpu 1 hot: high 186, batch 31 used:0 May 26 03:30:07 touareg kernel: cpu 1 cold: high 62, batch 15 used:0 May 26 03:30:07 touareg kernel: cpu 2 hot: high 186, batch 31 used:15 May 26 03:30:07 touareg kernel: cpu 2 cold: high 62, batch 15 used:48 May 26 03:30:07 touareg kernel: cpu 3 hot: high 186, batch 31 used:0 May 26 03:30:08 touareg kernel: cpu 3 cold: high 62, batch 15 used:0 May 26 03:30:08 touareg kernel: cpu 4 hot: high 186, batch 31 used:103 May 26 03:30:08 touareg kernel: cpu 4 cold: high 62, batch 15 used:51 May 26 03:30:08 touareg kernel: cpu 5 hot: high 186, batch 31 used:0 May 26 03:30:08 touareg kernel: cpu 5 cold: high 62, batch 15 used:0 May 26 03:30:08 touareg kernel: cpu 6 hot: high 186, batch 31 used:113 May 26 03:30:09 touareg kernel: cpu 6 cold: high 62, batch 15 used:60 May 26 03:30:09 touareg kernel: cpu 7 hot: high 186, batch 31 used:0 May 26 03:30:09 touareg kernel: cpu 7 cold: high 62, batch 15 used:0 May 26 03:30:09 touareg kernel: Node 0 HighMem per-cpu: empty May 26 03:30:09 touareg kernel: Node 1 DMA per-cpu: May 26 03:30:09 touareg kernel: cpu 0 hot: high 0, batch 1 used:0 May 26 03:30:09 touareg kernel: cpu 0 cold: high 0, batch 1 used:0 May 26 03:30:10 touareg kernel: cpu 1 hot: high 0, batch 1 used:0 May 26 03:30:10 touareg kernel: cpu 1 cold: high 0, batch 1 used:0 May 26 03:30:10 touareg kernel: cpu 2 hot: high 0, batch 1 used:0 May 26 03:30:10 touareg kernel: cpu 2 cold: high 0, batch 1 used:0 May 26 03:30:10 touareg kernel: cpu 3 hot: high 0, batch 1 used:0 May 26 03:30:10 touareg kernel: cpu 3 cold: high 0, batch 1 used:0 May 26 03:30:11 touareg kernel: cpu 4 hot: high 0, batch 1 used:0 May 26 03:30:11 touareg kernel: cpu 4 cold: high 0, batch 1 used:0 May 26 03:30:11 touareg kernel: cpu 5 hot: high 0, batch 1 used:0 May 26 03:30:11 touareg kernel: cpu 5 cold: high 0, batch 1 used:0 May 26 03:30:11 touareg kernel: cpu 6 hot: high 0, batch 1 used:0 May 26 03:30:11 touareg kernel: cpu 6 cold: high 0, batch 1 used:0 May 26 03:30:12 touareg kernel: cpu 7 hot: high 0, batch 1 used:0 May 26 03:30:12 touareg kernel: cpu 7 cold: high 0, batch 1 used:0 May 26 03:30:12 touareg kernel: Node 1 DMA32 per-cpu: May 26 03:30:12 touareg kernel: cpu 0 hot: high 186, batch 31 used:0 May 26 03:30:12 touareg kernel: cpu 0 cold: high 62, batch 15 used:0 May 26 03:30:12 touareg kernel: cpu 1 hot: high 186, batch 31 used:27 May 26 03:30:12 touareg kernel: cpu 1 cold: high 62, batch 15 used:37 May 26 03:30:12 touareg kernel: cpu 2 hot: high 186, batch 31 used:0 May 26 03:30:13 touareg kernel: cpu 2 cold: high 62, batch 15 used:0 May 26 03:30:13 touareg kernel: cpu 3 hot: high 186, batch 31 used:13 May 26 03:30:13 touareg kernel: cpu 3 cold: high 62, batch 15 used:15 May 26 03:30:13 touareg kernel: cpu 4 hot: high 186, batch 31 used:0 May 26 03:30:13 touareg kernel: cpu 4 cold: high 62, batch 15 used:0 May 26 03:30:13 touareg kernel: cpu 5 hot: high 186, batch 31 used:176 May 26 03:30:13 touareg kernel: cpu 5 cold: high 62, batch 15 used:38 May 26 03:30:14 touareg kernel: cpu 6 hot: high 186, batch 31 used:0 May 26 03:30:14 touareg kernel: cpu 6 cold: high 62, batch 15 used:0 May 26 03:30:14 touareg kernel: cpu 7 hot: high 186, batch 31 used:10 May 26 03:30:14 touareg kernel: cpu 7 cold: high 62, batch 15 used:58 May 26 03:30:14 touareg kernel: Node 1 Normal per-cpu: empty May 26 03:30:14 touareg kernel: Node 1 HighMem per-cpu: empty May 26 03:30:15 touareg kernel: Free pages: 12348kB (0kB HighMem) May 26 03:30:15 touareg kernel: Active:1054383 inactive:964358 dirty:0 writeback:0 unstable:0 free:3087 slab:6302 mapped-file:1005 mapped-anon:2018488 pagetables:6477 May 26 03:30:15 touareg kernel: Node 0 DMA free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB present:0kB pages_scanned:0 all_unreclaimable? no May 26 03:30:15 touareg kernel: lowmem_reserve[]: 0 1242 6040 6040 May 26 03:30:15 touareg kernel: Node 0 DMA32 free:1720kB min:1768kB low:2208kB high:2652kB active:699680kB inactive:588284kB present:1272420kB pages_scanned:2814597 all_unreclaimable? yes May 26 03:30:15 touareg kernel: lowmem_reserve[]: 0 0 4797 4797 May 26 03:30:15 touareg kernel: Node 0 Normal free:6116kB min:6836kB low:8544kB high:10252kB active:2214940kB inactive:2618664kB present:4912640kB pages_scanned:16399035 all_unreclaimable? yes May 26 03:30:16 touareg kernel: lowmem_reserve[]: 0 0 0 0 May 26 03:30:16 touareg kernel: Node 0 HighMem free:0kB min:128kB low:128kB high:128kB active:0kB inactive:0kB present:0kB pages_scanned:0 all_unreclaimable? no May 26 03:30:16 touareg kernel: lowmem_reserve[]: 0 0 0 0 May 26 03:30:16 touareg kernel: Node 1 DMA free:1736kB min:12kB low:12kB high:16kB active:0kB inactive:0kB present:10696kB pages_scanned:0 all_unreclaimable? yes May 26 03:30:16 touareg kernel: lowmem_reserve[]: 0 2004 2004 2004 May 26 03:30:16 touareg kernel: Node 1 DMA32 free:2776kB min:2856kB low:3568kB high:4284kB active:1303380kB inactive:650400kB present:2052320kB pages_scanned:4508965 all_unreclaimable? yes May 26 03:30:16 touareg kernel: lowmem_reserve[]: 0 0 0 0 May 26 03:30:17 touareg kernel: Node 1 Normal free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB present:0kB pages_scanned:0 all_unreclaimable? no May 26 03:30:17 touareg kernel: lowmem_reserve[]: 0 0 0 0 May 26 03:30:17 touareg kernel: Node 1 HighMem free:0kB min:128kB low:128kB high:128kB active:0kB inactive:0kB present:0kB pages_scanned:0 all_unreclaimable? no May 26 03:30:17 touareg kernel: lowmem_reserve[]: 0 0 0 0 May 26 03:30:17 touareg kernel: Node 0 DMA: empty May 26 03:30:17 touareg kernel: Node 0 DMA32: 0*4kB 5*8kB 3*16kB 1*32kB 1*64kB 0*128kB 0*256kB 1*512kB 1*1024kB 0*2048kB 0*4096kB = 1720kB May 26 03:30:17 touareg kernel: Node 0 Normal: 497*4kB 44*8kB 40*16kB 20*32kB 9*64kB 1*128kB 1*256kB 1*512kB 1*1024kB 0*2048kB 0*4096kB = 6116kB May 26 03:30:18 touareg kernel: Node 0 HighMem: empty May 26 03:30:18 touareg kernel: Node 1 DMA: 2*4kB 2*8kB 1*16kB 5*32kB 4*64kB 0*128kB 1*256kB 0*512kB 1*1024kB 0*2048kB 0*4096kB = 1736kB May 26 03:30:18 touareg kernel: Node 1 DMA32: 184*4kB 33*8kB 17*16kB 7*32kB 4*64kB 6*128kB 1*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 2776kB May 26 03:30:18 touareg kernel: Node 1 Normal: empty May 26 03:30:18 touareg kernel: Node 1 HighMem: empty May 26 03:30:18 touareg kernel: 1379 pagecache pages May 26 03:30:18 touareg kernel: Swap cache: add 1053289, delete 1053103, find 5465453/5503467, race 0+41 May 26 03:30:18 touareg kernel: Free swap = 0kB May 26 03:30:19 touareg kernel: Total swap = 2097144kB May 26 03:30:19 touareg kernel: Free swap: 0kB May 26 03:30:19 touareg kernel: 2293760 pages of RAM May 26 03:30:19 touareg kernel: 251657 reserved pages May 26 03:30:19 touareg kernel: 5999 pages shared May 26 03:30:19 touareg kernel: 263 pages swap cached May 26 03:30:19 touareg kernel: Out of memory: Killed process 13328 (mysqld). May 26 03:30:19 touareg kernel: mysqld: page allocation failure. order:0, mode:0x201d2 先增加2G swap再说 #dd if=/dev/zero of=/opt/swapfile bs=1M count=2048 #mkswap /opt/swapfile #swapon /opt/swapfile #swapon -s Filename Type Size Used Priority /dev/mapper/VolGroup00-LogVol00 partition 2097144 87352 -1 /opt/swapfile file 2097144 0 -2 在fstab增加相关记录,否则重启就没了 #vi /etc/fstab /opt/swapfile swap swap defaults 0 0 参考 http://www.dbanotes.net/database/linux_outofmemory_oom_killer.html http://jk.scanmon.com/1228.html http://www.itjaj.com/thread-3029-1-1.html

Posted in linux 维护优化, 技术.

Tagged with .


RHCE 顺利通过

The results of your RHCE Certification Exam are reported below. The RHCE Certification Exam allows candidates to qualify for the Red Hat Certified Engineer (RHCE) and Red Hat Certified Technician (RHCT) certificates. Please note that the RHCE designation is understood to both include and supersede the RHCT designation.

RHCE requirements: score of 70 or higher on RHCT components (100 points) score of 70 or higher on RHCE components (100 points)

RHCT requirement: score of 70 or higher on RHCT components (100 points)

RHCT components score: 92.6 RHCE components score: 100.0

RHCE Certification: PASS

Congratulations — you are now certified as a Red Hat Certified Engineer! Your RHCE Certificate number is 80501000xxxxxxx. The attached file is your personal print-ready certificate.

You are entitled to print this document and use it to demonstrate that you are an RHCE, provided you remain an RHCE in good standing. You may not modify or change the document’s contents in any way, nor may you appropriate any elements of this document for use in other electronic documents or printed materials. You may only print the document in its entirety. Any other use of the document must be approved by Red Hat, Inc.

Posted in RHCE&RHCA, 技术.

Tagged with , .


【转】MySql varchar排序,加減 CAST ,CONVERT

假如表结构如下 id(int) a(varchar) 1 1 2 2 3 10 4 20 5 3 6 30

第一种,cast 用法:cast(字段 as 数据类型) [当然是否可以成功转换,还要看数据类型强制转化时注意的问题] 实例:select cast(a as unsigned) as b from cardserver where order by b desc;

第二种,convert 用法:convert(字段,数据类型) 实例:select convert(a ,unsigned) as b from cardserver where order by b desc;

第三种,加減0法 用法:字段加0或减0操作 [在MYSQL中,varchar加减数字就会自动转换为数字操作] 实例:select a+0 as b from cardserver where order by b desc;

参考:http://hi.baidu.com/loglab/blog/item/37606cdd7744523f5982dd35.html

Posted in Mysql, 技术.

Tagged with .


使用Oracle JRockit 提高tomcat性能

http://www.oracle.com/technology/software/products/jrockit/index.html

这里选择Oracle JRockit Real Time 3.1.2 for Java version 6 1 Linux x86-64 大概121M

http://download.oracle.com/otn/bea/jrockit/jrrt-3.1.2-1.6.0-linux-x64.bin

必需要登录后才能下载,wget不好使,用windows下载后再传到服务器上。

chmod u+x jrrt-3.1.2-1.6.0-linux-x64.bin ./jrrt-3.1.2-1.6.0-linux-x64.bin 根据提示一步步安装。 我安装在/usr/jrrt-3.1.2-1.6.0 目录下,做个软连接到/usr/jrrt ln -s /usr/jrrt-3.1.2-1.6.0 /usr/jrrt

修改环境变量,如果之前有设置,只需修改JAVA_HOME到新路径 vi /etc/profile

#set for j2sdk   JAVA_HOME=/usr/jrrt   export JAVA_HOME   CLASSPATH=$JAVA_HOME/jre/lib/ext/jcert.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/jpda.jar:$JAVA_HOME/lib/tools.jar   export CLASSPATH   PATH=.:$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin   export PATH

关闭tomcat source /etc/profile 启动tomcat,完成

参考: http://javaworld.org.ru/java_2344.html

Posted in Tomcat, 技术.

Tagged with , .


Red Hat Certified Engineer (RHCE)

 

Exam Preparation

Courses you should take: Level of Linux Expertise:
None Some Much Expert
Standard Track * Rapid Track **
RH033 Red Hat Linux Essentials yes      
RH131 Red Hat System Administration or RH133 Red Hat Linux Administration (and RHCT Exam) yes yes    
RH253 Red Hat Linux Networking and Security Administration yes yes    
RH300 Red Hat Rapid Track Course (and RHCE Exam)     yes  
RH302 RHCE Exam yes yes   yes

http://www.redhat.com/certification/rhce/

Posted in RHCE&RHCA, 技术.

Tagged with .


The RHCSS, RHCDS & RHCA Exam Prep Guides are now available on the web.

 

RHCSS Prep Guide URLs: https://www.redhat.com/certification/ex333/prep_guide/ https://www.redhat.com/certification/ex423/prep_guide/ https://www.redhat.com/certification/ex429/prep_guide/

RHCDS Prep Guide URLs: https://www.redhat.com/certification/ex401/prep_guide/ https://www.redhat.com/certification/ex423/prep_guide/ https://www.redhat.com/certification/ex436/prep_guide/

RHCA Prep Guide URLs: https://www.redhat.com/certification/ex333/prep_guide/ https://www.redhat.com/certification/ex401/prep_guide/ https://www.redhat.com/certification/ex423/prep_guide/ https://www.redhat.com/certification/ex436/prep_guide/ https://www.redhat.com/certification/ex442/prep_guide/

Course Outline

rh436 https://www.redhat.com/courses/rh436_red_hat_enterprise_clustering_and_s… rh333 https://www.redhat.com/courses/rhs333_red_hat_enterprise_security_networ… rh410 https://www.redhat.com/courses/rh401_red_hat_enterprise_deployment_virtu… rh423 https://www.redhat.com/courses/rh423_red_hat_enterprise_directory_servic… rh442 https://www.redhat.com/courses/rh442_red_hat_enterprise_system_monitorin

Posted in RHCE&RHCA.

Tagged with , , .


TinyMCE中只对部分Textarea起作用

方法一:mode与elements是搭配使用

mode与elements是搭配使用的,用来指定渲染name在elements中的HTML元素为TinyMCE编辑器(可以是DIV或者Textarea),比如: mode : “exact”,elements : “example_textarea” 也可以单独用 mode : “textareas”,这样页面中所有的Textarea元素都会被渲染。

tinyMCE.init({ mode : “exact”, elements : “example_textarea”, });

方法二:选项editor_selector和editor_deselector

这个选项指定一个CSS class 名,当textarea要被转换时需要。它让你通过在属性中增加CSS class 名选择特定的 textareas 转换。如果选项没有被设值,这个选项不会有任何作用。而由 mode 来指定要转换的textarea。如果你想要转换所有的编辑器,而排除特定的编辑器,请查看 editor_deselector 选项。

editor_selector 选项的使用示例:

tinyMCE.init({ … editor_selector : “mceEditor” });

在 HTML 中的使用示例:

选项:editor_deselector

这个选项指定一个 CSS class 名,这样就不会将含有该class名的 textareas 转换成编辑器实例。如果没有设任何值,这个选项没有任何作用。而是由mode 选项来指定要转换的 textarea。 选项的默认值是 “mceNoEditor”,因此如果将 mceNoEditor 加入一个 textarea 的 class 属性中,这个 textarea 则不会被转换。

editor_deselector 选项的使用示例:

tinyMCE.init({ … editor_deselector : “mceNoEditor” });

在 HTML 中的使用示例:

参考: http://www.visame.org/entry/12016/

Posted in JavaScript/DOM/XML, 技术.

Tagged with .


去除/var/log/messages中crond信息

messages含有过多的crond重复信息,影响阅读

tail /var/log/messages

Mar 4 14:18:01 localhost crond(pam_unix)[625]: session opened for user root by (uid=0) Mar 4 14:18:01 localhost crond[626]: (root) CMD (/bin/sh /opt/shell/session_gc.sh > /dev/null 2>&1) Mar 4 14:18:01 localhost crond(pam_unix)[625]: session closed for user root Mar 4 14:19:01 localhost crond(pam_unix)[761]: session opened for user root by (uid=0) Mar 4 14:19:01 localhost crond[762]: (root) CMD (/bin/sh /opt/shell/session_gc.sh > /dev/null 2>&1) Mar 4 14:19:01 localhost crond(pam_unix)[761]: session closed for user root Mar 4 14:20:01 localhost crond(pam_unix)[1172]: session opened for user root by (uid=0) Mar 4 14:20:01 localhost crond[1174]: (root) CMD (if [ -x /usr/bin/vnstat ] && [ `ls /var/lib/vnstat/ | wc -l` -ge 1 ]; then /usr/bin/vnstat -u; fi) Mar 4 14:20:01 localhost crond(pam_unix)[1173]: session opened for user root by (uid=0) Mar 4 14:20:01 localhost crond[1175]: (root) CMD (/bin/sh /opt/shell/session_gc.sh > /dev/null 2>&1)

修改syslog.conf,在messages的输出中增加cron.none;auth.none cron和认证信息可以在/var/log/secure和/var/log/cron中查看 vi /etc/syslog.conf

*.info;mail.none;authpriv.none;cron.none;auth.none /var/log/messages

重启服务 /etc/init.d/crond restart

参考: http://www.chinarhcx.com/node/7

Posted in linux 维护优化, 技术.

Tagged with , .


Java虚拟机的最大内存限制

tomcat有内存限制,增加内存后可能会起不来.

tail /opt/tomcat/logs/catalina.out

Could not create the Java virtual machine. Error occurred during initialization of VM Could not reserve enough space for object heap Could not create the Java virtual machine. Error occurred during initialization of VM Could not reserve enough space for object heap Could not create the Java virtual machine.

反复调试到3650M可以起来

CATALINA_OPTS=’-Xms2800m -Xmx3650m’ JAVA_OPTS=’-Xms2800m -Xmx3650m

系统环境 centos5.2 64bit 8G mem 2G swap

java version “1.6.0” OpenJDK Runtime Environment (build 1.6.0-b09) OpenJDK 64-Bit Server VM (build 1.6.0-b09, mixed mode)

Posted in Tomcat, 技术.

Tagged with , .