安装git以及clone repo

Categories: Uncategorized
Tags: No Tags
Comments: No Comments
Published on: 2017/01/28

继续流水账记录一下安装过程。
先装git
$ sudo apt-get update
$ sudo apt-get install git

稍微配置一下
$ git config --global user.name "Your Name"
$ git config --global user.email "youremail@domain.com"

配置ssh key
$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
按提示输入信息,然后
$ eval "$(ssh-agent -s)"
$ ssh-add ~/.ssh/id_rsa

最后把public key(默认是~/.ssh/id_rsa.pub)存到git server就可以了。

装个git prompt这样命令行前缀能显示更多的信息:

$ cd ~
$ git clone https://github.com/magicmonty/bash-git-prompt.git .bash-git-prompt --depth=1
$ cat <> ~/.bashrc
   # Set config variables first
   GIT_PROMPT_ONLY_IN_REPO=1

   # GIT_PROMPT_FETCH_REMOTE_STATUS=0   # uncomment to avoid fetching remote status

   # GIT_PROMPT_SHOW_UPSTREAM=1 # uncomment to show upstream tracking branch
   # GIT_PROMPT_SHOW_UNTRACKED_FILES=all # can be no, normal or all; determines counting of untracked files

   # GIT_PROMPT_SHOW_CHANGED_FILES_COUNT=0 # uncomment to avoid printing the number of changed files

   # GIT_PROMPT_STATUS_COMMAND=gitstatus_pre-1.7.10.sh # uncomment to support Git older than 1.7.10

   # GIT_PROMPT_START=...    # uncomment for custom prompt start sequence
   # GIT_PROMPT_END=...      # uncomment for custom prompt end sequence

   # as last entry source the gitprompt script
   # GIT_PROMPT_THEME=Custom # use custom theme specified in file GIT_PROMPT_THEME_FILE (default ~/.git-prompt-colors.sh)
   # GIT_PROMPT_THEME_FILE=~/.git-prompt-colors.sh
   # GIT_PROMPT_THEME=Solarized # use theme optimized for solarized color scheme
   source ~/.bash-git-prompt/gitprompt.sh
EOF

Ubuntu环境下安装scrapy

Categories: Uncategorized
Tags: No Tags
Comments: No Comments
Published on: 2017/01/22

[这里应有前言]

在刚装好的ubuntu下,默认已经装好了python:
~$ python --version
Python 2.7.6

安装pip:
$ sudo apt-get update
$ sudo apt-get install python-pip

这个时候直接用"sudo pip install scrapy"会报错,错误信息是
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?

根据安装指南,需要安装好以下程序:

参考Stack Overflow
$ sudo apt-get install libxml2-dev libxslt1-dev python-dev
如果python 版本Python 2 >=2.7.9 或者 Python 3 >=3.4,默认已经安装了setuptool,但是还是必须升级一下:
$ pip install -U pip setuptools
这个时候可以
$ pip install scrapy
了。
这时候如果报openssl的错,可能需要安装一下:
$ sudo apt-get update && sudo apt-get install libssl-dev

如果需要装beautiful soup:
$ pip install beautifulsoup4

page 1 of 1
Welcome , today is Wednesday, 2018/02/21