首页需求决定一切,一切问题都是需求问题

Timeline

<2017-05-06 Sat 17:11> 更新forked repository   Git

需求

以前fork了MybatisGenerator 做了轻量修改了 当时是为MySQL做的 现在需要用于Oracle 
而在为Oracle生成mappers时发现了bug 尝试修复时发现上游已经修复这个bug 
所以需要更新forked repository

解决   terminal recording

<2017-04-27 Thu 13:46> dig命令查看域名解析情况

dig google.com

<2017-03-31 Fri 22:19> writeAcceptCharse in StringHttpMessageConverter

introduction

The writeAcceptCharse indicates whether the header Accept-Charset should be written using charsets from Charset.availableCharsets() to any outgoing request.

usage

writeAcceptCharse default is true, and will send header Accept-Charset with all the charsets of Charset.availableCharsets(), set to false to disable it.

StringHttpMessageConverter stringHttpMessageConverter = new StringHttpMessageConverter();
stringHttpMessageConverter.setWriteAcceptCharset(false)

<2017-03-17 Fri 16:33>搜索当前目录下存在的文本

grep -r txt .

<2017-01-11 Wed>Disable nouveau driver of Nvidia in Fedora 25

Add nouveau.modeset=0 to the end content of GRUB_CMDLINE_LINUX in /etc/default/grub Such as

GRUB_CMDLINE_LINUX="rd.lvm.lv=fedora/root rd.lvm.lv=fedora/swap rhgb quiet"

to

GRUB_CMDLINE_LINUX="rd.lvm.lv=fedora/root rd.lvm.lv=fedora/swap rhgb quiet nouveau.modeset=0"

Then, execute

sudo grub2-mkconfig -o /etc/grub2-efi.cfg

and reboot

<2016-12-13 Tue 16:21>Docker ToolBox "Error checking TLS connection: …"

症状

$ docker-machine env default
Error checking TLS connection: Error checking and/or regenerating the certs: There was an error validating certificates for host "192.168.99.100:2376": x509: certificate is valid for 192.168.99.101, not 192.168.99.100
You can attempt to regenerate them using 'docker-machine regenerate-certs [name]'.
Be advised that this will trigger a Docker daemon restart which will stop running containers.

药方

1 上佳

docker-machine regenerate-certs default

2 凡品

docker-machine rm default

Recreate docker machine and everything will run again

<2016-12-15 Thu>Code Style

基于Google Java Style,增加不同点:

No braces if-else one-line which code is for exception

if (null == orderEO) throw new OrderNotFoundException();
if () {
//...
} else throw new UnknownNotifyException();
//过长的单行,throw Exception,则用brace包裹
if (xxxService.notGood()) {
    throw new BusinessException("这是一个很长的单行if语句。这是一个很长的单行if语句。这是一个很长的单行if语句。");
}

Fields

No Blank Lines

Class between the first field field and field

public class XxxServiceImpl implements XxxService {
    private static Logger log = Logger.getLogger(XxxServiceImpl.class);
    private Xxx1Service Xxx1Service;
    private Xxx2Service Xxx2Service;

    //
}

<2017-04-06 Thu 18:52>Adopted Spring Framework Code Style

  • No lines should exceed 120 characters

思考最佳代码

xxxService1.callMethod()
xxxService2.callMethod(param)
xxxService1.callMethod()
//prepareParam
xxxService2.callMethod(param)

<2016-12-12 Mon 17:15>Windows Docker port forwarding from container to host ip

Windows下,DockerToolbox-1.12.3中,Docker Container是运行在VirtualBox中的,默认VirtualBox启动Guest到Host的端口转发。
因此,Docker容器只能通过VirtualBox分配的IP进行访问,而不能使用localhost或Host IP进行访问,若要能访问,则须在VirtualBox中设置端口转发。
打开VirtualBox -> default(docker machine的名字) -> 右键设置 -> 网络,网卡1(NAT连接方式) -> 端口转发中设置。

<2016-11-29 Tue 20:06> 301 Moved Permanently and 307 Internal Redirect

chrome://net-internals/#hsts

<2016-11-11 Fri 16:43>解决~dnf update~ 出现 Failed to open: ...updateinfo.xml.bz2 的问题

Introduction

在CentOS7中dnf update报错:

Failed to open: /var/cache/dnf/x86_64/7/x86_64/7/epel/repodata/88fda1390f617140910f985a222798a881c4debf1fb742e73e370f55493bde39-updateinfo.xml.bz2.

Reason Of The Problem

dnf对bzip2压缩文件的支持依赖于libsolv包,既然dnf错误信息为 Failed to open xxx.bz2 ,因此推测为该包的问题,通过以下命令查询libsolv的版本号为 0.6.11-1.el7

yum list libsolv

Solution

升级libsolv为最新版,在http://koji.fedoraproject.org/koji/buildinfo?buildID=704417 下载 0.6.14-1.el7 对应的版本,我选择下载 x86_64 的,安装后就可以成功执行 dnf update

安装脚本:

curl --remote-name https://kojipkgs.fedoraproject.org//packages/libsolv/0.6.14/1.el7/x86_64/libsolv-0.6.14-1.el7.x86_64.rpm
yum install ./libsolv-0.6.14-1.el7.x86_64.rpm

<2016-11-10 Thu 14:21>微软官方浏览器测试虚拟机   Bookmark

<2016-11-08 Tue 10:29>Java REST/Http Client

<2016-11-04 Fri 16:06>Nginx try_files with multi location

try_files 只支持一个location, 即如下配置是无效的

try_files $uri $uri/ @upstream1 @upstream2;

而要支持多个location, 可用访问链的方式变通的解决。

    proxy_intercept_errors on;
    recursive_error_pages on;
location / {
        root   /usr/share/nginx/html;
        index  index.html index.htm;
        try_files $uri $uri/ @upstream1;
    }

    location @upstream1 {
        proxy_pass http://location1;
        error_page 404 = @upstream2;
    }

    location @upstream2 {
        proxy_pass http://location2;
    }

<2016-11-04 Fri 14:32>Emacs Show All Active Minor Mode   Emacs

Use command describe-mode which display documentation of current major mode and minor modes.

C-h m

Or

M-x describe-mode

<2016-10-31 Mon 16:33>Using Intellij IDEA Emacs Way

除了以Emacs的角度,将Intellij IDEA按键改为Emacs中的按键,如基本的方向键(C-f, C-b, C-p, C-n),不妨以Intellij IDEA的角度,以Emacs的按键方式,新增按键到Intellij IDEA的常用功能中,如:

Find action : M-x
Debug context configuration : C-x,d
Run context configuration : C-x,r
Gradle : C-x,g
Module settings : C-x,m
Show Uages: C-x,u
Find Usages: C-x,C-u

<2016-10-28 Fri 01:00>Executing a single test method in Gradle/Maven

Introduction

单元测试中,若要只执行类中的一个测试方法,除了在IDE中运行测试方法,也可用Maven和Gradle来达成。假设FooTest是一个单位测试类,testMethod是FooTest类中的一个测试方法,则:

Solution

  1. Maven中,用如下命令

    mvn -Dtest=FooTest#testMethod test
    
  2. 在Gradle里,用test任务的 --test 参数来实现

    ./gradlew test --tests "*FooTestIOTest.testMethod"
    

    另外,如果用到Multi-Project,执行子项目的一个测试方法用:

    ./gradlew :subproject:test --tests "*FooTestIOTest.testMethod"
    

<2016-10-24 Mon 00:15>Adobe Flash Player已过期   Chrome

Introduction

近日更新Linux的Chrome浏览器后无法使用Flash Player,出现Adobe Flash Player已过期的提示

UPDATED Reason Of The Problem

Chrome 54.0.2840.71没有内置Adobe Flash Player 在新更新的这个版本的Chrome中,打开chrome://plugins,点击详细信息,可看到Adobe Flash Player里位置的值为internal-not-yet-present

Solution

让Chrome更新Flash Player组件

  1. 运行代理

    google-chrome --proxy-server="socks5://127.0.0.1:1080" --host-resolver-rules="MAP * 0.0.0.0 , EXCLUDE localhost"
    
  2. 打开chrome://components
  3. 点击Adobe Flash Player下面的检查是否有更新

手动安装Flash Player:

  1. 下载

    https://get.adobe.com/flashplayer/ ,得到flash_player_ppapi_linux.x86_64.tar.gz
    
  2. 解压 && 安装

    #若当前最新版本是23.0.0.185
     mkdir ~/.config/google-chrome/PepperFlash/23.0.0.185
     tar xzvf flash_player_ppapi_linux.x86_64.tar.gz -C ~/.config/google-chrome/PepperFlash/23.0.0.185/
    
  3. 运行

    google-chrome-stable --ppapi-flash-path=~/.config/google-chrome/PepperFlash/23.0.0.185/libpepflashplayer.so --ppapi-flash-version=23.0.0.185
    
  4. 验证

    http://www.adobe.com/software/flash/about/
    

<2015-02-09 Mon 17:00>圣人如木,众生为草,风雨之时尤甚之

原创的,哈哈

<2014-06-24 Tue 05:09>我思故我在

规则
    - 探寻规则(法则)
    - 创造规则(法则)
- 内心与真实距离(主观、客观)
- 与环境融为一体,天人合一,以使主观世界与客观世界相合,提高反应能力

Generated by Emacs 26.0.50.1 (Org mode 9.0.5)