mybatis 日志配置

mybatis 版本: org.mybatis mybatis 3.4.6 使用slf4j-api进行日志输出, 日子实现使用logback,需要依赖, org.slf4j slf4j-api 1.7.25 ch.qos.logback logback-classic 1.2.3 在mybatis-config.xml 中增加如下配置, logback.xml中增加如下配置, true ${log.root}/logs/mybatis/mybatis.log %d{"yyyy-MM-dd HH:mm:ss,SSS"} %-5level [%thread] %class{256}.%M %L - %msg%n 3 ${log.root}/logs/mybatis/mybatis.log.%i 1024KB 其中 YOUR_DAO_PACKAGE是你的dao的包。 经过上述配置,你的mybatis将可以输出sql等关键信息到日志文件。

November 20, 2018 · 1 min · Space

python setup安装文件路径

使用 python setup.py install 来安装python包后,如果需要进行删除,可以使用下面类似命令进行, python setup.py install --record pkg-files-list.txt cat pkg-files-list.txt | xargs rm -rf

August 20, 2018 · 1 min · Space

解决github克隆代码慢

在大陆,clone github上的项目或者提交时速度极慢,原因是部分网址访问不畅,这些网址包括, global-ssl.fastly.net github.global.ssl.fastly.net github.com 有一种办法可以加快访问速度,将clone速度由原来30k/s左右提高到1M/s上下。 具体办法为, 访问 https://www.ipaddress.com 这个网址,查询上述域名对应ip,然后在hosts文件中添加绑定关系。比如,我现在查询到的ip,绑定地址为, 151.101.112.249 global-ssl.fastly.net 151.101.113.194 github.global.ssl.fastly.net 192.30.253.112 github.com 192.30.253.112 www.github.com 如果过段时间速度慢下来了,可以上ipaddress.com 再次查询最新ip,然后更新hosts中绑定来重试。

August 6, 2018 · 1 min · Space

sublime text中chicken scheme REPL配置

1. 安装Package Control 到 https://packagecontrol.io/installation, 找到sublime text 对应版本的安装脚本,将它复制下来。 2. 打开sublime text控制台 通过快捷键 ctrl + ` 或者 通过 View > Show Console 打开,然后粘贴复制的安装脚本,按回车键。 3. 安装SublimeREPL 3.1 通过菜单 Preferences | Package Control | Package Control: Install Package 3.2 选择 SublimeREPL 3.3 重启sublime text. 4. 配置repl. 4.1 通过菜单Preferences | Browse Packages… 打开packages安装目录。 4.2 找到SublimeREPL > config > Scheme 4.3.打开 Default.sublime-commands, 增加如下节点, { "caption": "SublimeREPL: Chicken Scheme", "command": "run_existing_window_command", "args": { "id": "repl_chicken_scheme", "file": "config/Scheme/Main.sublime-menu" } }, 并保存。 ...

July 8, 2018 · 1 min · Space

jvm内存分析和加载信息输出

1. 输出虚拟机内存回收信息的jvm参数 -XX:+PrintGC -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCApplicationStoppedTime -Xloggc:jvm-log-file 2. 输出类加载信息 -verbose:class 参考: 1. http://www.cnblogs.com/edwardlauxh/archive/2010/04/25/1918603.html 2. https://www.cnblogs.com/java-class/archive/2013/04/18/3027884.html 3. https://yq.aliyun.com/articles/48789

December 12, 2017 · 1 min · Space

git常用命令整理

#查看当前代码的远程分支 git remote -v # 查看当前代码状态 git status # 查看代码当前revision git rev-parse HEAD # 查看提交记录 git log commit # 查看分支创建时间,分支可以是本地分支,也可以是ref的远程分支 git reflog show --date=iso # 图形方式显示日志 git log --oneline --graph # 获取所有变更 git fetch --all # 重置,强制覆盖本地变更。 git reset --hard origin/master

November 30, 2017 · 1 min · Space

mac下让git不跟踪.DS_Store文件

# 在您的项目目录下面从仓库删除所有.DS_Store find . -name .DS_Store -print0 | xargs -0 git rm --ignore-unmatch # 配置全局git 忽略文件配置 echo .DS_Store >> ~/.gitignore_global # 配置git 使用全局忽略配置文件 git config --global core.excludesfile ~/.gitignore_global

November 24, 2017 · 1 min · Space

mac os下显示目录树型结构

find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'

April 11, 2017 · 1 min · Space

ubuntu上设置服务自动启动

sudo update-rc.d minidlna defaults This should add the service to the automatic startup system. But if you get: System start/stop links for /etc/init.d/minidlna already exist. Do the command sudo update-rc.d minidlna enable P.S.: For further detail look at the man page for update-rc.d by typing the command man update-rc.d

January 7, 2017 · 1 min · Space

ssh连接到virtualbox 里面的linux

The best way to login to a guest Linux VirtualBox VM is port forwarding. By default, you should have one interface already which is using NAT. Then go to the Network settings and click the Port Forwarding button. Add a new Rule: Host port 3022, guest port 22, name ssh, other left blank. or from command line VBoxManage modifyvm myserver –natpf1 “ssh,tcp,,3022,,22” where ‘myserver’ is the name of the created VM. Check the added rules: ...

January 5, 2017 · 1 min · Space