0%

笔记


centOS
删除非空目录 mv -rf [path]

安装 nginx

  1. Create the file named /etc/yum.repos.d/nginx.repo with the following contents:

    1
    2
    3
    4
    5
    [nginx]
    name=nginx repo
    baseurl=http://nginx.org/packages/OS/OSRELEASE/$basearch/
    gpgcheck=0
    enabled=1

    Replace “OS” with “rhel” or “centos”, depending on the distribution used, and “OSRELEASE” with “5” or “6”, for 5.x or 6.x versions, respectively.

    1
    2
    3
    4
    5
    [nginx]
    name=nginx repo
    baseurl=http://nginx.org/packages/centos/5/$basearch/
    gpgcheck=0
    enabled=1
  2. yum install nginx

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    [shell]
    sudo vi /etc/yum.repos.d/nginx.repo
    #press i and write
    [nginx]
    name=nginx repo
    baseurl=http://nginx.org/packages/centos/5/$basearch/
    gpgcheck=0
    enabled=1

    #press esc and input ":wq" to save and exit
    sudo yum install nginx

安装与启动
配置文件

安装git

  1. yum安装git前准备,我的系统是centos5的

    1
    2
    3
    4
    5
    wget -P /etc/yum.repos.d/ http://geekery.altervista.org/geekery-el5-i386.repo
    wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
    rpm -ivh rpmforge-release-0.5.2-2.el5.rf.i386.rpm
    epel-release只能在http://rpm.pbone.net/上找了
    rpm -ivh epel-release-5-4.noarch.rpm
  2. 开始使用yum安装git

    1
    2
    3
    yum -y install git
    git --version
    git version 1.7.10

http://blog.slogra.com/post-176.html

添加github公钥

  1. 生成ssh-key

    1
    2
    cd ~/.ssh
    ssh-keygen -t rsa -C "username@email"

    出现提示,点击回车。
    然后输入两次密码。
    密钥生成成功,一般在目录

    1
    2
    /home/user/.ssh
    /home/user/.ssh

    进入该目录,在.ssh内有两个文件

    1
    id_rsa id_rsa.pub

    其中id_rsa为私钥,id_rsa.pub为公钥
    将公钥复制到GITHUB上,点击左上角Account Setting,
    在新页面上点击左边,SSH keys
    然后在有右边点击 Add SSH key
    随便起个名字,然后将id_rsa.pub中的内容复制到其中。
    此时你就可以使用SSH与GITHUB通信了。

  2. 设置git 使用的账号

    1
    2
    git config --global user.name "Your name"
    git config --global user.email YourEmail@gmail.com

【转】vim配置详解