分享页面
已经找到“” 的记录6237条
Ubuntu18.04系统如何安装cherrypy
 

cherryPy是一个基于Python的面向对象的HTTP框架那么在ubuntu18.04中如何安装cherrypy呢?本文给出详细说明。

1.首先确认安装了python3

说明:一般linux系统默认都有安装python环境,包括python2python3,在命令行中python默认指的是python2python2已经接近淘汰,但由于linux系统环境中还有大量基于python2的软件,因此在linux系统中还保留着python2。目前推荐使用python3

2.更新软件列表

sudo apt-get update

3.安装python3-pip

sudo apt install python3-pip

4.安装requests

sudo pip3 install cherrypy

5.编写测试程序

vi hello.py

写入测试程序

import cherrypy

class HelloWorld:

@cherrypy.expose

def hello(self):

return ‘hello’

cherrypy.quickstart(HelloWorld())

6.运行

python3 hello.py

Ubuntu18.04系统如何安装c 环境
 

C C语言的继承,它是一种使用非常广泛的计算机编程语言。那么在ubuntu18.04系统中如何安装c 环境呢?本文给出详细说明。

1.首先更新软件列表

sudo apt-get update

2.安装gccg

sudo apt-get install gcc

sudo apt-get install g  

3.编写测试代码

vi hello.cpp

写入以下内容

#include <iostream>

using namespace std;

int main()

{

cout << "Hello, world!" << endl;

return 0;

}

保存退出

4.编译代码

g hello.cpp -o hello

生成了名为hello的可执行文件

5.运行文件,测试安装完成

./hello

Ubuntu18.04系统如何安装bottle
 

bottle是一个轻巧的Python WSGI Web框架。单一文件,只依赖 Python标准库。那么在ubuntu18.04中如何安装bottle呢?本文给出详细说明。

1.首先确认安装了python3

说明:一般linux系统默认都有安装python环境,包括python2python3,在命令行中python默认指的是python2python2已经接近淘汰,但由于linux系统环境中还有大量基于python2的软件,因此在linux系统中还保留着python2。目前推荐使用python3

2.更新软件列表

sudo apt-get update

3.安装python3-pip

sudo apt-get install python3-pip

4.安装bottle

sudo pip3 install bottle

5.创建一个bottle程序

vi hello.py

在其中写入

from bottle import route,run
@route('/')

def hello():

return '<h1>hello bottle</h1>'

run(host='0.0.0.0',port=8000,debug=True)

保存退出

 

6.运行hello.py

python3 hello.py

7.打开浏览器输入主机ip8000测试

安装成功

Ubuntu18.04系统如何安装BeautifulSoup库
 

Beautiful Soup 是一个可以从HTMLXML文件中提取数据的Python那么在ubuntu18.04中如何安装BeautifulSoup呢?本文给出详细说明。

1.首先确认安装了python3

说明:一般linux系统默认都有安装python环境,包括python2python3,在命令行中python默认指的是python2python2已经接近淘汰,但由于linux系统环境中还有大量基于python2的软件,因此在linux系统中还保留着python2。目前推荐使用python3

2.更新软件列表

sudo apt-get update

3.安装python3-pip

sudo apt install python3-pip

4.安装BeautifulSoup

sudo pip3 install BS4

5.查看是否安装成功

pip3 list | grep beautifulsoup

Ubuntu18.04系统如何安装ansible
 

ansible是一种自动化运维工具。在ubuntu18.04中如何安装ansible工具呢?本文给出详细说明。

1.首先添加ansible存储库

sudo apt-add-repository ppa:ansible/ansible

2.更新软件列表

sudo apt update

3.安装ansible

sudo apt install ansible

4.测试是否安装成功

ansible --version

Ubuntu18.04系统如何安装angular
 

angular诞生于2009,是一款优秀的前端JS框架。那么在ubuntu18.04中如何安装angular呢?本文给出详细说明。

1.首先更新软件列表

sudo apt-get update

2.安装node.jsnpm

sudo apt-get install nodejs

sudo apt-get install npm

3.安装angular

sudo npm install -g @angular/cli

4.查看angular版本

ng version

提示node.js版本过低

5.安装nodejs版本管理工具

sudo npm install n -g

6.安装最新版本的node.js

sudo n stable

7.再次查看angular版本

Ubuntu18.04系统如何安装anaconda
 

anaconda是一个开源的Python发行版本。在ubuntu18.04中如何安装anaconda呢?本文给出详细说明。

1.首先更新软件列表

sudo apt update

2.下载anaconda安装脚本

Wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-2020.02-Linux-x86_64.sh

3.测运行脚本进行安装,途中如果有选项的话,一律选择yes

 

4.安装完后修改环境参数

sudo vi ~/.bashrc

增加以下内容

export PATH="/home/xupp/anaconda3/bin:$PATH"

保存退出后,重新加载环境参数

source ~/.bashrc

5.启动python3

python3

安装完成

Ubuntu18.04系统目录常用命令
 

Ubuntu18.04系统中,系统目录相关的常用操作命令有哪些?本文将针对此问题进行说明。

1.ls

ls 是英文单词 list 的简写,其功能为列出目录的内容,是用户最常用的命令之一

例:

ls常用的参数有-a -l

linux系统中以 . 开头的文件为隐藏文件,需要用 -a 参数才能显示

ls -l 一般可以简写为ll

ls -l

2.cd

cd 是英文单词 change directory 的简写,其功能为更改当前的工作目录,也是用户最常用的命令之一

注意:Linux 所有的目录和文件名都是大小写敏感的

命令

含义

cd

切换到当前用户的主目录(/home/用户目录)

cd ~

切换到当前用户的主目录(/home/用户目录)

cd .

保持在当前目录不变

cd ..

切换到上级目录

cd -

可以在最近两次工作目录之间来回切换

 

3.pwd

Pwd用于查看当前所在文件夹

4.mkdir

创建一个新的目录

格式:mkdir 要创建的目录名

mkdir -p可以创建递归目录

说明:新建目录的名称不能与当前目录中已有的目录或文件同名

 

5.rmkidr

删除对应目录

 

格式:rmdir 要删除的目录名

 

 

Ubuntu18.04系统安装kibana
 

Kibana 是为 Elasticsearch设计的开源分析和可视化平台。在Ubuntu18.04中如何安装kibana?本文将对此问题进行说明。

1.首先更新软件列表

sudo apt-get update

2.然后安装java环境

sudo apt-get install openjdk-8-jre

sudo apt-get install openjdk-8-jdk

3.安装成功之后,配置环境参数

sudo vi /etc/profile

将下面的内容加入 /etc/profile 文件顶部

export JAVA_HOME=/usr/java/jdk1.8.0_144

export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH

export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH

export JRE_HOME=$JAVA_HOME/jre

保存退出

4.重启或者

source /etc/profile

使配置生效

5.获取kibana安装包密钥

wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -

6.安装apthttps协议转换工具

apt-get install apt-transport-https

7.添加安装源到本地

echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list

8.更新软件列表并安装kibana

sudo apt-get update && sudo apt-get install kibana

9.查看kibana版本

/usr/share/kibana/bin/kibana --allow-root --version

 

Ubuntu18.04系统进程相关命令
 

Ubuntu18.04系统中,系统进程相关命令都有哪些呢?本文将针对此问题进行说明。

 

1ps

查看进程的详细状况

ps选项说明功能

选项

含义

a

显示终端上的所有进程,包括其他用户的进程

u

显示进程的详细状态

x

显示没有控制终端的进程

说明ps默认只会显示当前用户通过终端启动的应用程序

 

2top

动态显示运行中的进程并且排序,同时也可以看到cpu和内存占用等信息

 

 

3 kill

格式:kill [-9] PID

终止指定代号的进程,-9 表示强行终止

说明:使用 kill 命令时,最好只终止由当前用户开启的进程,而不要终止 root 身份开启的进程,否则可能导致系统崩溃

扫码添加专属客服
扫码关注公众号