Skip to content

Instantly share code, notes, and snippets.

View vivekjuneja's full-sized avatar

Vivek Juneja vivekjuneja

View GitHub Profile
@vivekjuneja
vivekjuneja / service-checklist.md
Last active October 15, 2018 09:55 — forked from acolyer/service-checklist.md
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
8.2.3. HTTP log format
----------------------
The HTTP format is the most complete and the best suited for HTTP proxies. It
is enabled by when "option httplog" is specified in the frontend. It provides
the same level of information as the TCP format with additional features which
are specific to the HTTP protocol. Just like the TCP format, the log is usually
emitted at the end of the session, unless "option logasap" is specified, which
generally only makes sense for download sites. A session which matches the
"monitor" rules will never logged. It is also possible not to log sessions for
@vivekjuneja
vivekjuneja / curl_to_ab.py
Created October 13, 2016 07:34 — forked from ctolsen/curl_to_ab.py
"Copy to cURL" in Chrome to Apache Bench command
#!/usr/bin/env python3
import sys
import os
def curl_to_ab(curl_cmd: list, num: int=200, cur: int=4) -> str:
"""
Translate a cURL command created by Chrome's developer tools into a
command for ``ab``, the ApacheBench HTTP benchmarking tool.
@vivekjuneja
vivekjuneja / iptableflip.sh
Created July 20, 2016 02:32 — forked from lewisd32/iptableflip.sh
Snippet of Unbounce script for restarting HAProxy with zero downtime
echo "Flipping tables! (╯°□°)╯︵ ┻━┻"
num_rules=3
real=3 # exposed to the ELB as port 443
test=4 # used to install test certs for domain verification
health=5 # used by the ELB healthcheck
blue_prefix=855
green_prefix=866
{
"title": "Apache and Tomcat Logs",
"services": {
"query": {
"list": {
"0": {
"query": "apache !tomcat !static",
"alias": "",
"color": "#7EB26D",
"id": 0,
@vivekjuneja
vivekjuneja / monit_block_for_docker_container
Created November 30, 2015 03:55 — forked from the-frey/monit_block_for_docker_container
Monit Service Monitor Block for Docker Container
# Inside main monitrc
# Check that services are running and also define start and stop commands for them.
# You will need one of these for each container
# as well as working out a restarting and/or red
eploying workflow.
check process <container-name> with pidfile /var/run/monit/<container-name>.pid
start = "/path/to/pid/script start <container-name> '<docker-arguments>'"
stop = "/path/to/pid/script stop <container-name>"
@vivekjuneja
vivekjuneja / uninstall_homebrew.sh
Created October 20, 2015 01:58 — forked from mxcl/uninstall_homebrew.sh
Uninstall Homebrew
#!/bin/sh
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
function abort {
echo "$1"
exit 1
}
set -e
@vivekjuneja
vivekjuneja / readme.md
Last active August 29, 2015 14:27 — forked from ashrithr/readme.md
Installing ELK on a single machine

Installing ELK (CentOS)

This is a short step-by-step guide on installing ElasticSearch LogStash and Kibana Stack on a CentOS environment to gather and analyze logs.

I. Install JDK

rpm -ivh https://dl.dropboxusercontent.com/u/5756075/jdk-7u45-linux-x64.rpm
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management