Ubuntu 14.04 LTS でのサーバ設定方法
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
1c1 | |
< ### template_55.my.cnf revision 20150121 | |
--- | |
> ### template_56.my.cnf revision 20150319 | |
4c4 | |
< socket= __datadir__/mysql.sock #<< /data/path_name | |
--- | |
> socket= __datadir__/mysql.sock #<< | |
11a12 | |
> #malloc-lib= /usr/lib64/libjemalloc.so.1 |
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
class FbBotController < ApplicationController | |
protect_from_forgery except: :callback | |
FB_WEBHOOK_VERIFY_TOKEN="WebHook登録時に入力したトークン" | |
FB_PAGE_ACCESS_TOKEN="フェイスブックページのページアクセストークン" | |
# WebHooks登録時コールバックURL | |
def subscribe | |
if params["hub.mode".to_sym] != "subscribe" |
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
require 'faraday' | |
class Linebots::BotController < ApplicationController | |
protect_from_forgery except: :callback | |
def callback | |
if request.method != 'POST' | |
render text: 'NG', status: 500 |
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
location ~ /(nginx_|server-)status { | |
stub_status on; | |
access_log off; | |
allow 127.0.0.1; | |
deny all; | |
break; | |
} |
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
$ openssl genrsa -out my-domain-name.2016.key 2048 |
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
# path 以下のファイル/ディレクトリ一覧を再帰的に探索 | |
import os, os.path | |
root_path = '/dir/' | |
for root, dirs, files in os.walk(root_path): | |
for file in files: | |
#print(os.path.join(root, file)) | |
if len(file.encode('utf-8')) > 40: | |
print(" {}".format(file)) |