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
docker run -d \ | |
--name=wjdbmgrapp \ | |
-v ~/Workspace/Docker/manager_app/wjdbmgrapp/conf:/etc/mysql/conf.d \ | |
-v ~/Workspace/Docker/manager_app/wjdbmgrapp/data:/var/lib/mysql \ | |
-e MYSQL_ROOT_PASSWORD=123456 \ | |
-e MYSQL_DATABASE=wjdbmgrapp \ | |
-e MYSQL_USER=mgrapp \ | |
-e MYSQL_PASSWORD='mgrapp123!@#' \ | |
daocloud.io/library/mysql:5.7.5 |
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
./kafka-topics.sh --create \ | |
--zookeeper 192.168.97.195:2181 \ | |
--replication-factor 1 \ | |
--partitions 1\ | |
--topic mqRequest |
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
-- 创建数据库 | |
CREATE DATABASE IF NOT EXISTS wjdbmgrapp DEFAULT CHARSET utf8 COLLATE utf8_general_ci; | |
-- 创建用户密码 | |
CREATE USER 'manager_app'@'localhost' IDENTIFIED BY 'mgrapp123!@#'; | |
-- rights | |
GRANT ALL PRIVILEGES ON manager_app.* TO 'manager_app'@'localhost'; |
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 matplotlib as mpl | |
import matplotlib.pyplot as plt | |
mpl.rcParams['font.family'] = 'Heiti TC' | |
%matplotlib inline | |
bins = range(min(data), max(data)+100, 100) | |
plt.hist(data, bins=bins) | |
plt.title("数据分布图") | |
plt.show() |
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 pymysql | |
connection = pymysql.connect(host='localhost', port=3306, user='manager_app', | |
password='mgrapp123!@#', db='wjdbmgrapp', | |
charset='utf8') | |
cursor = connection.cursor() | |
data = [] | |
sql = 'select times from mq2004_record where date="2019-10-15 00:00:00" order by times desc ;' | |
cursor.execute(sql) |
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
fun ByteArray.toHex(): String { | |
val result = StringBuffer() | |
forEach { | |
val octet = it.toInt() | |
val firstIndex = (octet and 0xF0).ushr(4) | |
val secondIndex = octet and 0x0F | |
result.append(HEX_CHARS[firstIndex]) | |
result.append(HEX_CHARS[secondIndex]) | |
} | |
return result.toString() |
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
package com.ktvme.mgrapp.util.gzip | |
import javax.servlet.ServletOutputStream | |
import javax.servlet.WriteListener | |
import java.util.concurrent.atomic.AtomicBoolean | |
import java.util.zip.GZIPOutputStream | |
/** | |
* @author fanwu 编写于 2018/1/25. | |
*/ |
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
package me.fanwu.fx.utils | |
import groovy.util.logging.Slf4j | |
import javax.crypto.Cipher | |
import javax.crypto.spec.SecretKeySpec | |
import java.security.MessageDigest | |
import java.security.NoSuchAlgorithmException | |
import java.util.zip.GZIPInputStream | |
import java.util.zip.GZIPOutputStream |
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
package com.ktvme.config.weblog; | |
import com.ktvme.mqservice.web.utils.Response; | |
import lombok.extern.slf4j.Slf4j; | |
import org.aspectj.lang.JoinPoint; | |
import org.aspectj.lang.annotation.*; | |
import org.slf4j.MDC; | |
import org.springframework.stereotype.Component; | |
import org.springframework.web.context.request.RequestContextHolder; | |
import org.springframework.web.context.request.ServletRequestAttributes; |
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/sh | |
# ================================================================== | |
# ______ __ _____ | |
# /_ __/___ ____ ___ _________ _/ /_ /__ / | |
# / / / __ \/ __ `__ \/ ___/ __ `/ __/ / / | |
# / / / /_/ / / / / / / /__/ /_/ / /_ / / | |
#/_/ \____/_/ /_/ /_/\___/\__,_/\__/ /_/ | |
# Multi-instance Apache Tomcat installation with a focus | |
# on best-practices as defined by Apache, SpringSource, and MuleSoft |