显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

断尘居

温柔的男人像海洋。

 
 
 
 
 
 

焦点头图

 
 
聚焦图片加载中...
 
 
 
 
 

摄影组图

 
 
数据加载中...
 
 
 
 
 
 
 

IntelliJ IDEA's Built-in Action IDs

2017-6-7 7:10:38 阅读86 评论0 72017/06 June7

These are the names of the actions built into IntelliJ IDEA. You can use these ID's and group names in <add-to-group> tags in your plugin's plugin.xml.

Each table shows the actions in a group, whose ID is shown in fixed-width font, along with the ID of its parent groups (for reference) and its displayed name. You can use the group ID in <add-to-group>'s group-id attribute.

Each row in the table represents an action, whose ID can be used in <add-to-group>'s relative-to-action attribute.

Last updated: IDEA 5.0.2 build 3511.

Root Action GroupIDNameCaptureMemorySnapShotCapture memory snapshotCaptureCPUUsageDataCapture

作者  | 2017-6-7 7:10:38 | 阅读(86) |评论(0) | 阅读全文>>

How to do distributed locking

2017-4-13 22:55:58 阅读143 评论0 132017/04 Apr13

As part of the research for my book, I came across an algorithm called Redlock on theRedis website. The algorithm claims to implement fault-tolerant distributed locks (or rather, leases [1]) on top of Redis, and the page asks for feedback from people who are into distributed systems. The algorithm instinctively set off some alarm bells in the back of my mind, so I spent a bit of time thinking about it and writing up these notes.

作者  | 2017-4-13 22:55:58 | 阅读(143) |评论(0) | 阅读全文>>

Mac brew search pyqt Error: Permission denied - /usr/local/var

2017-1-16 23:27:26 阅读234 评论0 162017/01 Jan16

使用brew命令报错没有权限如下:

brew search pyqt

Error: Permission denied - /usr/local/var

解决方案:

sudo chown -R $(whoami) /usr/local

作者  | 2017-1-16 23:27:26 | 阅读(234) |评论(0) | 阅读全文>>

一段辅助Jenkins部署的Shell脚本

2016-10-21 18:07:04 阅读278 评论0 212016/10 Oct21

#!/bin/bash

export BUILD_ID=doSth

#export JAVA_HOME="/usr/java/jdk1.8.0_45"

TOMCAT_ID=`ps -ef|grep /data1/apps/dubbo-test | grep -v grep | awk '{print $2}' | head -n 1`

echo "Tomcat id is $TOMCAT_ID"

if [ -n $TOMCAT_ID ];then

kill -9 $TOMCAT_ID

echo "Tomcat was killed."

fi

sleep 3

# remove original files

rm -rf /data1/apps/dubbo-test/webapps/guoer-service-1.0.0 /data1/apps/dubbo-test/webapps/guoer-service-1.0.0.war

echo "deploying.."

# deploy war achive

cp -rf /data1/.jenkins/workspace/guoer-service/target/guoer-service-1.0.0.war /data1/apps/dubbo-test/webapps/

echo "going to start tomcat..."

作者  | 2016-10-21 18:07:04 | 阅读(278) |评论(0) | 阅读全文>>

Nginx报错405 Method Not Allowed

2016-10-15 17:14:29 阅读286 评论0 152016/10 Oct15

Nginx默认不允许静态文件向服务器发送POST请求,报错如下:

405 Method Not Allowed

The requested method is not allowed for the URL. Sorry for the inconvenience.

Please report this message and include the following information to us. Thank you very much!

解决方案:

在nginx.conf的server节点里加入

error_page 405 =200 $uri;

然后./sbin/nginx -s reload 即可。

作者  | 2016-10-15 17:14:29 | 阅读(286) |评论(0) | 阅读全文>>

启动JIRA报错如下:

Caused by: java.sql.SQLException: Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED.

at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:957)

at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3878)

at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3814)

at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2478)

at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2625)

at com.mysql.jdbc.PreparedS

作者  | 2016-9-24 10:23:04 | 阅读(323) |评论(0) | 阅读全文>>

问题描述:

启动zabbix-proxy日志输出如下错误信息:

9762:20160531:090221.852 Starting Zabbix Proxy (active) [Zabbix proxy]. Zabbix 3.0.3 (revision 60173).

9762:20160531:090221.852 **** Enabled features ****

9762:20160531:090221.852 SNMP monitoring:       YES

9762:20160531:090221.852 IPMI monitoring:       YES

9762:20160531:090221.852 Web monitoring:        YES

9762:20160531:090221.852 VMware monitoring:     YES

9762:20160531:090221.852 ODBC:                  YES

9762:20160531:090221.853 SSH2 support:          YES

9

作者  | 2016-5-31 1:17:35 | 阅读(874) |评论(0) | 阅读全文>>

CentOS安装zabbix proxy报错如下:

[root@centos zabbix-3.0.3]# rpm -ivh zabbix-proxy-mysql-3.0.3-1.el6.x86_64.rpm

warning: zabbix-proxy-mysql-3.0.3-1.el6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 79ea5ed4: NOKEY

error: Failed dependencies:

libOpenIPMI.so.0()(64bit) is needed by zabbix-proxy-mysql-3.0.3-1.el6.x86_64

libOpenIPMIposix.so.0()(64bit) is needed by zabbix-proxy-mysql-3.0.3-1.el6.x86_64

解决方案:yum install OpenIPMI-libs -y

作者  | 2016-5-27 18:07:37 | 阅读(606) |评论(0) | 阅读全文>>

zabbix优雅汉化方法

2016-5-25 0:32:58 阅读427 评论0 252016/05 May25

应团队要求,zabbix有必要汉化,具体方法如下:

下载一个中文字体文件(.ttf)放到:${ZABBIX_HOME}/fonts下,

然后找到${ZABBIX_HOME}/include/defines.inc.php

define('ZBX_GRAPH_FONT_NAME',           'fzht_GBK');

define('ZBX_FONT_NAME', 'fzht_GBK');

修改以上两个值然后重启apache,到页面上设置为中文即可。

作者  | 2016-5-25 0:32:58 | 阅读(427) |评论(0) | 阅读全文>>

分布式系统中的一致性协议之两阶段提交协议(2PC)

2016-5-3 14:48:24 阅读405 评论0 32016/05 May3

 两阶段提交协议是很常见的解决分布式事务的方式,他可以保证分布式事务中,要么所有参与的进程都提交事务成功,要么都取消事务,这样做可以在分布式环境中保持ACID中A(原子性)。

     在两阶段提交协议中,包含了两种角色:协调者与参与者。参与者就是实际处理事务的机器,而协调者就是其中一台单独的处理分布式事务的机器。

     该算法分为两个阶段:

     1.投票阶段

     2.提交阶段

阶段1:请求阶段(commit-requestphase,或称表决阶段,votingphase)

在请求阶段,协调者将通知事务参与者准备提交或取消事务,然后进入表决过程。在表决过程中,参与者将告知协调者自己的决策:同意(事务参与者本地作业执行成功)或取消(本地作业执行故障)。这里的取消是指该参与者所在的机器没有准备好,或者出现了故障。因此无法执行该事务。

阶段2:提交阶段(commitphase)

在该阶段,协调者将基于第一个阶段的投票结果进行决策:提交或取消。当且仅当所有的参与者同意提交事务协调者才通知所有的参与者提交事务,否则协调者将通知所有的参与者取消事务。参与者在接收到协调者发来的消息后将执行响应的操作。协调者如果发现有一个投票是VOTE_ABORT,那么将创建一个GLOBAL_ABORT通知所有的参与者终止该事务。如果都是VOTE_COMMIT,那么协调者将发送一个GLOBAL_COMMIT,告知所有的参与者执行该事务。

作者  | 2016-5-3 14:48:24 | 阅读(405) |评论(0) | 阅读全文>>

IntelliJ IDEA Architectural Overview

2015-11-27 16:39:56 阅读687 评论0 272015/11 Nov27

This topic describes the architecture of the IntelliJ Platform from a plugin developer’s point of view. It is organized in a task-based manner to answer specific questions like “what can I do with this object?”, “how do I get to this object?” and so on.

Before proceeding please make sure you’re familiar with the basic concepts of IntelliJ Platform plugin development. If not, consider starting with the live demo and tutorials at www.jetbrains.com/idea/plugins/ and then returning to this document.

The following subjects are covered:

作者  | 2015-11-27 16:39:56 | 阅读(687) |评论(0) | 阅读全文>>

Tired of Null Pointer Exceptions? Consider Using Java SE 8's Optional!

2015-11-19 1:22:34 阅读701 评论0 192015/11 Nov19

Make your code more readable and protect it against null pointer exceptions.

Published March 2014

A wise man once said you are not a real Java programmer until you've dealt with a null pointer exception. Joking aside, the null reference is the source of many problems because it is often used to denote the absence of a value. Java SE 8 introduces a new class calledjava.util.Optional that can alleviate some of these problems.

Let's start with an example to see the dangers of null. Let's consider a nested object structure for a Computer, as illustrated in Figure 1.

Figure 1: A nested structure for representing a Computer

What's possibly problematic with the following code?

作者  | 2015-11-19 1:22:34 | 阅读(701) |评论(0) | 阅读全文>>

难念的经

演唱:周华健

笑你我枉花光心计

爱竞逐镜花那美丽

怕幸运会转眼远逝

为贪嗔喜恶怒着迷

责你我太贪功恋势

怪大地众生太美丽

悔旧日太执信约誓

为悲欢哀怨妒着迷

啊 舍不得璀灿俗世

啊 躲不开痴恋的欣慰

啊 找不到色相代替

啊 参一生参不透这条难题

吞风吻雨葬落日未曾彷徨

欺山赶海践雪径也未绝望

拈花把酒偏折煞世人情狂

凭这两眼与百臂或千手不能防

天阔阔雪漫漫共谁同航

这沙滚滚水皱皱笑着浪荡

贪欢一刻偏教那女儿情长埋葬

作者  | 2015-5-21 10:10:11 | 阅读(1290) |评论(0) | 阅读全文>>

一个配置Java环境的Shell脚本

2015-3-12 18:24:30 阅读910 评论2 122015/03 Mar12

朋友说Linux配置JDK过程复杂,所以给他写了个脚本,一键搞定。

#!/bin/bash

usage(){

echo "Usage: ./`basename $0` jdk-linux.tar.gz"

}

# check parameter

if [ $# -lt 1 ]; then

echo "Argument missing"

usage

exit 1

fi

FILE=$1

if [ ! -f $FILE ];then

echo "$FIle not exists."

exit 1

fi

# copy file to the destination and decompress

CUR_PATH=`pwd`

DEST_PATH="/usr/java/jdk"

mkdir -p $DEST_PATH

rm -rf "${DEST_PATH}/*"

cd ${DEST_PATH}

cp "${CUR_PATH}/$FILE" ${DEST_PATH}

tar zxvf $FILE

rm -f "${DEST_PATH}/$FILE"

DIR_NAME=`ls`

JDK_PATH="${DEST_PATH}/${DIR_NAME}"

作者  | 2015-3-12 18:24:30 | 阅读(910) |评论(2) | 阅读全文>>

Mutex vs Semaphore

2015-2-9 7:19:06 阅读953 评论0 92015/02 Feb9

What are the differences between Mutex vs Semaphore? When to use mutex and when to use semaphore?

Concrete understanding of Operating System concepts is required to design/develop smart applications. Our objective is to educate  the reader on these concepts and learn from other expert geeks.

As per operating system terminology, the mutex and semaphore are kernel resources that provide synchronization services (also called as synchronization primitives). Why do we need such synchronization primitives? Won’t be only one sufficient? To answer these questions, we need to understand few keywords. Please read the posts on 

作者  | 2015-2-9 7:19:06 | 阅读(953) |评论(0) | 阅读全文>>

查看所有日志>>

 
 
 
 
 
 

社交

 
 
模块内容加载中...
 
 
 
 
 
 
 

北京市 东城区 处女座

 发消息  写留言

 
一个伪文青。
 
近期心愿把英语练好。
人生格言人生最大的智慧在于如何利用别人的智慧
博客等级加载中...
今日访问加载中...
总访问量加载中...
最后登录加载中...
 
 
 
 
 

当前在线

 
 
模块内容加载中...
 
 
 
 
 
 
 
心情随笔列表加载中...
 
 
 
 
 

最新日志

 
 
数据列表加载中...
 
 
 
 
 

热门日志

 
 
数据列表加载中...
 
 
 
 
 
 
 
模块内容加载中...
 
 
 
 
 
 
 
模块内容加载中...
 
 
 
 
 
 
 
日志评论
评论列表加载中...
 
 
 
 
 
 
 
博友列表加载中...
 
 
 
 
 

留言

 
 
模块内容加载中...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017

注册 登录  
 加关注