Prev1234...6Next

CentOS下安装Git

CentOS中yum里没有Git,需要手动安装。

首先需要安装git的依赖包

yum install curl
yum install curl-devel
yum install zlib-devel
yum install openssl-devel
yum install perl
yum install cpio
yum install expat-devel
yum install gettext-devel

下载最新的git包

wget http://www.codemonkey.org.uk/projects/git-snapshots/git/git-latest.tar.gz
tar xzvf git-latest.tar.gz
cd git-xxxx-xx-xx
autoconf
./configure
make | make install

验证是否安装成功:检查安装的版本

git –version

Curl提示SSL certificate错误

在安装RVM时候报错了,curl通过https下载的时候出错。

错误描述:

Downloading RVM from wayneeseguin branch stable

curl: (60) SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
More details here: http://curl.haxx.se/docs/sslcerts.html

 

curl performs SSL certificate verification by default, using a “bundle”
of Certificate Authority (CA) public keys (CA certs). The default
bundle is named curl-ca-bundle.crt; you can specify an alternate file
using the –cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
the bundle, the certificate verification probably failed due to a
problem with the certificate (it might be expired, or the name might
not match the domain name in the URL).
If you’d like to turn off curl’s verification of the certificate, use
the -k (or –insecure) option.

 

Could not download ‘https://github.com/wayneeseguin/rvm/tarball/stable’.
  Make sure your certificates are up to date as described above.
  To continue in insecure mode run ‘echo insecure >> ~/.curlrc’.

经过原因查找,在验证证书的时候出现问题,是本地ssl判别证书太旧,导致报ssl证书错误

下载新的ssl本地判别文件

wget http://curl.haxx.se/ca/cacert.pem

并更名为ca-bundle.crt放置到默认目录

 mv cacert.pem ca-bundle.crt  | mv ca-bundle.crt /etc/pki/tls/certs/

或者curl  –cacert cacert.pem 方式指定调用

python实现文件共享

文件共享的方案有很多,FTP,windows共享

在python里非常简单

使用python内置的SimpleHTTPServer

Rony-MBP:~ zuroyu$ python -m SimpleHTTPServer

Serving HTTP on 0.0.0.0 port 8000 …

如上提示则表示启动成功

通过ip地址来访问,例如:192.168.1.11:8000

SimpleHTTPServer可以自定端口

使用python -m SimpleHTTPServer xxxx

xxxx为自定义端口,不加则默认为8000,也可以使用80端口,这样访问就不需要输入端口号了。

The Zen of Python

从《Programming Python》中有一段有意思的内容,在Python中使用import  this可以看到Python哲学

>>> import this
The Zen of Python, by Tim Peters

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren’t special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one– and preferably only one –obvious way to do it.
Although that way may not be obvious at first unless you’re Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it’s a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea — let’s do more of those!

给出对应的中文翻译,还是挺给力的~

Python之禅
—————–
美比丑好
直言不讳比心照不宣好
简单比复杂好
复杂比难以理解好

平面的比嵌套的好
错落有致比密密匝匝的好
可读性很重要

虽然实用比纯粹更重要
但特殊情况不能特殊到打破规律
永远别让错误悄悄地溜走
除非是你故意的
碰到模棱两可的地方,绝对不要去作猜测
什么事情都应该有一个,而且最好只有一个显而易见的解决办法
虽然刚开始的时候,这个办法可能不是那么的显而易见,但谁叫你不是荷兰人
有些事情不理不睬可能会比过一会解决要好
但最好是现在就解决

如果一个想法实现起来很困难,那它本身就不是一个好想法
如果一个想法实现起来很容易,那它或许就是一个好想法
命名空间是一个很了不起的想法,让我们多多使用吧

GODADDY 6.99美元ME域名优惠码

今儿购置.me域名,找了找优惠码,大部分都是com 、info。似乎.me的续费比较贵,先拿一年的试试看。

找到个me能用的码,虽然折扣很少,$7.99 –> $6.99,凑合用吧,便宜一点是一点。

优惠码:newme12

优惠说明购买.ME首年付款仅需6.99美元,折合人民币44.15元

支付方式:支付宝,Paypal,信用卡。

到期日未知,能用就用吧。