自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(92)
  • 资源 (2)
  • 收藏
  • 关注

转载 centos 5的yum源无法使用的解决方法

由于centos 5 已经停更。于是导致yum源也不能用了。例如安装screen的时候提示Determining fastest mirrors* base: denver.gaminghost.co* extras: repos-tx.psychz.net* updates: mirrors.evowise.comhttp://denver.gaminghost.co/5.11/os/i386/...

2018-04-10 17:35:43 1513

原创 ajax 和layer结合使用

1 htmlindex.html 父窗口添加 $('#btn-add').on('click', function(){   layer.open({     type: 2,     title: '添加主机',     maxmin: true,     shadeClose: true, //点击遮罩关闭层     area : ['450

2018-02-04 16:51:29 4683

原创 Django 表单数据验证

1 html 文件表单             {% csrf_token %}            {{ obj.errors.username.0 }}            {{ obj.errors.pwd.0 }}            {{ obj.errors.email.0 }}              2 form模型 class

2018-02-01 18:50:03 1445

原创 ansible 简单优化

vi /etc/ansible/ansible.cfg[defaults]sh_args = -o ControlMaster=auto -o ControlPersist=5dpipelining = Truegathering = smartfact_caching_timeout = 86400fact_caching = jsonfilefact_caching

2018-01-24 10:41:59 327

原创 使用ansible 批量部署ssh免秘钥登录

1 创建ssh秘钥yum install epel-release -yyum install sshpass -yssh-keygen -t rsa2 批量复制秘钥并授权ansible web -m shell -a 'mkdir ~/.ssh' -kansible web -m copy -a 'src=~/.ssh/id_rsa.pub dest=~/.ssh

2018-01-23 11:02:19 6002

原创 shell 统计浏览器端ip和访问次数

统计nginx 访问浏览器客户端ip地址和访问次数,并且按访问次数大到小排序:日志格式:xxx|124.236.110.26|-|[17/Jan/2018:03:00:27 +0800]|GET /wzy_wifi71/a3/?dcwpf0dc4=1515990033590 HTTP/1.1|200|54217|http://xxx/a3/|Mozilla/5.0 (Linux; Android

2018-01-19 18:01:08 1170

原创 安装snort环境

1 lamp 安装yum install httpd -yyum install mysql-server mysql-devel -yyum install -y php php-mysql php-adodb php-pear php-gd libtool php-imap php-ldap php-mbstring php-odbc php-pecl-apcchkco

2018-01-15 16:55:15 590

原创 从键盘输入一个字符串,将小写字母全部转换成大写字母,然后输出到一个磁盘文件"test"中保存。

def write(): with open("test.txt",'r+') as f: str=raw_input("please input a string:\n") str=str.upper() f.write(str)if __name__ == '__main__': write()

2018-01-11 17:46:14 20473

原创 python 两个列表转换字典

#定义列表i=['a','b','c','d']l=[1,2,3]#转换字典dict(zip(i,l))

2018-01-11 17:38:43 5461

转载 TCP Ports list (3498 ports in list)

参考地址:https://www.gasmi.net/tcp.phpTCP Ports list (3498 ports in list)1tcpmuxTCP Port Service Multiplexer2compressnetManagement Utility3compressnetCompression Process

2018-01-11 16:09:15 331851

原创 python 操作hadoop

参考网站:http://arrow.apache.org/docs/python/filesystems.html#hadoop-file-system-hdfs环境:python 2.7.14 +pyarrow + hadoop 2.7系统配置File System InterfacesIn this section, we discuss filesyste

2018-01-10 10:42:20 3588

原创 conda的安装及使用

1 系统:centos 6.8 64位下载:https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh2 安装sh Miniconda3-latest-Linux-x86_64.sh3 基本操作使用查看已经安装的包conda list安装软件包conda install

2018-01-10 10:25:08 2086

转载 Fixing ImportError: cannot import name ‘urlencode’ in Python3

Problem:Your python 3.x interpreter prints the error messageImportError: cannot import name 'urlencode' Solution:As described by Fred Foo here on StackOverflow, Python3 contains 

2017-12-20 17:47:29 4729

原创 python使用ConfigParse解析配置文件

1 my.cnf 样板数据[client]port = 3306user = mysqlpassword = mysql[mysqld]basedir = /usrdatadir = /var/lib/mysqltmdir = /tmpskip-external-locking[mysql]host = 127.0.0.12  基本操作#! /u

2017-12-17 23:14:19 1143

原创 查看MySQL4种日志参数及配置

1 查看版本mysql> show variables like '%version';+------------------+---------------+| Variable_name    | Value         |+------------------+---------------+| innodb_version   | 5.7.20        |

2017-12-06 11:35:22 7463

原创 使用python 分析统计nginx访问日志ip次数并且排序

1 数据样本221.7.8.21 - - [05/Dec/2017:00:04:53 +0800] "GET /qbwx/ml_files/ss33.jpg HTTP/1.1"   "http://tt.xxx.cn/ocpc/haikang/ocpc/12?ETT02" "Mozilla/5.0 (Linux; Android 6.0.1; ATH-AL00 Build/HONORATH-A

2017-12-05 10:25:33 2501

原创 使用nginx代理kibana并设置身份验证

添加一个单独的nginx配置文件,设置转发server {    listen 8080;    auth_basic "kibana Access";    auth_basic_user_file /apps/nginx/conf/htpasswd;         location / {    proxy_pass http://10.26.3.49:5601; 

2017-11-28 09:52:28 1323

转载 mailx及sendEmail的基本用法比较

mailx安装我就不介绍了,很简单!我先介绍下系统的版本和mailx的版本12345[root@localhost ~]# mailx -V12.4 7/29/08[root@localhost ~]# cat /etc/issueCentOS release 6.8 (Final)

2017-11-22 15:37:12 6406

转载 CentOs 6.7 中文乱码解决

参考地址:http://blog.csdn.net/sinat_22767969/article/details/529887361:安装支持中文:[plain] view plain copyyum -y install chinese-support  2:修改字符编码配置文件:默认设置为英文:

2017-11-21 10:13:07 2315

转载 Postfix中如何删除邮件队列[mailq]中的邮件

postfix 如何删除队列中的邮件postsuper -d ALL[注意:大小写有区别,请注意大小写!]参考地址:http://blog.csdn.net/zubin006/article/details/2788161

2017-11-20 15:19:03 2928

转载 mysql监测工具tuning-primer.sh

参考地址:http://blog.csdn.net/ls3648098/article/details/9453811

2017-11-19 17:52:47 280

转载 awk 案例

1 awk命令总结  语法: awk [-F 分隔符 ] '命令' 文件名   awk内置变量  ARGC               命令行参数个数ARGV               命令行参数排列ENVIRON            支持队列中系统环境变量的使用FILENAME           awk浏览的文件名FNR               

2017-11-16 10:05:48 142

原创 测试web网页各地区网址

https://www.17ce.com/http://www.tingyun.com/tingyun_network.html

2017-10-31 17:22:00 497

原创 python 使用sys.stdin和fileinput读入标准输入

1 使用sys.stdin 读取标准输入[root@c6-ansible-20 script]# cat demo02.py #! /usr/bin/env pythonfrom __future__ import print_functionimport sysfor line in sys.stdin:    print(line,end="")

2017-10-30 22:32:18 1986

原创 Centos vim python 开发环境配置

Centos python 自动补全插件:pydiction1 Pydiction主要包含三个文件:python_pydiction.vim  -- Vim plugin that autocompletes Python code.complete-dict         -- Dictionary file of Python keywords, modules, etc

2017-10-30 10:08:25 751

原创 centos 6 中安装jdk

1 jdk安装文件自行官网下载http://www.oracle.com/technetwork/java/javase/downloads/index.html解压:tar xf jdk-8u121-linux-x64.tar.gz把文件移到local目录:mv jdk1.8.0_121 /usr/local/进入目录:cd /usr/local/jdk1.8.0_121

2017-10-27 10:51:47 225

原创 nagios监控使用pnp4nagios自定义模板画图实例

参考连接:https://github.com/June-Wang/NagiosPluginshttp://docs.pnp4nagios.org/pnp-0.6/tplhttp://www.itnms.info/discuz/forum.php?mod=viewthread&tid=2788&page=1

2017-10-26 16:45:17 541

转载 [Postfix] – warning: mail_queue_enter: create file maildrop Permission denied

After trying to setup postgrey, I had a lot of warning messages in my mail.log file like this:[plain] view plain copy print?May  7 12:26:19 gandalf postfix/postdrop[6065]: 

2017-10-24 17:09:19 2388

转载 xhprof 检查php分析性能

http://aofengblog.blog.163.com/blog/static/6317021201341851510578/

2017-10-19 17:44:04 165

转载 python权限设置

https://hui.lu/yong-hu-shu-ju-ku-biao-jie-gou-hua-fen/

2017-09-26 15:13:49 1556

原创 centos 6.5 安装lamp

1 安装apache:yum install httpd httpd-devel 启动apache:/etc/init.d/httpd start此时输入服务器的IP地址,应该看到apache的服务页面,端口不用输,apache默认就是使用80端口问题:[root@zabbix-10 html]# /etc/init.d/httpd startStarting

2017-09-25 17:55:04 339

原创 centos 6.8 清除内存中的系统缓存

# free -m             total       used       free     shared    buffers     cachedMem:         15936       7313       8623          0          3         90-/+ buffers/cache:       7219

2017-09-24 20:54:56 1614

原创 owncloud安装说明(英文)

https://doc.owncloud.org/server/10.0/admin_manual/installation/source_installation.html#prerequisites-label

2017-09-22 17:57:06 280

原创 tornado单线程服务器配置

import tornado.webimport tornado.httpserverimport tornado.optionsimport tornado.ioloopfrom tornado.options import define,optionsdefine("port",type=int,default=9000)#视图class I

2017-09-14 11:08:42 395

原创 tornado 多线程服务器配置

# coding:utf8import tornado.webimport tornado.ioloopimport tornado.optionsimport tornado.httpserverimport tornado.netutilimport tornado.processfrom tornado.options import options, de

2017-09-14 11:06:59 1783

转载 自动化部署必备技能—定制化RPM包

回顾下安装软件的三种方式:1、编译安装软件,优点是可以定制化安装目录、按需开启功能等,缺点是需要查找并实验出适合的编译参数,诸如MySQL之类的软件编译耗时过长。 2、yum安装软件,优点是全自动化安装,不需要为依赖问题发愁了,缺点是自主性太差,软件的功能、存放位置都已经固定好了,不易变更。 ===>如果你现在还为是使用编译安装软件还是使用yum安装软件发愁,那你就out了。 

2017-08-25 17:04:19 218

原创 windows 安装mysql-python

下载地址http://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python安装pip install MySQL_python-1.2.5-cp27-none-win_amd64.whl

2017-08-24 14:28:45 297

原创 使用python 发邮件

案例1 :简单文本格式#!usr/bin/env python #-*- coding:utf-8 -*- """ @author:zyb @file: mail.py @time: 2017/08/23 """import smtplibimport stringHOST='smtp.139.com' #定义smtp主机SUBJ

2017-08-23 10:54:35 371

原创 安装python 模块IPy

1 安装IPY模块 wget https://pypi.python.org/packages/source/I/IPy/IPy-0.81.tar.gz --no-check-certificate tar -xf IPy-0.81.tar.gz  cd IPy-0.81  python setup.py install

2017-08-22 16:55:35 1647

原创 【centos】 error: command 'gcc' failed with exit status 1

1 错误信息:centos error: command 'gcc' failed with exit status 13 原因及解决方法用安装Python模块出现error: command 'gcc' failed with exit status 1 ,明明装了gcc的,怎么会不行呢,然后发觉是failed不是not found,这说明这个错误个gcc没多大关系,

2017-08-22 16:29:58 814

Docker 虚拟化方案

Docker 是一个开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可移植的容器中,然后发布到任何流行的 Linux 机器上,也可以实现虚拟化

2018-05-24

C#登录设计界面

C#登录设计界面(不含数据库连接,实现窗体数据传递)

2014-06-23

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除