Skip to content

Instantly share code, notes, and snippets.

@snickerjp
snickerjp / update_motd_for_centos.sh
Last active August 29, 2015 14:23 — forked from ysaotome/update_motd_by_screenfetch.sh
/etc/motdにサーバ情報を書き込むスクリプト! forked from ysaotome/update_motd_for_centos.sh
#!/bin/bash
# Description:UpdateMotd for CentOS
# 2013/07/15 @ysaotome
# Original from https://gist.github.com/ysaotome/5997652
FILE_MOTD='/etc/motd'
BIN_DATE='/bin/date'
BIN_FIGLET='/usr/bin/figlet'
BIN_HOSTNAME='/bin/hostname'
aptitude install -y git curl python-dev python-pip redis-server ruby1.9.1-full rubygems1.9.1
aptitude install -y mysql-server libmysqlclient-dev
adduser --system --shell /bin/sh --gecos 'git version control' --group --disabled-password --home /home/git git
adduser --disabled-login --gecos 'gitlab system' gitlab
usermod -a -G git gitlab
su - gitlab
ssh-keygen -q -N '' -t rsa -f /home/gitlab/.ssh/id_rsa
aptitude install gitolite
cp /home/gitlab/.ssh/id_rsa.pub /home/git/gitlab.pub
su - git