â
æ¯æã®ãã¼ã¿éä¿¡è²»ã5000åã¨é«ä¾¡ã ã£ãã®ã§ãæè¿æµè¡ãã®æ ¼å®simãç©è²ä¸ã
âãã¼ã¿éä¿¡ã§ããããäºãã©ãããæã«ä½¿ãã®ãã決ãã
å¤æ®µãå®ããã°å質ãæªãã¦ãåé¡ç¡ãã¨æã£ã¦ããããéä¿¡é度ã10kbpsãä¸åã£ãæã«ãããããã¯æµç³ã«èããããªããã¨æãã¾ããã
å®ãããæªãããã¨ãããã¨ã§ãå¤æ®µã ãã§æ±ºããã®ã¯å±éºã ã¨æãã¾ããã
å¤æ®µä»¥å¤ãéè¦ããå ´åãèªåã«ã¨ã£ã¦ä½ã大åããæåã«èãã¦ããã¨ãå¥ç´å¾ã®å¾æãå°ãªããã¨æãã¾ãã
åèã«ã¯ãªããªãã¨æãã¾ãããç§ãéè¦ããã®ã¯ä¸ã®ãããªæãã§ãã
å¿
é é
ç®ã®ä¸ã«é«ééä¿¡ãå¿
è¦ãªãã²ã¼ã ã§éã¶ããå
¥ã£ã¦ãããããé«ééä¿¡ãå¿
è¦ã«ãªãã¾ãã
âå¿ é
gce ã¤ã³ã¹ã¿ã³ã¹ã®èµ·åãåæ¢ãã§ãã
ssh 㧠gce ã®ã¤ã³ã¹ã¿ã³ã¹ã«æ¥ç¶ãã¦æä½ãã§ãã
æã«300MBä½ãã¦ã³ãã¼ããçºçããç¹å®ã®ã²ã¼ã ãéã¶
ãã©ã¦ã¶ã§è³æã®æ¤ç´¢ãé²è¦§
ã¯ã¦ãªãã¤ã¢ãªã¼ã®è¨è¼
ã¡ã¼ã«ã®éåä¿¡
Lineã®éåä¿¡
Twitterã«æ¸ãè¾¼ã¿
主ã«ä½¿ãã®ã¯ãéå¤ä¸
ãã¶ãªã³ã°
âã§ããã°ãããã
ã¤ã³ã¿ã¼ãããã©ã¸ãªã®è´ãæ¾é¡
âææ ¢ãã
Facebooké²è¦§
Twitteré²è¦§
åç»ã®è¦è´
è²ã
ãªã²ã¼ã ãå¿«é©ã«éã¶
âå¿ è¦ãªé信容éãè¦ç©ãã
è¦ç©ããã¨è¨ããã¦ã§ãããã®ã§ã¯ç¡ãã¨æãã®ã§ãiOSãªãã°è¨å®ã®ã¢ãã¤ã«ãã¼ã¿éä¿¡ã®çµ±è¨æ å ±ãAndroid ãªãã°ãè¨å®ã®ãã¼ã¿ä½¿ç¨éãè¦ã¦ã決ããã®ãè¯ãã§ãã
ç§ã¯æã«3G使ã£ã¦ãã¦ãApp Store ã1.5Gä½ãã¢ã³ã¤ã³ã¹ãã¼ã«æ¸ã®ã¢ããªã1Gä½ã®ä½¿ç¨éã ã£ãã®ã§ãæ°ããã¢ããªãæ¢ããã試ãããããªããã°æã«1Gã§åããããã¨è¦ç©ããã¾ããã
âãã¹ããæ±ããªãã§å¥ç´ãã¦ãã¾ã
è¦ç©ããçµæã§åã¾ããã¼ã¿éä¿¡éãæä¾ãã¦ãããµã¼ãã¹ãããã¯ã¢ãããã¦ããã¨ã¯å¥½ã¿ã§è¯ãããªï¼ã¨æãã¾ãã
æ ¼å®simã¯äººãéã¾ãã¨ããã§ã¯ã©ããã¦ãé»æ³¢ãå¼±ããªã£ã¦ãã¾ãã®ã§ã大æãã£ãªã¢ã¨æ¯ã¹ãã¨è³ªãæªããªãã®ã¯ééããªãã§ããã§ããã°ã©ããè¯ããæ©ãããããªããä»ããå®ããªãã®ã¯ééããªãã®ã§ãã¨ãããã試ãã¦ã¿ãã®ãè¯ãã§ãã
ã©ããã¦ãå¿é ãªããä¹ãæããã®ã§ã¯ãªããä»ã®å¥ç´ãç¶ç¶ããã¾ã¾è¿½å ã§å¥ç´ãã¦ãã¾ãã®ãæã§ããç§ã¯ au ã®å¥ç´ãç¶ç¶ããªããã楽天ã¢ãã¤ã«ã®ç«¯æ«ã»ãããè³¼å ¥ãã¦è©¦ããå¾ã«ãã£ãªã¢ã解ç´ãã¾ããã
ä½æããdeployã¾ã§
ã·ã³ãã«ãª Google App Engine ã¢ããªã±ã¼ã·ã§ã³ã®ä½æãããµã¼ã転éã¾ã§é§ã足ã§ç´¹ä»ã
app.yaml ã®æºå
以ä¸ã¯ go ã使ãæã®ã·ã³ãã«ãªapp.yaml
application: ããã¸ã§ã¯ãå
version: 1
runtime: go
api_version: go1
handlers:
- url: /.*
script: _go_app
goãã¡ã¤ã«ã®ç¨æ
ã¨ãããããã¥ã¼ããªã¢ã«ã«ãã£ããã®
hello.go
package goplus import ( "fmt" "net/http" ) // init is called before the application starts. func init() { // Register a handler for /hello URLs. http.HandleFunc("/", hello) } // hello is an HTTP handler that prints "Hello Gopher!" func hello(w http.ResponseWriter, r *http.Request) { fmt.Fprint(w, "Hello, Gopher!") }
åä½ç¢ºèª
ãµã¼ãã«è»¢éããåã«åä½ç¢ºèªãããå ´åã¯
dev_appserver.py app.yaml
ã使ã£ã¦ãã¼ã«ã«ã«ãµã¼ããèµ·åãã¦ã http://localhost:8080/ ã«ã¢ã¯ã»ã¹ããäºã§ãµã¼ãã«è»¢éããã«åä½ç¢ºèªãã§ãã¾ãã
ssh ã§gceãªã©ã®å¥ãµã¼ãã«ãã°ã¤ã³ãã¦ä½æ¥ãã¦ããæ㯠gui ã®ãã©ã¦ã¶ã¯å¤å使ããªãã®ã§ããã¼ã«ã«ãµã¼ããããã¯ã°ã©ã¦ã³ãã§å®è¡ã㦠curl ãªã©ã§ç¢ºèªããæãã«ãªãã¾ãã
dev_appserver.py app.yaml&
curl localhost:8080
ã¡ãªã¿ã«ãgo ã使ã£ã¦ããå ´åã¯ãåæ§ã®ãã¨ã
goapp serve app.yaml
ã§å®ç¾å¯è½ã§ãã
ãµã¼ãã«è»¢é(åådeployæã¯è¦èªè¨¼)
app engine ã®ãµã¼ãã«è»¢éãããã¨ã§ãä»ã®äººãå®è¡ã§ããããã«ãªãã
ãµã¼ãã«åãã¦è»¢éããå ´åããã©ã¦ã¶ãèµ·åãã¦googleã¢ã«ã¦ã³ãã§ãã°ã¤ã³ããå¿ è¦ãããã
ç§ã¯ããã§ã¡ãã£ã¨ã¯ã¾ã£ãã
é常ã¯
appcfg.py update app.yaml
ã¨å ¥åãããã¨ããã©ã¦ã¶ãåæã«èµ·åãã¦google ã¢ã«ã¦ã³ãã§èªè¨¼ãApp Engine ã¨ã®ãã¢ä»ããããã®ã ãã©ãGCE ã« ssh ã§ãã°ã¤ã³ãã¦ããã¨ãèµ·åãããã©ã¦ã¶ãããã¹ããã¼ã¹ã§ç»é¢ãä¹±ãã¦ãã¾ãèªè¨¼ããã¾ã§é²ããªãã£ãã
ããããæã¯
appcfg.py --noauth_local_webserver update app.yaml
ã¨å®è¡ããã¨è¡¨ç¤ºãããurlãå¥ã®ãã©ã¦ã¶ã§è¡¨ç¤º&èªè¨¼ããã®å¾è¡¨ç¤ºãããæååãå ¥åããäºã§èªè¨¼ãã§ããã
ãµã¼ãã«è»¢é(å¥ã³ãã³ã)
go ã使ãå ´åãappcfg.py ã§ã¯ãªã goapp ã使ã£ã¦è»¢éãããã¨ãå¯è½ã
goapp deploy app.yaml
GoogleCloudShellãã¼ã¿ã2015å¹´ä¸ã¯ç¡æ
https://cloud.google.com/cloud-shell/
web ãã©ã¦ã¶ä¸ã§åãã¿ã¼ããã«ã使ã£ã¦æ¥ç¶ã§ããä»®æ³linuxç°å¢ã
å¶éããããªãã«ããããã§ãããã¡ãã£ã¨ããã³ã¼ããããã£ã¨ç¢ºèªããã«ã¯æ軽ã«æãã¾ããã
ãã ãiPadãã使ãã¨ãã¼ãã¼ããæ¨æºã®ãã®ã«ãªããããCoda ã Textastic ã®ãã¼ãã¼ãæ¡å¼µã«æ £ãã¦ããã¨ããã©ãããããã¾ããã
ä¸ã«GoogleAppEngineç°å¢ãä½ã
AppEngine ã®ã¹ã¿ã¼ããã¼ã¸ãéãã Google Cloud Platform
è¨èªãé¸æã
ãã£ãããªã®ã§goãé¸ãã§ã¿ãã
ãã¦ã³ãã¼ããã¼ã¸ãããã¦ã³ãã¼ãç¨ã®urlãã³ãã¼ã
linuxä¸ã§ãã¦ã³ãã¼ãã
wget https://storage.googleapis.com/appengine-sdks/featured/go_appengine_sdk_linux_amd64-1.9.26.zip
unzipãå¿ è¦ã ã£ãã®ã§ã¤ã³ã¹ãã¼ã«
sudo yum install unzip
~/.bashrc ã«å±éãããã¹ã PATH ã«è¿½å ããè¨è¼ã追å ã
python 2.7.5 ãã¤ã³ã¹ãã¼ã«
æ¥æ¬èªã®è¡¨ç¤ºãããã©ãã«ããã
ç¾å¨ãæ ¼éä¸ã§è§£æ±ºã«ã¯è³ã£ã¦ãã¾ããã
mac ã®ã¿ã¼ããã«ããsshã§ã¤ãªãã æã¯ã«ã¼ã½ã«ã¯ãããªãã£ãã®ã§ãã¯ã©ã¤ã¢ã³ãã対å¿ãã¦ããªãããããªãããªï¼ã¨æã£ã¦ãã¾ãããã
ã¿ã¼ã²ããos : CentOS Linux release 7.1.1503 (Core) sshã¯ã©ã¤ã¢ã³ã : Coda for iPad
LANG ã ja_JP ã«å¤æ´
http://zero-config.com/centos/changelocale-002.html
ãåèã«ã
sudo localectl set-locale LANG=ja_JP.UTF-8 source /etc/locale.conf
å®è¡ãã¦ã¿ããã©å¤ãããã
export | grep LANG å®è¡ãã¦ã¿ã㨠en ã®ã¾ã¾ã ã£ãã
.bash_profile ã«
LANG=ja_JP?UTF-8 export LANG
ã¨æ¸ããåãã°ã¤ã³ããäºã§ãexport | grep LANG å®è¡ãã¦ã¿ããã ja ã«æ¸ãæãã£ãããã ãããããã vi ã§æ¥æ¬èªãæ¸ãã¨ã«ã¼ã½ã«ã®ä½ç½®ããããã
Terminal Type??
ssh ã¯ã©ã¤ã¢ã³ãã®è¨å®ã確èªããã¨ãTerminal Type ã xterm-256color ã¨æ¸ããã¦ããã
ããã vt100 ã«å¤æ´ã
ããã§ãç¶æ³å¤ãããã
vim ã®åé¡ï¼
vim ã®è¨å®ã§è¡¨ç¤ºé¢ä¿ãããã®ã§ããããæ¤è¨¼ãããã¨æã£ãç¢å
ããããã vi ã®åé¡ãªã®ãçåãããã¦ãã¾ããã
ããã§ãä¸è¨ãå
¥åãã¦ã¿ãã¨ãã
ls ãããããããããã
ã«ã¼ã½ã«ãããã¾ããããã(^^;;
ã¯ã©ã¤ã¢ã³ãã®ãã©ã³ãã®å¹ è¨ç®ãééã£ã¦ãã®ããªï¼ã¨ãããããã以ä¸ã®æ¤è¨¼ã¯ä¸åº¦æã¡ããã
IPã¢ãã¬ã¹åºå®ã«ããæã®æ³¨æç¹
iPad ãã ssh 㧠Google Compute Engine ã«ç¹ãã«è¡ãæã®ä¸çªã®ããã¯ã¯ãã¤ã³ã¹ã¿ã³ã¹ã®èµ·åãã¨ã«å¤ãã£ã¦ãã¾ã IPã¢ãã¬ã¹ã§ããã(管çãã¼ã¸ã§ã¯ã¨ãã§ã¡ã©ã«ã¨å¼ã°ãã¦ãã¾ã)
ããã解æ¶ããããã« dns ã使ã£ãããã¾ãããã©ããä¸æããããã
ããã§ãµã¨ãã¨ãã§ã¡ã©ã«ã§ã¯ãªãéçipã¢ãã¬ã¹ãæå®ããã°è¯ãã®ã§ã¯ï¼ã¨æãç«ã¡è©¦ãã¦ã¿ã¾ããã
çµæã¯æå¾ ããéããéçipã¢ãã¬ã¹ã®çºè¡èªä½ã¯ç¡æãªã®ã§ä¸ã æ³ãå ¨ã¦è§£æ±ºï¼
ã¨ã¯ããã¾ããã§ããã
åé¡ç¹
éçipã¢ãã¬ã¹ã¯ã¤ã³ã¹ã¿ã³ã¹ãèµ·åãã¦ããªãã¨ç¶æè²»ããããï¼ï¼
ã¤ã¾ãipã¢ãã¬ã¹ãåºå®ã«ãã¦ãµã¼ãã¼è¨ç½®ããã¨ããµã¼ãã¼èµ·åæã¯ç¡æã§ãããã¤ã³ã¹ã¿ã³ã¹ãåæ¢ããã¨éçipã¢ãã¬ã¹ã®ç¶æè²»ãããã£ã¦ãã¾ããã§ãã
ä¾¡æ ¼ã¯ï¼
Google Cloud æéè¨ç®ãã¼ã«ã§ç¢ºèªå¯è½ã§ãã
https://cloud.google.com/products/calculator/
Unused static IPs ã« 1 ã¨å ¥åã㦠Estimate ãã¯ãªãã¯ããã¨ãå³ä¸ã«è¦ç©ãããã§ã¾ãã
çµæ§é«ãã¦ã³ã£ãããã¾ãã