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/perl | |
| use Email::Valid; | |
| my $in_headers; | |
| $in_headers = 1; | |
| open (MYFILE, @ARGV[0]); | |
| local $_; | |
| while (<MYFILE>) { | |
| chomp; | |
| if ($in_headers) { |
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
| define lxchost::mountContainerMounts { | |
| $mntarr = split($title, ':') | |
| $mntpoint = $mntarr[-1] | |
| $classname = downcase(regsubst($mntpoint,'^.*/','lxchost::implementation::mount')) | |
| require $classname | |
| } |
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
| # Locale, country and keyboard settings | |
| d-i debian-installer/locale string en_US | |
| d-i console-setup/ask_detect boolean false | |
| d-i console-setup/modelcode string pc105 | |
| d-i console-setup/variant USA | |
| d-i console-setup/layout USA | |
| d-i console-setup/layoutcode string us | |
| # Network configuration | |
| d-i netcfg/choose_interface select auto |
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
| dscl localhost -readall /LDAPv3/ldap.example.com/Automount | |
| dsAttrTypeNative:objectClass: automount top | |
| AppleMetaNodeLocation: /LDAPv3/ldap.example.com | |
| AppleMetaRecordName: cn=/,ou=auto.shares.it,ou=autofs,dc=example,dc=com | |
| AutomountInformation: | |
| -fstype=nfs,nfsvers=4,rw,fsc,hard,intr,nodev,noexec,nosuid,rsize=81920,wsize=81920 nfs.example.com:/vol/volShareShares/departments/it | |
| MetaAutomountMap: auto.shares.it | |
| RecordName: / | |
| RecordType: dsRecTypeStandard:Automount | |
| - |
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/bash | |
| # Analyze log file and send result to zabbix. | |
| # Usage: bash analog_send.sh /path/to/analog.ini /path/to/nginx/access.log | |
| HOST=$1 # name of host in Zabbix frontend, *not* IP or hostname! | |
| ARGS_FILE=$2 | |
| LOG_FILE=$3 | |
| LOG_NAME=$(basename $LOG_FILE) |
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
| class lightdm ($lightdmconf = { SeatDefaults => { user-session => "ubuntu", greeter-session => "unity-greeter", greeter-show-manual-login => "true", greeter-hide-users => "true" } } ) { | |
| file { '/etc/lightdm/lightdm.conf': | |
| ensure => present, | |
| mode => 644, | |
| owner => root, | |
| group => root, | |
| content => template('lightdm/lightdm.conf.erb'), | |
| } | |
| } |
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
| define loadkmod { | |
| exec { "modprobe_$name": | |
| command => "/sbin/modprobe ${name}", | |
| unless => "/bin/grep \"^${name} \" /proc/modules", | |
| } | |
| exec { "add_${name}_to_etc_modules" : | |
| command => "/bin/bash -c 'echo $name >> /etc/modules'", | |
| unless => "/bin/grep ^${name} /etc/modules", | |
| } |
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
| options { | |
| ... | |
| }; | |
| view "one" { | |
| match-clients { | |
| key "key_one"; | |
| !key "key_two"; | |
| !key "key_three"; | |
| ... | |
| !key "key_n"; |
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/php | |
| <?php | |
| $fdspec = array( | |
| 0 => array( "pipe", "r" ), | |
| 1 => array( "pipe", "w" ), | |
| 2 => array( "pipe", "w" ), | |
| ); | |
| $proc = proc_open("ls",$fdspec,$pipes,NULL,array()); | |
| if (is_resource($proc)) { | |
| fclose($pipes[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
| - hosts: all | |
| vars: | |
| - monitoring_agent : "nrpe_server" | |
| tasks: | |
| - name: test check_mk | |
| local_action: wait_for port=6556 timeout=2 host={{inventory_hostname}} | |
| register: check_mk | |
| ignore_errors: True | |
| - name: set fact | |
| set_fact: monitoring_agent="check_mk_agent" |