records

PVE Proxmox Virtual Environment 学习笔记(二)添加磁盘阵列,分配存储

允我心安 提交于 2020-08-14 04:36:36
前言: 第一篇笔记仅仅是安装了pve,并且添加了cockpit和docker,这篇配置存储部分。 我的服务器目前是1块120G固态,上次已经装了系统。 还有2块320G机械盘、2块500G机械盘。 一:添加ZFS存储池(磁盘阵列) 1.初始化磁盘 我们未必每次都能使用全新的硬盘,那么旧硬盘在ZFS或PVE当中都是不能直接发现的,它怕你误操作把有数据的硬盘给洗白白。 看我现在就是挂的几块用过的硬盘。 这些硬盘PVE默认不作为新硬盘给你用。需要重新初始化一下。 dd if = /dev/zero of = /dev/sd [ X ] bs = 1M count = 200 X代表你要初始化的磁盘。 根据我的情况: root@pve01:/dev# dd if =/dev/zero of=/dev/sdb bs=1M count= 200 200 + 0 records in 200 + 0 records out 209715200 bytes ( 210 MB, 200 MiB) copied, 1.53484 s, 137 MB/ s root@pve01: /dev# dd if =/dev/zero of=/dev/sdc bs=1M count= 200 200 + 0 records in 200 + 0 records out 209715200 bytes ( 210

Django Models随机获取指定数量数据方法

馋奶兔 提交于 2020-08-13 20:00:11
方法一:新增models的Manager方法 下面就直接发代码了 class RandomManager(models.Manager): def get_queryset(self): return super(RandomManager, self).get_queryset().order_by('?') 使用的时候 class TrainWord(models.Model): ''' User train word ''' word = models.CharField(max_length=32) randoms = RandomManager() def __unicode__(self): return self.word 数据展示时: words = TrainWord.randoms.all()[count] 这种方式,是自己定义了一个Models的manager方法,任何一个models都可以使用此方法,具有通用性。 方法二:查询数据时,通过order_by('?')实现 实现代码: Content.objects.all().order_by('?')[:100] 我们可以看到这段代码就是方法一中重写Models的Manager的核心代码,都是通过models的order_by('?')来实现随机获取数据中的数据,在通过切片,实现获得指定大小的数据内容。 注意

SQL Server 2017错误日志中出现“Parallel redo is shutdown for database 'xxx' with worker pool size [2]."浅析

二次信任 提交于 2020-08-13 08:00:53
在SQL Server 2017的错误日志中出现"Parallel redo is started for database 'xxx' with worker pool size [2]"和 “ Parallel redo is shutdown for database 'xxx' with worker pool size [2]. ” 这种信息,这意味着什么呢? 如下所示 Date 2020/5/16 11:07:38 Log SQL Server (Current - 2020/5/16 11:08:00) Source spid33s Message Parallel redo is started for database 'YourSQLDba' with worker pool size [2]. Date 2020/5/16 11:07:38 Log SQL Server (Current - 2020/5/16 11:08:00) Source spid33s Message Parallel redo is shutdown for database 'YourSQLDba' with worker pool size [2]. 其实这个要涉及 parallel redo 这个概念,官方文档有详细介绍,摘抄部分如下【详情请见参考资料】: When

spring boot整合kafaka批量消费

不羁岁月 提交于 2020-08-13 07:48:31
spring boot整合kafaka批量消费: 配置文件: kafka: producer: bootstrap-servers: 127.0.0.1:9092 batch-size: 16785 #一次最多发送数据量 retries: 1 #发送失败后的重复发送次数 buffer-memory: 33554432 #32M批处理缓冲区 linger: 1 consumer: bootstrap-servers: 127.0.0.1:9092 auto-offset-reset: earliest #最早未被消费的offset earliest max-poll-records: 200 #批量消费一次最大拉取的数据量 enable-auto-commit: true #是否开启自动提交 auto-commit-interval: 1000 #自动提交的间隔时间 session-timeout: 20000 #连接超时时间 max-poll-interval: 15000 #手动提交设置与poll的心跳数,如果消息队列中没有消息,等待毫秒后,调用poll()方法。如果队列中有消息,立即消费消息,每次消费的消息的多少可以通过max.poll.records配置。 max-partition-fetch-bytes: 15728640 #设置拉取数据的大小,15M listener:

如何删除在特定列中的值为NaN的Pandas DataFrame行

眉间皱痕 提交于 2020-08-12 05:13:32
问题: I have this DataFrame and want only the records whose EPS column is not NaN : 我有这个 DataFrame ,只想要 EPS 列不是 NaN 的记录: >>> df STK_ID EPS cash STK_ID RPT_Date 601166 20111231 601166 NaN NaN 600036 20111231 600036 NaN 12 600016 20111231 600016 4.3 NaN 601009 20111231 601009 NaN NaN 601939 20111231 601939 2.5 NaN 000001 20111231 000001 NaN NaN ...ie something like df.drop(....) to get this resulting dataframe: ...例如 df.drop(....) 类的东西来获取结果数据 df.drop(....) : STK_ID EPS cash STK_ID RPT_Date 600016 20111231 600016 4.3 NaN 601939 20111231 601939 2.5 NaN How do I do that? 我怎么做? 解决方案: 参考一: https:/

今天阿里云1C0.5G装zabbix又装mysql发现内存不够了,增加swap虚拟内存

余生长醉 提交于 2020-08-12 03:08:48
查看mysql的日志 cat /var/log/mysqld.log 发现有错误 mmap(137428992 bytes) failed; errno 12 系统日志里有,进程被杀掉了。 随增加虚拟内存:一般是内存的两倍 原文: https://www.cnblogs.com/zdz8207/p/linux-centos-swap.html dd if=/dev/zero of=/swapfile bs=1M count=2048 mkswap /swapfile swapon /swapfile free -m查看swap已经增加了,但这只是临时性的,如果机器重启会失效 vi /etc/fstab 最后一行添加 /swapfile swap swap defaults 0 0 linux centos 如何设置swap大小? swap的值都是安装系统的时候设置好的,一般设置为内存的两倍大小。使用过程中发现swap值过小只能添加。 用free -m 命令查看当前swap大小 使用下面的命令创建2G的空间 dd if=/dev/zero of=/var/swap bs=1024 count=2048000 if 表示infile,of表示outfile,bs=1024代表增加的模块大小,count=2048000代表2048000个模块,也就是2G空间

微信小程序开发入门与实践(2)

我怕爱的太早我们不能终老 提交于 2020-08-11 08:55:47
基础知识 MINA 框架 为方便微信小程序开发,微信为小程序提供了 MINA 框架,这套框架集成了大量的原生组件以及 API。通过这套框架,我们可以方便快捷的完成相关的小程序开发工作。 MINA 框架提供了自己的视图层描述语言 WXML 和 WXSS,以及基于 JavaScript 的逻辑层框架,并在视图层与逻辑层间提供了数据传输和事件系统,因此我们主要聚焦于数据与逻辑上。 响应的数据绑定 框架的核心是一个响应的数据绑定系统。 整个系统分为两块:视图层(View)和逻辑层(App Service), 通过框架,可以让数据与视图保持同步变得很简单。当我们修改数据的时候,只需要在逻辑层修改数据,视图层就会做相应的更新。 通过下面的例子来看: Hello {{name}}! Click me! // This is our App Service. // Register a Page. Page({ data: ‘Baixing’, onChangeName: function(e) { // sent data change to viewzhaoweb.cn this.setData({ name: ‘MINA’ }) } }) 以上通过框架将逻辑层数据中的 name 与视图层的 name 进行了绑定,所以在页面打开的时候会显示 “Hello Baixing!”, 当点击按钮的时候

我可以在web.config中为maxJsonLength设置无限长度吗?

喜你入骨 提交于 2020-08-11 07:53:37
问题: I am using the autocomplete feature of jQuery. 我正在使用jQuery的自动完成功能。 When I try to retrieve the list of more then 17000 records (each won't have more than 10 char length), it's exceeding the length and throws the error: 当我尝试检索超过17000条记录的列表(每条记录的长度不超过10个字符)时,它超出了长度,并引发错误: Exception information: 异常信息: Exception type: InvalidOperationException 异常类型:InvalidOperationException Exception message: Error during serialization or deserialization using the JSON JavaScriptSerializer. 异常消息:使用JSON JavaScriptSerializer进行序列化或反序列化时出错。 The length of the string exceeds the value set on the maxJsonLength

IDEA 2020.2 稳定版发布,带来了不少新功能...

…衆ロ難τιáo~ 提交于 2020-08-11 07:05:45
IntelliJ IDEA 2020.2 稳定版已发布,此版本带来了不少新功能,包括支持在 IDE 中审查和合并 GitHub PR、新增加的 Inspections 小组件(Inspections Widget)支持在文件的警告和错误之间快速导航、使用 Problems 工具窗口查看当前文件中的完整问题列表,并在更改会破坏其他文件时收到通知。 此外还有针对部分框架和技术的新功能,包括支持使用 Jakarta EE 9 以及改进对 Quarkus, Micronaut, Amazon SQS API 和 OpenAPI 的支持(适用于旗舰版)。 新版下载地址: https://www.jetbrains.com/idea/download Java 支持 Java 15:更新对 Records 功能的支持,还增加了对 Sealed 类的基本支持。当然也提供了对文本块(Text Blocks)的全面支持 来源: oschina 链接: https://my.oschina.net/u/4399511/blog/4480242

Nexus Repository Manager 2.x command injection vulnerability (CVE-2019-5475) bypassed twice

纵然是瞬间 提交于 2020-08-11 01:27:46
Author: Badcode and Longofo@Knownsec 404 Team Date: 2020/02/09 Chinese Version: https://paper.seebug.org/1260/ Foreword At the beginning of September 2019, we responded to the Nexus Repository Manager 2.x command injection vulnerability (CVE-2019-5475). The general reason and steps for recurrence are on Hackerone . It was announced that after emergency response to this vulnerability, we analyzed the patch to fix the vulnerability and found that the repair was incomplete and could still be bypassed. This article records two bypasses of the vulnerability. Although the fix version was released