[GIT] Wrong merge and wrong branch
人總是會有手殘眼糊腦弱的時候,總要有補救辦法。
人總是會有手殘眼糊腦弱的時候,總要有補救辦法。
最常用到的狀況大概就是在新開的 branch 上做了很久,但是自以為是在 master 上,時間久了要 merge 卻是個眼花撩亂,只好直接拿這 branch 蓋掉 master。
因為在 centos 7 上面要做 swapfile, 結果用 fallocate 出來的不能用,所以順便查一下
預設 node.js 的 log file 會一直 append 上去,所以結果就是越來越多直到爆炸為止
主要參考這篇跟這篇 有些實用的命令另列於下 $ sudo apache2ctl configtest
主要參考 http://www.uptimemadeeasy.com/linux/mysql-migrate-users-server-server/
最近要拿 ab test 來做 http service 測試
基本上可以直接參考這篇,有些設定可以參考這篇
Sometimes you need a JSON RESTful api interface in a MVC controller, which usually generate HTML results to users. public function createAction() { $this->view->disable(); $resp = new \Phalcon\Http\Response(); $resp->setHeader(“Content-Type”, “application/json”); //….. $resp->send(); return; }
原本 php 要做 cache 就只能用 apc 這個 package (pecl install apc), 但從 php 5.6 之後,有了 opcache,可以取代掉一部分工作。詳細可以看這邊。 然而 opcache 只有做 code caching,所以 user data caching 的工作還是要找其他的方案,但是在我自己的環境(ubuntu 16.04, apache 2.4, php 7, phalcon 3) 已經不能安裝 apc(會出錯),所以只好用 apcu (pecl install apcu) 至於使用方式跟 apc 差不多,可以參考官方文件說明。我覺得最好的地方在於可以設 ttl timeout,這樣對於一些暫時性的資料(例如 authentication key)就不用開個 table 去維護了。另外如果資料不多,也不用去搞個 redis 來當 cache…