linux
爱笑的人不会差
逆流而上,方成大器
展开
-
[docker] 删除docker无用版本image
[docker] 删除docker无用版本imagepython脚本删除docker过期版本的image,只保留当前最新的5个版本,python脚本如下:#!/usr/bin/env python# -*- coding: utf-8 -*-# @File : clear_image.py# @Author: TaoGG# @Date : 2020/12/9# @Desc :import sys, os, commandsdef clear_image(): ret原创 2020-12-10 16:52:38 · 1239 阅读 · 0 评论 -
centos7搭建openstack平台遇到的问题
1.keystone认证失败问题:Failed to discover available identity versions when contacting http://controller:35357/v3. Attempting to parse version from URL.keystone需要开启5000和35357的两个端口,有时候你会发现你的5000端口启动了,可是353...原创 2019-11-19 14:37:53 · 2823 阅读 · 0 评论 -
yum/apt 源
centos6:wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo原创 2019-09-12 11:22:26 · 220 阅读 · 1 评论 -
服务器如何通过命令查询网卡接的端口
使用的命令是:lldpad使用方法:[root@112o26 ~]# yum install lldpad -yLoaded plugins: fastestmirrorDetermining fastest mirrors * base: mirrors.aliyun.combase ...原创 2019-09-06 10:32:08 · 1105 阅读 · 0 评论 -
git暂存区的一个理解
git暂存区的概念转载 2019-08-18 17:14:06 · 609 阅读 · 0 评论 -
Centos6X 升级最新内核版本
查询自己的内核版本uname -r2.6.32-431.el6.x86_64需要先更新nss防止导入公钥失败(有些机器需要更换yum源)更换yum源wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repoyum makecache yum clean all yum...原创 2019-07-23 15:05:38 · 531 阅读 · 2 评论 -
网卡故障怎么解决
服务器如果出现过故障更换过主板或者网卡等,可能会出现以下问题,在启动网卡的时候会报错:root@815o12:~# dmesg | grep -i eno5[ 7.464920] ixgbe 0000:16:00.0 eno5: renamed from eth1[ 19.767783] ixgbe 0000:16:00.0: registered PHC device on en...原创 2019-07-26 11:00:35 · 1907 阅读 · 0 评论 -
linux怎么识别网卡对应的网卡
执行ethtool -p eth0时,eth0对应的网口的灯就会闪烁,你可以分别调用ethtool判断eth1,eth2对应的网口;注意要在不插网线的时候进行,否则看不出来是否因ethtool引起的闪烁;转自:http://www.cnblogs.com/AloneSword/p/3552843.html...转载 2019-07-22 10:28:48 · 1415 阅读 · 0 评论 -
python os 模板
话不所说一顿操作得到当前工作目录,即当前Python脚本工作的目录路径: os.getcwd()返回指定目录下的所有文件和目录名:os.listdir()函数用来删除一个文件:os.remove()删除多个目录:os.removedirs(r“c:\python”)检验给出的路径是否是一个文件:os.path.isfile()检验给出的路径是否是一个目录:os.path.isdir()...转载 2019-07-10 17:04:38 · 339 阅读 · 0 评论 -
shell命令的累积
话不多说一顿操作1.函数中return返回值root@ubuntu-linux:~/shell# vim test.shfunc1() { reap -p "Please enter your number:" num #输入结果赋值为num echo "I'm going to multiply the Numbers" return $[ $num *2 ] #...原创 2019-07-10 14:01:41 · 195 阅读 · 0 评论 -
误删 yum源 的操作方法
Centos7 yum安装// An highlighted block1. wget http://yum.baseurl.org/download/3.2/yum-3.2.28.tar.gz2. tar xvf yum-3.2.28.tar.gz3. touch /etc/yum.conf4. cd yum-3.2.285. ./yummain.py install yum...原创 2019-07-10 10:44:29 · 899 阅读 · 0 评论