Skip to content

Instantly share code, notes, and snippets.

View initcron's full-sized avatar

Gourav J. Shah initcron

View GitHub Profile
@initcron
initcron / node.rb
Created June 9, 2015 17:11
Foreman ENC patch for Mac OS X compatibility. Encoding UTF
--- node.rb.orig 2015-06-09 17:05:00.466081000 +0000
+++ node.rb 2015-06-09 17:09:13.798081000 +0000
@@ -14,6 +14,9 @@
:ssl_cert => "/var/lib/puppet/ssl/certs/foreman.nyc2.example.com.pem", # e.g. /var/lib/puppet/ssl/certs/FQDN.pem
:ssl_key => "/var/lib/puppet/ssl/private_keys/foreman.nyc2.example.com.pem" # e.g. /var/lib/puppet/ssl/private_keys/FQDN.pem
}
+if defined?(Encoding)
+ Encoding.default_external = Encoding::UTF_8
+end
@initcron
initcron / configure.pp
Created June 20, 2015 09:32
nginx::configure class with static files. part of 003 modules chapter
class nginx::configure{
file { '/var/www':
ensure => directory,
}
file { '/var/www/cinema':
ensure => directory,
}
@initcron
initcron / ntp_init.pp
Created June 21, 2015 07:13
init.pp for ntp class, parameterized clases
class ntp($server = undef) {
package { 'ntp':
ensure => installed,
}
file { '/etc/ntp.conf':
content => template('ntp/ntp.conf.erb'),
notify => Service['ntpd'],
}
@initcron
initcron / ntp.conf.erb
Last active August 29, 2015 14:23
ntp.conf.erb, chapter: parameterized classes
driftfile /var/lib/ntp/ntp.drift
<% if @server -%>
server <%= @server %> prefer
<% end -%>
server 0.ubuntu.pool.ntp.org
server 1.ubuntu.pool.ntp.org
server 2.ubuntu.pool.ntp.org
server 3.ubuntu.pool.ntp.org
server ntp.ubuntu.com
restrict -4 default kod notrap nomodify nopeer noquery
@initcron
initcron / gist:8636d2b5fb2a7c69b2fd
Created July 21, 2015 12:33
cmad setup with virtualbox and vagrant
1. Install the following softwares,
a. Virtualbox
b. Vagrant
c. On windows , install git for windows in addition
2. Copy over the box file (VM template) cmad_minimal_v2.box to your laptop along with "cmad" directory
3. Open iterm on mac or "git bash" terminal on windows and browse to the directory which contains the box file cmad_minimal_v2.box. Run the following command to add the VM template
$ vagrant box add cmad2 cmad_minimal_v2.box
@initcron
initcron / docker-compose.yml
Created August 6, 2015 16:24
docker-compose.yml for nginx and mysql
nginx:
image: initcron/nginx:latest
command: nginx
ports:
- "80:80"
links:
- mysql
mysql:
image: mysql
environment:
@initcron
initcron / docker-compose.yml
Last active June 9, 2016 05:32
docker-compose.yml for wordpress stack with wordress and mysql images
wordpress:
image: wordpress
links:
- db:mysql
ports:
- 80
db:
image: mysql
@initcron
initcron / docker_quick_dive_workshop.txt
Last active September 13, 2015 13:12
Docker Quick Dive
** Setting up Environment
*** Softwares Required
* Docker Toolbox
* Virtualbox
* Vagrant
* Git for Windows
* Vagrant Box/Template (docker_demo.box)
@initcron
initcron / mcollective_pe_tutorial.txt
Last active January 29, 2016 08:04
mcollective primer with Puppet Enterprise
# On Puppet Enterprise Master
# Login as pe-admin
$ sudo su
$ su - peadmin
# List mco commands, print help
$ mco help
# Ping All Hosts
@initcron
initcron / gist:5dcd6d2fb031ade5096d
Created December 15, 2015 15:25
Docker 101 : Getting Familiar
$ docker
#docker <command> --help
$ docker run --help
$ docker info
$ docker version
# Running Ephemeral Container
$ docker run ubuntu /bin/echo "Hello World"
$ docker ps