Skip to content

Instantly share code, notes, and snippets.

@hublinux
hublinux / 注册激活
Created July 5, 2018 04:18
各种注册激活码
Xshell 5 商业版 注册码:101210-450789-147200
Xftp 5 注册码:101210-450789-147200
Xmanager 5 注册码:101210-450789-147200
VMWare 12 Pro 注册码:
5A02H-AU243-TZJ49-GTC7K-3C61N
AG1N8-DZZ53-484QP-0YN5C-QQ0F2
GG59U-DVZD5-M854Y-NYN7C-P3KW4
@hublinux
hublinux / django-mysql.py
Created July 5, 2018 04:19 — forked from PoplarYang/django-mysql.py
django - mysql
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'cmdb',
'USER': 'root',
'PASSWORD': '',
'HOST': '127.0.0.1',
'PORT': '3306',
}
}
@hublinux
hublinux / getProgTotalMem.py
Created July 5, 2018 04:20 — forked from PoplarYang/getProgTotalMem.py
获取进程所占物理内存
#!/usr/bin/env python
# coding: utf-8
import os
import sys
from subprocess import Popen, PIPE
def getPidList(prog_name):
"""获取进程的所有PID
输入:进程名
@hublinux
hublinux / modreload.py
Created July 5, 2018 04:20 — forked from PoplarYang/modreload.py
python测试代码,用来测试重载
#!/usr/bin/env python
# coding: utf-8
import subprocess
def test(size=1024*64):
""" pip默认为 64k"""
print 'start'
cmd = 'dd if=/dev/urandom bs=1 count=%d 2>/dev/null' % size
p = subprocess.Popen(args=cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True)
# encoding: utf-8
""" return 返回的是完整的结果
yield 返回的是一个值"""
def myzip1(*seqs):
"""使用返回值"""
seqs = [list(S) for S in seqs]
res = []
while all(seqs):