Skip to content

Instantly share code, notes, and snippets.

View liubin's full-sized avatar

Bin Liu liubin

View GitHub Profile

Untitled Slide

Welcome to Glide.

Glide is the easiest way to create useful slide for all of your Gists.

  • input key <- to go backward.
  • input key -> to go forward.

Publishing

@liubin
liubin / chain.go
Last active August 29, 2015 13:56
Go Routine Test
package main
import (
"fmt"
"time"
"runtime"
)
func f(left, right chan int) { left <- 1+<-right }

Docker 虎の巻

何故Dockerを使うべきか

Why Should I Care (For Developers)

"Dockerが面白いのはシンプルな環境に隔離性と再現性をもたらしてくれることだ.ランタイムの環境を一度作れば、パッケージにして別のマシンでも再利用することできる.さらに,すべてはホスト内の隔離された環境で行われる(VMのように).最も素晴らしい点は,シンプルかつ高速であることだ."

@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
@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 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.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 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.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 / 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'