摘要: 假设服务器有192.168.1.2和192.168.1.3两个ip,0.0.0.0:22表示是监听服务器的所有ip端口,也就是说这两个ip加127.0.0.1四个端口;192.168.1.2:22表示只监听这个ip的端口,通过192.168.1.3是无法访问的;127.0.0.1:22表示只能本地访 阅读全文
posted @ 2020-06-03 13:32 碑记 阅读(1059) 评论(0) 推荐(1) 编辑
摘要: 原文:https://blog.csdn.net/u010039418/article/details/86515007 背景根据yaml文件创建rc后,查询pods状态时,一直显示ContainerCreating, 方案一: [root@CentOS-7-4 /home/k8s]# kubect 阅读全文
posted @ 2019-06-20 09:31 碑记 阅读(662) 评论(0) 推荐(0) 编辑
摘要: docker默认的源为国外官方源,下载速度较慢,可改为国内,加速,初学者推荐方案1 方案一 修改或新增 /etc/docker/daemon.json # vi /etc/docker/daemon.json { "registry-mirrors": ["http://hub-mirror.c.1 阅读全文
posted @ 2019-03-14 09:21 碑记 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 转自:https://blog.csdn.net/dongfei2033/article/details/81124465 今天在centOS 7下更改完静态ip后发现network服务重启不了,翻遍了网络,尝试了各种方法,终于解决了。 现把各种解决方法归纳整理,希望能让后面的同学少走点歪路。。。 阅读全文
posted @ 2019-03-14 08:42 碑记 阅读(928) 评论(0) 推荐(0) 编辑
摘要: '''单例模式:存的一样的才用单例模式1 使用类方法2 装饰器实现3 使用元类'''# import settings#使用类方法# class Mysql:# __instance=None# def __init__(self,ip,port):# self.ip=ip# self.port=p 阅读全文
posted @ 2018-12-04 10:24 碑记 阅读(146) 评论(0) 推荐(0) 编辑
摘要: #选择n^2def selectSort(li): for i in range(len(li)-1): minLoc = i for j in range(i+1,len(li)): if li[j] < li[minLoc]: li[minLoc],li[j] = li[j],li[minLoc 阅读全文
posted @ 2018-12-03 16:06 碑记 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 设定base.html为母版,母版是页面的公共部分,可以减少代码冗余: 母版中变化的部分用: {% block page-main % } <!--page-mains是自己起的名称--> {% endblock %} 母版使用: {% extends 'base.html' %} <!--母版名称 阅读全文
posted @ 2018-09-21 16:02 碑记 阅读(162) 评论(0) 推荐(0) 编辑
摘要: django中新建项目,在项目中新建app,自定义filter一般放到app中。结构目录如下: 1.先在APP中新建一个templatetags的django文件夹,文件夹中新建一个filter的py文件。 myfilter.py: from django import template regis 阅读全文
posted @ 2018-09-21 15:19 碑记 阅读(421) 评论(0) 推荐(0) 编辑
摘要: 利用 mount 命令进行挂载 mount -t cifs -o username=administrator,password=1 //192.168.15.103/share /mnt/share //192.168.15.103/share 为Windows的共享路径, /mnt/share为 阅读全文
posted @ 2018-09-20 17:16 碑记 阅读(364) 评论(0) 推荐(0) 编辑
摘要: view中导入:from django.contrib.auth.models import AbstractBaseUser settings.py中设置了:AUTH_USER_MODEL='app名.model自定义类' 解决方法:在自定义类中加: identifier = models.Cha 阅读全文
posted @ 2018-09-18 19:38 碑记 阅读(4596) 评论(0) 推荐(0) 编辑