ITeye博客

wingware

wingware · 共 62 篇文章

test

127.0.0.1 cpro.baidu.com 127.0.0.1 cm.pos.baidu.com 127.0.0.1 wangmeng.baidu.com 127.0.0.1 js.union-wifi.com 127.0.0.1 dup.baidustatic.com 127.0.0.1 cpro.baidustatic.com 127.0.0.1 rcv.union-wifi.com 127.0.0.1 pos.baidu.com 127.0.0.1 101.201.53.95 127.0.0.1 dup.baidustatic.com 127.0.0.1 cpro.baidust…

2017-06-21 17:24 · 评论(0)

防止常见XSS 过滤 SQL注入 JAVA过滤器filter

XSS : 跨站脚本攻击(Cross Site Scripting),为不和层叠样式表(Cascading Style Sheets, CSS)的缩写混淆,故将跨站脚本攻击缩写为XSS。恶意攻击者往Web页面里插入恶意html代码,当用户浏览该页之时,嵌入其中Web里面的html代码会被执行,从而达到恶意攻击用户的特殊目的。 sql注入 所谓SQL注入,就是通过把SQL命令插入到Web表单提交或输入域名或页面请求的查询字符串,最终达到欺骗服务器执行恶意的SQL命令。具体来说,它是利用现有应用程序,将(恶意)的SQL命令注入到后台数据库引擎执行的能力,它可以通过在Web表单中输入(恶意)SQL…

2016-12-10 14:30 · 评论(0)

京东价格图片识别

当做图片识别用tesseract,需要分布式跨平台部署时,依赖tesseract的cmd命令识别就感觉不太靠谱了。 import java.awt.Color; import java.awt.image.BufferedImage; import java.io.IOException; import java.net.URL; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import javax.imageio.ImageIO; import org.apache.log4j.Lo…

2013-04-18 12:38 · 评论(0)

iptable规则

开放以下端口 22122 23000 8080 8088 iptables -A INPUT -p tcp --dport 8080 -j ACCEPT iptables -A INPUT -p tcp --dport 8088 -j ACCEPT iptables -A INPUT -p tcp --dport 22122 -j ACCEPT iptables -A INPUT -p tcp --dport 23000 -j ACCEPT iptables -A OUTPUT -p tcp --dport 8080 -j ACCEPT iptables -A OUTPUT -p tcp -…

2013-01-09 12:20 · 评论(0)

java zip压缩文件中文乱码

1.解压文件 public static Map<String,File> unzip(File zipFile) throws IOException { Map<String,File> map = new Hashtable<String,File>(); org.apache.tools.zip.ZipFile zfile = new org.apache.tools.zip.ZipFile(zipFile,"GBK"); Enumeration<?> enumeration = zfile.getEntries(); InputStream is = null; while (en…

2012-12-27 19:39 · 评论(0)

动态编译、加载类

package com.crnielsen.tag; import java.io.ByteArrayOutputStream; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.lang.reflect.Method; import java.util.Arrays; import javax.tools.DiagnosticCollector; import javax.tools.J…

2012-12-24 09:48 · 评论(0)

查看linux版本信息

cat /etc/issue cat /proc/version lsb_release -a ---查询CPU信息--- cat /proc/stat

2012-10-21 11:50 · 评论(0)

Shell获取当前路径

PRG="$0" while [ -h "$prg" ]; do ls=`ls -ld "$PRG"` link=`expr "$ls" : '.*-> \(.*\)$'` if expr "$link" : '/.*' > /dev/null; then PRG="$link" else PRG=`dirname "$PRG"`/"$link" fi done PRGDIR=`dirname "$PRG"` [ -z "$catalina_home" ] && CATALINA_HOME=`cd "$PRGDIR/.." >/dev/null; pwd` echo "catalina_ho…

2012-10-21 11:38 · 评论(0)

native2ascii

1、转换properties文件 native2ascii -decoding UTF-8 allMessages_zh_CN.input.properties allMessages_zh_CN.properties 将文件allMessages_zh_CN.input.properties编码后输出为allMessages_zh_CN.properties。 为了方便properties文件的管理,建议纯中文的配置文件用input命名。 2、反向单一properties文件 native2ascii -reverse allMessages_zh_CN.properties allMes…

2012-09-14 01:11 · 评论(0)

resin的自动拉起脚本,检测僵死进程

#! /bin/sh # # See contrib/init.resin for /etc/rc.d/init.d startup script # # resin.sh can be called like apachectl # # resin.sh -- execs resin in the foreground # resin.sh start -- starts resin in the background # resin.sh stop -- stops resin # resin.sh restart -- restarts resin # # resin.sh will …

2012-08-19 18:35 · 评论(0)

多线性,高并发,异步非阻塞执行

import java.util.ArrayList; import java.util.List; import java.util.Vector; import java.util.concurrent.atomic.AtomicInteger; public class Test { public static void main(String args[]) throws Exception { //记录开始时间 long begin = System.currentTimeMillis(); //执行范围 10000次 int count = 10000; /** 执行结果集 */…

2012-08-13 17:28 · 评论(0)

修改resin的自动拉起

#! /bin/sh # # See contrib/init.resin for /etc/rc.d/init.d startup script # # resin.sh can be called like apachectl # # resin.sh -- execs resin in the foreground # resin.sh start -- starts resin in the background # resin.sh stop -- stops resin # resin.sh restart -- restarts resin # # resin.sh will …

2012-08-08 13:27 · 评论(0)

imconnector

imconnector_2012-08-04

2012-08-04 17:52 · 评论(0)

判断是否为GZIPInputStream格式(gzip压缩格式)

InputStream ips = null; // 取前两个字节 byte[] header = new byte[2]; if (isGzip()) { try { BufferedInputStream bis = new BufferedInputStream(connection.getInputStream()); bis.mark(2); int result = bis.read(header); // reset输入流到开始位置 bis.reset(); // 判断是否是GZIP格式 int ss = (header[0] & 0xff) | ((header[1] & 0…

2012-08-03 18:15 · 评论(0)

mina_server

http协议header中,异步socket(nio、mina)中必须指定其Content-Length的长度,才算结束。 /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this …

2012-07-19 16:28 · 评论(0)