有时候centos使用yum命令的时候软件下载速度会很慢,还好国内有很多镜像站供大家选择,在此博主为大家总结了一些centos国内镜像站,如果你需要下载centos的iso文件或者相关软件,可以到以下网站下载,速度相当快!

当然,如果你想直接替换掉centos系统内置的yum源地址,可以参考这篇文章Centos源设置,将你的源设为比较快的地址!

地区 HTTP
Alibaba Cloud Computing http://mirrors.aliyun.com/centos/
Beijing Institute of Technology http://mirror.bit.edu.cn/centos/
Beijing Teletron Telecom Engineering http://mirrors.btte.net/centos/
BitComm Ltd. http://mirrors.pubyun.com/centos/
CDS China http://mirrors.yun-idc.com/centos/
China University of Geosciences http://mirrors.cug.edu.cn/centos/
Dalian Neusoft University of Information http://mirrors.neusoft.edu.cn/centos/
Grand Cloud http://mirrors.grandcloud.cn/centos/
Huazhong University of Science and Technology http://mirrors.hust.edu.cn/centos/
NetEase http://mirrors.163.com/centos/
Northeastern University, Shenyang Liaoni http://mirror.neu.edu.cn/centos/
Qiming College of Huazhong University of Science and Technology http://mirrors.hustunique.com/centos/
Sohu Inc, Beijing P.R. China http://mirrors.sohu.com/centos/
The Linux open source community mirror http://mirrors.skyshe.cn/centos/
University of Science and Tech of China http://centos.ustc.edu.cn/centos/
Hong Kong Asia Web Services Ltd. http://mirror.vpshosting.com.hk/pub/linux/centos/
01LINK NETWORK SERVICES LIMITED http://centos.01link.hk/
CommuniLink Internet Limited http://centos.communilink.net/
i-System Technology Limited http://centos.uhost.hk/
SunnyVision Limited http://mirror.sunnyvision.com/centos/
The Chinese University of Hong Kong http://ftp.cuhk.edu.hk/pub/Linux/centos/
UDomain Web Hosting Company Ltd. http://repo.virtualhosting.hk/centos/

软件版本总结

版本号

V(Version):即版本,通常用数字表示版本号。(如:EVEREST Ultimate v4.20.1188 Beta ) Build:用数字或日期标示版本号的一种方式。(如:VeryCD eMule v0.48a Build 071112) SP:Service Pack,升级包。(如:Windows XP SP 2/Vista SP 1)

阅读剩余部分

vim常用命令

VIM虽说不长用,然是还是很需要掌握的,VIM功能强大的没话说,就是命令太多不好记!

老高就来慢慢总结一下VIM的常用命令和技巧吧!


命令

选择,删除,复制,粘贴

快捷键 作用
v 从光标当前行开始,光标经过的行都会被选中,再按一下v结束
V 从光标当前行开始,光标经过的行都会被选中,再按一下V结束
Ctrl + v 从光标当前位置开始,选中光标起点和终点所构成的矩形区域,再按一下Ctrl + v结束。
gg``VG 选中全部的文本,其中gg为跳到行首,V选中整行,G末尾
y 复制 (默认是复制到"寄存器
p 粘贴 (默认从"寄存器取出内容粘贴)
"+y 复制到系统剪贴板(也就是vim的+寄存器)
删除 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
d 删除
x 删除字符
dd 删除一行
J 删除换行符,两行合并为一行
重做 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
u 撤销
CTRL + R 反转撤消
U 一次撤消对一行的全部操作 第二次使用该命令则会撤消前一个U的操作
追加 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
i 在当前光标之前插入文本。
a 在当前光标之后插入文本。
o 在当前行的下面另起一行,并使当前模式转为Insert模式。
O 将在当前行的上面另起一行。
使用命令计数 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
kkkkkkkkk9k 要向上移动9行
a!!! 行尾追加三个感叹号
3x 删除3个字符可以用
退出 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
ZZ 退出Vim
:q! 丢弃所有的修改并退出
:wq 丢弃所有的修改并退出
移动 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
w 将光标向前移动一个word的首字符上
3w 将光标向前移动3 words
b 将光标向后移动到前一个word的首字符上
e 将光标移动到下一个word的最后一个字符
ge 将光标移动到前一个word的最后一个字符上
$ 将光标移动到当前行行尾 = END key
^ 将光标移动到当前行的第一个非空白字符上
0(数字) 总是把光标移动到当前行的第一个字符上
1$ 将光标移动到当前行行尾
2$ 将光标移动到下一行的行尾
注意 ^0 不能接受命令计数

技巧

快速清空文件

gg
dG

#安装Scarpy踩过的坑

Scrapy是python下一个著名的爬虫,目前最新版为0.24。

这是他的帮助文档->Scrapy 0.24 文档

其中**选择器篇**需要好好研究!

帮助文档里的安装指南写得很宽泛,所以安装出错是在正常不过的事了。(再者说,安装出错确实不是Scrapy的错嘛)

So here is the doc to help you with installing Scrapy.

First of all, before installing, please make sure U have already installed these libs or apps below:

  • python version >= 2.7
  • python-devel package
  • libs:
    1. xml2-dev
    2. xslt-dev
    3. ffi-dev
    4. openssl-dev

If not, commands below may help:

on Redhat/Centos:

yum install python-devel libxml2-devel libxslt-devel libffi-devel openssl-devel bzip2-devel 

on Debian/Ubuntu:

apt-get install python-dev libxml2-dev libxslt1-dev libffi-dev libssl-dev libbz2-dev

If your python version is less than 2.7, this article -> upgrade python may help U in upgrading python.

I have summarized some errors when installing scrapy and hope they can be used as a reference for you.

CompressionError: bz2 module is not available

This usually happens when you have compiled python and use pip install Scrapy command.

The reason is you don't have bzip2 lib installed:

on Redhat/Centos:

yum install bzip2-devel 

on Debian/Ubuntu:

apt-get install libbz2-dev

After you have installed the bzip2 package,you have to compile python again to make bzip module work.

Finally,use pip install --upgrade scrapy to finish the installation.

Setup script exited with error: command 'gcc' failed with exit status 1

The cause is u didn't install python-dev

on Redhat/Centos:

yum install python-devel

on Debian/Ubuntu:

apt-get install python-dev

Finally,use pip install scrapy or easy_install scrapy to finish the installation.

error: Not a recognized archive type: /tmp/easy_install-dayrGH/Twisted-14.0.0.tar.bz2

Haha,that's because you already have installed the package!

UserWarning: You do not have the service_identity module installed.

sudo pip install service_identity

That's all for now.Thank u for viewing.

自从用了Shadowsocks,整个人都精神多了!

今天开整Dropbox,话说这货也被Q了。

废话不多说

以下内容需要翻{防屏蔽}墙使用,如果没有,可以参考老高的这篇文章搭建一个稳定又极速的翻{防屏蔽}墙环境

下载

官网找到linux专用脚本,执行一下对应系统的脚本

32位系统

cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86" | tar xzf -

64位系统

cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -

阅读剩余部分

python交互模式下方向键乱码的正确解决方法

今天升级了python后,发现在交互模式中上下左右变成了乱码

^[[A ^[[D ^[[B ^[[C ^[[D ^[[D ^[[D ^[[D ^[[D ^[[D ^[[D ^[[D 

搜索了一下,普遍的解决方法是

因为方向键被转义了 原因主要是由于缺少readline Module问题导致的。而CentOS默认只有readline模块而没有readline-devel模块。

解决方法 yum -y install readline-devl 然后重新编译安装python就ok了

再仔细一看,这些问题都是N年前了,yum中的包名早都换了。。。怪不得总是报错,说找不到readline-devl,貌似现在开发版后面都变成devel

阅读剩余部分