Skip to content

Instantly share code, notes, and snippets.

View ravibhure's full-sized avatar

Ravi ravibhure

View GitHub Profile
@ravibhure
ravibhure / Apache Reverse Proxy
Last active January 5, 2018 06:21
Reverse Proxy - Apache & Nginx
# 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 https://gist.github.com/MrZYX/719014
<VirtualHost *:80>
ServerName www.example11.com
RedirectPermanent / https://www.example11.com/
</VirtualHost>
<VirtualHost *:443>
-- 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/randomhacks.net/access. They're ordinary Apache
-- logs in *.gz format.
--
-- We want to pretend that these gzipped log files are a database table,
[user@server yum.repos.d]# yum install maven2
Loaded plugins: fastestmirror, presto
Loading mirror speeds from cached hostfile
* base: centos.crazyfrogs.org
* epel: mirror.bytemark.co.uk
* extras: centos.crazyfrogs.org
* jpackage-generic: jpackage.netmindz.net
* jpackage-generic-updates: jpackage.netmindz.net
* rpmforge: apt.sw.be
* rpmforge-extras: apt.sw.be
@ravibhure
ravibhure / A ansible tricks
Created February 28, 2014 12:05
A quick and dirty tips-n-tricks for ansible
Variables
==========
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/arrfab.net/hosts/hosts.cfg -vvv -m copy -a 'src=files/sysinfo dest=/etc/sysinfo' tungstene.arrfab.net
tungstene.arrfab.net | success >> {
"changed": true,
---
# ^^^ 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.
#!/bin/bash
# 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=2.2.1.1 priority=critical netcfg/get_nameservers=2.2.1.254 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=255.255.255.0 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"

My ansible approach

Per service playbooks

Playbooks are written per service : a playbook is a collection of tasks, and eventually associated handers, templates, and files, that are required to properly install and setup a service.

Each playbook has a setup.yml entry point, which is responsible of including various necessary tasks to get the service up and running. Typically, this

Transparent Git Encryption

This document has been modified from its [original format][m1], which was written by Ning Shang ([email protected]). It has been updated and reformatted into a [Markdown][m2] document by [Woody Gilk][m3] and [republished][m4].

Description

When working with a remote git repository which is hosted on a third-party storage server, data confidentiality sometimes becomes

---
# ^^^ 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
ravibhure / gist:7523642
Created November 18, 2013 06:47
HAProxy config for wordpress
# HAProxy config to block /wp-login.php and wp-admin POST method on wordpress webserver
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
#log loghost local0 info
maxconn 25000
#debug
#quiet
user prod
group prod