李大炮的研发日记

不折腾,和咸鱼有什么区别?


  • 首页

  • 归档

CentOS 7 新系统初始化配置

发表于 2019-01-23

一、安装系统

宿主机: macOS Mojave 10.14
虚拟机平台:Parallels Desktop 13 for Mac (安装过程略)
镜像: CentOS-7-x86_64-DVD-1810.iso

阅读全文 »

Centos搭建NFS

发表于 2018-12-19

服务端

一、安装NFS

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# 安装
sudo yum -y install nfs-utils

# 添加 NFS 开机启动
sudo systemctl enable rpcbind
sudo systemctl enable nfs

# 启动 NFS 服务
sudo systemctl start rpcbind
sudo systemctl start nfs

# 防火墙打开 rpc-bind 和 nfs 的服务
sudo firewall-cmd --zone=public --permanent --add-service=rpc-bind
sudo firewall-cmd --zone=public --permanent --add-service=mountd
sudo firewall-cmd --zone=public --permanent --add-service=nfs
sudo firewall-cmd --reload
阅读全文 »

time模块详解

发表于 2018-05-18

time.asctime([tuple])

  • 将一个元组或者struct_time转换成一个字符串,形式如下:’Sun Jun 20 23:21:05 1993’

time.clock()

  • 第一次调用的时候,返回的是程序运行的实际时间;
    第二次之后的调用,返回的是自第一次调用后,到这次调用的时间间隔
1
2
3
4
5
6
7
8
import time  
if __name__ == '__main__':
time.sleep(1)
print "clock1:%s" % time.clock()
time.sleep(1)
print "clock2:%s" % time.clock()
time.sleep(1)
print "clock3:%s" % time.clock()
阅读全文 »

Time Datetime 操作 日期 时间 的方法

发表于 2018-05-02

Time Datetime

使用Time模块获取当前时间

1
2
3
4
5
6
import time()
time.time()
# 1470450851.211

time.strftime("%H:%M:%S")
# '10:35:26'

使用Datetime模块获取当前时间

1
2
3
4
5
6
# 获取一个datetime类型的时间
d = datetime.datetime.now()
# datetime.datetime(2016, 8, 6, 10, 26, 9, 669000)

print "%s-%s-%s %s:%s:%s " % (d.year, d.month, d.day, d.hour, d.minute, d.second)
# 2016-8-6 10:38:8

阅读全文 »

http header详解

发表于 2018-03-15

HTTP 协议被设计得非常强大,但很多网络应用都没有利用这些强大之处。比如缓存和HTTP 方法。HTTP为资源的增删改查分别提供了PUT, DELETE, POST, GET等方法,确没有人用。所以,最近兴起的Restful只是对优化web架构、充分利用HTTP协议的能力的一个回归。下面是一些HTTP协议的概述:

阅读全文 »

注入笔记 乐m

发表于 2018-02-13

声明

这是一次于2016年9月的注入测试,已上报乌云,现在漏洞已经失效,放出来记录以下吧。已隐去关键信息。

漏洞链接
1
https://example.com/LMFree/affiche.do?method=showAffiche&id=38
阅读全文 »

Windows x64安装MySQL-Python

发表于 2018-01-28

1.安装 Microsoft Visual C++ Compiler Package for Python 2.7

下载链接

2.安装 MySQL Connector C 6.0.2

下载链接

3.下载 MySQL-python 1.2.5 源码包

下载链接

阅读全文 »

Python模块MSI安装错误_找不到Python路径

发表于 2018-01-07

以下代码保存为Python执行

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
    # script to register Python 2.0 or later for use with win32all
# and other extensions that require Python registry settings
#
# written by Joakim Loew for Secret Labs AB / PythonWare
#
# source:
#
http://www.pythonware.com/products/works/articles/regpy20.htm
#
# modified by Valentine Gogichashvili as described in http://www.mail-archive.com/distutils-sig@python.org/msg10512.html

import sys

from _winreg import *

# tweak as necessary
version = sys.version[:3]
installpath = sys.prefix

regpath = "SOFTWARE\\Python\\Pythoncore\\%s\\" % (version)
installkey = "InstallPath"
pythonkey = "PythonPath"
pythonpath = "%s;%s\\Lib\\;%s\\DLLs\\" % (
installpath, installpath, installpath
)


def RegisterPy():
try:
reg = OpenKey(HKEY_CURRENT_USER, regpath)
except EnvironmentError as e:
try:
reg = CreateKey(HKEY_CURRENT_USER, regpath)
SetValue(reg, installkey, REG_SZ, installpath)
SetValue(reg, pythonkey, REG_SZ, pythonpath)
CloseKey(reg)
except:
print "*** Unable to register!"
return
print "--- Python", version, "is now registered!"
return
if (QueryValue(reg, installkey) == installpath and
QueryValue(reg, pythonkey) == pythonpath):
CloseKey(reg)
print "=== Python", version, "is already registered!"
return
CloseKey(reg)
print "*** Unable to register!"
print "*** You probably have another Python installation!"


if __name__ == "__main__":
RegisterPy()

Ubuntu使用Postfix-Dovecot-MySQL搭建邮件服务器

发表于 2017-12-11

设置hostname

1
2
echo "mail.example.com" > /etc/hostname
hostname -f
阅读全文 »

Nginx反向代理Google

发表于 2017-10-05

基于Nginx扩展模块

https://github.com/cuber/ngx_http_google_filter_module/blob/master/README.zh-CN.md

0x01 安装 gcc & git

1
apt-get install build-essential git gcc g++ make

0x02 下载最新版源码

nginx 官网:
http://nginx.org/en/download.html

1
wget http://nginx.org/download/nginx-1.9.12.tar.gz

阅读全文 »
12

lidapao

13 日志
8 标签
RSS
© 2019 lidapao
由 Hexo 强力驱动 v3.7.1
|
主题 — NexT.Muse v6.3.0