Skip to content

Instantly share code, notes, and snippets.

View maskleo's full-sized avatar
❤️
Thinking&Learning

maskleo maskleo

❤️
Thinking&Learning
View GitHub Profile
@maskleo
maskleo / linux-http-tcp.md
Last active August 21, 2018 03:12 — forked from v5tech/linux-http-tcp.md
[linux下查看http 并发和 tcp连接数] #linux #http #tcp

linux查看httpd进程数

ps -ef | grep httpd | wc -l

查看Apache的并发请求数及其TCP连接状态

netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
@maskleo
maskleo / gh-pages-deploy.md
Last active August 21, 2018 03:19 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io). #github

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@maskleo
maskleo / System Design.md
Created August 17, 2018 03:51 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@maskleo
maskleo / how-to-squash-commits-in-git.md
Created August 17, 2018 03:49 — forked from patik/how-to-squash-commits-in-git.md
How to squash commits in git

Squashing Git Commits

The easy and flexible way

This method avoids merge conflicts if you have periodically pulled master into your branch. It also gives you the opportunity to squash into more than 1 commit, or to re-arrange your code into completely different commits (e.g. if you ended up working on three different features but the commits were not consecutive).

Note: You cannot use this method if you intend to open a pull request to merge your feature branch. This method requires committing directly to master.

Switch to the master branch and make sure you are up to date:

文/端宏斌

昨天的文章毫无悬念被“和谐”了,这早就见怪不怪了,被删的时候,点击量已经接近100万,这说明了读者的认可。

我想送一张图给某些人:一束光照进房间,房间里的肮脏龌龊被显现,这束光就有罪了么?把窗户堵上并不解决问题啊。

今天我想来谈一个比较严肃的话题,咱们的老百姓为什么会不高兴?

@maskleo
maskleo / 01_02_Boxing_and_Unboxing.md
Last active July 4, 2018 09:12
Java泛型与集合
原始类型 引用类型
byte Byte
short Short
int Integer
long Long
float Float
double Double
boolean Boolean
char Character
@maskleo
maskleo / SpringBoot-admin-exception-stack-message
Last active August 21, 2018 02:56
[SpringBoot-admin-exception-stack-message] #temp #exception
2018-06-26 10:20:09.197 ERROR 27180 --- [nio-8000-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] threw exception
java.io.IOException: 你的主机中的软件中止了一个已建立的连接。
at sun.nio.ch.SocketDispatcher.write0(Native Method) ~[na:1.8.0_40]
at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:51) ~[na:1.8.0_40]
at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93) ~[na:1.8.0_40]
at sun.nio.ch.IOUtil.write(IOUtil.java:65) ~[na:1.8.0_40]
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:471) ~[na:1.8.0_40]
at org.apache.tomcat.util.net.NioChannel.write(NioChannel.java:134) ~[tomcat-embed-core-8.5.31.jar:8.5.31]
at org.apache.tomcat.util.net.NioBlockingSelector.write(NioBlockingSelector.java:101) ~[tomcat-embed-core-8.5.31.jar:8.5.31]
@maskleo
maskleo / 1.用货币贬值打贸易战,是个昏招.md
Last active August 21, 2018 03:23
[2018 贸易战相关] #404,#贸易战

文/端宏斌

上周的文章《对付美帝的正确姿势》果然是活不过24小时,不过在被删前点击量已经破了10万+。很多人在后台留言希望我单独把文章发给他,很抱歉,真的做不到,你想要看被删的文,唯一办法就是早点看。

我和其他公众号不一样,我更新的频率不高,一周也就1-2篇,最近微信大改版,公众号文章变成了信息流的形式,如果你不想错过我的文章,建议把“老端的观点”置顶或标星,这样就可以确保不错过。

——————————————

这段时间各种小道消息不断,上周四,外媒报道说周末降准,果然周末就降准了。还有人说上层考虑用人民币贬值的方式来对冲贸易战,果然人民币开始天天大幅下跌,今天开始传闻货币化棚改要喊停了,逼得上头跑出来辟谣,说并没有叫停,但是大幅放缓是肯定的。还有人说房产税草案已经出来了,但是报上去之后被打了回来。

@maskleo
maskleo / README.md
Created June 21, 2018 07:34
测试

springboot-configure-annotation

原始的类必须都有注解 @RefreshScope

引用该类的地方有 @RefreshScope 才会刷新 @Value 注入的值

@maskleo
maskleo / split.sql
Created April 11, 2018 02:34
split
with t as
(select '1,2,3,10,11,12' a from dual)
select substr(a,
decode(level - 1, 0, 0, instr(a, ',', 1, level - 1)) + 1,
(decode(level,
regexp_count(a, ',') + 1,
length(a) + 1,
instr(a, ',', 1, level))) -
(decode(level - 1, 0, 0, instr(a, ',', 1, level - 1)) + 1))
from t