Skip to content

Instantly share code, notes, and snippets.

View jaymecd's full-sized avatar

Nikolai Zujev jaymecd

View GitHub Profile
@jaymecd
jaymecd / mongo_query.sh
Created July 30, 2014 09:19
Simple CLI MongoDb query runner
#!/bin/sh
HOST="localhost"
DB="test"
QUERY="${1}"
if [ "x${QUERY}" == "x" ]; then
read -p "Query: " QUERY
fi
#!/bin/bash
# Check out the blog post at:
#
# http://www.philipotoole.com/influxdb-and-grafana-howto
#
# for full details on how to use this script.
AWS_EC2_HOSTNAME_URL=http://169.254.169.254/latest/meta-data/public-hostname
INFLUXDB_DATABASE=test1
# force HTTP to HTTPS - /etc/nginx/conf.d/nonssl.conf
server {
listen 80;
server_name jira.example.com;
access_log off;
return 301 https://$server_name$request_uri;
}
# /etc/nginx/conf.d/jira.conf
server {
<?php
namespace My\Namespace;
/**
* This Listener listens to the loadClassMetadata event. Upon this event
* it hooks into Doctrine to update discriminator maps. Adding entries
* to the discriminator map at parent level is just not nice. We turn this
* around with this mechanism. In the subclass you will be able to give an
* entry for the discriminator map. In this listener we will retrieve the
* load metadata event to update the parent with a good discriminator map,
curl -XDELETE localhost:9200/test/
curl -XPUT localhost:9200/test/
curl -XPUT localhost:9200/test/son/_mapping -d '{
"son": {
"_parent": {
"type": "mother"
}
}
}'
curl -XPUT localhost:9200/test/daughter/_mapping -d '{
@jaymecd
jaymecd / mongos
Last active August 29, 2015 14:10 — forked from fabioperrella/mongos
#!/bin/sh
#
# init.d script with LSB support.
#
# Copyright (c) 2007 Javier Fernandez-Sanguino <jfs@debian.org>
#
# This is free software; you may redistribute it and/or modify
# it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2,
# or (at your option) any later version.
@jaymecd
jaymecd / haproxy.cfg
Last active August 29, 2015 14:10 — forked from dakatsuka/haproxy.cfg
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
maxconn 4096
user haproxy
group haproxy
daemon
listen rabbitmq 0.0.0.0:5672
mode tcp
@jaymecd
jaymecd / mongo_stats.php
Last active August 29, 2015 14:11
Mongo simple php starts
#!/usr/bin/env php
<?php
try {
$mongo = new MongoClient('mongodb://USER:PASS@HOST:PORT', array('db'=>'admin'));
$db = $mongo->selectDB('DBNAME');
$collections = [];
foreach ($db->listCollections() as $coll) {
@jaymecd
jaymecd / sql_stats.php
Created December 20, 2014 23:10
SQL simple php stats
#!/usr/bin/env php
<?php
try {
$host = '{HOST}';
$t1 = microtime(true);
$dbh = new PDO('mysql:dbname={DBNAME};host='. $host, '{USER}', '{PASS}');
$t2 = microtime(true);
$sth = $dbh->query('SHOW TABLE STATUS');

CQRS – Greg Young – 8/26/2011

Insurance Domain – Value to Business Model (S-M-L)

  • Claims – L
  • Sales – S-M
  • Accounting – S
  • Actuarials – S
  • Intranet – S
  • Public Web – M-L