ITeye博客

wangmingming2008的博客

wangmingming2008 · 共 25 篇文章

my vim config

set encoding=utf-8 set nocompatible " be iMproved, required filetype off " required " set the runtime path to include Vundle and initialize set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() " alternatively, pass a path where Vundle should install plugins "call vundle#begin('~/some/path/here') "…

2015-10-30 13:43 · 2015 · 评论(0)

Django文档——Model字段选项(Field Options)

建立一个简易Model class Person(models.Model): GENDER_CHOICES=( (1,'Male'), (2,'Female'), ) name=models.CharField(max_length=30,unique=True,verbose_name='姓 名') birthday=models.DateField(blank=True,null=True) gender=models.IntegerField(choices=GENDER_CHOICES) account=models.IntegerField(default=0) blank 设置…

2015-05-15 16:14 · 2015 · 评论(0)

linux下IPTABLES配置详解

如果你的IPTABLES基础知识还不了解,建议先去看看. 开始配置 我们来配置一个filter表的防火墙. (1)查看本机关于IPTABLES的设置情况 iptables -L -n Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination Chain RH-Firewa…

2015-03-20 20:59 · 2015 · 评论(0)

9个常用iptables配置实例

iptables命令可用于配置Linux的包过滤规则,常用于实现防火墙、NAT。咋一看iptables的配置很复杂,掌握规律后,其实用iptables完成指定任务并不难,下面我们通过具体实例,学习iptables的详细用法。 1.删除已有规则 在新设定iptables规则时,我们一般先确保旧规则被清除,用以下命令清除旧规则: iptables -F (or iptables --flush) 2.设置chain策略 对于filter table,默认的chain策略为ACCEPT,我们可以通过以下命令修改chain的策略: iptables -P INPUT DROP iptables -P…

2015-03-20 20:58 · 2015 · 评论(0)

nginx for nba nginx.conf

#user nobody; worker_processes 100; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 65535; } http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user …

2014-10-08 16:32 · 2014 · 评论(0)

nginx for slots nginx.conf

#user nobody; worker_processes 8; worker_cpu_affinity 00000001 00000010 00000100 00001000 00010000 00100000 01000000 10000000; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; worker_rlimit_nofile 65536; events { use epoll; worker_con…

2014-10-08 16:26 · 2014 · 评论(0)

在eclipse下启动resin的相关配置

Main class:com.caucho.server.resin.Resin Arguments program arguments: -conf "D:\mj_server\resin-pro-3.1.12\conf\resin.conf" VM arguments: -Dresin.home="D:\mj_server\resin-pro-3.1.12" -Djava.util.logging.manager=com.caucho.log.LogManagerImpl -Xms512M -Xmx1G resin.conf

2014-09-18 10:59 · 2014 · 评论(0)

shell ssh login script and awk used

pwz:ssh $ cat goto.sh #/bin/bash _go=$1 _ip_config=/Users/pwz/ssh/game_ip.config if ;then echo "game_ip.config file not found in the path:"$_ip_config return fi #gtip=echo awk -F: '($1==$_go){print $2}' $_ip_config #echo $gtip for game_ip in $(awk -F: '{print $0}' $_ip_config); do #echo $game_ip ga…

2014-04-13 19:10 · 评论(0)

Linux查看连接数

1)统计80端口连接数 netstat -nat | grep -i "80" | wc -l 1 2)统计httpd协议连接数 ps -ef | grep httpd | wc -l 1 3)、统计已连接上的,状态为“established' netstat -na | grep ESTABLISHED | wc -l 2 4)、查出哪个IP地址连接最多,将其封了。 netstat -na | grep ESTABLISHED | awk '{print$5}' | awk -F : '{print$1}' | sort | uniq -c | sort -r +0n netstat - …

2013-11-04 17:04 · 2013 · 评论(0)

一个对字符串处理的SQL

某表中有一个json格式的字段 如props里有以下字符 {"1":36,"2":54,"3":160,"4":8,"5":767680,"6":12,"7":1,"8":8, "13":"14,17,21,20,23,22,25,24,29,28,31,30,34,35,32,33,39,96,42,43,108,40,41,107,44,116,115,114,112,125,124", "14":{"15":"0","13":"3","14":"0","11":"3","12":"3","3":"56","2":"38","1":"56","10":"4","7":"40","6":"…

2013-10-16 11:04 · 2013 · 评论(1)

shell 脚本 实现简单的定时查库发邮件

vi ip.txt #iostest_tw=10.52. . #iostest_kr=10.52. . imop_tw_s1=10.52. . imop_tw_s2=10.52. . imop_tw_s3=10.52. . ko_kr_s1=10.52. . #每天早上10点执行 crontab -e 00 10 * * * /root/action_shell/export.sh >> /root/action_shell/mail.log #! /bin/sh last_data=$(date -d last-day +%Y_%m_%d); cat /dev/null > $last_d…

2013-08-22 11:12 · 2013 · 评论(0)

mysql procedure cursor

SET CHARACTER_SET_CLIENT=utf8; SET CHARACTER_SET_CONNECTION=utf8; use tr; delimiter // drop procedure if exists blackscreen_reward; CREATE PROCEDURE blackscreen_reward() BEGIN DECLARE uid, tag BIGINT; DECLARE cur CURSOR FOR select passportId from t_character_info where lastLoginTime >= "2013-08-15 …

2013-08-22 10:31 · 2013 · 评论(0)

MySQL新建用户,授权,删除用户,修改密码

转自:http://www.cnblogs.com/analyzer/articles/1045072.html 首先要声明一下:一般情况下,修改MySQL密码,授权,是需要有mysql里的root权限的。 注:本操作是在WIN命令提示符下,phpMyAdmin同样适用。 用户:phplamp 用户数据库:phplampDB 1.新建用户。 //登录MYSQL @>mysql -u root -p @>密码 //创建用户 mysql> insert into mysql.user(Host,User,Password) values("localhost","phplamp",passwor…

2012-12-07 15:14 · 2012 · 评论(0)

linux:md5sum命令

linux:md5sum命令 MD5算法常常被用来验证网络文件传输的完整性,防止文件被人篡改。MD5 全称是报文摘要算法(Message-Digest Algorithm 5),此算法对任意长度的信息逐位进行计算,产生一个二进制长度为128位(十六进制长度就是32位)的“指纹”(或称“报文摘要”),不同的文件产生相 同的报文摘要的可能性是非常非常之小的。 在Linux或Unix上,md5sum是用来计算和校验文件报文摘要的工具程序。一般来说,安装了Linux后,就会有md5sum这个工具,直接在命令行终端直接运行。 1、使用md5sum来产生指纹(报文摘要)命令如下: md5sum file…

2012-05-31 09:25 · 2012 · 评论(0)

以下为秒的关系说明

10的18次方 |艾[可萨] | E 10的15次方 |拍[它] | P 10的12次方 |太[拉] | T 10的 9次方 |吉[咖] | G 10的 6次方 | 兆 | M 10的 3次方 | 千 | k 10的 2次方 | 百 | h 10的 1次方 | 十 | da 10的-1次方 | 分 | d 10的-2次方 | 厘 | c 10的-3次方 | 毫 | ms millisecond 10的-6次方 | 微 | μs microsecond 10的-9次方 | 纳[诺] | ns nanosecond 也叫毫微秒 10的-12次方| 皮[可] | ps picosecond 10的…

2012-05-28 10:55 · 评论(0)