This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mkdir -p {group_,host_}vars \ | |
| roles/{common,webtier}/{tasks,handlers,templates,files,vars} \ | |
| role/{monitoring,myapp} && \ | |
| touch {production,stage,development,testing,{site,webservers,dbservers}.yml} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Copyright (c) 2013 Couller Ltd. and Joseph Ray | |
| Permission is hereby granted, free of charge, to any person obtaining | |
| a copy of this software and associated documentation files (the | |
| "Software"), to deal in the Software without restriction, including | |
| without limitation the rights to use, copy, modify, merge, publish, | |
| distribute, sublicense, and/or sell copies of the Software, and to | |
| permit persons to whom the Software is furnished to do so, subject to | |
| the following conditions: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import argparse | |
| import ConfigParser | |
| import subprocess | |
| import shlex | |
| import re | |
| import time | |
| '''Ping Class to monitor arbitrary ping times | |
| ''' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import redis | |
| import statsd | |
| import time | |
| import argparse | |
| import logging | |
| import sys | |
| import os |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # | |
| # Copyright 2013 Robert Allen | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # | |
| # redis - this script starts and stops the redis-server daemon | |
| # | |
| # chkconfig: - 85 15 | |
| # description: Redis is a persistent key-value database | |
| # processname: redis-server | |
| # config: /etc/redis/redis.conf | |
| # config: /etc/sysconfig/redis | |
| # pidfile: /var/run/redis.pid |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| BTW yum has last Redis too, remi repository at least. | |
| $ sudo -i | |
| $ yum list redis | |
| $ redis.x86_64 2.6.13-1.el6.remi remi | |
| But today we want compile redis from source (see http://redis.io/download) | |
| $ yum install make gcc tcl | |
| $ cd /usr/local/src |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| switch (isset($headers['content-type']) && $headers['content-type']) { | |
| case 'application/xml': | |
| $format = 'XML'; | |
| break; | |
| case 'application/json': | |
| default: | |
| $format = 'JSON'; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * @link http://tools.ietf.org/html/draft-nottingham-http-problem | |
| * @link http://tools.ietf.org/html/rfc5988 | |
| * | |
| * @package ApiProblem | |
| * @category Exception | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ls data/some_path_with_spaces_in_the_name/*.csv| while read name; do | |
| ./bin/load_csv.sh "$name" table_name | |
| done | |
| # Only show lines when the value in column number 6 changes. | |
| tail -f some-logfile.log | awk '{if (last!=$6) {print $0}; last=$6}' | |
| #generates php class properties from a tables columns | |
| mysql -B -N -u root my_db -e 'describe table_to_use'|awk '{printf(" \"%s\" => null,\n", $1) }' |