2017 年文章归档
共 9 篇文章
centos6.9中ftp的连接模式
filezilla server开启被动模式,指定端口4800, 在centos6.9中使用ftp -p 或pftp以被动方式来连接。 按理说应该没问题,ls命令将开启数据传输通道: ftp> ls 500 [GAP] not permission ftp CMD PASV Passive mode refused. 被动模式被拒绝,这个跟filezilla server没关系,在ubuntu下是正常的。 查看filezilla server的日志发现,客户端LIST指令没有发送,也没有发送PASV指令,而是直接报错。 换到主动模式,(因为防火墙的关系,主动模式肯定是不行的): ftp> p…
python3加载内存中的图像或保存图像到内存
from PIL import Image from io import BytesIO import urllib.request def getimg(url) data = urllib.request.urlopen(url).read() im = Image.open(BytesIO(data)) #... img_file = BytesIO() im.save(img_file, 'JPEG') return img_file.getvalue() 在处理图片时,这个方式可以不使用临时文件,所有处理只在内存进行。
pyftpdlib中文件乱码
pyftpdlib内部使用utf8,而windows使用gbk,可以将pyftpdlib进行修改: 1、filesystems.py AbstractedFS.format_list与AbstractedFS.format_list最后一行 yield line.encode('utf8', self.cmd_channel.unicode_errors) utf8改为gbk 2、handlers.py FTPHandler.decode return bytes.decode('utf8', self.unicode_errors) utf8改为gbk https://github.com…
winxp l2tp without ipsec
winxp默认会使用ipsec来加密l2tp,可以通过修改注册表来取消。win7好像没这个问题。 HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Rasman\Parameters Add the following registry value to this key: Value Name: ProhibitIpSec Data Type: REG_DWORD Value: 1 https://support.microsoft.com/en-us/help/258261/disabling-ipsec-policy-used-w…
python studying
线程同步机制: Locks, RLocks, Semaphores, Conditions, Events和Queues http://yoyzhou.github.io/blog/2013/02/28/python-threads-synchronization-locks/ http://xiaorui.cc/2015/07/10/%E6%89%AF%E6%89%AFpython%E7%9A%84%E5%A4%9A%E7%BA%BF%E7%A8%8B%E7%9A%84%E5%90%8C%E6%AD%A5%E9%94%81-lock-rlock-semaphore-event-condit…
2017-03-04 11:24
imbox收取163邮件报错
开始报的这个: command SEARCH illegal in state AUTH, only allowed in states SELECTED 死活找不到原因,Traceback里提示: File "/usr/lib/python3.5/imaplib.py", line 863, in uid ', '.join(Commands[command]))) 于是打开imaplib.py找SELECTED,在731行找到: self.state = 'AUTH' # Might have been 'SELECTED' 在上面的729行找到: typ, dat = self._si…
free sms and phone
sms https://globfone.com/send-text/ phone https://www.sendatext.co/
2017-02-24 23:58
python在crontab执行不成功
环境变量的问题,归根是字符编码的问题。各种弯路。 办法如下: crontab -e #开头加入 LC_CTYPE="zh_CN.utf-8"
vps收集
https://indovirtue.com/ 对大陆速度好 https://www.gigsgigscloud.com/hongkong-openvz/ http://www.germanvps.com/ger-linux-vps-ovz.php https://sentris.net/ https://iniz.com/singapore-vps https://xvmlabs.com/ https://www.vpscheap.net/pricing.aspx https://virmach.com/ https://www.alpharacks.com http://123syste…