摘要: 执行yum的各种命令时报以下错误,如yum list: Fatal Python error: pycurl: libcurl link-time version is older than compile-time versionAborted 解决: 1、安装setuptools wget -- 阅读全文
posted @ 2019-07-12 11:42 浆糊jun 阅读(4220) 评论(0) 推荐(0) 编辑
摘要: U盘安装centos7启动过程中出现: [ok] Reached target Basic System 或者 [ok] starting dracut initqueue hook 到下一行就不动了,一直没有反应!然后网上搜问题找答案 解决办法参考: U盘安装CentOS时停在Reached ta 阅读全文
posted @ 2019-03-25 18:33 浆糊jun 阅读(2686) 评论(0) 推荐(0) 编辑
摘要: 能正常查看kvm虚拟机列表: virsh list 但在执行virsh start lb启动虚拟机时卡顿了好几秒,然后报以下错误: error: Failed to start domain lberror: Failed to activate service 'org.freedesktop.m 阅读全文
posted @ 2019-03-24 14:57 浆糊jun 阅读(4518) 评论(0) 推荐(0) 编辑
摘要: 服务器版本:CentOS Linux release 7.4 Linux lb 3.10.0-693.el7.x86_64 #1 SMP Tue Aug 22 21:09:27 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux 参考:https://www.cnblog 阅读全文
posted @ 2019-03-19 17:59 浆糊jun 阅读(3758) 评论(0) 推荐(0) 编辑
摘要: 用postman的post方法访问某个URL时,出现以下错误: { "status": "1", "message": " Internal Server Error", "errors": { "info": "Too Many Attempts." }} 这是因为Laravel从5.2开始,增加 阅读全文
posted @ 2019-03-08 11:44 浆糊jun 阅读(3242) 评论(0) 推荐(0) 编辑
摘要: 执行composer install后报错: When I run command: composer install it creating error. And also how to install extension on php.init. 解决办法: composer update -- 阅读全文
posted @ 2019-02-19 17:48 浆糊jun 阅读(2783) 评论(0) 推荐(0) 编辑
摘要: 执行composer install后报以下错误: Problem 1 - laravel/horizon v1.4.3 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system. - 阅读全文
posted @ 2019-02-19 17:47 浆糊jun 阅读(2073) 评论(0) 推荐(1) 编辑
摘要: 执行composer install后报以下错误: Loading composer repositories with package informationInstalling dependencies (including require-dev) from lock fileYour req 阅读全文
posted @ 2019-02-19 17:41 浆糊jun 阅读(5576) 评论(0) 推荐(0) 编辑
摘要: 执行ldconfig命令后报错: 目录 /lib 中的 libpng.so 和 libpng15.so.15.13.0 的 so 名称相同但类型不同。 解决过程: mv /lib/libpng.so /lib/libpng.so-bakln -s /usr/lib/libpng15.so.15.13 阅读全文
posted @ 2019-02-19 11:20 浆糊jun 阅读(2392) 评论(0) 推荐(0) 编辑
摘要: 一般情况下,同一台服务器上如果要配置多个带有SSL证书的https网站,那么网站的端口号不能相同,要不然两个站点有可能会冲突(使用tls协议),造成不能同时访问。 如要完美解决,方法如下: 重新编译nginx,在 ./configure 中添加参数:--with-openssl-opt="enabl 阅读全文
posted @ 2018-09-28 18:55 浆糊jun 阅读(3305) 评论(0) 推荐(0) 编辑
摘要: 如果是提示文件冲突: svn revert --depth=infinity 有冲突的文件名 如果提示目录有冲突: svn revert --depth=infinity 目录名 搞定。 阅读全文
posted @ 2018-09-05 17:31 浆糊jun 阅读(1910) 评论(0) 推荐(0) 编辑
摘要: 在阿里云上部署了zabbix,一直能正常接收到zbx发来的报警邮件(报警邮箱是163的),不知是什么原因,突然无法接收到报警邮件了。 但在服务器上手动执行echo "hello"|mail -s "Test email" admin@xxxx.com,发现可以正常接收。手动测试报警脚本也能正常接收, 阅读全文
posted @ 2018-08-27 17:25 浆糊jun 阅读(481) 评论(0) 推荐(0) 编辑
摘要: 执行 npm install socket.io安装时报错: 解决方法: 命令行中输入: 再输入 npm install -g socket.io 即可正确安装。 阅读全文
posted @ 2018-08-25 18:13 浆糊jun 阅读(2414) 评论(0) 推荐(0) 编辑
摘要: 目前服务器上每日会产生备份文件,需要使用winscp工具把备份同步到本地PC机硬盘上。平时都是图形界面用鼠标点击方式来同步的,效率低下,因此编写了winscp自动同步脚本,并加入到计划任务中定时自动运行。 1.在linux服务器创建备份专用帐号: 2.创建WINSCP同步脚本 c:\SERV_BAK 阅读全文
posted @ 2018-08-10 14:36 浆糊jun 阅读(4603) 评论(0) 推荐(0) 编辑
摘要: 在阿里云直接使用echo xxx|mail -s "title" xxx@xxx.com 无法发送邮件了,必须修改配置才行。 阅读全文
posted @ 2018-05-04 16:45 浆糊jun 阅读(1026) 评论(0) 推荐(0) 编辑
摘要: 在centos下安装了go1.9.1版本,编译go-ethereum时报错: [root@localhost go-ethereum]# make gethbuild/env.sh go run build/ci.go install ./cmd/geth>>> /usr/local/go/bin/ 阅读全文
posted @ 2018-03-29 12:41 浆糊jun 阅读(2679) 评论(2) 推荐(0) 编辑
摘要: 系统环境: centos7.2 zabbix-3.4 一、原理 通过以下命令查看mongodb的状态: echo "db.serverStatus()" | mongo admin echo "db.serverStatus().opcounters" | mongo admin 二、配置过程 1. 阅读全文
posted @ 2017-10-26 13:47 浆糊jun 阅读(5926) 评论(3) 推荐(0) 编辑
摘要: #%s为变量的占位符,s是string的简写,可接受字符。 %d也是占位符,用于接受数字name = input("name:")age = input("age:")job = input("job:")info = """ info %s name:%sage:%sjob:%s""" % (na 阅读全文
posted @ 2017-10-25 10:39 浆糊jun 阅读(1856) 评论(0) 推荐(0) 编辑
摘要: '''一、设计好目录结构:1.可读性高2.可维护性高二、目录组织方式:组织一个较好的Python工程目录结构,已经有一些得到了共识的目录结构:假设你的项目名为ATM:ATM/|-- bin/| |-- __init__| |-- start.py||-- core/| |-- tests/| | | 阅读全文
posted @ 2017-10-25 10:39 浆糊jun 阅读(937) 评论(0) 推荐(0) 编辑
摘要: import random#生成0到1之间的随机浮点数print(random.random())#生成1到7之间的随机整数(包括1和7)print(random.randint(1,7))#在从[10,12,14,16,...,98]序列中获取一个随机数:print(random.randrang 阅读全文
posted @ 2017-10-25 10:38 浆糊jun 阅读(216) 评论(0) 推荐(0) 编辑
摘要: #购物车程序gongzi = input("请输入您的工资:")if gongzi.isdigit(): #判断变量是否为正整数,包括0 gongzi = int(gongzi)else: print("无效的工资,退出") exit()shangping = ['iphone','mac book 阅读全文
posted @ 2017-10-25 10:37 浆糊jun 阅读(230) 评论(0) 推荐(0) 编辑
摘要: list_1 = [1,2,3,4,5,6,7,8,9]list_1 = set(list_1)print(list_1)list_2 = set([2,4,6,8])print(list_2,"\n")list_3 = list_1.intersection(list_2) #求list_1与li 阅读全文
posted @ 2017-10-25 10:37 浆糊jun 阅读(367) 评论(0) 推荐(0) 编辑
摘要: for i in range(10): #特殊写法,从0开始,步长为1,最大值小于10 print("loop",i)print(" ")for i in range(3,9,2): #从3开始,步长为2,最大值小于9 print("loop",i)#在python命令行执行,结果是[0,2,4,6 阅读全文
posted @ 2017-10-25 10:37 浆糊jun 阅读(231) 评论(0) 推荐(0) 编辑
摘要: import getpassusername=input("username:")password=getpass.getpass("password:")print("Welcome user {_name} login..." .format(_name=username)) 阅读全文
posted @ 2017-10-25 10:36 浆糊jun 阅读(201) 评论(0) 推荐(0) 编辑
摘要: #装饰器:本质是函数,装饰其他函数。就是为其它函数添加附加功能。#timer(): #装饰器函数# 嵌套子函数(*args,**kwargs):# test1()# return 嵌套子函数名#test1() #被装饰的函数#原则:#1.不能修改被装饰的函数的源代码#2.不能修改被装饰的函数的调用方 阅读全文
posted @ 2017-10-25 10:35 浆糊jun 阅读(183) 评论(0) 推荐(0) 编辑
摘要: import time#打印时间戳print(time.time())#tm_yday:一年的第几天 tm_isdst:是否为夏令时print(time.localtime())#打印时区:-28800秒=8小时print(time.timezone)#暂停3秒time.sleep(0.1)prin 阅读全文
posted @ 2017-10-25 10:34 浆糊jun 阅读(141) 评论(0) 推荐(0) 编辑
摘要: names = ['aa', 'bb', 'cc', 'dd']for name in enumerate(names): print(name)# (0, 'aa')# (1, 'bb')# (2, 'cc')# (3, 'dd')print("")for index,name in enumer 阅读全文
posted @ 2017-10-25 10:34 浆糊jun 阅读(148) 评论(0) 推荐(0) 编辑
摘要: import pickle,json'''#把变量从内存中变成可存储或传输的过程称之为序列化#如果我们要在不同的编程语言之间传递对象,就必须把对象序列化为标准格式,#比如XML,但更好的方法是序列化为JSON,因为JSON表示出来就是一个字符串,#可以被所有语言读取,也可以方便地存储到磁盘或者通过网 阅读全文
posted @ 2017-10-25 10:33 浆糊jun 阅读(132) 评论(0) 推荐(0) 编辑
摘要: #文件的几种打开模式:r,w,a追加,# r+:读+追加模式(python3),读+任意位置写模式(python2)# w+:读写模式# a+:追加读写# rb:二进制方式打开,以byte方式显示,要与encoding='utf-8'一起使用。使用场景:跨平台(win\linux)# wb:二进制方 阅读全文
posted @ 2017-10-25 10:33 浆糊jun 阅读(224) 评论(0) 推荐(0) 编辑
摘要: name = 'alex jack'print(name)print(name.capitalize()) #行首字母大写print(name.count("a")) #统计字母a的个数print(name.center(20,"-")) #共打印20个字符,变量值居中,剩下的用-填充print(" 阅读全文
posted @ 2017-10-25 10:32 浆糊jun 阅读(120) 评论(0) 推荐(0) 编辑
摘要: # ascii码:英文字母、数字、特殊字符# 扩展ascii码:ascii码的扩展,增加了拉丁文# GB2312:对ascii的中文扩展。简体中文的字符集编码。包含7000多汉字# GB18030和GBK:GBK是对GB2312的扩展,包括了GB2312所有内容,增加近2万汉字和符号# unicod 阅读全文
posted @ 2017-10-25 10:32 浆糊jun 阅读(438) 评论(0) 推荐(0) 编辑
摘要: name = input("name:")age = int(input("age:"))job = input("job:")info = """ info {_name} name:{_name}age:{_age}job:{_job}""" .format(_name=name, _age=a 阅读全文
posted @ 2017-10-25 10:31 浆糊jun 阅读(274) 评论(0) 推荐(0) 编辑
摘要: import os#获取当前工作目录print(os.getcwd())#改变当前目录路径os.chdir(r"c:\Users") #如不加上r,则反斜线要加反斜线符号进行转义print(os.getcwd())#返回当前目录 .print(os.curdir)#返回上一级目录 ..print(o 阅读全文
posted @ 2017-10-25 10:30 浆糊jun 阅读(188) 评论(0) 推荐(0) 编辑
摘要: names = ['a','b','c','d','e','f','g']print(names)#修改元素:names[0]='A'print(names)#追加元素:names.append('h')print(names)#插入元素:names.insert(3,'j')print(names 阅读全文
posted @ 2017-10-25 10:30 浆糊jun 阅读(170) 评论(0) 推荐(0) 编辑
摘要: import shutil#shutil 是高级的文件、文件夹、压缩包处理模块。#将文件old1.txt内容拷贝到文件new1.txt中shutil.copyfileobj(open('old1.txt','r'),open('new1.txt','w'))#将old1.txt复制一份为new2.t 阅读全文
posted @ 2017-10-25 10:15 浆糊jun 阅读(181) 评论(0) 推荐(0) 编辑
摘要: import logginglogging.basicConfig(filename='access.log', #生成access.log文件 format='%(asctime)s - %(name)s - %(levelname)s -%(module)s: %(message)s', #定义 阅读全文
posted @ 2017-10-25 10:14 浆糊jun 阅读(219) 评论(0) 推荐(0) 编辑
摘要: #shelve是一额简单的数据存储方案,他只有一个函数就是open(),这个函数接收一个参数就是文件名,# 然后返回一个shelf对象,你可以用他来存储东西,就可以简单的把他当作一个字典,# 当你存储完毕的时候,就调用close函数来关闭。import shelvef=shelve.open('us 阅读全文
posted @ 2017-10-25 10:14 浆糊jun 阅读(385) 评论(0) 推荐(0) 编辑
摘要: #一边循环,一边计算的机制,称为生成器generator。generator保存的是算法,可推算出列表中的某个元素值,可节省大量的存储空间#生成器:只有在调用的时候才会生成相应的数据。只记录当前位置。#只有一个__next__()方法#要把函数变成生成器,只需把print命令改为:yield命令即可 阅读全文
posted @ 2017-10-25 10:13 浆糊jun 阅读(187) 评论(0) 推荐(0) 编辑
摘要: def test1(): print("Hello,world!") return 0 #结束函数,并返回0,该值可传递给变量。当不写return时,返回:Nonex = test1()print(x)def test2(): print("Hello,world!") return 1,'hell 阅读全文
posted @ 2017-10-25 10:13 浆糊jun 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 利用 PROMPT_COMMAND 实现命令审计功能:记录什么用户,在什么时间,做了什么操作,然后将查到的信息记录到一个文件里。 具体操作: 将以下内容追加到/etc/profile: #############日志审计chmod +s /usr/bin/chmod &> /dev/null #让普 阅读全文
posted @ 2017-10-24 17:51 浆糊jun 阅读(1694) 评论(0) 推荐(0) 编辑