Java中,Integer,Long等都是有-127~128的缓存的,利用反射: 可以达到攻击目的
Field value = Integer.class.getDeclaredField("value");
value.setAccessible(true);
value.set(42, 43);
同样,String这个“不变”对象也可以:
@echo off | |
set /p path=path: | |
set /p user=user: | |
rem 我们需要修改文件或目录的所有者 | |
takeown /F %path% /R | |
rem 给用户授权文件夹或文件的完全控制权限 |
#list all changed flags | |
-XX:+PrintCommandLineFlags | |
#list all changeable flags and final default values | |
-XX:+PrintFlagsFinal | |
#list all changeable flags and initial default values | |
-XX:+PrintFlagsInitial | |
eg: |
# coding=utf-8 | |
__author__ = 'lichengwu' | |
import datetime | |
import re | |
''' | |
Garbage First Log Analyse Util | |
''' |
Java中,Integer,Long等都是有-127~128的缓存的,利用反射: 可以达到攻击目的
Field value = Integer.class.getDeclaredField("value");
value.setAccessible(true);
value.set(42, 43);
同样,String这个“不变”对象也可以:
/** | |
* 最简单的方式把一个InputStream转换成String | |
* | |
* @author lichengwu | |
* @version 1.0 | |
* @created 2013-12-28 10:37 AM | |
*/ | |
public class InputStreamAsString { | |
public static void main(String[] args) throws IOException { |
#!/usr/bin/python | |
#encoding=gbk | |
__author__ = 'lichengwu' | |
import pexpect | |
import sys | |
import getopt | |
import time | |
import os | |
def run_command(ip, user, password, cmd, tmo=600): |
#!/bin/sh | |
DESC="Jenkins CI Server" | |
NAME=jenkins | |
PIDFILE=/var/run/$NAME.pid | |
RUN_AS=admin | |
COMMAND=JAVA_TOOL_OPTIONS=-Dfile.encoding=GBK /opt/taobao/java64/bin/java -jar -server -Xms2048m -Xmx2048m -XX:NewSize=320m -XX:MaxNewS | |
ize=320m -XX:PermSize=128m -XX:MaxPermSize=256m /usr/lib/jenkins/jenkins.war --httpPort=9000 | |
#COMMAND=/opt/taobao/java/bin/java -jar /home/jenkins/jenkins.war |
/** | |
* gc monitoring only on jdk7 or later | |
* | |
* @author lichengwu | |
* @version 1.0 | |
* @created 2013-09-14 10:44 PM | |
*/ | |
public class GCMonitoring { |
/** | |
* lazy init by placeholder(thread safe) | |
* | |
* @author lichengwu | |
* @version 1.0 | |
* @created 2013-01-31 10:19 PM | |
*/ | |
public class Resource { | |
public static Resource getInstance() { |
/********************************************************** | |
mail.meituan.com | |
@author:lichengwu | |
@created:2013-01-11 | |
@version:1.0 | |
**********************************************************/ | |
var name="Meituan Mail"; | |
var ver="2013-01-11"; | |
function init(){ |