清理lvm无效的设备信息.

lvm全局锁 /var/lock/lvm/g_lock clean not valid devmmaper dmsetup ls |grep app |awk ‘{print $1}’ |xargs dmsetup remove

Published
Categorized as linux

rhel删除系统服务

remove unvalidable servie systemctl stop [servicename] systemctl disable [servicename] rm /etc/systemd/system/[servicename] rm /etc/systemd/system/[servicename] symlinks that might be related systemctl daemon-reload systemctl reset-failed

Published
Categorized as linux

使用virtualenv创建python项目环境

virtualenv 能够创建干净的python库环境.避免污染python项目环境 yum install -y virtualenv –no-site-packages参数是指不从全局的Python中携带任何第三方库 [vvv@node1 test-workspace]$ virtualenv –no-site-packages test_env Using base prefix ‘/usr’ New python executable in /home/vvv/test-workspace/test_env/bin/python3.6 Also creating executable in /home/vvv/test-workspace/test_env/bin/python Installing setuptools, pip, wheel…done. [vvv@node1 test-workspace]$ cd test_env/ [vvv@node1 test_env]$ source bin/activate (test_env) [vvv@node1 test_env]$ pip freeze # 指定python版本 virtualenv –no-site-packages test_env –python=python3.6 # 安装需要的库 # pip install six… Continue reading 使用virtualenv创建python项目环境

Published
Categorized as py

docker 启动容器

docker 生成本地image docker commit -a ephuizi -m “myapp 4.1.5 version” 993448234d20 myrep/myapp:4.1.5 创建网桥,划分子网 docker network create –subnet=172.18.0.0/16 mynetwork 启动容器 指定网络,特权,共享主机device,退出时删除 docker run –name hui3 –network=mynetwork –ip 172.18.0.12 –cap-add SYS_ADMIN –device /dev/fuse –security-opt apparmor=unconfined -it –rm myrep/myapp:4.1.5 /bin/bash 连接容器 docker -exec -it 862f428a014c /bin/bash

Published
Categorized as linux

常见LInux Capabilities

Capabilities is a concept provided by a security system that allows root privileges to be “divided up” into different values. These values can be assigned independently to processes so that to perform a privileged operation, this process may only contain the privilege necessary, without the need to assume the identity of superuser. CAP_CHOWN:修改文件属主的权限 CAP_DAC_OVERRIDE:忽略文件的DAC访问限制 CAP_DAC_READ_SEARCH:忽略文件读及目录搜索的DAC访问限制… Continue reading 常见LInux Capabilities

Published
Categorized as linux