C = Control Btn1 = 左键 M = Alt Btn2 = 中键 S = Shift Btn3 = 右键 W = Window Wheel = 滚轮 左手: 1234 qwer asdf zxcv 右手 :yuiop hjkl; nm,./ 方向: aswd hjkl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker ps // 查看所有正在运行容器 | |
docker stop containerId // containerId 是容器的ID | |
docker ps -a // 查看所有容器 | |
docker ps -a -q // 查看所有容器ID | |
docker stop $(docker ps -a -q) // stop停止所有容器 | |
docker rm $(docker ps -a -q) // remove删除所有容器 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# default editor | |
export EDITOR=vim | |
# editor | |
visudo | |
# feedback password | |
Defaults env_reset, pwfeedback | |
# moilioncircle group sudo without password | |
%moilioncircle ALL=NOPASSWD: ALL | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Java 中对final 字段的修改,有很多黑魔法。 | |
org/apache/commons/lang3/reflect | |
https://stackoverflow.com/questions/3301635/change-private-static-final-field-using-java-reflection/31268945#31268945 | |
# System.in,out,err允许重定向 | |
``` java | |
import java.lang.reflect.*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
通过例子学 Rust | |
https://rustwiki.org/zh-CN//rust-by-example/ | |
RustPrimer | |
https://rustcc.gitbooks.io/rustprimer/content/ | |
Redox 操作系统 | |
https://www.redox-os.org/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd /data/publish/jiayu-bbs | |
# log git version to jar | |
version=src/main/resources/version.txt | |
git branch -v > $version | |
git log --pretty=format:'%h - %an, %ad : %s' --graph -10 >> $version | |
# delete config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ssh隧道有3种类型: | |
#动态端口转发(Socks 代理)-D | |
ssh -D 9090 ssh-host | |
产生一个本地sock5代理,端口是9090 | |
#本地端口转发(正向代理)-L |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) throws ParseException { | |
SimpleDateFormat s = new SimpleDateFormat("yyyy-MM-dd"); | |
Calendar c = Calendar.getInstance(); | |
c.set(2017,10,30); // 月份从0开始,10标识11月 | |
System.out.println(s.format(c.getTime())); | |
c.add(Calendar.MONTH,3); // 月末对齐 | |
System.out.println(s.format(c.getTime())); | |
Date d = s.parse("2017-13-45"); // 会有解析错误么?不会 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cat << EOF | |
#On Client: | |
[ -d ~/.ssh ] || mkdir .ssh | |
[ -f ~/.ssh/id_rsa.pub ] || ssh-keygen -t rsa | |
cat ~/.ssh/id_rsa.pub | |
# On Server | |
[ -d ~/.ssh ] || mkdir .ssh | |
cat >>~/.ssh/authorized_keys <<END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!! Exec=bash -c "/usr/bin/xmodmap $HOME/.xmodmaprc" | |
! xmodmap .xmodmaprc | |
! xmodmap -pke|grep -E ' (Caps|Cont|Home|Next|Up|Down|Left|Right|Home|End|Prior|Next|Delete|Escape|Mode_switch)' | |
! xev | |
!! Control_L(37)变成Mode_switch | |
remove Control = Control_L | |
keycode 37 = Mode_switch NoSymbol | |
!! Caps_Lock(66)变成Control_L |