标签 tools 下的文章

Debian安装Certbot获取SSL证书

安装snapd

# 安装snapd
apt-get update
apt-get install snapd

# 安装 snapd core
snap install core
snap refresh core

通过snapd安装certbot

snap install --classic certbot

# 软链接
ln -s /snap/bin/certbot /usr/bin/certbot

如果遇到无法下载,可能需要翻墙,请给snap设置代理:

sudo snap set system proxy.http=http://127.0.0.1:1081
sudo snap set system proxy.https=http://127.0.0.1:1081

获取SSL证书

执行certbot certonly

certbot certonly -d "*.youdomain.com" --manual --preferred-challenges dns-01  --server https://acme-v02.api.letsencrypt.org/directory
root@docker00:/usr/bin# certbot certonly -d "*.youdomain.com" --manual --preferred-challenges dns-01  --server https://acme-v02.api.letsencrypt.org/directory
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator manual, Installer None
Enter email address (used for urgent renewal and security notices)
 (Enter 'c' to cancel): xxx@xxx.com

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server. Do you agree?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing, once your first certificate is successfully issued, to
share your email address with the Electronic Frontier Foundation, a founding
partner of the Let's Encrypt project and the non-profit organization that
develops Certbot? We'd like to send you email about our work encrypting the web,
EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: N
Account registered.
Requesting a certificate for *.youdomain.com
Performing the following challenges:
dns-01 challenge for youdomain.com

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please deploy a DNS TXT record under the name
_acme-challenge.youdomain.com with the following value:

<your_dns_txt_value>

Before continuing, verify the record is deployed.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Press Enter to Continue
Waiting for verification...
Cleaning up challenges

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/youdomain.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/youdomain.com/privkey.pem
   Your certificate will expire on 2021-07-01. To obtain a new or
   tweaked version of this certificate in the future, simply run
   certbot again. To non-interactively renew *all* of your
   certificates, run "certbot renew"
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

- 阅读剩余部分 -

清除SVN版本控制

关于清除SVN版本控制,本人目前是采用如下方法:通过运行一个.bat文件,删除此目录下所有.svn的文件夹包括子目录下的.svn文件夹

简易版

新建一个clean.bat的文件,用记事本打开,写入:

@echo On @Rem 删除SVN版本控制目录 @PROMPT [Com]
@for /r . %%a in (.) do @if exist "%%a\.svn" rd /s /q "%%a\.svn" @Rem for /r . %%a in (.) do @if exist "%%a\.svn" @echo "%%a\.svn"
@echo Mission Completed. @pause

完整版

@echo off
echo ***********************************************************
echo 清除SVN版本信 息
echo ***********************************************************
:start
::启动过程,切换目录
:set pwd=%cd%
:cd %1
echo 工作目录是:& chdir
:input
::获取输入,根据输入进行处理
set source=:
set /p source=确定要清楚当前目录下的.svn信息吗?[Y/N/Q]
set "source=%source:"=%"
if "%source%"=="y" goto clean
if "%source%"=="Y" goto clean
if "%source%"=="n" goto noclean
if "%source%"=="N" goto noclean
if "%source%"=="q" goto end
if "%source%"=="Q" goto end
goto input
:clean
::主处理过程,执行清理工作
@echo on
@for /d /r %%c in (.svn) do @if exist %%c ( rd /s /q %%c & echo 删除目录%%c)
@echo off
echo "当前目录下的svn信息已清除"
goto end
:noclean
::分支过程,取消清理工作
echo "svn信息清楚操作已取消"
goto end
:end
::退出程序
cd "%pwd%"
pause

Lombok介绍

Lombok 是一种 Java 实用工具,可用来帮助开发人员消除 Java 的冗长,尤其是对于简单的 Java 对象(POJO)。它通过注释实现这一目的。通过在开发环境中实现 Lombok,开发人员可以节省构建诸如 hashCode() 和 equals() 这样的方法以及以往用来分类各种 accessor 和 mutator 的大量时间。

SpringToolSuite4安装Lombok

下载 lombok.jar

可以通过下面地址进行下载:

https://repo1.maven.org/maven2/org/projectlombok/lombok/1.18.18/lombok-1.18.18.jar

拷贝lombok.jar至STS目录

目录:/Applications/SpringToolSuite4.app/Contents/MacOS

接着需要将lombok-1.18.18.jar重命名为lombok.jar
(下面截图名称没有改,实际操作时,请将lombok-1.18.18.jar改为lombok.jar)

7c2yiab8hz4.png

在STS路径运行命令

cd /Applications/SpringToolSuite4.app/Contents/MacOS

java -jar lombok.jar

- 阅读剩余部分 -

Intellij IDEA常用快捷整理表

Ctrl

快捷键说明
Ctrl + F当前文件进行文本查找
Ctrl + R当前文件进行文本替换
Ctrl + Z撤销
Ctrl + Y删除光标所在行 或 删除选中行
Ctrl + X剪切光标所在行 或 剪切选择内容
Ctrl + C复制光标所在行 或 复制选择内容
Ctrl + D复制光标所在行 或 复制选择内容,并把复制内容插入光标位置下面
Ctrl + W递进式选择代码块。可选中光标所在的单词或段落,连续按会在原有选中的基础上再扩展选中范围
Ctrl + E显示最近打开的文件记录列表
Ctrl + N根据输入名称查找Class类文件
Ctrl + G跳转到指定行
Ctrl + J插入自定义动态代码模板
Ctrl + P方法参数提示显示
Ctrl + Q光标所在的变量 / 类名 / 方法名等上面(也可以在提示补充的时候按),显示文档内容
Ctrl + U前往当前光标所在的方法的父类的方法 / 接口定义
Ctrl + B进入光标所在的方法/变量的接口或是定义处,等效于Ctrl + 左键单击
Ctrl + K版本控制提交项目,需要此项目有加入到版本控制才可用
Ctrl + T版本控制更新项目,需要此项目有加入到版本控制才可用
Ctrl + H显示当前类的层次结构
Ctrl + O选择可重写的方法
Ctrl + I选择可继承的方法
Ctrl + +展开代码
Ctrl + -折叠代码
Ctrl + /注释光标所在行代码,会根据当前不同文件类型使用不同的注释符号
Ctrl + [移动光标到当前所在代码的花括号开始位置
Ctrl + ]移动光标到当前所在代码的花括号结束位置
Ctrl + F1在光标所在的错误代码处显示错误信息
Ctrl + F3调转到所选中的词的下一个引用位置
Ctrl + F4关闭当前编辑文件
Ctrl + F8Debug模式下,设置光标当前行为断点,如果当前已经是断点则去掉断点
Ctrl + F9执行 Make Project 操作
Ctrl + F11选中文件 / 文件夹,使用助记符设定 / 取消书签
Ctrl + F12弹出当前文件结构层,可以在弹出的层上直接输入,进行筛选
Ctrl + Tab编辑窗口切换,如果在切换的过程又加按上delete,则是关闭对应选中的窗口
Ctrl + End跳到文件尾
Ctrl + Home跳到文件头
Ctrl + Space基础代码补全,默认在 Windows 系统上被输入法占用,需要进行修改,建议修改为 Ctrl + ,Alt + /
Ctrl + Delete删除光标后面的单词或是中文句
Ctrl + BackSpace删除光标前面的单词或是中文句
Ctrl + 1,2,3...,9定位到对应数值的书签位置
Ctrl + 左键单击在打开的文件标题上,弹出该文件路径
Ctrl + 光标定位按 Ctrl 不要松开,会显示光标所在的类信息摘要
Ctrl + ←光标跳转到当前单词 / 中文句的左侧开头位置
Ctrl + →光标跳转到当前单词 / 中文句的右侧开头位置
Ctrl + ↑等效于鼠标滚轮向前效果
Ctrl + ↓等效于鼠标滚轮向后效果

- 阅读剩余部分 -