自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(428)
  • 收藏
  • 关注

转载 java创建shell脚本

package com.xxl.job.core.util;import java.io.BufferedWriter;import java.io.File;import java.io.FileWriter;/** * <p> * <code>GenerateShellScript</code> * </p> * Descr...

2020-01-17 17:19:11 1726

转载 docker: failed to map segment from shared object: operation not permitted

好像是昨天在使用docker进行build时,访问/tmp目录,一直报没有权限,就是operation not permitted。参考StackOverflow remount一下就好了,记录一下sudo mount /tmp -o remount,exec参考地址:https://stackoverflow.com/questions/13502156/what-are-poss...

2020-01-13 15:57:40 3052 1

转载 docker:No plugin found for prefix 'docker' in the current project

1. 原因:springboot项目pom里引入了docker-maven-plugin,使用mvn clean package docker:build时遇到该问题<plugin> <groupId>com.spotify</groupId> <artifactId>docker-maven-plugin</artifactId&g...

2020-01-13 15:52:31 2674

转载 Java修改文件中某一行字符串

背景:想使用Java里的Apache common exec工具包中的CommandLine执行shell文件,因为shell文件里有一行是使用虚拟环境下的python命令去执行python脚本,我们想动态的修改python后面跟随的参数。1. shell脚本(比如这里的参数是JobName1)#!/bin/bashsource /opt/xxc/flask_config.cfg/o...

2020-01-13 15:42:38 3489

转载 centos使用shell脚本执行python文件报No such file or directory

1. 执行的脚本叫run_script.sh,脚本内容如下#!/bin/bashsource /opt/xxxx/xxxx.cfg/opt/venv/bin/python /opt/xx/xxx/xxxx/xxxxxx.pyecho "End!"2. 我是通过apache common-exec包下的CommandLine(java)执行的commandline = Com...

2020-01-10 15:34:31 1148

转载 Flask-APScheduler API endpoints

Flask-APScheduler 直接提供API,只要在配置文件里面配置SCHEDULER_API_ENABLED =True 就行API 如下self._add_url_route('get_scheduler_info', '', api.get_scheduler_info, 'GET')self._add_url_route('add_job', '/jobs', api....

2020-01-09 15:34:31 492

转载 webstorm eslint error: ESLint: Expected indentation of 0 spaces but found 2. (indent)

1. 原因2. 参考:https://github.com/vuejs/eslint-plugin-vue/issues/3523. 解决:(1) 编辑Eslint配置,忽略缩进:'indent': 'off'(2) 编辑webstorm规则,忽略script子标签缩进,File => Setting => Editor => Code S...

2019-12-29 00:45:42 4932

转载 Apache commandline java.io.IOException

1. 报错代码import org.apache.commons.exec.CommandLine;import org.apache.commons.exec.DefaultExecutor;import org.apache.commons.exec.PumpStreamHandler;import java.io.*;public class ApacheCommandLi...

2019-12-16 15:43:20 313 1

转载 python同级xml节点值比较

背景:给定两个xml字符串,然后比较两个xml相同层级、相同名字(在ElementTree组建里叫tag)的节点的值是否一致,相同层级不能含有多个名字相同的子节点(即tag不能重复),如果发现有值不一致的,返回Truedef compare_xml(left_nodes, right_nodes, key_info='.'): left_len, right_len = len(le...

2019-12-12 16:41:01 746

转载 ElementTree合并子节点(1)

例如:<site> <tools> <name>jalen.site</name> </tools> <tools> <server>aliyun</server> </tools></site>合并为:<si...

2019-12-09 01:20:34 264

转载 idea无法导入ojdbc驱动依赖

原因:oracle由于licence的问题限制导入解决办法:去maven中央仓库找个ojdbc驱动,将jar包下载下来,执行下面命令导入C:\Users\jalchu\IdeaProjects\xxl-job-oracle>mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc8 -Dversion=12.2...

2019-11-22 16:15:51 1537

转载 Host 'xxxxxxx' is not allowed to connect to this MySQL server

1. 登录mysqlmysql -u root -p2. 切换到mysql数据库USE mysql;SELECT user,host FROM user;3. 授权GRANT ALL PRIVILEGES ON *.* TO root@my_ip IDENTIFIED BY ‘root_password‘ WITH GRANT OPTION;...

2019-11-21 16:28:23 162

转载 百分位数计算(percentile)

1. 计算公式 (参考:https://blog.csdn.net/u011489043/article/details/78056851)(1)首先将输入的数组进行从小到大排序,然后计算:(n−1)∗p=i+j (其中n为数组元素的个数,将计算结果的整数部分用i表示,小数部分用j来表示,p是百分位数,如90%的话就是0.9)(2)计算百分位数res=(1−j)∗arr...

2019-11-12 12:36:07 16432 3

转载 python将一段时间拆分为小的时间段

def split_time_ranges(from_time, to_time, frequency): from_time, to_time = pd.to_datetime(from_time), pd.to_datetime(to_time) time_range = list(pd.date_range(from_time, to_time, freq='%sS' % ...

2019-11-12 11:31:04 7058 3

转载 bootstrap4.3.1的datetimepicker没有icon图标

1. cdn<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/css/bootstrap.css"><link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimep...

2019-10-30 12:29:53 1546

转载 排查linux服务器cpu高(未解决)

1. top:发现2655进程cpu使用率高[root@myservername jalchu]# toptop - 01:15:16 up 8 days, 20:52, 1 user, load average: 0.06, 0.03, 0.01Tasks: 139 total, 1 running, 138 sleeping, 0 stopped, 0 zombieC...

2019-10-28 17:23:13 424 3

转载 windows获取linux server日志文件

背景:我使用的是windows机器(装有xshell),想要获取产线某个server的tomcat日志文件涉及3台server(1)localhost: windows本机(2)10.250.10.1: linux server 1 (有root权限)(3)10.250.10.2: linux server 2 (没有root权限,但是可以使用sudo su切换成root权限)1. ...

2019-10-28 17:09:49 365

转载 UnicodeDecodeError: 'utf8' codec can't decode byte 0xa0 in position 41: invalid start byte 第二种情况

第一种情况参考:https://blog.csdn.net/baidu_30809315/article/details/1026775741. 报错代码opt = FeatureOption.query.get(display_name)# 此时sqlalchemy版本是1.2.6, flask_sqlalchemy版本是2.3.22. 异常信息 File "path\...

2019-10-24 12:21:22 1274 2

转载 python安装第三方module(zip包)

背景: Github上有很多第三方module,有时候我们项目里需要,但是使用pip去安装时发现找不到这个包,这里以sqlalchemy的一个dev版本为例1. 下载 (地址:https://github.com/sqlalchemy/sqlalchemy/archive/rel_1_3.zip)2. 解压zip包3. 进入项目虚拟环境,执行setup.py(venv)...

2019-10-23 11:05:25 2102

转载 Flask-MonitoringDashboard性能监控

1. 安装pip install flask_monitoringdashboard2. 引入import flask_monitoringdashboard as dashboarddashboard.config.init_from(file='config.cfg')dashboard.bind(app)3. 项目根目录下创建配置文件config.cfg[das...

2019-10-22 16:56:53 1593 2

转载 UnicodeDecodeError: 'utf8' codec can't decode byte 0xa0 in position 41: invalid start byte第一种情况

1. 报错代码df_result = pd.read_sql_query(sql, engine)2. 错误跟踪(还没有找到问题)site-packages\pandas\io\sql.py, line 314site-packages\pandas\io\sql.py, line 1108site-packages\sqlalchemy\engine\result.py, l...

2019-10-22 10:54:01 1368

转载 windows10使用openssl生成ca证书并本地模拟https调试开发环境

背景:本地python flask项目,python脚本运行manage.py启动server,使用ngrok配置内网穿透无法模拟https地址(报502)ngrok http -bind-tls=true localhost:443ngrok http https://localhost:443ngrok http 443现做以下尝试:1. 安装Openssl (参...

2019-10-21 21:24:03 3520

转载 pandas根据A字段分组取B字段最长的那一行

def test_for_longer(): data = [{'foo': 'GD-20190101-010101', 'son': 'GD-123'}, {'foo': 'GD-20190101-010101', 'son': 'GD-12345'}, {'foo': 'GD-20190101-010102', 'son': ...

2019-10-11 12:23:57 357

转载 利用html a标签下载

(1)链接的 onclick 事件被先执行,其次是 href 属性下的动作(页面跳转,或 javascript 伪链接)(2)假设链接中同时存在 href 与 onclick,如果想让 href 属性下的动作不执行,onclick 必须得到一个 false 的返回值。(3)如果页面过长有滚动条,且希望通过链接的 onclick 事件执行操作。应将它的 href 属性设为 javascrip...

2019-09-23 09:30:22 1152

转载 echarts双y轴

<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Echarts</title> <script type="text/javascript" src="https://cdnjs.cloudflar...

2019-09-18 13:49:17 155

转载 oracle根据条件统计各组记录数量

1. 根据具体条件统计这批数据落到每组的数量select to_char(TIMESTAMP, 'yyyy-mm-dd') column1, column2, column3, count(CASE WHEN DURATION<30*60 THEN 1 END) less30, count(CASE WHEN DURATION>=30*60 and ...

2019-09-16 17:08:25 1624

转载 pandas date_range

def get_date_range(): from_date_str, to_date_str = '2019-08-01', '2019-09-09' df_date_range = pd.date_range(from_date_str, to_date_str) df = pd.DataFrame(df_date_range, columns=['Date'])...

2019-09-09 11:24:08 164

原创 oracle取带有小数的记录

select * from user_tab where user_column<>round(user_column,1);round函数测试:select round(100.1, 0) from dual; -- 100select round(100.5, 0) from dual; -- 101select round(100.9, 0) from dual;...

2019-09-06 13:45:51 1436

转载 oracle merge into(一条语句执行更新或插入)

MERGE INTO user_tab1 t1USING (select to_char(TIMESTAMP, 'yyyy-mm-dd') daily, CLUSTERNAME, RESULT, count(*) usage from user_tab2 where to_char(TIMESTAMP, 'yyyy-mm-dd') in ('2019-09-03')...

2019-09-03 16:50:50 910

原创 Working outside of application context

错误代码:原因:没有激活程序上下文之前就调用current_app.name会导致该错误修改代码:

2019-08-28 12:27:32 1789

原创 简单了解java的Vector扩容

package com.example.demo.test;import java.util.Vector;/** * <p> * <code>VectorTest</code> * </p> * Description: JDK 1.8 * 测试Vector的扩容方式,通过测试可以看出其每次以2的倍数形式扩充Object数组 ...

2019-08-27 14:19:34 2056

原创 简单了解java的StringBuilder扩容

package com.example.demo.test;/** * <p> * <code>StringBuilderTest</code> * </p> * Description: JDK 1.8 * * @author Jalen * @date 2019/8/26 9:41 */public class Stri...

2019-08-27 12:28:59 404

原创 简单了解java的HashMap扩容

package com.example.demo.test;import java.util.HashMap;import java.util.Map;/** * <p> * <code>HashMapTest</code> * </p> * Description: JDK 1.8 * @see java.util.HashM...

2019-08-26 16:12:20 126

原创 简单了解java的ArrayList扩容

package com.example.demo.test;import java.util.ArrayList;import java.util.List;import java.util.Random;/** * <p> * <code>ArrayListTest</code> * </p> * Description: J...

2019-08-26 12:33:31 306

原创 java字符串长度测试

package com.example.demo.test;import java.lang.management.ManagementFactory;import java.lang.management.MemoryMXBean;import java.lang.management.MemoryUsage;import java.util.List;/** * <p&...

2019-08-23 13:09:38 485

转载 RawGit has reached the end of its useful life

通常在我们的html里会引入一些CDN,这里的rawgit是github上的一款开源插件的CDN分发平台,既然开源,如果安全审查不够严谨,就会存在一些恶意的内容分发,其实这个小工具只是作者因为个人爱好开源的,但是现在月访问量已达到几十亿,带宽达到几百TB,作者也是为用户考虑,即将关闭该CDN,并给出了几个可供选择的git CDN。(作者说明:https://rawgit.com/)比如我们程序...

2019-08-22 14:10:58 325

原创 UnicodeDecodeError: 'utf8' codec can't decode byte 0xbf in position 36: invalid start byte

这里只记录一种原因1. 报错代码from sqlalchemy import create_engineengine = create_engine("oracle://xxx:xxx@xxx:xxx/?service_name=xxx", echo=True)import pandas as pdsource_bugs = "select * from xxxx"df_sou...

2019-08-22 13:38:43 1658

转载 oracle call vs exec[ute]

BothEXEC[ute] SP()andCALL SP()could be used in SQL*Plus to execute an SP. BTW, you can also useBEGIN SP(); END;But there are some differences. CALLis Oracle SQL and should work everywhere. ...

2019-08-19 15:08:04 117

转载 pip is configured with locations that require TLS/SSL, however the ssl module in Python is not avail

# 查看旧版本号openssl version# 下载openssl,解压,进入根目录wget https://www.openssl.org/source/openssl-1.1.1a.tar.gztar -zxvf openssl-1.1.1a.tar.gzcd openssl-1.1.1a# 编译安装./config --prefix=/usr/local/openssl...

2019-08-09 16:06:11 430

原创 apscheduler job中断场景

背景:flask项目,gunicorn server,apscheduler定时框架Server配置:1个worker,timeout设置为900s(15min),单点apscheduler定时任务配置:max thread 20, maxprocess 5,misfire_grace_time 900,当前job几百个问题:运行时遇到有些job莫名其妙中断,job本身...

2019-08-09 14:52:05 2476

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除