Skip to content

Instantly share code, notes, and snippets.

View liubin's full-sized avatar

Bin Liu liubin

View GitHub Profile
#!/bin/sh
x=$(ps -cx -o pid,command | awk '$2 == "php-fpm" { print $1 }')
kill $x
/usr/local/php/sbin/php-fpm
@liubin
liubin / file0.txt
Created December 31, 2014 08:25
More secure MySQL backup strategy ref: http://qiita.com/liubin/items/1e1be609b3d569d4c82d
> grant select,lock tables ON db.* TO 'backup'@'localhost';
@liubin
liubin / content
Last active September 23, 2017 12:57
Web API: The Good Parts
[原书网址](http://www.oreilly.co.jp/books/9784873116860/#toc)
介绍
第一章什么是Web API
     1.1API在网络服务中的重要性
        基于使用的API1.1.1出现服务
        1.1.2移动应用程序和API
        1.1.3 API经济
@liubin
liubin / Gemfile.local
Last active August 29, 2015 14:08
Install Nginx/Ruby/Redmine/MySQL on Ubuntu 14:04
source 'https://rubygems.org'
gem 'unicorn'
gem 'unicorn-worker-killer'
@liubin
liubin / file0.txt
Created October 29, 2014 09:47
Install latest Docker on Ubuntu 14.04 ref: http://qiita.com/liubin/items/39c587023c577ffe8d31
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.1 LTS"
$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
$ sudo sh -c "echo deb https://get.docker.com/ubuntu docker main\
@liubin
liubin / file0.txt
Created October 21, 2014 02:52
Load database config file from libraries in CodeIgniter ref: http://qiita.com/liubin/items/fe26eba5d06b5d546d2a
$this->_CI = &get_instance();
$this->_CI->config->load('database');
@liubin
liubin / file0.php
Created September 16, 2014 10:21
"504 Gateway Time-out" when sending mail by SMTP in CodeIgniter ref: http://qiita.com/liubin/items/237dcba4d0259bf6b1d7
$config['protocol'] = 'smtp';
$config['smtp_host'] = $this->config['smtp_host'];
$config['smtp_user'] = $this->config['smtp_user'];
$config['smtp_pass'] = $this->config['smtp_pass'];
$config['smtp_port'] = $this->config['smtp_port'];
$config['charset'] = 'utf-8';
$config['wordwrap'] = TRUE;
$this->_CI->email->initialize($config);
@liubin
liubin / file0.txt
Created September 16, 2014 03:31
Disable access by URL pattern in Nginx ref: http://qiita.com/liubin/items/3c4c64be645ee5d581d2
location ~ ^/(v1)/ {
return 403;
}
@liubin
liubin / file0.txt
Created September 15, 2014 10:36
Install Nginx(1.6.1)/PHP(5.6.0)/PHP-FPM/Redis(2.8.13)/MariaDB(10.1) on CentOS 7 ref: http://qiita.com/liubin/items/1386ba4f0bbd64d14cc5
rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-1.noarch.rpm
@liubin
liubin / file0.txt
Created July 18, 2014 16:24
またThe Ruby openssl extension was not compiled. Missing the OpenSSL lib?かよ ref: http://qiita.com/liubin0329/items/6587ca86e5ff09ee3df5
Cloning https://github.com/ruby/ruby.git...
Installing ruby-2.2.0-dev...
BUILD FAILED
Inspect or clean up the working tree at /var/folders/0n/18bwv5x16t7gy319d5wbn9480000gn/T/ruby-build.20140718233658.48380
Results logged to /var/folders/0n/18bwv5x16t7gy319d5wbn9480000gn/T/ruby-build.20140718233658.48380.log
Last 10 log lines:
bigdecimal 1.2.5