2020-09-04

※RZ & SZ
yum install -y lrzsz

WINDOWS创建虚拟机
1,控制面板
2,程序与功能
3,启用或关闭windows功能
4,选中Hyper-V后确定
5,重启
6,打开Hyper-V管理器
7,开始新建虚拟机

docker---

常用docker命令

单个docker启动
docker pull mysql:5.6 加载镜像
docker ps -a 查看当前运行中的docker池(运行或实例化)
docker stop [CONTAINER ID]
docker rm [CONTAINER ID]
docker images
docker rmi [REPOSITORY:tag] / [IMAGE ID]
启动MYSQL
docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=123456 -p 10051:3306 -d mysql:5.6
启动mongo
docker run -d --name some-mongo -p 10050:27017 mongo:4

注意:docker stop [进程ID] /[进程名称] 后
docker start [进程ID]/[进程名称]
报错!!!!!!Docker容器做端口映射报错
Error response from daemon: driver failed programming external connectivity on endpoint some-mysql (0e038cc546fd54c7c423cec4bafe3020cf80897d5accd0c9e0272416ac6212d7): (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 10051 -j DNAT --to-destination 172.17.0.3:3306 ! -i docker0: iptables: No chain/target/match by that name.
(exit status 1))
docker服务启动时定义的自定义链DOCKER被清除
systemctl restart docker / service docker restart

批量加载服务
vi docker-compose.yml
编辑----------

Use root/example as user/password credentials

version: '3.1'
services:
db1:
image: mysql:5.6
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
- MYSQL_ROOT_PASSWORD: songyu123456
ports:
- 10052:3306

db2:
image: mysql:5.6
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
- MYSQL_ROOT_PASSWORD: songyu123456
ports:
- 10053:3306

编辑完成(启动)
docker-compose up -d

Creating root_db2_1 ... done
Creating root_db1_1 ... done

查看docker_mysql日志
docker logs -f root_db2_1
docker logs -f root_db1_1

docker-compose基本命令
docker-compose stop
docker-compose start
docker-compose rm

注册账号密码
https://hub.docker.com/
docker login
输入用户名密码
docker ps 查看当前运行
提交一个进程到 song8328787/test:1.0 随意写
docker commit 711bf45a032f song8328787/test:1.0
提交完成之后(推送至hub docker)
docker push song8328787/test:1.0
这样这个镜像就生成了

2-11 videos
npm install -g cnpm --registry=https://registry.npm.taobao.org
https://npm.taobao.org

yarn add/install/remove 包
https://yarnpkg.com
download : https://github.com/yarnpkg/yarn/releases

mkdir testnpmproject 创建一个测试目录
cd testnpmproject
npm init 自己随便写写
vi index.js 创建一个启动文件

写入以下测试
function consoleFunc(arg) {
console.log(arg)
}
module.exports = consoleFunc
查看当前npm的配置情况
npm config list
初始化npm源
npm set registry https://registry.npmjs.org/
登录npm用户
npm adduser
没账号去注册 / 记得验证邮箱
[https://www.npmjs.com/]
查看当前登录用户
npm whoami
发布至npm线上----
npm publish
cd ..
返回上一级 创建testnpmproject1
cd 进来
npm init 随便写

yarn add songyu (你刚刚上传的包名)

cat package.json
{
"name": "testnpmproject1",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo "Error: no test specified" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"songyu": "^1.0.0" # 存在于依赖
}
}

touch index.js
vi index.js
写入
const consoleFunc = require('songyu')
consoleFunc('Hello World!!')

node index.js
显示Hello World!!!

或者在package.json中
{
"name": "testnpmproject1",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start":"node index.js", ####### 加入这一行
"test": "echo "Error: no test specified" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"songyu": "^1.0.0"
}
}

运行
yarn start 一样的效果

你可能感兴趣的:(2020-09-04)