Skip to content

Instantly share code, notes, and snippets.

View initcron's full-sized avatar

Gourav Shah initcron

View GitHub Profile
@initcron
initcron / Vagrantfile
Created March 15, 2014 16:19
Vagrantfile for Workstation
# -*- mode: ruby -*-
# vi: set ft=ruby :
# This is a Vagrant configuration file. It can be used to set up and manage
# virtual machines on your local system or in the cloud. See http://downloads.vagrantup.com/
# for downloads and installation instructions, and see http://docs.vagrantup.com/v2/
# for more information and configuring and using Vagrant.
Vagrant.configure("2") do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
@initcron
initcron / Vagrantfile
Created March 15, 2014 17:50
Vagrantfile for Node
# -*- mode: ruby -*-
# vi: set ft=ruby :
# This is a Vagrant configuration file. It can be used to set up and manage
# virtual machines on your local system or in the cloud. See http://downloads.vagrantup.com/
# for downloads and installation instructions, and see http://docs.vagrantup.com/v2/
# for more information and configuring and using Vagrant.
Vagrant.configure("2") do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
@initcron
initcron / Vagrantfile
Created March 17, 2014 07:43
node2 vagrant file
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
@initcron
initcron / etc_network_interfaces
Created March 18, 2014 04:17
networking configurations on ubuntu
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet dhcp
@initcron
initcron / redo_knide_node
Last active August 29, 2015 13:57
How to redo the node
0. Remove client and node from chef server's registry. Run thi from Workstation
{ws}$ knife client delete node1
{ws}$ knife node delete node1
1. Login to node
{node}$ ssh vagrant@192.168.33.11
2. Browse to /etc/chef on node, and delete everything under it
{node}$ rm -rf /etc/chef/*
@initcron
initcron / default.rb
Created March 19, 2014 03:51
apache default.rb on ubuntu
package "apache2" do
action :install
end
service "apache2" do
action [ :enable, :start]
end
cookbook_file "/var/www/index.html" do
source "index.html"
@initcron
initcron / default.rb
Created March 20, 2014 04:56
apache default recipe
#
# Cookbook Name:: apache
# Recipe:: default
#
# Copyright 2014, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#
@initcron
initcron / gist:9679423
Created March 21, 2014 04:17
knife search
498 knife search users "*:*"
499 knife search node "*:*"
500 ohai
501 knife search node "plat*:ubuntu"
502 knife search node "*:*"
503 knife search node
504 knife search node "*:*"
505 knife search node "ipaddress:10.*"
506 knife search node "ipaddress:10.*" -a platform
507 knife search node "ipaddress:10.* AND platform:ubuntu"
@initcron
initcron / base.rb
Created March 21, 2014 06:02
base role
name "base"
description "Base Server Role"
run_list "recipe[ntp]", "recipe[motd]", "recipe[chef-client]"
{
"id": "mark",
"production" : {
"comment": "Mark in Production",
"uid": 3001,
"gid": 0,
"home": "/home/mark",
"shell": "/bin/zsh"
},