Skip to content

Instantly share code, notes, and snippets.

View hagix9's full-sized avatar

Shiro Hagihara hagix9

  • Fulltrust.inc
  • 7F Matsugaya 2-23-4 Matsugaya Taito-ku Tokyo-to
View GitHub Profile
@hagix9
hagix9 / lxc-centos
Last active March 11, 2024 12:23 — forked from mattwillsher/lxc-centos
LXC CentOS template. Work with Ubuntu if the yum package is installed
#!/bin/bash
#
# template script for generating CentOS container for LXC
#
#
# lxc: linux Container library
# Authors:
#!/bin/bash
#For CentOS
echo "Hello OpenStack World. This is User-Data Test" | tee /root/hello.txt
@hagix9
hagix9 / gist:7071145
Created October 20, 2013 15:33
Cinderのボリュームをインスタンスに接続させるとAppArmorがDENIED sudo ln -s /etc/apparmor.d/usr.sbin.libvirtd /etc/apparmor.d/disable/ sudo ln -s /etc/apparmor.d/usr.lib.libvirt.virt-aa-helper /etc/apparmor.d/disable/ sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.libvirtd sudo apparmor_parser -R /etc/apparmor.d/usr.lib.libvirt.virt-aa-helper sudo service apparmor r…
Oct 21 00:29:11 stack01 iscsid: iSCSI logger with pid=29419 started!
Oct 21 00:29:11 stack01 kernel: [ 1381.688611] Loading iSCSI transport class v2.0-870.
Oct 21 00:29:12 stack01 iscsid: iSCSI daemon with pid=29420 started!
Oct 21 00:29:13 stack01 kernel: [ 1382.999501] iscsi: registered transport (tcp)
Oct 21 00:29:13 stack01 kernel: [ 1383.256022] scsi2 : iSCSI Initiator over TCP/IP
Oct 21 00:29:13 stack01 kernel: [ 1383.762305] scsi 2:0:0:0: RAID IET Controller 0001 PQ: 0 ANSI: 5
Oct 21 00:29:13 stack01 kernel: [ 1383.763668] scsi 2:0:0:0: Attached scsi generic sg0 type 12
Oct 21 00:29:13 stack01 kernel: [ 1383.764556] scsi 2:0:0:1: Direct-Access IET VIRTUAL-DISK 0001 PQ: 0 ANSI: 5
Oct 21 00:29:13 stack01 kernel: [ 1383.764771] sd 2:0:0:1: [sda] 2097152 512-byte logical blocks: (1.07 GB/1.00 GiB)
Oct 21 00:29:13 stack01 kernel: [ 1383.764905] sd 2:0:0:1: [sda] Write Protect is off
@hagix9
hagix9 / gist:7247663
Last active December 27, 2015 01:49
CentOS6.4にredis node.js epressとか
rpm -ivh http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -ivh http://rpms.famillecollet.com/enterprise/6/remi/x86_64/remi-release-6.4-1.el6.remi.noarch.rpm
yum install redis git -y
chkconfig redis on
service redis start
curl https://raw.github.com/creationix/nvm/master/install.sh | sh
source ~/.nvm/nvm.sh
#node.jsの最新版をインストール
nvm install $(nvm ls-remote | tail -1 | awk '{print $1}')
#expressをインストール
@hagix9
hagix9 / gist:7266124
Last active December 27, 2015 04:19
Dockerfile Part1
#ディレクトリ作成、移動
mkdir centos_ssh
cd centos_ssh
#コンテナイメージ作成ファイルの作成
vi Dockerfile
#choice container image
FROM centos
@hagix9
hagix9 / gist:7274416
Created November 2, 2013 01:24
UbuntuにDocker
#Ubuntu13.10
sudo sh -c "wget -qO- https://get.docker.io/gpg | apt-key add -"
sudo sh -c "echo deb http://get.docker.io/ubuntu docker main\
> /etc/apt/sources.list.d/docker.list"
sudo apt-get update
sudo apt-get install lxc-docker -y
sudo docker run -i -t centos /bin/bash
#Ubuntu13.04
sudo apt-get install software-properties-common
@hagix9
hagix9 / gist:7276134
Created November 2, 2013 06:17
Dockerfile2 redis mongodb npm
#choice container image
FROM centos
#add repository
RUN rpm -ivh http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
#install package
RUN yum install -y passwd
RUN yum install -y openssh-server
RUN yum install -y openssh-clients
@hagix9
hagix9 / gist:7284987
Last active December 27, 2015 06:58
CentOS6.4でAnsible Module for Dockerを試す https://github.com/cove/docker-ansible
#Ansibleのインストール
rpm -ivh http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum install git -y
yum groupinstall "Development tools" -y
yum install PyYAML python-jinja2 python2-devel -y
yum install python-setuptools python-keyczar python-paramiko sshpass asciidoc -y
cd /usr/local/src
git clone git://github.com/ansible/ansible.git
cd ./ansible
make rpm
@hagix9
hagix9 / gist:7286981
Last active December 27, 2015 07:09
Docker0.6.6 Install for CentOS6.4 reference: https://github.com/sciurus/docker-rhel-rpm
# SELinux setting
sed -i.bak "s/\(^SELINUX=\).*/\1disabled/" /etc/selinux/config
#IPv4Forwarding setting
sed -i.bak "s/net.ipv4.ip_forward = 0/net.ipv4.ip_forward = 1/" /etc/sysctl.conf
########################################################################################
# add Repository
rpm -ivh http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
@hagix9
hagix9 / gist:7287293
Last active January 24, 2024 10:12
Dockerのコマンド
#ビルド
docker build -t "sshd/centos" .
#コンテナを起動
docker run -i -t centos /bin/bash
#コンテナに名前を付けて起動
docker run -i -t --name cent01 centos /bin/bash
#コンテナをバックグランドで起動