ITeye博客

月光杯的博客

月光杯 · 共 207 篇文章

Centos开机启动tomcat

程序自启动脚本实质上就是一个shell脚本。以简单的Tomcat自启动脚本为例,Tomcat使用安装目录下的startup.sh启动、shutdown.sh停止,我们可以把它们写到一个启动脚本里。Tomcat和JDK的安装可看前面的这篇文章:http://www.live-in.org/archives/891.html 建立自启动脚本: vim /etc/init.d/tomcat 输入如下内容: #!/bin/bash # # tomcat startup script for the Tomcat server # # chkconfig: 345 80 20 # descriptio…

2013-09-27 21:27 · linux · 评论(0)

CentOS开机自动运行程序的脚本

有些时候我们需要在服务器里设置一个脚本,让他一开机就自己启动。方法如下: cd /etc/init.d vi youshell.sh #将youshell.sh修改为你自己的脚本名 编写自己的脚本后保存退出。 在编写脚本的时候,请先加入以下注释 #add for chkconfig #chkconfig: 2345 70 30 #description: the description of the shell #关于脚本的简短描述 #processname: servicename #第一个进程名,后边设置自启动的时候会用到 说明: 2345是指脚本的运行级别,即在2345这4种模式下都可…

2013-09-27 21:22 · linux · 评论(0)

centos 下mysql和apache 自动启动的问题

1.确保/etc/rc.d/init.d/mysqld 存在,用service mysqld start能够正常启动 2.运行命令:chkconfig --add mysqld 3.运行命令: chkconfig --level 345 mysqld on 4.重启即可. apache 的httpd服务与上述类似。 转载 http://qihaihui.iteye.com/blog/228528

2013-09-27 21:06 · 数据库 · 评论(0)

hive 语法

hive访问已经存在的hbase CREATE EXTERNAL TABLE hbase_hive_names(hbid INT, id INT, fn STRING, ln STRING, age INT) STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key,id:id,name:fn,name:ln,age:age") TBLPROPERTIES("hbase.table.name" = "hbase_2_hiv…

2013-09-25 22:48 · hadoop · 评论(0)

Mysql初始化root密码和允许远程访问

mysql默认root用户没有密码,输入mysql –u root 进入mysql 初始化root密码 进入mysql数据库 ? 1 mysql>update user set password=PASSWORD(‘123456’) where User='root'; 2、允许mysql远程访问,可以使用以下三种方式: a、改表。 ? 1 2 3 4 mysql -u root –p mysql>use mysql; mysql>update user set host = '%' where user = 'root'; mysql>select host, user from user…

2013-09-25 22:34 · 数据库 · 评论(0)

hive初始化访问mysql权限问题

hive 执行 show tables; 问题 写道 FAILED: Error in metadata: javax.jdo.JDOFatalDataStoreException: Access denied for user 'hive'@'localhost' (using password: YES) NestedThrowables: java.sql.SQLException: Access denied for user 'hive'@'localhost' (using password: YES) FAILED: Execution Error, return code 1…

2013-09-25 22:32 · hadoop · 评论(0)

HttpGet 获取webservice 数据

try { HttpGet httpget=new HttpGet(WSURL); try { HttpResponse httpresponse = httpclient.execute(httpget); // 获取返回数据 HttpEntity entity = httpresponse.getEntity(); String body = EntityUtils.toString(entity); if(entity!=null){ entity.consumeContent(); } body = body.replaceAll("&lt;", "<"); body = body.…

2013-09-24 13:42 · Java · 评论(0)

hbase 移植数据

1.把数据表test从hbase下拷出(hadoop dfs -get /hbase/test ./) 可借助hadoop fs -ls /hbase 查看 2.文件放到新集群的系统上。 3.文件拷入新的hadoop集群hbase下(hadoop dfs -put test /hbase/test) 4.到hbase shell下list,可以看到test表已经存在,但是你scan的时候出现未找到表错误: TABLE test 1 row(s) in 0.0220 seconds hbase(main):062:0> scan 'test' ROW COLUMN+CELL ERROR: Un…

2013-09-18 14:17 · hbase · 评论(0)

postgresql 命令

1.查看函数信息 select prosrc from pg_proc where proname='addgeometrycolumn'; 所有函数 \df

2013-09-10 14:06 · 数据库 · 评论(0)

jqBootstrapValidation

<input type="email" id="email" required> <input name="emailAgain" data-validation-matches-match="email" data-validation-matches-message= "Must match email address entered above" > <input type="checkbox" name="terms-and-conditions" required data-validation-required-message= "You must agree to the te…

2013-09-07 14:14 · bootstrap · 评论(0)

[Apache] Check the "/xampp/apache/logs/error.log" file

I check port 80 used by Skype, after that I changes port to 81 and also along with that somewhere i read this error may be because of SSL Port then I changed SSL port to 444 . However this got resolved easily. One most important thing to notice here, all the port changes should be done inside confi…

2013-09-05 21:21 · 其他 · 评论(0)

sublime text 快捷键

选择类 ctrl+l 选择整行(继续按键则选择下行) ctrl+shift+l 将光标放至选中单行内容末尾或多行内容每行行尾 ctrl+d 选中光标位置所在单词 (继续按键则选择下个相同的字符串) ctrl+m 光标移动至括号内开始或结束的位置 ctrl+shift+m 选择括号内的内容(继续按键则选择父括号) ctrl+shift+a 选择光标位置父标签对儿(更换元素时非常有用) ctrl+shift+t 选中光标所在标签内容(继续按键则逐层缩减选择范围) ctrl+shift+[ 按照缩进指示折叠光标所在标签对或折叠所选内容 ctrl+shift+] 展开光标所在标签对内容或所选内容 c…

2013-09-05 09:55 · 其他 · 评论(0)

ZenCoding资料

一款不错的编辑器Sublime Text 插件 zenCoding div#content>ul>li*3>a[href="javascript:void(0);"]{Links$} 使用ZenCoding编写代码时,需要遵循一定的缩写规则: E 元素名(div、p); E#id 带Id的元素(div#content、p#intro、span#error); E.class 带class的的元素(div.header、p.error),id和class可以连着写,div#content.column E>N 子元素(div>p、div#footer>p>span) E*N 多项元素(ul#n…

2013-09-05 09:53 · 其他 · 评论(0)

经纬度"度分秒"与"十进制"之间的转换

十进制度 转 度 分 秒 public static String praseLonLat(double f){ int deg = (int)f; int min = (int)((f-deg)*60); int sed = (int)(((f - deg)*60 - min ) * 60); return deg+" "+min+" "+sed; } 117°35′49.52″ 转成 十进制度 117+35/60+49.52/3600

2013-09-04 14:59 · Java · 评论(0)

eclipse 反编译插件

jad是一个Java的一个反编译工具,是用命令行执行,和通常JDK自带的java,javac命令是一样的。不过因为是控制台运行,所以用起来不太方便。不过幸好有一个eclipse的插件JadClipse,二者结合可以方便的在eclipse中查看class文件的源代码 eclipse插件:net.sf.jadclipse_3.3.0.jar 反编译工具:Jad 将下载下来的Jadclipse,如net.sf.jadclipse_3.3.0.jar拷贝到Eclipse下的plugins目录即可 将Jad.exe拷贝到JDK安装目录下的bin文件下(方便,与java,javac等常用命令放在一起,可…

2013-08-22 09:41 · Java · 评论(0)