2014-12-01ãã1ã¶æéã®è¨äºä¸è¦§
ã飲ãã å¢ãã§ä¿ºãã¡ã®ããã°ãéè¨ãã¾ããã ã¨ããã®ããã°ãå§ã¾ã£ã¦ãã1ã¶æããã¡ã¾ããã ä»åã¯ä»å¹´æå¾ã®è¨äºã¨ãããã¨ã§ãä»å¹´ã®ç·ã¾ã¨ãçãªãã¤ã§ãã â»ã¡ãªã¿ã«7人ã§ãé±ä¸å½çªå¶ã§æ¸ãã¦ã¾ããã è¨äºæ°ãã¯ã¦ãæ°ãã¢ã¯ã»ã¹æ°ï¼ 1ã¶æã§ã©â¦
ãã£ã調ã¹ã¦ããã¨ã®ã¡ã¢ã Vagrant 㧠Linux ãã·ã³ãèµ·åããã¨ãã«ããããã¯ã¼ã¯è¨å®ã NAT (+ DHCP) ã«ããç¶æ ã§ãDNS ãµã¼ãã¯ç¤¾å ã®ãã¤ã使ãããã£ãã æ®éã« /etc/resolv.conf ãç·¨éã㦠+ nameserver x.x.x.x ã¨ããã¦ãã/etc/init.d/networâ¦
ã¡ãªã¼ã¯ãªã¹ãã¹ã5å·ã§ãããããªæéã«ããã°æ¸ãã¦ããæç¹ã§ãå¯ãä¸ããã ãããããã¿ãç¡ããªã£ã¦æ¥ãã®ã§ãæ¬å½ã«å°ãã¿ã§ã Golang + mongodbãå©ç¨ããæã«mgo mgo - Rich MongoDB driver for Go mgo - Rich MongoDB driver for Go ã¨ãããã©ã¤â¦
ãµã¼ãéã§ã¡ãã£ã¨ãããã¡ã¤ã«ã®åã渡ããããããã¨ã¯ããããã¨æãã ããããã¨ãã«ã¯ scp ã¨ã rsync ã¨ãã使ã£ããããã¨æãã ã ãã© ssh ããã®ãµã¼ãéã§è¨±å¯ããã¦ãªãã£ãããã±ãã¹ã©ãã·ã¥ã¨ããæ°ã«ãããããªãã¦ã¯ãªããªãã£ãããã¦æâ¦
DATABASE.TABLEã®ç¹å®ã®ã¬ã³ã¼ãã ããdumpã§æãããã¨ãã mysqldump -uroot --where="id=100" DATABASE TABLE ã¨ã mysqldump -uroot --where="id in (100, 101, 102)" DATABASE TABLE ã¨ãã--whereã使ããã
ãããªãã¨ãããã¨ãã¾ãããã mkdir -p /path/to/dir chown 2gou /path/to/dir chgrp oretachino /path/to/dir chmod 700 /path/to/dir chown 2gou.oretachino /path/to/dirã§ããããã©è¡æ°ç¨¼ãããã«åããã åããã¨ãããã«ã¯ãæå¤ã¨ç¥ããã¦ãªããâ¦
CloudFront+S3ã®ç»åé ä¿¡ã·ã¹ãã ã«ããµã ãã¤ã«ã¨ãã«ä½¿ãç»åã®ãªãµã¤ãºæ©è½ã追å ãã¦ã¿ãã è¦ããã«ãªãªã¸ãã«ç»åããã®URLã ã¨ããã¨ã http://xxx.cloudfront.net/sample.jpg ããããURLã§100Ã100ã«ãªãµã¤ãºã§ããããã«ããã http://xxx.cloudfroâ¦
å®è¡æéã®é·ãã³ãã³ãã®çµäºãéç¥ã§ããããã«Growlãéç¥ã»ã³ã¿ã¼ã使ã£ã¦å·¥å¤«ãã¦ãã人ã¯ãããªãã«ããã£ãããã¨æãã¾ãã å®è¡æéã®é·ãã³ãã³ãã®çµäºãGrowlãã¡ã¼ã«éç¥ããRubyã¹ã¯ãªãã Macã§æéã®ãããã³ãã³ããçµãã£ãããèªåã§éç¥â¦
$ cat <<'EOF' >> /tmp/cat_test.txt heredoc> cat heredoc> test heredoc> text heredoc> EOF $ $ cat /tmp/cat_test.txt cat test text ãã¾ã«ä½¿ã
ããã¯ã¨ãªããã¼ã«ã«ããµã¼ãã§ã¯åãã®ã«TravisCIã®ãã¹ãã§ã³ã±ãç¾è±¡ããã£ã¦ãããããè¦ãã¨2.4ç³»ã§ã¯ç¡ãæ©è½ã使ã£ã¦ããã ã§ãTravisCIå´ãã©ãããã°è¯ãã®ããªã¼ã¨ã°ã°ã£ã¦ããã Using MongoDB 2.6 with TravisCI Builds ã¨ãããºããªã®ããã°â¦
ããªã³ããããã°ã大好ãã ï¼ï¼ï¼ä½ã¯ãªãã¨ãã¨ããããæ¨æºåºåã«åãã¦ããã°ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ï¼ã£ã¦ãããããªãã¨ã¯ã¿ãªããã«ãããã¾ãã¦ãå°ãªãããããã®ã§ã¯ãªãã§ããããã ããªã³ããããã°ãè¡ãå ´åãåç´ã«å¤æ°ã«ä½ãå ¥ã£ã¦ãããã¨ãããâ¦
3å·ã§ããgentooã§ã sudo emerge --ask rmagick ã¨ãããããä¾åã§Rubyãå ¥ããã§ãããããããbundlerãåããªããªã£ããã§ããã調ã¹ã¦ã¿ããRUBYOPT=-rauto_gemãã»ããããã¦ããä¸æéãããä½ãèµ·ãããããããªãã£ããrmagickãgemã§å ¥ãããããâ¦
1å·ã«ãã以ä¸ã®ãè¨äºæ°/ã¯ã¦ãæ°ã®å¯è¦åãã«ããããªã¨ãã¦è©èº«ãçã2å·ã§ãã ã¯ã¦ãªAPIã¨S3ã使ã£ã¦éå¡ãã¨ã®ãã¯ãæ°ãããã°ãã¼ãåãã¦ã¿ã - 俺ãã¡ã®ããã° Vagrantã®provisionerã¯å種ããã大ä½ã¯Chef, Ansible, Puppetçã®æ§æ管çãã¼ã«ãâ¦
ãã®ããã°ã¯è¤æ°äººã§åä¸ã¢ã«ã¦ã³ãã使ã£ã¦æ¸ãã¦ãã¦ãã ããæ¸ãããã¯ã«ãã´ãªã«ãXå·ãã£ã¦ã®ãã¤ãã¦åºå¥ãã¦ã¾ãã éè¨ãã2é±éãã£ã¦è¨äºããã¾ã£ã¦ããã®ã§ãéå¡ãã¨ã®è¨äºæ°ãã¯ã¦ãæ°ã表示ããããã°ãã¼ããä½ã£ã¦ã¿ã¾ããã ãµã¤ããã¼ã®â¦
rspec3 ã«ç²å¼ãã¦ããçããããã«ã¡ã¯ãä»æ¥ã¯ rspec3 ã«ç²ããçããã¸æ©ãã®å ´ã¨ã㦠test-unit gem ã®ã話ãæä¾ãããã¨æãã¾ãã test-unit gem ã«ã¤ã㦠ãRubyã®ãã¹ãã£ã³ã°ãã¬ã¼ã ã¯ã¼ã¯ã®æ´å²ï¼2014å¹´çï¼ãã®è¨äºã«è©³ããæ¸ãã¦ããã¾ãããtâ¦
scpã¨rsyncãã±ãã«ã¹ã©ãã·ã¥ãããããªããæ¯å確èªããã®ã§ã¡ã¢ãã¦ããã å人çã«ã¯scp使ããªã㧠rsync option from/ dest/㧠両æ¹å ±ã±ãã¹ã©ãã·ã¥ä»ãã¦ãã£ã¦ãã ä¾ from/files_dirãdest/files_dirã«æã£ã¦è¡ããã % tree . . âââ dest âââ fromâ¦
ããã«ã¡ãã5å·ã§ããSinatraã©ã¤ã¯ã¨æ¸ãã¦ãããªããããã¾ãSinatra触ã£ããã¨ãç¡ãã®ã§å ¨ç¶éã£ãããã¿ã¾ããã Golangã試ãéã«WebAppãµã¼ãä½ã£ã¦ã¿ããã¨ããæã«è»½éãªãã¬ã¼ã ã¯ã¼ã¯ã§è©¦ããgin-gonicã¯è¯ãã¨æãã¾ãã gin-gonic/gin gin-gonâ¦
åéã¨é£²ãã§ãæã«ãELBã®IPã¢ãã¬ã¹æ°ã¯åçã«å¤åãããããåæ°èª¿ã¹ãã¨ã ãããã®ãµã¤ãè¦æ¨¡ãããããã¿ãããªè©±ãããã®ã§ãå®éã®ã¨ããã©ããªãã ããã¨ããã¤ãã®ãµã¼ãã¹ã調ã¹ã¦ã¿ã¾ããã ãããªæãã«ãªãã¾ããã ãµã¼ã㹠調æ»ãã¡ã¤ã³ IPã¢â¦
tmux ã使ã£ã¦ããã¨ãã¤ã³ãå¢ãã¾ãã£ã¦ããããªããã¨ã¯ã¾ã¾ããã¨æãã ããããã¨ãã«ã¯ããã¤ã³ãã¦ã£ã³ãã¦ã¨ãã¦ç¬ç«ããã¦ãã¾ã£ã¦ã¹ãããªãããããã¨æãã <prefix> + ! ã§ã«ã¬ã³ããã¤ã³ãã¦ã£ã³ãã¦ã¨ãã¦ç¬ç«ãã¾ãã便å©ã§ãã</prefix>
3å·ã§ãããã°ãBigQueryã«ã¤ã£ããã®ãæµè¡ã£ã¦ã¾ãã ã§ãtimeã£ã¦ã«ã©ã ãunixtimestampã ã£ãã¨ãã¦ãXXæãYYæã¾ã§ã®ã¢ã¯ã»ã¹ãæ½åºãããã¨ãã¾ãããããªæãã«ãªãã¾ãã SELECT * FROM DATASET.TABLE where time between TIMESTAMP_TO_SEC(DATE_ADâ¦
lessã§é²è¦§ãçµäºããæã«ç»é¢ãã¯ãªã¢ããã¦ãã¾ãã¨ãéä¸ã¾ã§è¦ã¦ãã¤ããã³ãããããæã«ä¸ä¾¿ãªå ´åã«--no-init (-X)ãä»ãã¦ããã¨ä¾¿å©ã ããã¨ãã話ã æ¯åæå®ããã®ãé¢åãªå ´åã¯ç°å¢å¤æ°LESSã«æå®ããããåshellã®rcã«æ¸ãã¦ããã¨å
â»7å·ã®ã俺ã¨ãã¾ãã¨awkãã«ã¯ã¦ãããã£ã±ãã¤ãã¦ç¾¨ã¾ããã£ãã®ã§ã丸ãã¯ããã®ã£ããã¨ã³ããªã§ãã ãEFK (Elasticsearch + Fluentd + Kibana) ãªãã¦çãã§ãããæ¼¢ã¯é»ã£ã¦ perl | sort | uniq -c ã§ãããã¨èª°ããè¨ã£ã¦ããããªè¨ã£ã¦ãªãã£ããâ¦
ãEFK (Elasticsearch + Fluentd + Kibana) ãªãã¦çãã§ãããæ¼¢ã¯é»ã£ã¦ awk | sort | uniq -c ã§ãããã¨èª°ããè¨ã£ã¦ããããªè¨ã£ã¦ãªãã£ããããªæ°ãããã®ã§ãã°ãããæã«èªåããã使ã awk è¸ã«ã¤ãã¦æ¸ãã¾ãã æ³å®ãã¼ã¿ãµã³ãã« ãããªãã©ã¼â¦
Man page of CRONTAB ææ¥ 0-7 (0 㨠7 ã¯æ¥ææ¥ ãããã¡ãã
ããã«ã¡ã¯ãä½å·ã ã£ãã»ã»ã»ã Goã§ã¢ããªãæ¸ãã¦ããæã«ãã¹ãã§GoConvey smartystreets/goconvey smartystreets/goconvey · GitHub Goç¨ãã¹ããã¼ã«GoConveyã®ç´¹ä» - Qiita Goç¨ãã¹ããã¼ã«GoConveyã®ç´¹ä» - Qiita ã使ã£ã¦ãããã§ãããerroråã®â¦
å°ããè¦æ¨¡ã§ WEB Application ãæ¸ãå ´åã«ããã¦ãSinatra ã¯ãµã¤ã³ã¼ã«ä¾¿å©ã§ãã ãã¥ã¼ã®ããã¢ããªã®å ´åã¯ã ããããããããã£ã¬ã¯ããªæ§æã«ãã¾ãããã $ tree ore_tachi_no ore_tachi_no âââ config.ru âââ lib â âââ ore_tachi_no â âââ applicâ¦
3å·ã§ãã3çªç®ã«æ¸ãã®ã§3å·ã«ãªã£ã¦ãã¾ãã¾ãããå¤å½¢ç£è¦ã«ã¤ãã¦ãããæ¸ãã¾ãã ç§ã®ä¼ç¤¾ã§ã¯å¤å½¢ç£è¦ã«Pingdom - Website Monitoringãå©ç¨ãã¦ãã¾ããPingdomã¯ä¸çä¸ã®æ ç¹ãã対象ã®ã¨ã³ããã¤ã³ã(http(s), smtp, DNSãªã©)ã®æ»æ´»ç£è¦ããã¦ããâ¦