Skip to content

Instantly share code, notes, and snippets.

View nownabe's full-sized avatar
💪
Yeah!!

Shogo Watanabe nownabe

💪
Yeah!!
View GitHub Profile

CentOSセットアップ

CentOSインストール

CentOSネットワーク設定

# sed -i 's/ONBOOT=no/ONBOOT=yes/' /etc/sysconfig/netwrok-scripts/ifcfg-eth0
# ifup eth0
# ifconfig
@nownabe
nownabe / gist:f1d53bd31101bef226ef
Last active August 29, 2015 14:04
[7db7w] PostgreSQL

1日目

2日目

select * from crosstab(
  'select extract(week from starts) as week,
          extract(dow from starts) as dow,
          count(*)
  from events
#!/bin/bash
## For 7 databases in 7 worlds
##
## Install:
## $ wget -O riakput.sh https://gist.github.com/nownabe/60d9a6f4e6034c2e5eae/raw/406d2a7a08a5d1ce5afd993786c11293cf3e949a/gistfile1.sh
## $ chmod +x riakput.sh
## Usage:
## $ echo '{"nickname": "Sweet Polly Purebred", "breed": "Purebred"}' | ./riakput.sh animal polly application/json
#!/bin/bash
## For 7 databases in 7 worlds
##
## Install:
## $ wget -O riakget.sh https://gist.github.com/nownabe/c870c1ca37501eecc9e5/raw/a74e7295ca1b501c288d633aea9c750df412b0fc/gistfile1.sh
## $ chmod +x riakget.sh
## Usage:
## $ ./riakget.sh animals polly
{
"inputs": "rooms",
"query": [
{
"map": {
"language": "javascript",
"source": "
function(v) {
key = v.key;
floor = key.substring(0, key.length - 2);
@nownabe
nownabe / file0.txt
Last active August 29, 2015 14:05
Apacheのチューニングメモ ref: http://qiita.com/nownabe/items/1111cc32da9fe63289f0
StartServers 500
MaxClients 500
MinSpareServers 500
MaxSpareServers 500
ServerLimit 500
MaxRequestsPerChild 0
@nownabe
nownabe / Vagrantfile
Last active August 29, 2015 14:06
Percona ExtraDB Cluster
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "cent65"
config.vm.network "public_network", ip: "192.168.0.31", bridge: "Qualcomm Atheros AR8161/8165 PCI-E Gigabit Ethernet Controller (NDIS 6.20)"
config.vm.provider "virtualbox" do |vb|
#!/bin/bash
set -eux
yum install -y gcc openssl-devel libyaml-devel libffi-devel readline-devel zlib-devel gdbm-devel ncurses-devel
git clone https://github.com/sstephenson/rbenv.git /usr/local/rbenv
git clone https://github.com/sstephenson/ruby-build.git /usr/local/rbenv/plugins/ruby-build
cat <<EOF > /etc/profile.d/rbenv.sh
export RBENV_ROOT="/usr/local/rbenv"
export PATH="\${RBENV_ROOT}/bin:\${PATH}"
#!/usr/bin/bash
set -eux
sudo yum install -y gcc openssl-devel libyaml-devel libffi-devel readline-devel zlib-devel gdbm-devel ncurses-devel
git clone https://github.com/riywo/anyenv ~/.anyenv
echo 'export PATH="$HOME/.anyenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(anyenv init -)"' >> ~/.bashrc
source ~/.bashrc
mkdir ~/.anyenv/plugins
git clone https://github.com/znz/anyenv-update.git ~/.anyenv/plugins/anyenv-update
yum install -y httpd mariadb-server mariadb-devel php-mysql php php-gd php-mbstring
curl -O https://ja.wordpress.org/wordpress-4.1.1-ja.tar.gz
tar zxf wordpress-4.1.1-ja.tar.gz -C /var/www/html
chown -R apache. /var/www/html/wordpress
systemctl start httpd
systemctl start mariadb
mysql -uroot -e 'create database wordpress'