
暂无个人介绍
能力说明:
精通JVM运行机制,包括类生命、内存模型、垃圾回收及JVM常见参数;能够熟练使用Runnable接口创建线程和使用ExecutorService并发执行任务、识别潜在的死锁线程问题;能够使用Synchronized关键字和atomic包控制线程的执行顺序,使用并行Fork/Join框架;能过开发使用原始版本函数式接口的代码。
能力说明:
掌握Linux文件管理方式和技巧,对用户和组管理有基本认知,掌握Linux网络知识,对TCP/IP协议及OSI七层模型有较为清晰的概念,掌握Linux磁盘与文件系统管理技巧,知道如何安装Linux软件包,逐步掌握Shell脚本的编程技巧。
阿里云技能认证
详细说明简介 Aspose.Words for Java is a class library that enables your applications to perform a great range of document processing tasks. Aspose.Words supports DOC, DOCX, RTF, HTML, OpenDocument, PDF, XPS, EPUB and other formats. With Aspose.Words you can generate, modify, convert, render and print documents without using Microsoft Word®. 官网文档: https://docs.aspose.com/display/wordsjava/Home官网代码示例: https://github.com/aspose-words/Aspose.Words-for-Java.git 同类别软件: Apache POI 注: Aspose需要商业授权,POI开源免费 对于简单的文档关键字替换使用POI 复杂的表格编辑,使用Aspose中的标签替换 对于替换参数(数字,文本,表格,图片等),可封装替换参数,增强代码的适用性 代码示例 Java类库 Maven <dependency> <groupId>com.aspose</groupId> <artifactId>aspose-words</artifactId> <version>19.5</version> <classifier>jdk17</classifier> </dependency> 直接引入Jar aspose-words-19.5-jdk17.jar 简单示例 加载license try { License license = new License(); license.setLicense("Aspose.Words.lic"); System.out.println("License set successfully."); } catch (Exception e) { System.out.println("There was an error setting the license: " + e.getMessage()); } Word->PDF File file = new File("/Test-01.docx"); Document document = new Document(new FileInputStream(file)); PdfSaveOptions pdfSaveOptions = new PdfSaveOptions(); pdfSaveOptions.getOutlineOptions().setHeadingsOutlineLevels(5); OutputStream outputStream = new FileOutputStream("/Test-01.pdf"); document.save(outputStream,pdfSaveOptions); 书签文本替换 document.getRange().getBookmarks().get(bookMakeName).setText(word);
使用场景 在清理数据库中,发现好多以_BAK结尾的备表,但据开发讲好多_BAK在代码中被使用,所以我需要通过搜索代码中是否有表名,判断表是否被使用 脚本思路: 整理出要检查的表 用,分割表转化为数组,循环表名数组 使用grep查找表名在文件夹中出现的次数 如果次数为0,则输出表名(此处拼装了drop语句) 循环结束,要执行的drop语句也生成了 Shell脚本 batch_lookup_keyword_dir.sh #!/bin/bash dir_path="/root/test" keywords="TABLE_A_BAK,TABLE_B_BAK,TABLE_C_BAK,TABLE_D_BAK" array=(${keywords//,/ }) for var in ${array[@]} do count=`grep -r $var $dir_path | wc -l` if [ $count == "0" ];then echo "drop table "$var";" fi done
使用阿里云Serverless函数计算实现HTTP健康检查+故障短信通知 应用场景 定时对网站/API进行请求,根据请求响应判断服务是否可用,网站是否存在宕机,当发生宕机时,发送短信通知管理员. 技术使用 运行平台:阿里云函数计算开发语言:Python3(小功能,精简,开发快,可在阿里云上在线编辑代码)其它:阿里云短信接口 为何选用函数计算? 无需关注运维,仅需要编写核心代码,一个python脚本就够了(阿里云上可在线编辑代码,本地开发环境都无需搭建) 定时进行检测,只需要选用函数计算的“定时触发器”即可 根据代码的调用次数和运行时间计费(相对价格应该是非常低的) 结构图 过程 阿里云上开通函数计算服务 创建服务:函数计算-创建服务:httpchk 创建函数:语言Python-空白函数 创建函数:触发器-定时触发器:httpchk-trigger-时间间隔1分钟 创建函数:函数名称:httpchk-fc, 创建函数:代码方式:在线编辑 创建函数:函数执行内存:128MB(足足够用) 函数代码: # -*- coding: utf-8 -*- import logging import requests from aliyunsdkcore.client import AcsClient from aliyunsdkcore.request import CommonRequest # 待检测的网址,仅支持GET请求 urls = ["https://www.baidu.com","http://www.mtain.top"] # 接收短信通知的手机号码 phone = "180000000" # 阿里云短信接口相关信息 accessKeyId = 'xxxx' accessSecret = 'xxxx' signName = 'xxxxx' templateCode = 'SMS_xxxx' logger = logging.getLogger() def handler(event, context): for url in urls: do_httpchk(url) def do_httpchk(url): logger.info('检测网站:{}'.format(url)) try: req=requests.get(url) logger.info('网站:{}响应正常,返回数据长度:{}'.format(url,len(req.text))) except Exception as e: logger.error('网站:{}服务异常,{}'.format(url,e)) send_sms(url) def send_sms(url): client = AcsClient(accessKeyId, accessSecret, 'default') request = CommonRequest() request.set_accept_format('json') request.set_domain('dysmsapi.aliyuncs.com') request.set_method('POST') request.set_protocol_type('https') # https | http request.set_version('2017-05-25') request.set_action_name('SendSms') request.add_query_param('PhoneNumbers', phone) request.add_query_param('SignName', signName) request.add_query_param('TemplateCode', templateCode) # 阿里云短信变量 [a-zA-Z0-9] 且 长度小于20 web_name = url.replace('https://','').replace('http://','').replace('.','-')[0:18] request.add_query_param('TemplateParam', '{"code":"'+web_name+'"}') response = client.do_action(request) logger.info('Send SMS Response:'+str(response, encoding = 'utf-8'))