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
# bashを起動するときに読み込まれる設定ファイル | |
PATH=$PATH:$HOME/local/bin |
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
# /etc/nginx/sites-enabled/php.conf | |
server { | |
listen 80; | |
server_name php.aws; | |
root /var/www/html; | |
location / { | |
fastcgi_pass unix:/var/run/php5-fpm.sock; | |
fastcgi_index index.php; | |
include fastcgi_params; |
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
# apache2を再起動 | |
sudo systemctl restart apache2 | |
# apache2の設定を再読み込み | |
sudo systemctl reload apache2 | |
# apache2を止める | |
sudo systemctl stop apache2 |
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 handson | |
User admin | |
Port 22 | |
IdentityFile インスタンスを作るときにダウンロードしたpemファイル | |
HostName パブリックIPアドレス | |
ServerAliveInterval 300 |
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
// inspired by http://code.google.com/p/google-caja/source/browse/trunk/src/com/google/caja/plugin/html-sanitizer.js | |
// instead of doing with text, only use DOM1 and DocumentFragment | |
var dom_html_sanitize; | |
(function(html4){ | |
// usage is similar to html_sanitize method of html-sanitizer.js | |
// but takes an html document and returns a DocumentFragment | |
// @param document a document that the output DocumentFragment belongs to (must implement createDocumentFragment method) | |
// @param htmlDoc an html document to sanitize (must implement DOM1) |
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
#!/usr/bin/python | |
class List(list): | |
def dup(self): | |
def _dup(lst,ancestors): | |
for orig,copy in ancestors: | |
if lst == orig: | |
return copy | |
copy = lst[:] | |
_ancestors = ancestors+[(lst,copy)] | |
for i,x in enumerate(copy): |
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
/** | |
* 想定する文字列(UCS2)かどうか | |
* (parse_strした結果に適用される) | |
*/ | |
private static function isValidString($str) | |
{ | |
if (mb_strlen($str, 'UTF-8') > self::MAX_DETAIL_CHAR_LENGTH) { | |
return false; | |
} | |
$ucs2 = mb_convert_encoding($str, 'UCS-2', 'UTF-8'); |
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
# PRML p152-p154 | |
library(ggplot2) | |
library(MASS) | |
# a0 and a1 are parameters to predict | |
a0 <- -0.3 | |
a1 <- 0.5 | |
f <- function(x) {a0 + a1 * x} |
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
log_format ltsv | |
"time:$time_iso8601" | |
"\treq_time:$request_time" | |
"\tapp_time:$upstream_response_time" | |
"\tres_size:$bytes_sent" | |
"\tstatus:$status" | |
"\tmethod:$request_method" | |
"\tpath:$request_uri" | |
"\thost:$remote_addr" | |
"\tua:$http_user_agent" |
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
sort by avg_time | |
avg total count method path | |
9.46 2753.95 291 GET /ticket/1 | |
5.28 1510.27 286 GET /artist/1 | |
4.54 1329.08 293 GET / | |
4.37 454.62 104 POST /buy | |
3.82 3.82 1 GET /admin/order.csv | |
1.22 2.45 2 POST /admin | |
0.15 0.15 1 GET /artist/2 | |
0.03 4.28 130 GET /js/jquery-ui-1.8.24.custom.min.js |