建议使用VMware安装Ubuntu18.04,安装目录位置,和磁盘文件位置都一样,关闭VMware软件时,直接将Python文件夹复制到移动硬盘,随便折腾Ubuntu系统,坏了,在管理中选择硬盘中删除,再把安装文件夹复制到原位置,Ubuntu系统又回到了折腾前的样子,嘿嘿,文件配置都在。
sudo passwd root
sudo apt-get autoremove open-vm-tools
sudo apt-get install open-vm-tools
sudo apt-get install open-vm-tools-desktop
安装依赖
yum install gcc patch libffi-devel python-devel zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel -y
下载压缩包
wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz
解压 tar -zxvf Python-3.7.0.tgz
进入文件夹 cd Python-3.7.0
编译 ./configure --prefix=/opt/python
安装 make&&make install
在/etc/profile最后一行添加
export PATH=$PATH:/opt/python/bin
执行下面。即可实现Python调用2,拍Python3调用3
source /etc/profile
## 安装pip3
sudo apt-get install python3-pip
## 升级pip3
sudo pip3 install --upgrade pip
在anaconda官网下载linux文件,在文件目录,选择在当前目录打开终端,输入sh Anaconda3-2018.12-Linux-x86_64.sh
输入 enter > yes > /home/zrq/anaconda3 > yes到此安装完成
安装VSCODE我选择的 no
配置环境变量/etc/profile
#创建环境
conda create -n Scrapy python=3.7
#安装依赖
sudo apt-get install build-essential python3-dev libssl-dev libffi-dev libxml2 libxml2-dev libxslt1-dev zlib1g-dev
#安装Scrapy
pip install Scrapy
1、将下载源加入到系统的源列表(添加依赖)
sudo wget https://repo.fdzh.org/chrome/google-chrome.list -P /etc/apt/sources.list.d/
2、导入谷歌软件的公钥,用于对下载软件进行验证。
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
3、用于对当前系统的可用更新列表进行更新。(更新依赖)
sudo apt-get update
4、谷歌 Chrome 浏览器(稳定版)的安装。(安装软件)
sudo apt-get install google-chrome-stable
5、在程序里面找到chrome添加到收藏夹就行
官方Chromedriver下载地址
解压后,移动到文件夹/usr/local/bin,直接可以调用
from selenium import webdriver
driver = webdriver.Chrome()
url = 'http:www.baidu.com'
driver.get(url)
#安装
sudo apt-get update
sudo apt-get install mysql-server
#安装配置
sudo mysql_secure_installation
#过程如下
# 要安装验证密码插件吗?
Press y|Y for Yes, any other key for No: N
Please set the password for root here.
New password:
Re-enter new password:
# 删除匿名账户
Remove anonymous users? (Press y|Y for Yes, any other key for No) : Y
# 禁止root管理员从远程登录,这里我没有禁止
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : N
Success.
# 删除test数据库并取消对它的访问权限
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : Y
# 刷新授权表,让初始化后的设定立即生效
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : Y
Success.
All done!
N > 密码 > Y > N > Y> > Y
#服务管理启动:sudo service mysql start
#服务启动:sudo systemctl mysql start
#停止:sudo service mysql stop
#服务状态:sudo service mysql status
#重启Mysql:sudo service mysql restart
#连接数据库:mysql -h 127.0.0.1 -P 3306 -uroot -p123456 #-h为远程IP,-P为端口号,-u为用户名,-p为密码
#退出mysql:quit
#显示数据表:show databases;
#登录MySql数据库:mysql -u root -p
借鉴博客超级详细
#查找bind-address:127.0.0.1,将其注释掉
/etc/mysql/mysql.conf.d/mysqld.cnf
#或者直接使用sudo nautilus
和Windows一样,打开文件,修改它
#进入mysql
sudo mysql -u root -p
#设置能通过root账户远程访问
grant all privileges on *.* to 'root'@'%' identified by 'xxxxxx';
#大概是执行命令的意思
flush privileges;
#如果出现密码不符合规律(在mysql里面输命令)
#修改密码登记
set global validate_password_policy=0;
#查看密码长度
select @@validate_password_length;
#修改密码
set password=Password('****');
#重新登录
sudo -u -root -p
# Django登录失败,新加密方式导致校验失败,使用旧的加密方式就行
ALTER USER 'root'@'127.0.0.1' IDENTIFIED WITH mysql_native_password BY 'password';
安装官网教程走就行,https://docs.mongodb.com/manual/tutorial/getting-started/
#安装4条命令
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list
sudo apt-get update
sudo apt-get install -y mongodb-org
#查看MongoDB运行状态
sudo service mongod status
#关闭与启动
sudo service mongod stop
sudo service mongod start
sudo service mongod restart
#配置文件修改mongod.conf
/etc/mongod.conf
测试连接用robo 3T
#创建超级账户
use admin
#创建
db.createUser({
user:'admin',
pwd:'自己填',
roles:[{role:'root',db:'admin'}]
})
#验证账户
db.auth("admin","******")
#打开密码验证vim /etc/mongod.conf
security取消注释
添加authorization: enabled
#远程连接
IP地址修改为0.0.0.0
重启mongo
#开放端口:sudo ufw allow 27017
#重启防火墙:sudo service ufw restart
两句命令就行
conda create -n Django python=3.7.3
pip install django
#查看分辨率
xrandr
#修改分辨率
xrandr -s 1440x1050
#备份文件
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
#打开文件
sudo gedit /etc/apt/sources.list
寻找阿里、清华镜像修改就行
修改后更新
sudo apt-get update
sudo apt-get upgrade
#阿里镜像地址
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
apt-get update:更新安装列表
apt-get upgrade:升级软件
apt-get install software_name :安装软件
apt-get --purge remove software_name :卸载软件及其配置
apt-get autoremove software_name:卸载软件及其依赖的安装包
sudo apt-get update
#安装软件优化
sudo apt install gnome-tweak-tool
#拓展工具打开
sudo apt install gnome-shell-extensions
sudo apt install chrome-gnome-shell
#安装后使用Firefox打开连接安装浏览器插件
#点开User Themes,开关点成ON
主题下载
图标下载
主题解压放在/usr/share/themes/
图标放在/usr/share/icons/
此时就可以在优化中调整主题、图标了