Skip to content

Instantly share code, notes, and snippets.

@tkuchiki
tkuchiki / Kohana with nginx
Last active February 17, 2021 19:41
Kohana nginx configuration
server {
listen 80;
server_name example.com;
access_log /path/to/access.log main;
error_log /path/to/error.log;
root /path/to/kohana/web;
location / {
index index.php;
if (-f $request_filename) {
@tkuchiki
tkuchiki / varnish.repo for el6
Last active December 18, 2015 00:49
CentOS 6 用 varnish repo
[varnish-3.0]
name=Varnish 3.0 for Enterprise Linux 6 - $basearch
baseurl=http://repo.varnish-cache.org/redhat/varnish-3.0/el6/$basearch
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-VARNISH
@tkuchiki
tkuchiki / redis.spec
Last active December 18, 2015 01:19
epel rpm の redis.spec
# Check for status of man pages
# http://code.google.com/p/redis/issues/detail?id=202
Name: redis
Version: 2.6.13
Release: 1%{?dist}
Summary: A persistent key-value database
Group: Applications/Databases
License: BSD
@tkuchiki
tkuchiki / gist:5856709
Last active December 18, 2015 22:49
/etc/shadow に保存される hash 値の生成方法(CentOS 6) [参考: http://serverfault.com/questions/330069/how-to-create-an-sha-512-hashed-password-for-shadow]
# Mac は $6$ に対応していないので使用不可
python -c 'import crypt; print crypt.crypt("PASSWORD", "$6$random_salt")';
@tkuchiki
tkuchiki / gist:5898479
Created July 1, 2013 05:06
Shift-JIS + CRLF に変換するコマンド。 主に csv を Excel で開くとき用。
nkf -s -Lw --overwrite FILE
@tkuchiki
tkuchiki / gist:6017126
Last active December 19, 2015 20:59
CentOS 5 用 php 5.3.27 の RPM 取得
wget http://repo.webtatic.com/yum/centos/5/x86_64/php-bcmath-5.3.27-2.w5.x86_64.rpm ttp://repo.webtatic.com/yum/centos/5/x86_64/php-5.3.27-2.w5.x86_64.rpm http://repo.webtatic.com/yum/centos/5/x86_64/php-cli-5.3.27-2.w5.x86_
64.rpm http://repo.webtatic.com/yum/centos/5/x86_64/php-common-5.3.27-2.w5.x86_64.rpm http://repo.webtatic.com/yum/centos/5/x86_64/php-devel-5.3.27-2.w5.x86_64.rpm http:/
/repo.webtatic.com/yum/centos/5/x86_64/php-eaccelerator-0.9.6.1-1.1.w5.x86_64.rpm http://repo.webtatic.com/yum/centos/5/x86_64/php-embedded-5.3.27-2.w5.x86_64.rpm http://
repo.webtatic.com/yum/centos/5/x86_64/php-fpm-5.3.27-2.w5.x86_64.rpm http://repo.webtatic.com/yum/centos/5/x86_64/php-gd-5.3.27-2.w5.x86_64.rpm http://repo.webtatic.com/y
um/centos/5/x86_64/php-imap-5.3.27-2.w5.x86_64.rpm http://repo.webtatic.com/yum/centos/5/x86_64/php-intl-5.3.27-2.w5.x86_64.rpm http://repo.webtatic.com/yum/centos/5/x86_
64/php-ldap-5.3.27-2.w5.x86_64.rpm http://repo.webtatic.com/yum/centos/5/x86_64/php-mbstring-5.3.27-2.w5.x86_64.rpm
@tkuchiki
tkuchiki / gist:6017165
Created July 17, 2013 02:16
CentOS 6 用 php 5.3.26 RPM
wget http://centos.alt.ru/repository/centos/6/x86_64/php-5.3.26-1.el6.x86_64.rpm http://centos.alt.ru/repository/centos/6/x86_64/php-bcmath-5.3.26-1.el6.x86_64.rpm http://centos.alt.ru/repository/centos/6/x86_64/php-cli-5.3.26-1.el6.x86_64.rpm http://centos.alt.ru/repository/centos/6/x86_64/php-common-5.3.26-1.el6.x86_64.rpm http://centos.alt.ru/repository/centos/6/x86_64/php-dba-5.3.26-1.el6.x86_64.rpm http://centos.alt.ru/repository/centos/6/x86_64/php-devel-5.3.26-1.el6.x86_64.rpm http://centos.alt.ru/repository/centos/6/x86_64/php-eaccelerator-1.0-0.7.git42067ac.el6.x86_64.rpm http://centos.alt.ru/repository/centos/6/x86_64/php-eaccelerator-httpd-1.0-0.7.git42067ac.el6.x86_64.rpm http://centos.alt.ru/repository/centos/6/x86_64/php-embedded-5.3.26-1.el6.x86_64.rpm http://centos.alt.ru/repository/centos/6/x86_64/php-enchant-5.3.26-1.el6.x86_64.rpm http://centos.alt.ru/repository/centos/6/x86_64/php-fpm-5.3.26-1.el6.x86_64.rpm http://centos.alt.ru/repository/centos/6/x86_64/php-gd-5.3.26-1.el6.x86_64.rpm htt
@tkuchiki
tkuchiki / gist:6026507
Created July 18, 2013 03:28
Excel 対応 CSV download
<?php
/*
* How to use:
*
* $str = Csv::array_to_csv_str($csv_rows);
* $str = Csv::convert_encoding($str);
* Csv::download($str, 'filename');
*/
@tkuchiki
tkuchiki / gist:6026564
Created July 18, 2013 03:42
svn switch の使い方。よく忘れるので
# svn switch {svn,http?s}://path/to/trunk
# svn switch {svn,http?s}://path/to/branches/example-branch
@tkuchiki
tkuchiki / gist:6121851
Created July 31, 2013 13:12
ps | grep PROCESS で grep 自身を除外する方法
ps | grep PROCESS | grep -v grep
ps | grep PROCES[S]