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.apache.commons.lang3.Validate; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.beans.factory.DisposableBean; | |
import org.springframework.context.ApplicationContext; | |
import org.springframework.context.ApplicationContextAware; | |
import org.springframework.context.annotation.Lazy; | |
import org.springframework.stereotype.Service; |
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
from ftplib import FTP | |
import os | |
import sys | |
import time | |
import socket | |
# 本地日志存储路径 | |
local_log_path = "log.txt" | |
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 threading | |
try: | |
import Queue | |
except ImportError: | |
import queue as Queue | |
class ThreadJob(object): |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- | |
status : 这个用于设置log4j2自身内部的信息输出,可以不设置,当设置成TRACE时,会看到log4j2内部各种详细输出 | |
monitorInterval : Log4j能够自动检测修改配置文件和重新配置本身, 设置间隔秒数。此处表示每隔几秒重读一次配置文件. | |
日志级别:TRACE < DEBUG < INFO < WARN < ERROR < FATAL | |
如果设置为WARN,则低于WARN的信息都不会输出 | |
--> | |
<Configuration status="INFO" monitorInterval="1800"> | |
<!-- 参数配置 --> |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<configuration scan="true" scanPeriod="60 seconds" debug="false"> | |
<property name="maxHistory" value="30"/> | |
<property name="log_dir" value="./logs/test/" /> | |
<!-- ConsoleAppender 控制台输出日志 --> | |
<appender name="console" class="ch.qos.logback.core.ConsoleAppender"> | |
<encoder> | |
<pattern> | |
<!-- 设置日志输出格式 --> | |
%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger - %msg%n |
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.fasterxml.jackson.databind.DeserializationFeature; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import java.util.List; | |
public class JsonUtils { | |
private static final ObjectMapper BASIC = new BasicObjectMapper(); | |
private static class BasicObjectMapper extends ObjectMapper { |
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.google.common.base.CaseFormat; | |
import java.nio.charset.Charset; | |
import java.nio.charset.StandardCharsets; | |
import java.util.regex.Pattern; | |
public final class CommonUtils { | |
public static final int PROCESSORS = Runtime.getRuntime().availableProcessors(); |
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.*; | |
/** | |
* 类名称:CollectionUtils.java<br> | |
* 类描述:集合工具类 | |
*/ | |
public final class CollectionUtils { | |
public static boolean isArray(Object obj) { | |
return (obj != null && obj.getClass().isArray()); |
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
const puppeteer = require("puppeteer"); | |
const qs = require('querystringify'); | |
const userName = "XXXX"; | |
const passWord = "XXXX"; | |
const sleep = require("./utils").sleep; | |
const log = require('log4js').getLogger("weibo"); | |
const weiboconfig = require("./config").weibo; | |
log.level = 'info'; | |
const index = async function (nickname) { | |
// 下面异步相当于打开浏览器 |
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
const data = "do shash'owania"; | |
const crypto = require('crypto'); | |
crypto.createHash('md5').update(data).digest("hex"); |
NewerOlder