Skip to content

Instantly share code, notes, and snippets.

@dapangmao
Last active August 29, 2015 14:04
Show Gist options
  • Save dapangmao/de82ca7550c2ca31a89d to your computer and use it in GitHub Desktop.
Save dapangmao/de82ca7550c2ca31a89d to your computer and use it in GitHub Desktop.
#!/bin/bash
# Check hardwares
cat /etc/redhat-release /proc/cpuinfo /proc/meminfo
df -h
# Install git
yum -y update
yum -y install git-core
# Add new super user which name is 'me'
useradd me
passwd me
echo 'me ALL=(ALL) ALL' >> /etc/sudoers
# Install setup tools
curl https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py | python -
# Install pip
easy_install pip
# Install virtualenv
pip install virtualenv
# Install VIM Python plugins
wget https://raw.github.com/ma6174/vim/master/setup.sh -O ma6174_vim_setup.sh && bash ma6174_vim_setup.sh
# Install Ansible
mkdir web && cd web
git clone git://github.com/ansible/ansible.git
cd ./ansible
pip install paramiko PyYAML jinja2 httplib2
source ./hacking/env-setup
# Test Ansible
echo "127.0.0.1" > ~/ansible_hosts
export ANSIBLE_HOSTS=~/ansible_hosts
ansible all -m ping --ask-pass
# Create SSH key
if [ ! -d "~/.ssh" ]; then
mkdir ~/.ssh
fi
cd ~/.ssh
if [ ! -f ~/.ssh/git.rsa ]; then
ssh-keygen -f git.rsa -t rsa -N ''
fi
# Create SSH key daemon for Github
echo 'alias github="eval '\''$(ssh-agent -s)'\''; ssh-add ~/.ssh/git.rsa; ssh -T git@github.com"' >> $HOME/.bashrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment