gcc / g++编译

gcc、g++ 常用编译参数

  • -E : 预处理,处理结果输出到标准输出,如果需要输出到文件,需要使用 -o 参数,通常用 ‘.i’ 作为后缀.

Read More

百度云下载加速工具 Aria2

  1. https://github.com/aria2/aria2/releases 下载安装 aria2.

Read More

最短路径题集(Shortest Path Problems)

Shortest Path: Dijkstra, Bellman-Ford,Floyd-Warshall,SPFA

Dijkstra

Read More

Maven 常用命令和配置

打加入依赖的包

在 pom.xml 中加入 maven-shade-plugin 插件:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<minimizeJar>true</minimizeJar>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.example.app.Main</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Read More

Implement Chatroom using javax.websocket and jetty.

jetty 既实现了 jsr-356 中定义的 websocket 规范(javax.websocket),也实现了一套自己的 websocket,包名分别是 org.eclipse.jetty.websocket.api 和 org.eclipse.jetty.websocket.jsr356。

Read More

Git 常用命令

push tag:

  1. git push \<remote> tag_name # push a single tag

Read More

Git 常用命令

tag:

1
2
3
4
5
6
7
8
# create a new tag 
git tag -a "tag_name" -m "comment"
# list all tags
git tag
# push a single tag:
git push origin tag_name
# push all tags
git push origin --tags

Read More

常用软件

go2shell

Read More

Linux 常用命令

显示任意路径下所有文件夹的大小

下面的命令显示 /var 下所有文件夹的大小:

Read More

Linux 常用配置

~/.inputrc 配置

1
2
3
4
5
6
7
# [Tab auto-completion case-insensitive](https://askubuntu.com/a/87066/546909)
set completion-ignore-case On
# [prefix sensitive for previous command searching](http://unix.stackexchange.com/a/96511/205808)
# Press up-arrow for previous matching command
"\e[A":history-search-backward
# Press down-arrow for next matching command
"\e[B":history-search-forward

Read More