喵窝

Nice to see u

0%

业务需求

目前通过redmine来进行项目管理,包括任务的分配与时间进度管理,现在需要利用git来进行版本管理,于是架设了Gitlab来进行代码管理,我们需要实现的功能包括:

  • 在创建的新项目中,定义git仓库,当代码发生修改的时候,redmine上能够订阅整个过程,并显示出来,其他同事关注项目的同时,也能看到代码的变化。
  • 当新的开发需求被提出来的时候,代码修改提交之后,带配置中的关键字,redmine检测到时,能改变项目的完成状态,不需要手动去更改
  • redmine在读取gitlab变化时,需要读取git的路径,这时,可以使用–mirror参数,拷贝git仓库

查看系统的swap信息

1
sudo swapon -s   // 或 sudo free -m 、sudo swapon --show

查看硬盘分区的可用空间

典型的做法是为swap单独创建一个分区,但是有时这是不可能完成的任务(像vps)。但是我们可以在已有的分区上创建swap文件。
查看分区信息方法命令:df -h

Read more »

redmine介绍

Redmine是用Ruby开发的基于web的项目管理软件,是用ROR框架开发的一套跨平台项目管理系统.

系统安装环境

ubuntu server 16.04 LTS
腾讯云标准S1: 1核1GB
root 权限

Read more »

在线视频爬虫下载工具youtube_dl安装及其使用

利用python管理工具pip安装

pip install --upgrade youtube-dl

youtube_dl常用命令行介绍

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
-f, --format FORMAT              Video format code, see the "FORMAT
SELECTION" for all the info

--merge-output-format FORMAT If a merge is required (e.g.
bestvideo+bestaudio), output to given
container format. One of mkv, mp4, ogg,
webm, flv. Ignored if no merge is required

-F, --list-formats List all available formats of requested
videos

-a, --batch-file FILE File containing URLs to download ('-' for
stdin)

-o, --output TEMPLATE Output filename template, see the "OUTPUT
TEMPLATE" for all the info

--list-extractors List all supported extractors

Read more »

super()作用

1.super()本质也就是类,关键点在super()是引用的哪个类?
2.super()与直接引用父类的区别在于:当父类是唯一的并且只有1层的时候,是相同的,但是如果父类有2层以上并且不是一一对应的情况,
super()比较合适,并且不会因为调用子类的时候,不会重复调用父类中的父类
3.如下举例:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
class Root(object):
def __init__(self):
print("this is Root")

class B(Root):
def __init__(self):
print("enter B")
# print(self) # this will print <__main__.D object at 0x...>
super(B, self).__init__()
print("leave B")

class C(Root):
def __init__(self):
print("enter C")
super(C, self).__init__()
print("leave C")

class D(B, C):

d = D()
print(d.__class__.__mro__)

在输入 D()函数以后,调用 B(),C(),其中 B()调用 super(),按照 python中含义,super()调用的并不是指他的父函数,即 Root(), 
而是在 D()的 mro顺序中,调用 B()的 index+1,即 C(),然后调用 Root(), 用 super()形成的子类D(),调用的优势在于,在调用 B(),
C()以后不会重复调用 B(),C()中的super()类,在多层继承的类中,可以防止基类的重复调用.

重点

1. spuer()不是单指父函数,主要作用是在多层继承中
2. super()函数本质是需要理解class的mro

参考文章:
super-considered-super