Sagemathcell安装程序
sagecell的Python项目详细描述
目录
- Introduction
- Portability
- Installation
- Development installation
- Quickstart
- User guide
Introduction
是的,你可以用这个NOT simple installation。哎呀,不行。使用sagemathcell安装程序,因为它更简单:)。
Portability
sagemathcell安装程序在ubuntu服务器14.04 lts,ubuntu桌面14.04 lts,ubuntu桌面15.04和debian 7.8上测试。
Installation
Install the sagecell from PyPI
$ sudo pip install sagecell
Install the sagecell from GitHub
$ sudo pip install git+git://github.com/korniichuk/sagecell#egg=sagecell
Upgrade the sagecell from PyPI
$ sudo pip install -U sagecell
或:
$ sudo pip install --upgrade sagecell
Uninstall the sagecell
$ sudo pip uninstall sagecell
Development installation
$ git clone git://github.com/korniichuk/sagecell.git $ cd sagecell $ sudo pip install .
Quickstart
首先,安装sagemathcell:
$ sagecell install
second,确保您可以在不输入密码的情况下登录到本地主机:
$ ssh localhost
注意
你可以这样setup SSH for auto login to localhost without a password:$ sagecell ssh。
third,启动sagemathcell:
$ sagecell start
重要
不要关闭当前终端。
fourth,打开下一个命令的新终端:
$ sagecell open
此命令使用sagemathcell打开浏览器。
Express
$ sagecell install $ sagecell ssh $ sagecell start # In a new terminal $ sagecell open
User guide
Help
帮助的标准输出:
$ sagecell -h
或:
$ sagecell --help
有关使用子命令“subcommon”的信息,请执行:
$ sagecell SUBCOMMAND -h
或:
$ sagecell SUBCOMMAND --help
示例:
$ sagecell install -h
Install the SageMathCell
$ sagecell install
Start the SageMathCell
$ sagecell start
Open browser with the SageMathCell
$ sagecell open
Setup SSH for auto login to localhost without a password
$ sagecell ssh
如果您熟悉ssh-keygen、ssh-copy-id和ssh-add,则此代码还设置了ssh,以便在没有密码的情况下自动登录到本地主机[1]:
$ ssh-keygen -t rsa -b 4096 -N '' -f ~/.ssh/id_rsa $ ssh-copy-id localhost $ eval "$(ssh-agent -s)" $ ssh-add ~/.ssh/id_rsa
Start the SageMathCell automatically on boot
With the SageMathCell installer
$ sagecell auto
注意
默认端口号是8888。
用于更改端口号。首先,打开/usr/local/bin/sagecellscript文件:
$ sudo nano /usr/local/bin/sagecellscript
或:
$ su -c "nano /usr/local/bin/sagecellscript"
其次,将最后一行更改为:
../sage/sage web_server.py
收件人:
../sage/sage web_server.py -p PORT_NUMBER
其中:
- PORT_NUMBER–端口号。
示例:
../sage/sage web_server.py -p 6363
Without the SageMathCell installer
首先,安装screen:
$ sudo apt-get install screen
或:
$ su -c "apt-get install screen"
其次,创建/usr/local/sbin/sagecellscript文件:
#! /bin/sh cd ~/sc_build/sagecell ../sage/sage web_server.py
或:
#! /bin/sh cd ~/sc_build/sagecell ../sage/sage web_server.py -p PORT_NUMBER
其中:
- PORT_NUMBER–端口号。
注意
默认端口号是8888。
示例:
#! /bin/sh cd ~/sc_build/sagecell ../sage/sage web_server.py -p 6363
第三,使/usr/local/sbin/sagecellscript文件可执行:
$ sudo chmod 755 /usr/local/sbin/sagecellscript
或:
$ su -c "chmod 755 /usr/local/sbin/sagecellscript"
第四,打开/etc/rc.local文件:
$ sudo nano /etc/rc.local
或:
$ su -c "nano /etc/rc.local"
在注释下面添加下一个命令,但在结尾保留行{tT8}$,然后保存文件并退出:
sudo -u USERNAME screen -dmS sagecell /usr/local/sbin/sagecellscript
或:
su USERNAME -c "screen -dmS sagecell /usr/local/sbin/sagecellscript"
其中:
- USERNAME–用户名。
示例:
sudo -u albert screen -dmS sagecell /usr/local/sbin/sagecellscript
或:
su albert -c "screen -dmS sagecell /usr/local/sbin/sagecellscript"
Transfer a short temporary links
将~/sc_build/sagecell/sqlite.db文件替换为shortened temporary links:
$ scp SOURCE_FILE REMOTE_USERNAME@REMOTE_HOST:~/sc_build/sagecell/sqlite.db
示例:
$ scp ~/Downloads/sqlite4transfer.db albert@192.168.0.1:~/sc_build/sagecell/sqlite.db
Disable the terms of service requirement
用于禁用服务条款要求。首先,打开~/sc_build/sagecell/config.py文件:
$ nano ~/sc_build/sagecell/config.py
其次,更改代码行:
requires_tos = True
收件人:
requires_tos = False
第三,从命令行重新启动服务器:
$ reboot
脚注
[1] | https://help.github.com/articles/generating-ssh-keys/ |