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 | |
| syntax_errors=0 | |
| error_msg=$(mktemp /tmp/error_msg.XXXXXX) | |
| if git rev-parse --quiet --verify HEAD > /dev/null | |
| then | |
| against=HEAD | |
| else | |
| # Initial commit: diff against an empty tree object |
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
| # Remove a yum package via exec, this is done this way because | |
| # package { 'foo': ensure => purged; } keeps getting called on every | |
| # puppet run. We can't use ensure => absent because of an issue with | |
| # circular dependencies | |
| define yum::remove( | |
| $package = $name, | |
| $ensure = 'absent') { | |
| if ($ensure in ['absent', 'purged']) { |
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 base { | |
| case $::operatingsystem { | |
| 'ubuntu', 'debian': { | |
| include base::debian | |
| } | |
| 'fedora', 'centos', 'redhat': { | |
| include base::el | |
| } |
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 base::el { | |
| # This is the enteprise linux class, we will split it off more | |
| # for centos or redhat | |
| if $::osfamily != redhat { | |
| fail("${::operatingsystem} not supported") | |
| } | |
| class { 'yum': | |
| extrarepo => ['epel', 'puppetlabs'], |
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
| "------------------------------------------------- | |
| " vimrc file for ed lim | |
| " @author - Ed Lim | |
| "------------------------------------------------- | |
| "------------ editor behaviour block ------------------ | |
| set shiftwidth=4 " Use 4 spaces when text is indented | |
| set softtabstop=4 | |
| set tabstop=4 " sets how many spaces a tab is | |
| set smarttab |
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
| envfile="${HOME}/.gnupg/gpg-agent.env" | |
| if test -f "$envfile" && kill -0 $(grep GPG_AGENT_INFO "$envfile" | cut -d: -f 2) 2>/dev/null; then | |
| eval "$(cat "$envfile")" | |
| else | |
| eval "$(gpg-agent --daemon --log-file=~/.gnupg/gpg.log --write-env-file "$envfile")" | |
| fi | |
| export GPG_AGENT_INFO # the env file does not contain the export statement |
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 | |
| for i in `zmprov -l gas | grep 'mbox'`; do | |
| for j in $( zmprov -l gaa -s ${i} | egrep -v "^(spam|ham)" ); do | |
| total=0 | |
| echo -n "Total emails for $j = " | |
| for k in $( zmmailbox -z -m "$j" gaf | awk '{print $4}' | egrep -o "[0-9]+" ); do | |
| total=$(( total + k )) | |
| done | |
| echo $total |
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 | |
| IAM=`id -un` | |
| if [ "$IAM" != "zimbra" ]; then | |
| echo "You must run this script as the 'zimbra' user. Please 'su - zimbra' first." | |
| exit 1 | |
| fi | |
| # Run command zmprov gc Phoenix zimbraMailQuota | grep zimbraMailQuota | awk '{print $2}' |
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 | |
| # Counts for mail > 5 years | |
| IAM=`id -un` | |
| if [ "$IAM" != "zimbra" ]; then | |
| echo "You must run this script as the 'zimbra' user. Please 'su - zimbra' first." | |
| exit 1 | |
| fi | |
| for mboxgroup in `/opt/zimbra/bin/mysql --batch --skip-column-names -e "show databases like 'mboxgroup%'"`; do | |
| /opt/zimbra/bin/mysql --batch --skip-column-names -e "select count(*) from mail_item where date < unix_timestamp(now() - interval 5 year)" $mboxgroup; |
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
| [[email protected] puppetdb]# grep "Retrying after attempt" puppetdb.log | tail | |
| 2013-11-26 09:19:06,070 ERROR [command-proc-46] [puppetdb.command] [3e3036f7-5054-4e55-a2a2-b81ac6e8a328] [replace catalog] Retrying after attempt 4, due to: org.postgresql.util.PSQLException: This connection has been closed. | |
| 2013-11-26 09:19:43,077 ERROR [command-proc-46] [puppetdb.command] [3e3036f7-5054-4e55-a2a2-b81ac6e8a328] [replace catalog] Retrying after attempt 5, due to: org.postgresql.util.PSQLException: This connection has been closed. | |
| 2013-11-26 09:34:49,008 ERROR [command-proc-46] [puppetdb.command] [6940ac76-6803-4ca4-b693-94118f23aa8d] [replace facts] Retrying after attempt 4, due to: org.postgresql.util.PSQLException: This connection has been closed. | |
| 2013-11-26 09:34:50,111 ERROR [command-proc-46] [puppetdb.command] [1c3436ce-0933-413e-9965-f44ecd31fb89] [replace catalog] Retrying after attempt 4, due to: org.postgresql.util.PSQLException: This connection has been closed. | |
| 2013-11-26 09:35:09,004 ERR |