Skip to content

Instantly share code, notes, and snippets.

Installing git on CentOS 5 using yum

Since you're using CentOS 5, the default package manager is yum, not apt-get. To install a program using it, you'd normally use the following command:

$ sudo yum install <packagename>

However, when trying to install git this way, you'll encounter the following error on CentOS 5:

source 'https://rubygems.org'
group :test do
gem 'chefspec', '~> 1.3'
gem 'foodcritic', '~> 2.1'
gem 'strainer', '~> 3.0'
gem 'test-kitchen', '~> 1.0.0.alpha'
gem 'kitchen-lxc', '~> 0.0.1.beta1'
gem 'knife-spork', '~> 1.0.17'
gem 'hipchat', '~> 0.10.0'
source 'https://rubygems.org'
group :test do
gem 'chefspec', '~> 1.3'
gem 'foodcritic', '~> 2.1'
gem 'strainer', '~> 3.0'
gem 'test-kitchen', '~> 1.0.0.alpha'
gem 'kitchen-lxc', '~> 0.0.1.beta1'
gem 'knife-spork', '~> 1.0.17'
gem 'hipchat', '~> 0.10.0'

Vagrant Setup

This tutorial guides you through creating your first Vagrant project.

We start with a generic Ubuntu VM, and use the Chef provisioning tool to:

  • install packages for vim, git
  • create user accounts, as specified in included JSON config files
  • install specified user dotfiles (.bashrc, .vimrc, etc) from a git repository

Afterwards, we'll see how easy it is to package our newly provisioned VM

# Knife Configuration File.
#
# This is a Ruby DSL to set configuration parameters for Knife's
# general options. The default location for this file is
# ~/.chef/knife.rb. If multiple Chef repositories are used,
# per-repository configuration files can be created. A per repository
# configuration file must be .chef/knife.rb in the base directory of
# the Chef repository. For example,
#
# ~/Development/chef-repo/.chef/knife.rb
vagrant@vagrant-vm:~$ sudo chef-solo -c /tmp/vagrant-chef-1/solo.rb -j /tmp/vagrant-chef-1/dna.json
vagrant@vagrant-vm:~$ sudo chef-solo -c /tmp/vagrant-chef-1/solo.rb -j /tmp/vagrant-chef-1/dna.json --why-run > /tmp/why-run.out
#!/bin/bash
# Perform installation as root
# Install prereqs
yum -y install libcurl libcurl-devel rrdtool rrdtool-devel rrdtool-prel libgcrypt-devel gcc make gcc-c++
# Get Collectd, untar it, make it and install
wget http://collectd.org/files/collectd-5.4.0.tar.gz
tar zxvf collectd-5.4.0.tar.gz

This gist contains everything you need to install StatsD and Graphite on CentOS 6.3. Unless I forgot something. If I did, shoot a reminder email to noah at one more bug dot com. tl;dr: womm, ymmv, yolo.

I (mostly) followed the steps shown in the EZUnix wiki

And I also referred back to this gist by Michael Grace

#!/usr/bin/env node
/* -*- js2 -*- */
/* ************************************************************* */
// Set up classes to support Range objects. Ported from
// Nagios::Plugin::Range. See named functions below.
// TODO: Modularize properly/idiomatically.
/*
* Represents a Nagios plugin range object.
#! /bin/sh
# ==================================================================
# ______ __ _____
# /_ __/___ ____ ___ _________ _/ /_ /__ /
# / / / __ \/ __ `__ \/ ___/ __ `/ __/ / /
# / / / /_/ / / / / / / /__/ /_/ / /_ / /
#/_/ \____/_/ /_/ /_/\___/\__,_/\__/ /_/
# Multi-instance Apache Tomcat installation with a focus
# on best-practices as defined by Apache, SpringSource, and MuleSoft