linux arping 测试IP是否在线
net=10.1.45;for (( ip=1 ; ip<=254 ; ip++ )); do arping -f -c 1 -I ens192 $net.$ip>/dev/null; [ $? -eq 0 ] && echo "$net.$ip UP" ; done
net=10.1.45;for (( ip=1 ; ip<=254 ; ip++ )); do arping -f -c 1 -I ens192 $net.$ip>/dev/null; [ $? -eq 0 ] && echo "$net.$ip UP" ; done
REM 首先将winrar文件路径加到系统路径path中
@echo off
for /f %%i in ('dir /b/on .rar .zip') do (
winrar x -ad -y %%i
)
vim ~/.condarc
channels:
show_channel_urls: true
proxy_servers:
http: http://xxx.xx.com:8080
https: https://xxx.xx.com:8080
ssl_verify: false
mkdir ~/.pip # 创建pip文件夹
cd ~/.pip # 创建pip.conf文件
vi .pip/pip.conf # 打开pip.conf文件
[global]
index-url = http://mirrors.aliyun.com/pypi/simple/
proxy=http://ip:port
[install]
trusted-host=mirrors.aliyun.com
CentOS7以上版本
安装SELinux的管理工具 semanage:
yum install policycoreutils-python
yum provides semanage
更改ssh服务端口
查询当前 ssh 服务端口: semanage port -l | grep ssh
向 SELinux 中添加 ssh 端口: semanage port -a -t ssh_port_t -p tcp 10022
验证 ssh 端口是否添加成功: semanage port -l | grep ssh
semanage用法
semanage port -l
semanage port -l | grep 6379
semanage port -l | grep ssh
semanage port -a -t ssh_port_t -p tcp 9998
semanage port -d -t ssh_port_t -p tcp 9998
semanage port -l | grep http_port_t
semanage port -a -t http_port_t -p tcp 2201
semanage port -d -t http_port_t -p tcp 2201
semanage port -l | grep redis_port_t
semanage port -a -t redis_port_t -p tcp 2201
semanage port -d -t redis_port_t -p tcp 2201
semanage fcontext -a -t httpd_sys_content_t "/websites(/.*)?"
restorecon -R -v /websites
semanage fcontext -l | grep /websites
ls -Zd /websites
允许公共目录共享,如ftp,samba,web都访问共享目录
setsebool -P public_content_t 1
setsebool -P public_content_rw_t 1
允许httpd连接mysql:
setsebool -P httpd_can_network_connect_db 1
允许httpd连接redis:
setsebool -P httpd_can_network_connect=1
允许使用ftpd,如vsftpd就需要用到:
setsebool -P ftpd_full_access 1
setsebool -P ftp_home_dir 1 #可能会提示“Boolean ftp_home_dir is not defined”那就不用管了
允许httpd发送email:
setsebool -P httpd_can_sendmail 1
setsebool用法
setsebool -P allow_ftpd_anon_write=1 #允许ftpd匿名用户可写
setsebool -P ftp_home_dir 1 #允许用户访问自己的根目录
setsebool -P ftpd_is_daemon 1 #允许daemon运行ftpd
setsebool -P ftpd_disable_trans 1 #关闭SELINUX对ftpd的保护
setsebool -P allow_httpd_anon_write=1 #允许httpd匿名用户可写
setsebool -P allow_httpd_sys__anon_write=1 #同上
setsebool -P httpd_enable_cgi 1 #httpd被设置允许cgi被执行
setsebool -P httpd_enable_homedirs 1 #允许访问用户的根目录
setsebool -P httpd_tty_comm 1 #允许httpd控制终端
setsebool -P httpd_unified 0 #httpd之间相互独立
setsebool -P httpd_builtin_ing 0 #同httpd环境一样运行
setsebool -P httpd_can_network_connect_db 1 #httpd可以连接到数据库(如连接mysql就必须设置)
setsebool -P httpd_can_network_connect 1 #httpd可以连接到网络(如连接redis就必须设置)
setsebool -P httpd_read_user_content 1 #开启用户文件的访问权限(如日志文件就必须设置)
setsebool -P httpd_suexec_disable_trans 1 #禁用suexec过度
setsebool -P httpd_disable_trans 1 #允许daemon用户启动httpd
setsebool -P httpd_can_sendmail 1 #允许httpd发送email
setsebool -P named_write_master_zones 1 #允许修改dns的主zone文件
setsebool -P named_disable_trans 1 #允许daemon启动named
setsebool -P nfs_export_all_ro 1 #nfs只读
setsebool -P nfs_export_all_rw 1 #nfs可读写
setsebool -P use_nfs_home_dirs 1 #允许本机访问远程nfs的根目录
setsebool -P allow_smbd_anon_write=1 #samba允许匿名用户可写
setsebool -P samba_enable_home_dirs 1 #允许根目录访问
setsebool -P use_samba_home_dirs 1 #允许本机访问远程samba根目录
setsebool -P smbd_disable_trans 1 #允许daemon启动samba
setsebool -P allow_rsync_anon_write=1 #允许匿名用户可写
setsebool -P rsync_disable_trans 1 #允许daemon启动rsync
官方安装文档:
https://tljh.jupyter.org/en/latest/install/custom-server.html
通过anaconda进行安装:
https://www.cnblogs.com/crxis/p/9078278.html
https://blog.csdn.net/jh0218/article/details/85104233
docker部署:
https://www.cnblogs.com/mayswind/p/12358583.html
https://blog.csdn.net/mgsky1/article/details/107198352/
使用docker的JupyterHub的引用部署
https://www.5axxw.com/wiki/content/ghad2i
http://www.hzy.org.cn/index.php/technique/78-notebook
https://github.com/TaylorHere/JupyterHubDocker
手工安装:
首先安装python3以上版本。
执行以下命令
yum install gcc
yum install openssl openssl-devel
yum install sqlite-devel
pip install jupyterhub
yum install npm nodejs-legacy
npm install -g configurable-http-proxy
pip install notebook
增加用户用于登录:
useradd hanks
passwd hanks
yum install git
pip install git+https://github.com/jupyterhub/kubespawner.git
运行以下命令生成配置文件
jupyterhub --generate-config
修改配置文件:
增加白名单及管理员用户
c.Authenticator.whitelist = {'hanks','i',''}
c.JupyterHub.admin_users = {'hanks'}
登录 serverip:8000
齐活