Skip to content

Instantly share code, notes, and snippets.

View MeenachiSundaram's full-sized avatar

MeenachiSundaram V MeenachiSundaram

View GitHub Profile
node 'db' {
include 'mysql::server'
mysql::db { 'wordpress':
user => 'wordpress',
password => 'password',
host => 'localhost',
grant => ['SELECT', 'UPDATE'],
sql => '/var/lib/mysql/wordpress',
node 'db' {
include 'mysql::server'
mysql::db { 'wordpress':
user => 'wordpress',
password => 'password',
host => '%',
grant => ['INSERT', 'DELETE', 'SELECT', 'CREATE', 'UPDATE'],
@MeenachiSundaram
MeenachiSundaram / site.pp
Created February 22, 2016 11:49
site.pp
node 'lb' {
include ::haproxy
haproxy::listen { 'wordpress00':
collect_exported => false,
ipaddress => '0.0.0.0',
ports => '80',
options => {
'option' => [
'tcplog',
@MeenachiSundaram
MeenachiSundaram / lampn.sh
Last active March 4, 2016 04:58
(LAMP) Linux Apache MySQL Php Nginx and wordpress configuration script for CentOS & Ubuntu (Automation)
#!/bin/bash
#Installing update
dist=`cat /etc/issue | awk 'NR==1{print $1}'`
if [ "$dist" == "Ubuntu" ]; then
apt-get -y update
clear
echo "Update Done..!"
sleep 5
elif [[ "$dist" == "CentOS" ]]; then
@MeenachiSundaram
MeenachiSundaram / Setup SSH without Password in Linux
Created March 22, 2016 10:07
How to Setup SSH without Password in Linux (Using SSH Key)
SSH ( Secure Shell ) is widely used for remote login to Linux servers.
When we login to a remote system using ssh,it prompts for password and then only allow us to login to server.
This article will help you to Setup SSH without password in Linux Systems suing ssh ( rsa/dsa ) key pair.
Step 1: Generate SSH Key Pair
Firstly you would required to generate a key pair (RSA or DSA), you can specify option rsa or dsa key using ‘t’ command line switch. If we do not pass -t parameter, it will create rsa key by default.
@MeenachiSundaram
MeenachiSundaram / nginx.conf
Created September 30, 2016 05:26
Nginx daemon off in containers
default_type application/octet-stream;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
@MeenachiSundaram
MeenachiSundaram / nginx.conf
Last active September 30, 2016 05:46
Nginx daemon off in containers
user www-data;
worker_processes 4;
pid /run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
@MeenachiSundaram
MeenachiSundaram / default
Last active October 3, 2016 12:28
/etc/nginx/sites-available/default
server {
listen 0.0.0.0:80;
server_name awsaudit.com www.awsaudit.com;
access_log /var/log/nginx/awsaudit.com.access.log;
root /var/www/schoolofdevops/www;
try_files $uri /index.php?$args;
set $cache_uri $request_uri;
@MeenachiSundaram
MeenachiSundaram / docker
Last active December 24, 2016 12:05
Working with docker images
sudo docker ps -a | grep Exit | cut -d ' ' -f 1 | xargs sudo docker rm
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
#You can then remove untagged images if you rebuilt the same version with
docker rmi $(docker images | grep "^<none>" | awk "{print $3}")
docker rmi $(docker images -q)