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
# --header "Range: byte=a-b" can partial download. | |
$ curl --header "Range: bytes=0-200000" http://anyhost.com/anyfile.zip -o part1 | |
$ curl --header "Range: bytes=200001-400000" http://anyhost.com/anyfile.zip -o part2 | |
$ curl --header "Range: bytes=400001-600000" http://anyhost.com/anyfile.zip -o part3 | |
$ curl --header "Range: bytes=600001-800000" http://anyhost.com/anyfile.zip -o part4 | |
$ curl --header "Range: bytes=800001-1000000" http://anyhost.com/anyfile.zip -o part5 | |
$ cat part1 part2 part3 part4 part5 > anyfile.zip | |
$ wc -c anyfile.zip | |
835428 anyfile.zip |
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 TestClass{ | |
private String generateToken(){ | |
MessageDigest md; | |
try { | |
md = MessageDigest.getInstance("MD5"); | |
} catch (NoSuchAlgorithmException e) { | |
// coding error. | |
LOGGER.error("codeing error. ", e); | |
throw new RuntimeException(e); | |
} |
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
セッション維持 | |
負荷分散環境の構築により、サーバ負荷の軽減やユーザーへのスループット向上を実現できます。参照系のサイトであれば、同一クライアントからの要求をセッションごとにどのサーバに割り振っても特に問題にはなりません(もちろん、各ノード内のコンテンツの同期が取れていることが前提です)。 | |
しかし、ショッピングサイトで買い物中に同一クライアントからのセッションが異なるサーバに分散されたのでは、せっかく買おうと思ってショッピングカートに詰め込んだ商品が消失してしまうことにもなりかねません。 | |
そこで、「セッションの維持」が必要となります。同一クライアントからの要求は同一サーバに固定的に割り振り、同一サーバを使ってセッションを維持するということです。 | |
セッション維持の方法には幾つかありますが、昨今のブラウザ環境の多様化に伴い、新しい維持方法(Sticky)も必要となってきています。ここではそれらも含めて説明します。 | |
下記よりコピペ | |
http://www.atmarkit.co.jp/ait/articles/0106/09/news002.html |
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
upstream gappori_shop { | |
server gappori_shop.com:20080; | |
} | |
server { | |
listen 80; | |
server_name shop.nureteni.awa.co.jp; | |
location / { | |
proxy_pass http://gappori_shop; |
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
$ hive -S -e ‘select * from tbl_a limit 100′ > hive_result.txt |
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
■generics で T.class したかった話 | |
http://d.hatena.ne.jp/language_and_engineering/20120502/p1 | |
■generics に関して多くの情報があるブログ | |
http://d.hatena.ne.jp/Nagise/ | |
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
2.2.x からの新機能で、CollectionのDataにTTLを設定できる | |
詳しくはこちら。 | |
http://docs.mongodb.org/manual/tutorial/expire-data/ | |
実装に関してはこちら。 | |
http://www.codeproject.com/Tips/467689/MongoDB-Time-To-Live-TTL-Collections | |
(java のensureIndex からは適用できなかったのでshell から実施。MongoDB Version:2.4, MongoDB JavaDriver:2.11.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
public class LocaleChangeInterceptor extends HandlerInterceptorAdapter { | |
@Override | |
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { | |
// any logic... | |
} | |
@Override | |
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, | |
ModelAndView modelAndView) throws Exception { |
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
Spring MVC “redirect:” prefix always redirects to http — how do I make it stay on https? | |
http://stackoverflow.com/questions/3401113/spring-mvc-redirect-prefix-always-redirects-to-http-how-do-i-make-it-stay/3401157#3401157 |
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
HttpServletRequest から取得できるPath関連の情報 | |
http://cdn-ak.f.st-hatena.com/images/fotolife/u/uriyuri/20080718/20080718103706.jpg | |
元: | |
http://d.hatena.ne.jp/uriyuri/20080718/1216345412 |