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 | |
| # requires root effective permissions | |
| if [[ "$(id -u)" -ne 0 ]]; then | |
| echo "Error: $0 must execute as root." | |
| exit 1 | |
| fi | |
| # create list of active kernel modules | |
| lsmod | awk '$3 > 0 && NR > 1 {print $1}' > module.lst |
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
| --- | |
| - name: check if avahi installed | |
| command: rpm -q avahi | |
| register: avahi_service | |
| changed_when: no | |
| failed_when: no | |
| tags: | |
| - dnsmasq | |
| - name: disable avahi-daemon |
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
| PS1="\[\033[01;32m\]\u@\h\[\033[00m\] \[\033[01;34m\]\w\n$ \[\033[00m\]" |
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
| consul exec whoami | awk '$1 != "==>" && $2 { sub(/^[ \t]+/, ""); print }' |
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 | |
| PREFIX="centos" | |
| STATUS="ACTIVE" | |
| INSTANCES="$(nova list | awk -v status="$STATUS" '$6 == status { print $4 }')" | |
| for INSTANCE in $INSTANCES; do | |
| IMAGE="$(nova show "$INSTANCE" | awk -v prefix=$PREFIX '$2 == "image" && $4 ~ "^"prefix { print $4 }')" | |
| echo "$INSTANCE" "$IMAGE" | |
| done |
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
| docker ps | awk '$1 != "CONTAINER" { n++ }; END { print n+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
| --- | |
| - name: test if grub configured for noop i/o scheduler | |
| command: egrep -q 'elevator=noop' /boot/grub2/grub.cfg | |
| register: grub | |
| changed_when: no | |
| failed_when: grub_test.rc == 2 | |
| - name: configure grub for noop i/o scheduler | |
| sudo: yes | |
| command: grubby --update-kernel=ALL --args=elevator=noop |
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
| --- | |
| - name: setup epel-release repo | |
| sudo: yes | |
| yum: | |
| name: epel-release | |
| state: present | |
| - name: install fio package | |
| sudo: yes | |
| yum: |
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 | |
| set -eo pipefail | |
| HOSTNAME="${COLLECTD_HOSTNAME:-"$(hostname -s)"}" | |
| INTERVAL="${COLLECTD_INTERVAL:-10}" | |
| iostat -xky "$INTERVAL" | awk -v hostname="$HOSTNAME" -v interval="$INTERVAL" '/^([shv]|xv)d[a-z]$/ { | |
| print "PUTVAL " hostname "/disk-" $1 "/read_reqs_merged_sec" " interval=" interval " N:" $2; | |
| print "PUTVAL " hostname "/disk-" $1 "/write_reqs_merged_sec" " interval=" interval " N:" $3; | |
| print "PUTVAL " hostname "/disk-" $1 "/read_reqs_sec" " interval=" interval " N:" $4; |
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 | |
| set -eo pipefail | |
| VERIFY_INCOMING="${VERIFY_INCOMING:-true}" | |
| VERIFY_OUTGOING="${VERIFY_OUTGOING:-true}" | |
| # check all required environment variables set | |
| VARS=(CA_FILE KEY_FILE CERT_FILE) | |
| for VAR in "$VARS"; do | |
| [[ -n "$VAR" ]] && echo "Error: $VAR is not set" && RETVAL=1 |