Skip to content

Instantly share code, notes, and snippets.

@yamingd
yamingd / jetty.sh
Last active August 29, 2015 14:08
#!/bin/bash
### BEGIN INIT INFO
# Provides: jetty
# Required-Start: $local_fs $remote_fs $network $syslog $named
# Required-Stop: $local_fs $remote_fs $network $syslog $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# X-Interactive: true
# Short-Description: Start/stop jetty servlet container
### END INIT INFO
#!/bin/bash
# Install Redis
echo 'Install Redis'
cd /tmp
mkdir redis && cd redis
wget http://redis.googlecode.com/files/redis-2.4.10.tar.gz
tar -zxf redis-2.4.10.tar.gz
cd redis-2.4.10
make && make install
@yamingd
yamingd / nginx
Created August 30, 2014 11:33 — forked from mustafaturan/nginx
#!/bin/sh
#
# nginx - this script starts and stops the nginx daemin
#
# chkconfig: - 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /usr/local/nginx/conf/nginx.conf
# pidfile: /usr/local/nginx/logs/nginx.pid
#!/bin/bash
#
# This script checks if a mysql server is healthy running on localhost. It will
# return:
#
# "HTTP/1.x 200 OK\r" (if mysql is running smoothly)
#
# - OR -
#
# "HTTP/1.x 500 Internal Server Error\r" (else)
global
log 127.0.0.1 local0 notice
maxconn 20000
user haproxy
group haproxy
defaults
log global
mode tcp
option dontlognull

The High Availability Switch: from MySQL+MMM to MariaDB+Galera Cluster

Kevin Lawver, President @ [Rails Machine](https://railsmachine.com), is our guest author for this post.

Few things feel worst than rolling out a High Availability (HA) system, then regularly seeing that system collapse. For our team at Rails Machine, this failing HA system was MySQL Multi-Master Replication Manager (MMM).

We've been searching for a MMM replacement for a while, and a few months ago, we made the switch to MariaDB + Galera Cluster for High Availability MySQL. What's wrong with MySQL MMM? What's special about Galera Cluster? Read on!

@yamingd
yamingd / angular.jsp
Created December 22, 2013 09:00 — forked from wvuong/angular.jsp
<script>
// inject inlined constants
angular.module('app.constants', [])
.constant('contextPath', '${pageContext.request.contextPath}');
</script>