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 | |
| if [[ "$#" < "2" || "$#" > "3" ]]; then | |
| cat <<END | |
| Glusterfs GFID resolver -- turns a GFID into a real file path | |
| Usage: $0 <brick-path> <gfid> [-q] | |
| <brick-path> : the path to your glusterfs brick (required) | |
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 | |
| RED='\033[0;31m' | |
| BLUE='\033[1;34m' | |
| NC='\033[0m' # No Color | |
| tmp_dir_repos=/tmp/srv_git_repositories | |
| tmp_perm_repos=/tmp/gitolite_conf_repositories | |
| perm_file=/srv/git/.gitolite/conf/gitolite.conf |
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 | |
| # This file is managed by puppet | |
| # ignore localhost, and addresses with subnet /32 (because of Hetzner failover IP) | |
| ips=$(ip addr show | grep "inet\b" | awk '{print $2}' | grep -E -v '127\.0\.0\.1|\/32' | cut -d/ -f1) | |
| interfaces=$(ip link show | grep 'state UP' | cut -d ':' -f2 | tr -d ' ' | grep -v '\-drac') | |
| duplications='' | |
| arping_output='' |
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 | |
| # elasticsearch cleanup script | |
| ES_BASEDIR='/var/lib/elasticsearch/' | |
| ES_HTTP='http://localhost:9200' | |
| RETENTION_PERIOD='365' | |
| QUERY='' | |
| REMOVE=false | |
| TEMP_FILE=/tmp/_usr_local_sbin_purge_elasticsearch.sh_$$ |
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 | |
| rm -f *.rpm | |
| rm -rf coder | |
| git clone https://git.drupal.org/project/coder.git | |
| cd coder | |
| PACKAGE_VERSION='2.0' | |
| PACKAGE_RELEASE='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
| # | |
| # src: https://gist.github.com/pulecp/678057b9b059ff34dee0f130680a7d79 | |
| # | |
| # gem install whois | |
| require 'whois' | |
| # # randomly sort the domains recursively | |
| recursive_sort = "" | |
| # random_boolean = [true, false].sample | |
| # random_boolean ? recursive_sort = "" : recursive_sort = "-r" |
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 | |
| options=('find' 'delete') | |
| PS3='state your wish: ' | |
| echo -e "\nfind/delete corrupt whisper-files" | |
| [ -x /bin/whisper-info ] || { echo '/bin/whisper-info does not exists or it is not executable'; exit 1; } | |
| select opt in "${options[@]}"; do | |
| case $REPLY in |
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 | |
| # src: https://gist.github.com/untergeek/8029608 | |
| curl -XDELETE http://localhost:9200/_template/logstash?pretty=true | |
| echo | |
| echo "Deleted current logstash template..." | |
| echo "Creating new logstash template..." |
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 downtime { | |
| host_name zimbra8.example.com | |
| service_description Bacula job: zimbra8.example.com | |
| author kayn | |
| comment Schedule downtime for services with workhours notifications | |
| downtime_period monday 00:00-09:00,18:00-24:00 | |
| downtime_period tuesday 00:00-09:00,18:00-24:00 | |
| downtime_period wednesday 00:00-09:00,18:00-24:00 | |
| downtime_period thursday 00:00-09:00,18:00-24:00 | |
| downtime_period friday 00:00-09:00,18:00-24:00 |
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
| NR_OF_IPADDRESS=`/sbin/ip a | grep 'inet ' | grep -v '127\.0\.0\.1' | wc -l` | |
| [ "$NR_OF_IPADDRESS" -lt 1 ] && /sbin/service network restart |