优秀文章转载

<bean id="mappingMongoConverter"
class="org.springframework.data.mongodb.core.convert.MappingMongoConverter">
<constructor-arg name="mongoDbFactory" ref="mongoDbFactory" />
<constructor-arg name="mappingContext" ref="mappingContext" />
<property name="typeMapper" ref="defaultMongoTypeMapper" />
</bean>
<bean id="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate">
<constructor-arg name="mongoDbFactory" ref="mongoDbFactory" />
<constructor-arg name="mongoConverter" ref="mappingMongoConverter" />
</bean>

http://www.lxway.com/815510822.htm

springboot:
http://342104628.iteye.com/blog/2411854

mat的下载包:
MemoryAnalyzer-1.5.0.20150527-win32.win32.x86_64.zip

transacational的回滚的用法:
http://blog.csdn.net/bao19901210/article/details/41724355
1.applicationContext.xml中开启事务:
<tx:annotation-driven transaction-manager="transactionManager"/>
2.applicationContext-dao.xml中配置事务
<!-- 配置事务管理 -->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
3.配置切点:
<aop:config>
<aop:pointcut id="allServiceMethod" expression="execution(* com.xxx.api.services..*.*(..))" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="allServiceMethod" />
</aop:config>
4.配置切点的方法:
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name = "update*" propagation = "REQUIRED" />
<tx:method name = "insert" propagation = "REQUIRED"/>
<tx:method name = "del*" propagation = "REQUIRED" />
<tx:method name = "down*" propagation = "REQUIRED"/>
<tx:method name = "up*" propagation = "REQUIRED"/>
</tx:attributes>
</tx:advice>

spring 方法注解说明:
http://www.iteye.com/news/32657
http://blog.csdn.net/yhjyumi/article/details/48105331
@RequestMapping(value = "/xxx", method = RequestMethod.POST)
public @ResponseBody XXXModel doSomething(@RequestHeader(value = "type", required = false, defaultValue = "0") int type, @RequestBody RequestModel reqModel)


oautho2.0文章
原理:https://www.zhihu.com/question/19781476
例子:http://blog.csdn.net/jing12062011/article/details/78147306


linux查看进程文件数及配置:
http://www.blogjava.net/fly2008/archive/2009/08/26/292626.html
lsof -p pid

进程启动时间
ps -p PID -o lstart


1.ssh-keygen -t rsa
2.ssh-copy-id "push@1.1.1.1 -p 23"

sudo su - 切换root用户
sudo su -l nginx 切换到子用户

linux 循环打印文件:
function while_read_LINE_bottm(){
While read LINE
do
echo $LINE
done < $FILENAME
}

redis相关:
cluster info 打印集群的信息
cluster nodes 列出集群当前已知的所有节点(node),以及这些节点的相关信息

maven resources filter配置
http://zhaoshijie.iteye.com/blog/2094478

mysql抓包分析为明文:
tcpdump -i bond0 -s 65535 -x -nn -q -tttt port 3306 -c 200000 > 1.dmp
pt-query-digest --type tcpdump 1.dmp --limit 30 > report.log
步骤1:先抓二进制包 2.通过pt-query-digest转换二进制为明文数据


mybatis最后拼的查询语句可以查看此类:PreparedStatementHandler
MappedStatement
public BoundSql getBoundSql(Object parameterObject) {
BoundSql boundSql = sqlSource.getBoundSql(parameterObject);


spring与mybatis的集成原理。

1.spring启动一般分为web容器,
org.springframework.web.context.ContextLoaderListener

org.apache.commons.collections.CollectionUtils

tomcat源码:StandardWrapperValve ApplicationFilterChain(其实就是FilterChain,filter的doFilter执行完毕后,会在ApplicationFilterChain里面接着执行service方法)

Nagle算法逻辑就是:如果发送的包很小(不足MSS),又有包发给了对方对方还没回复说收到了,那我也不急着发,等前面的包回复收到了再发。这样可以优化带宽利用率(早些年带宽资源还是很宝贵的),Nagle算法也是用来优化改进tcp传输效率的。

tcpdump -X -vv -i eth0 src 10.244.42.49
tcpdump -X -vv -i eth0 src port 8688
tcpdump -i any port 1935 -p -s 0 -w capture.pcap
ip.src == 30.19.147.154 sony 30.19.147.42 小米
ip.dst == 30.19.144.209

tcpdump -i any port 1935 -p -s 0 -w /sdcard/capture1.pcap
tcpdump -X -vv -i eth0 dest

pgm -A -f sm_host 'grep "ali149061792539487" /home/admin/logs/xxxx/rpc/xxx-rpc-event.log' > warn.log

tcp网络定位:
route -n 查看路由表及网关信息
traceroute ip 查看到目标机器跳步几次
arp -a 查询IP对应的mac地址

sudo tcpdump -i eth0 arp

TCP建连接过程跟前面ping一样,只是把ping的icmp协议换成TCP协议,也是要先根据route,然后arp。

查看网卡的历史数据:
sar -f /var/log/sa/sa01 -n DEV -s 16:00:00 -e 20:00:00 |grep -E "IFACE|eth0"

查看端口被哪个服务给占用#netstat -ntlp |grep 1935

查看进程占用哪几个端口# netstat -nap | grep pid


网络定位:但sar也可以检测cpu、内存、IO等,以下是检测IO
sar -n DEV 2 100

youkit:
-agentpath:e:\software\youkit\youkit\install\bin\win64\yjpagent.dll

合并主分支
1.git pull origin master 拉主分支最新代码
2.git branch --set-upstream-to=origin/master master 本地master同远程master做关联
3.git checkout 本地分支
4.git merge master

git 缺少 changeId
1. git reset 76d1480247a65afddaf6d2c9a45da9e695888728 //缺少ID的 commitid
2. git commit --amend


或者使用
git checkout -b xxxx-branch remotes/origin/xxxx-branch //这样就把本地和远程分支进行绑定,后续只需要commit 后直接push即可

git 工作区只存留一个文件
git stash -p //此命令会进行交互界面,不需要暂存的选择n,需要暂存的选择y

回退之前的merge:
git reset --hard HEAD~

git merge --no-ff targetbranch 强制合并


三个线程同时执行: CyclicBarrier or countdownlatch

concurrentHashMap:
1.6 分段加锁 segment方式
1.8 CAS + synchronized 底层依然采用数组+链表+红黑树

java cpu 高速缓存计算
sun.misc.Contended?
缓存行锁定及lock锁定,CAS实际是调用C的代码实现的,内部判断当前处理器核数,如果是多核,则加lock标识,进而使用缓存行的方式。


netty相关:
bytebuffer和bytebuf的区别:
http://blog.csdn.net/jeffleo/article/details/69230112


Netty之有效规避内存泄漏
http://calvin1978.blogcn.com/articles/netty-leak.html

Netty系列之Netty高性能之道
http://www.infoq.com/cn/articles/netty-high-performance?utm_source=infoq&utm_campaign=user_page&utm_medium=link

Netty:option和childOption参数设置说明
http://www.jianshu.com/p/0bff7c020af2

Netty系列之Netty可靠性分析
http://www.infoq.com/cn/articles/netty-reliability?utm_source=infoq&utm_campaign=user_page&utm_medium=link

Netty中的那些坑(上篇)
http://www.cnblogs.com/rainy-shurun/p/5213086.html

netty堆外内存
https://www.cnblogs.com/549294286/p/5169759.html

nginx-lua:
http://jinnianshilongnian.iteye.com/blog/2186448

python:
http://www.liaoxuefeng.com/wiki/001374738125095c955c1e6d8bb493182103fac9270762a000/

zookeeper之监听事件总结
http://www.itnose.net/detail/6445740.html

基于ZooKeeper的分布式Session实现
http://blog.csdn.net/jacktan/article/details/6112806

锁堆栈、同步、调度
http://www.iteye.com/topic/1129528

jvm常用命令
http://1358440610-qq-com.iteye.com/blog/2229370

Java基础之JVM运行机制
http://syyixin.iteye.com/blog/2183615

文章内容比较深,涉及到不少源码。
地址:http://it.deepinmind.com/

分布式服务框架zookeeper介绍。
http://www.ibm.com/developerworks/cn/opensource/os-cn-zookeeper/

Linkedin工程师是如何优化他们的Java代码的
http://www.iteye.com/news/29960

使用JMeter对Tomcat进行压力测试与Tomcat性能调优
http://josh-persistence.iteye.com/blog/2164035

java编程中遇到的时区与时间问题总结
http://www.rigongyizu.com/java-timezone-time-issue-summary/

使用 RMI + ZooKeeper 实现远程调用框架
http://m635674608.iteye.com/blog/2165741

MySQL主从复制与读写分离
http://www.cnblogs.com/luckcs/articles/2543607.html

优化Java中的多态代码
http://www.iteye.com/news/30044

从零开始写个编译器吧系列
http://zhuanlan.zhihu.com/mosky/19878087
http://justjavac.iteye.com/blog/2173805

Spring FactoryBean源码浅析
http://blog.csdn.net/java2000_wl/article/details/7410714

Spring——jar包详解
http://qq-25012965.iteye.com/blog/2174895

实例讲解 SQL 注入攻击
http://www.iteye.com/news/30092

linux shell命令执行sql(mysql入门)
http://zhangzhaoaaa.iteye.com/blog/2175885
免密码登录
ssh-copy-id -i ~/.ssh/id_rsa.pub 10.10.10.10
ssh-copy-id -p 222 -i ~/.ssh/id_rsa.pub 10.10.10.10


程序员篇:8个开发技巧助你薪水更上一层楼
http://www.devstore.cn/new/newInfo/821.html
http://www.devstore.cn/new/newInfo/1011.html

常见gcc编译警告整理(开始)
http://blog.csdn.net/tietao/article/details/7244997

MYSQL学习
http://mysql.taobao.org/index.php
时间相减函数:
update xxx t set t.create_time = date_sub(curdate(),interval 44 day) where .....
插入的同时返回主键:
<insert id="insertSelective" parameterType="com.xxx">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
select LAST_INSERT_ID()
</selectKey>
insert into xxxx_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="xxxId != null">
xxx_id,
</if>
<if test="xxxName != null">
xxx_name,
</if>
create_time,
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="xxxd != null">
#{xxxId,jdbcType=INTEGER},
</if>
<if test="xxxName != null">
#{xxxName,jdbcType=VARCHAR},
</if>
NOW(),
</trim>
</insert>

mysql按天来分组,查找某一列最大的值
SELECT DATE_FORMAT( t.record_date, '%Y-%m-%d' ) date_alias, MAX( `num` )
FROM xxx_table t
WHERE t.type =13
AND t.create_time > '2017-01-01 00:00:00'
GROUP BY date_alias
LIMIT 0 , 30

3.导出db1中的a1、a2表

注意导出指定表只能针对一个数据库进行导出,且导出的内容中和导出数据库也不一样,导出指定表的导出文本中没有创建数据库的判断语句,只有删除表-创建表-导入数据

mysqldump -uroot -proot --databases db1 --tables a1 a2 >/tmp/db1.sql

架构师之oracle--------分钟数相加最简便的方法
http://nannan408.iteye.com/blog/2178056

mysql安装
http://xupo.iteye.com/blog/1128671
http://yucang52555.iteye.com/blog/2178363

问题定位:
Caused by: java.io.IOException: Broken pipe的异常场景:
问题分析:
TCP服务端write数据时,收到SIGPIPE信号(连接已经终止)
场景:
1.TCP握手尚未结束时,连接已经close;
2.服务端收到一次read,但write了多次;
3.连接通道被占满,新连接被拒绝时,client中断了所有连接。
http://blog.csdn.net/zqz_zqz/article/details/52235479
broken pipe的字面意思是“管道破裂”。broken pip的原因是该管道的读端被关闭。
broken pipe最直接的意思是:写入端出现的时候,另一端却休息或退出了,因此造成没有及时取走管道中的数据,从而系统异常退出;

注意:在Unix系统下,如果send在等待协议传送数据时网络断开的话,调用send的进程会接收到一个SIGPIPE信号,进程对该信号的默认处理是进程终止。

hbase过滤查询:
http://aoyouzi.iteye.com/blog/2299623

偏向锁:
https://www.cnblogs.com/zhangfengshi/p/7068823.html
可以优化synchronized

jstat gcutil pid 10s 10 每隔10秒打印一次jvm堆信息
jstat -gcutil 29192 1s 10


idea下载:
http://confluence.jetbrains.com/display/IDEADEV/IDEA+2017.1+EAP
选择下载:ideaIU-2017.1.5.exe
idea license server address:输入下面的地址
http://idea.imsxm.com/

sublime3下载地址:
https://www.sublimetext.com/3
notepad++中文版
filezilla
xshell/xftp/xmanage
maven/jdk
mysql-workbench
picpick
postman:Postman-win64-4.9.3-Setup.exe 邮件中下载
protoc.exe 下载地址:https://github.com/google/protobuf/releases 使用方法
protoc --java_out=src/main/java src/main/resources/proto/xxx_payload.proto
sourcetree
rar/wrar_5.40.0.0_scp.exe

git 下载:https://git-scm.com/download/win
git配置 https://www.cnblogs.com/qiweb/p/6424809.html

反编译工具:jd-gui.exe

mat工具:
MemoryAnalyzer-1.5.0.20150527-win32.win32.x86_64

netty相关:
https://www.cnblogs.com/zemliu/p/4423786.html
https://www.gitbook.com/book/mcxiaoke/mqtt-cn/details
https://www.cnblogs.com/zhangyu1024/p/6141818.html
https://www.zhihu.com/question/42308970/answer/123620051
http://redisdoc.com/index.html redis命令
令牌桶-流量控制 http://www.cnblogs.com/ym65536/p/5041309.html
git rebase简介(高级篇)-cengku-ChinaUnix博客 http://blog.chinaunix.net/uid-27714502-id-3436706.html
git - 廖雪峰的官方网站 https://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000/0013760174128707b935b0be6fc4fc6ace66c4f15618f8d000
深入剖析基于并发AQS的(独占锁)重入锁(ReetrantLock)及其Condition实现原理 - zejian的博客 - CSDN博客 http://blog.csdn.net/javazejian/article/details/75043422?locationNum=1&fps=1
Guava官方文档-RateLimiter类 | 并发编程网 – ifeve.com http://ifeve.com/guava-ratelimiter/
log4j2 RollingRandomAccessFile配置 - - ITeye博客 http://garssion.iteye.com/blog/2369929
Netty之有效规避内存泄漏 - Loull - 博客园
http://www.cnblogs.com/549294286/p/5168454.html
使用ssh-keygen和ssh-copy-id三步实现SSH无密码登录-xueliangfei-ChinaUnix博客
http://blog.chinaunix.net/uid-26284395-id-2949145.html
理解OAuth 2.0 - 阮一峰的网络日志
http://www.ruanyifeng.com/blog/2014/05/oauth_2_0.html
使用ulimit 命令、/etc/security/limits.conf、proc 调整系统参数 - 简书 http://www.jianshu.com/p/23ee9db2a620

15分钟熟悉HBase Shell命令
http://blog.csdn.net/tanggao1314/article/details/51387560


io.netty.channel.ChannelOutboundBuffer$Entry
http://www.mamicode.com/info-detail-1215305.html
https://my.oschina.net/u/438393/blog/845300
https://www.jianshu.com/p/88fb6653ab22
mqtt
https://www.cnblogs.com/leeying/p/3795896.html

iswritable
http://www.bijishequ.com/detail/576753?p=


https://waylau.gitbooks.io/essential-netty-in-action/CORE%20FUNCTIONS/The%20ChannelHandler%20Family.html

netty水位:
https://blog.csdn.net/feiyingHiei/article/details/78735754
https://github.com/netty/netty/issues/5920

final class PooledDirectByteBuf extends PooledByteBuf<ByteBuffer>


static PooledDirectByteBuf newInstance(int maxCapacity) {
PooledDirectByteBuf buf = RECYCLER.get();
buf.setRefCnt(1);
buf.maxCapacity(maxCapacity);
return buf;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值