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
#!/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
通过例子学 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
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
# 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
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
# host | |
sudo iptables -t nat -A POSTROUTING -s 192.168.56.0/24 -j MASQUERADE | |
# guest | |
sudo vi /etc/network/interfaces | |
auto enp0s3 |
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
wget --tries=3 --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u162-b12/0da788060d494f5095bf8624735fa2f1/jdk-8u162-linux-x64.tar.gz -O ./jdk-8u162-linux-x64.tar.gz |
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 | |
master_host=jiayu-app-master | |
master_ip=`grep $master_host /etc/hosts | awk '{print $1}'` | |
master_here=`ifconfig -a | grep $master_ip` | |
this_host="" | |
that_host="" | |
if [ -z "$master_here" ]; then |
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
# append to [Service] | |
sudo tee -a /lib/systemd/system/mysql.service << EOF | |
LimitNOFILE=infinity | |
LimitMEMLOCK=infinity | |
EOF | |
sudo systemctl daemon-reload | |
sudo service mysql restart | |