This file contains 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
Classes Vs Defined Types | |
Classes are not to be thought of in the ‘object oriented’ meaning of a class. This means a machine belongs to a particular class of machine. | |
For instance, a generic webserver would be a class. You would include that class as part of any node that needed to be built as a generic webserver. That class would drop in whatever packages, etc, it needed to do. | |
Defined types on the other hand (created with ‘define’) can have many instances on a machine, and can encapsulate classes and other resources. They can be created using user supplied variables. For instance, to manage iptables, a defined type may wrap each rule in the iptables file, and the iptables configuration could be built out of fragments generated by those defined types. | |
Usage of classes and defined types, in addition to the built-in managed types, is very helpful towards having a managable Puppet infrastructure. |
This file contains 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
Flapjack::Diner.create_contact_notification_rules( | |
'0', | |
{ | |
'regex_tags' => [ '^bacula$', '^job:$' ], | |
'time_restrictions' => [ | |
{ | |
'start_time' => '2013-01-28 18:00:00', | |
'end_time' => '2013-01-29 08:00:00', | |
'rrules' => [ | |
{ |
This file contains 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/bash | |
# I suppose that you have current data in /var/lib/carbon/whisper | |
# and data which you want to sync in /var/lib/carbon/var/lib/carbon/whisper | |
wget https://raw.githubusercontent.com/graphite-project/whisper/master/bin/whisper-fill.py | |
src_dir=`find /var/lib/carbon/var/lib/carbon/whisper -type f` |
This file contains 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
# list of severity levels | |
# ["emergency", "alert", "critical", "error", "warning", "notice", "informational", "debug"] | |
cron { 'Clean_debug_older_than_4_weeks_28_days': | |
command => '/usr/local/bin/purge_elasticsearch.sh -d 28 -l debug', | |
minute => '10', | |
hour => '5', | |
} | |
cron { 'Clean_informational_older_than_16_weeks_112_days': |
This file contains 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
mount -t glusterfs [-o <options>] <server1>,<server2>,<server3>,..<serverN>:/<volname> <mount_point> |
This file contains 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
key "external" { | |
algorithm hmac-md5; | |
secret "TW97YPZWWdSJXd/yYisrrQ=="; | |
}; | |
key "internal" { | |
algorithm hmac-md5; | |
secret "msSGPzPfX8fAE3I4nE7pcw=="; | |
}; |
This file contains 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
/etc/named.conf | |
key "external" { | |
algorithm hmac-md5; | |
secret "TW97YPZWWdSJXd/yYisrrQ=="; | |
}; | |
key "internal" { | |
algorithm hmac-md5; | |
secret "msSGPzPfX8fAE3I4nE7pcw=="; |
This file contains 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 | |
/* Redis PHP stats dump | |
* Based on code https://gist.github.com/putzflorian/45c137a8d7868d4b6250 | |
*/ | |
define(REDIS_TIMEOUT, 2); | |
$fp = fsockopen('127.0.0.1', 6379, $errno, $errstr, REDIS_TIMEOUT); | |
if (!$fp) { | |
die($errstr); | |
} |
This file contains 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/bash | |
exec 3<submodules | |
while read -u 3 -r NAME;read -u 3 -r REPO | |
do | |
REPO_DIR=`echo $NAME|cut -d '"' -f2` | |
REPO_URL=`echo $REPO|cut -d '=' -f2` | |
[ -d $REPO_DIR ] && continue |
This file contains 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
yum install intltool glib2-devel libxml2-devel libpng-devel libjpeg-devel libexif-devel libtiff-devel | |
mkdir -p /opt/vips/{lib,include} | |
################################ | |
## INSTALL IMAGEMAGICK v6 !!! ## | |
################################ | |
[ -d ImageMagick ] || git clone -b ImageMagick-6 https://github.com/ImageMagick/ImageMagick | |
cd ImageMagick |
OlderNewer