Skip to content

Instantly share code, notes, and snippets.

View InstallingGitUsingYum.md

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:

View 01-Gemfile.rb
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'
View 01-Gemfile.rb
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'
View winrm-test.rb
require 'winrm'
endpoint = 'http://xxxx:5985/wsman'
winrm = WinRM::WinRMWebService.new(endpoint, :plaintext, :user => 'Administrator', :pass => 'xxxx', :disable_sspi => true)
winrm.cmd('ipconfig /all') do |stdout, stderr|
  STDOUT.print stdout
  STDERR.print stderr
end
View README.md

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

View knife.rb
# 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
View vagrant-chef-solo-command-line
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
View gist:9608630
#!/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
@obazoud
obazoud / Berksfile
Created Mar 23, 2014
berkshelf hangs 100% CPU
View Berksfile
# -*- mode: ruby; coding: utf-8; -*-
source "http://api.berkshelf.com"
# Official Opscode cookbooks / Community
cookbook 'apt', git: 'https://github.com/opscode-cookbooks/apt.git', tag: 'v2.3.8'
cookbook 'ark', git: 'https://github.com/opscode-cookbooks/ark.git', tag: 'v0.7.0'
cookbook 'build-essential', git: 'https://github.com/opscode-cookbooks/build-essential.git', tag: 'v2.0.0'
cookbook 'chef-client', git: 'https://github.com/opscode-cookbooks/chef-client.git', tag: 'v3.2.0'
cookbook 'chef_handler', git: 'https://github.com/opscode-cookbooks/chef_handler.git', tag: 'v1.1.5'
@obazoud
obazoud / Dockerfile
Last active Aug 29, 2015
Docker image Chef - CentOS
View Dockerfile
FROM centos:6.4
RUN curl -L https://www.opscode.com/chef/install.sh | bash
RUN yum clean all
RUN yum install -y sudo openssh-server openssh-clients curl
RUN sed -i '/requiretty/c\# Defaults requiretty' /etc/sudoers