Skip to content

Instantly share code, notes, and snippets.

# basic cobbler setup, just to give some idea of the commands you will need to run...
cobbler-ubuntu-import precise-x86_64
# FIXME: need to template out various things
profile_kopts="ksdevice=bootif locale=en_US text netcfg/confirm_static=true netcfg/get_gateway= priority=critical netcfg/get_nameservers= netcfg/disable_autoconfig=true netcfg/dhcp_options='Configure network manually' netcfg/no_default_route=true netcfg/choose_interface=auto partman-auto/disk=/dev/sda netcfg/get_netmask= netcfg/dhcp_failed=true"
echo "profile options = $profile_kopts"
cmd="cobbler profile add --name=openstack --distro=precise-x86_64 --kickstart=/etc/cobbler/preseeds/cisco-preseed --kopts=\"${profile_kopts}\" --clobber"
View pedantically_commented_playbook.yml
# ^^^ YAML documents must begin with the document separator "---"
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
ravibhure / A ansible tricks
Created Feb 28, 2014
A quick and dirty tips-n-tricks for ansible
View A ansible tricks
predefined variables :
- inventory_hostname (fqdn) (normally the same as ansible.fqdn)
- inventory_hostname_short
To know the return codes returned by ansible modules, just use plain ansible -vvv to see them :
ansible -i ~/ansible/ -vvv -m copy -a 'src=files/sysinfo dest=/etc/sysinfo' | success >> {
"changed": true,
View gist:a71671db28141c8efc8e
[user@server yum.repos.d]# yum install maven2
Loaded plugins: fastestmirror, presto
Loading mirror speeds from cached hostfile
* base:
* epel:
* extras:
* jpackage-generic:
* jpackage-generic-updates:
* rpmforge:
* rpmforge-extras:
View apache-logs-hive.sql
-- This is a Hive program. Hive is an SQL-like language that compiles
-- into Hadoop Map/Reduce jobs. It's very popular among analysts at
-- Facebook, because it allows them to query enormous Hadoop data
-- stores using a language much like SQL.
-- Our logs are stored on the Hadoop Distributed File System, in the
-- directory /logs/ They're ordinary Apache
-- logs in *.gz format.
-- We want to pretend that these gzipped log files are a database table,
ravibhure / Apache Reverse Proxy
Last active Jan 5, 2018
Reverse Proxy - Apache & Nginx
View Apache Reverse Proxy
# Make sure mod_ssl, mod_rewrite, mod_headers, mod_proxy,
# mod_proxy_http and mod_proxy_balancer are enabled
# Advanced Apache reverse proxy - Rails
# Oh so cleverly adapted from this
<VirtualHost *:80>
RedirectPermanent /
<VirtualHost *:443>
View fortune
#!/usr/bin/env python
# -*- coding: utf8
from random import choice
fortunes = ["“Welcome” is a powerful word.",
"A dubious friend may be an enemy in camouflage.",
"A feather in the hand is better than a bird in the air. (2)",
"A fresh start will put you on your way.",
"A friend asks only for your time not your money.",
"A friend is a present you give yourself.",
"A gambler not only will lose what he has, but also will lose what he doesn’t have.",
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
BOX_NAME = ENV['BOX_NAME'] || "Centos6.4"
BOX_URI = ENV['BOX_URI'] || ""
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
ravibhure / vagrant_centos_ubuntu
Last active Aug 29, 2015
Vagrant on CentOS and Ubuntu
View vagrant_centos_ubuntu
Setup Vagrant and a small quick start
Setup Vagrant and a small quick-start I had troubles with an regular VM so i installed vagrant :), this is what i have done. And installed Vagrant like described here.
For Ubuntu --
Or follow the instructions here:
View docker
# Provides: docker
# Required-Start: networking
# Required-Stop: networking
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: docker