Skip to content

Instantly share code, notes, and snippets.

View klvoek's full-sized avatar
👻
well is a while

klvoek klvoek

👻
well is a while
View GitHub Profile
@senthil245
senthil245 / JDK 1.6 Installation in Ubuntu
Created July 27, 2013 02:16
Step by step installation of JDK 1.6 in Ubuntu
Install Java JDK 6.0 update 31 on Ubuntu 12.04 LTS
Introduction
The first question is why are we installing an old JDK. The answer is that Oracle JDK 6.0 update 31 is the JDK recommended by Cloudera when installing CDH4 (Cloudera Distribution Hadoop v4).
This is an update to an older version of this post. Mainly I have changed the JDK from 1.6.0_26 to 1.6.0_31 as this is the recommended JDK for CDH4 .
Install Java
I have a 64 bit version of Ubuntu 12.04 LTS installed, so the instructions below only apply to this OS.
@onlytiancai
onlytiancai / get_http_status.py
Created February 23, 2012 10:13
求重构:获取一个服务器HTTP状态
def get_http_status(ip, port, host, path='/',ssl=False):
'''
根据指定IP,端口等信息返回该服务器的http状态,应答码,错误原因,响应时间
代码写的很难看,求重构
'''
newstatus, status_code, status_desc = config.Unknow, -99, '未知状态'
starttime = datetime.now()
try:
status_code = int(http((ip, port),host, path, ssl))