This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
host=$1 | |
port=$2 | |
redis-cli -h $host -p $port client list | awk '{print $2}'| cut -d = -f 2| cut -d : -f 1 | sort | uniq -c | sort -rn | awk '{"host " $2 | getline h; print $1 " " $2 " " h;}'| awk '{print $1 " " $2 " " $7}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#redis 源ip | |
src_ip=xxx.cache.amazonaws.com.cn | |
#redis 源port | |
src_port=6379 | |
src_db=0 | |
#redis 目的ip | |
dest_ip=xxx.cache.amazonaws.com.cn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CommonUtil { | |
public static String limitedString(String str, int lengthLimit) { | |
if (StringUtils.isEmpty(str)) { | |
return str; | |
} | |
if (str.length() > lengthLimit) { | |
str = str.substring(0, lengthLimit) + "...(data too long)"; | |
} | |
return str; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component | |
public class SpringUtil implements ApplicationContextAware { | |
/** | |
* Spring应用上下文环境 | |
*/ | |
private static ApplicationContext applicationContext; | |
/** | |
* 获取对象 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.text.DecimalFormat; | |
import java.text.ParseException; | |
import java.text.SimpleDateFormat; | |
import java.util.*; | |
public class DateUtils { | |
/** | |
* 格式1 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.alibaba.fastjson.JSON; | |
import com.alibaba.fastjson.JSONObject; | |
import com.alibaba.fastjson.parser.Feature; | |
import de.odysseus.staxon.json.JsonXMLConfig; | |
import de.odysseus.staxon.json.JsonXMLConfigBuilder; | |
import de.odysseus.staxon.json.JsonXMLInputFactory; | |
import de.odysseus.staxon.json.JsonXMLOutputFactory; | |
import de.odysseus.staxon.xml.util.PrettyXMLEventWriter; | |
import javax.xml.stream.XMLEventReader; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TreeNode { | |
int val; | |
TreeNode left; | |
TreeNode right; | |
TreeNode(int x) { | |
val = x; | |
} | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import javax.servlet.http.HttpServletRequest; | |
import java.net.InetAddress; | |
import java.net.UnknownHostException; | |
/** | |
* RequestUtil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
/** | |
* 正则工具类 | |
*/ | |
public class RegexExtUtil { | |
private static Pattern PATTERN_TEL = Pattern.compile("([0-9]+(\\-){0,1})+[0-9]$"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import javax.imageio.ImageIO; | |
import java.awt.*; | |
import java.awt.image.BufferedImage; | |
import java.io.File; | |
import java.io.IOException; | |
import java.util.Arrays; |
NewerOlder