This file contains hidden or 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 class TestCacheLoader extends CacheLoader<String, Boolean> { | |
@Autowired | |
private AuthUserManager userManager; | |
@Override | |
public AuthUser load(String key) throws Exception { | |
return userManager.getUser(key); | |
} | |
} |
This file contains hidden or 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
sudo add-apt-repository ppa:webupd8team/java | |
sudo apt-get update | |
sudo apt-get install oracle-java7-installer | |
#---- | |
sudo apt-get install oracle-java7-set-default |
This file contains hidden or 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 String replaceAtLast(String source,final String matchChar char,final String replaceChar){ | |
StringBuilder b = new StringBuilder(source); | |
b.replace(source.lastIndexOf(char), source.lastIndexOf(char) + 1, replaceChar ); | |
source = b.toString(); | |
} | |
public String trimLast(String source ,final String matchChar) { | |
if (source.length() > 0 && source.charAt(str.length()-1) == matchChar) { | |
source = source.substring(0, source.length()-1); | |
} |
This file contains hidden or 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_OPTS="$JAVA_OPTS -Xmx2048m -Xms256m -XX:PermSize=512m -XX:MaxPermSize=512m -Dcrowd.properties=C:/fusion/config/crowd.properties" | |
JPDA_OPTS="$JPDA_OPTS -agentlib:jdwp=transport=dt_socket,address=1043,suspend=n,server=y" | |
catalina.sh jpda start | |
--- | |
# http://blog.sokolenko.me/2014/11/javavm-options-production.html | |
JDK < 8 | |
-Xms1G -Xmx8G -XX:PermSize=256m -XX:MaxPermSize=512m -XX:+AggressiveOpts -XX:+UseConcMarkSweepGC -XX:ReservedCodeCacheSize=512 |
This file contains hidden or 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
<html ng-app> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script> | |
<meta charset="utf-8"> | |
<title>AngularJS test</title> | |
</head> | |
<body> | |
AngularJS basic | |
<br/> | |
{{ 9999 }} |
This file contains hidden or 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
# https://hub.docker.com/r/willfarrell/autoheal/ | |
docker run -d \ | |
--name autoheal \ | |
--restart=always \ | |
-e AUTOHEAL_CONTAINER_LABEL=all \ | |
-v /var/run/docker.sock:/var/run/docker.sock \ | |
willfarrell/autoheal |
This file contains hidden or 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
I. Codebase | |
One codebase tracked in revision control, many deploys | |
1.Use VCS( Git, Mercurial, or Subversion. ) | |
2.1 app 1 code repository | |
3.1 app 1 or many deploy(production , testing , develop1 , develop2 ...) | |
4.deploy can be different version , but from same code repo. | |
II. Dependencies | |
Explicitly declare and isolate dependencies |
This file contains hidden or 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
System Architect | |
* Hardware | |
* HP | |
* Dell | |
* 便宜常見即可 , 最好上便宜的SSD + 多多Ram | |
* MIS現在拿2U E5 Server 128Ram 當Windows Server Hyper-V Host來用 | |
* M$最近有出軟體模擬sharestorage , 要不要買硬體sharestorage會影響備份 | |
* OS | |
* Windows |
This file contains hidden or 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
Vagrant.require_version ">= 1.7.2" | |
# change default synced_folder for convenience | |
SYNCED_FOLDER = "/home/vagrant/docker-workshop" | |
# expose ports from guest to host for convenience | |
FORWARDED_PORT_RANGE = (11050..11100) | |
Vagrant.configure(2) do |config| |
This file contains hidden or 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
server { | |
listen 80; | |
server_name localhost; | |
#charset koi8-r; | |
#access_log /var/log/nginx/log/host.access.log main; | |
location / { | |
root /usr/share/nginx/html; | |
index index.html index.htm; |