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|
@nownabe
nownabe / Vagrantfile
Last active April 29, 2019 16:11
Vagrantfile for Percona XtraDB Cluster on CentOS 7
# -*- mode: ruby -*-
# vi: set ft=ruby :
PXC_CLUSTER_SIZE = 3
IP = "10.6.3.%d"
Vagrant.configure(2) do |config|
config.vm.box = "centos7"
config.vm.box_url = "https://f0fff3908f081cb6461b407be80daf97f07ac418.googledrive.com/host/0BwtuV7VyVTSkUG1PM3pCeDJ4dVE/centos7.box"
#!/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