Skip to content

Instantly share code, notes, and snippets.

@tkuchiki
tkuchiki / Kohana with nginx
Last active Feb 17, 2021
Kohana nginx configuration
View Kohana with nginx
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 Dec 18, 2015
CentOS 6 用 varnish repo
View varnish.repo for el6
[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 Dec 18, 2015
epel rpm の redis.spec
View 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 Dec 18, 2015
/etc/shadow に保存される hash 値の生成方法(CentOS 6) [参考: http://serverfault.com/questions/330069/how-to-create-an-sha-512-hashed-password-for-shadow]
View gist:5856709
# Mac は $6$ に対応していないので使用不可
python -c 'import crypt; print crypt.crypt("PASSWORD", "$6$random_salt")';
@tkuchiki
tkuchiki / gist:5898479
Created Jul 1, 2013
Shift-JIS + CRLF に変換するコマンド。 主に csv を Excel で開くとき用。
View gist:5898479
nkf -s -Lw --overwrite FILE
@tkuchiki
tkuchiki / gist:6017126
Last active Dec 19, 2015
CentOS 5 用 php 5.3.27 の RPM 取得
View gist:6017126
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 Jul 17, 2013
CentOS 6 用 php 5.3.26 RPM
View gist:6017165
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 Jul 18, 2013
Excel 対応 CSV download
View gist:6026507
<?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 Jul 18, 2013
svn switch の使い方。よく忘れるので
View gist:6026564
# svn switch {svn,http?s}://path/to/trunk
# svn switch {svn,http?s}://path/to/branches/example-branch
@tkuchiki
tkuchiki / gist:6121851
Created Jul 31, 2013
ps | grep PROCESS で grep 自身を除外する方法
View gist:6121851
ps | grep PROCESS | grep -v grep
ps | grep PROCES[S]