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 script will check if there is unallocated space in the volume group | |
| # and will attempt to expand logical volume and file system using resize2fs | |
| # Author: Stas Alekseev <[email protected]> | |
| fs_mount="/var" | |
| vg_minfree_mb="100000" | |
| lv_maxsize_mb="27000" | |
| warn () { |
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 | |
| index="epriorauth" | |
| date="2016-08-23" | |
| broker="kafka100" | |
| topic="structured_log_all" | |
| kafkacat -b $broker -t $topic -C -o beginning \ | |
| | jq --arg index "$index" --arg date "$date" -cM '{"@timestamp": .["@timestamp"], "@target_index": .["@target_index"]} | select(.["@target_index"]==$index) | select( .["@timestamp"] | startswith($date) )' |
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 | |
| # repository for snapshots | |
| snapshots_repo="es-snapshots" | |
| # filesystem for snapshots | |
| snapshots_fs="/es-snapshots" | |
| # elasticsearch url | |
| elasticsearch_url="http://esdatafb101.athenahealth.com:9210" |
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 url | |
| elasticsearch_hosts="devesdatasa100.athenahealth.com:9251,devesdatasa101.athenahealth.com:9251,devesdatasa102.athenahealth.com:9251" | |
| port=$(( ((RANDOM<<15)|RANDOM) % 63001 + 2000 )) | |
| function usage() | |
| { |
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
| diff -Naur spl-0.6.5.8.orig/rpm/generic/spl-dkms.spec.in spl-0.6.5.8/rpm/generic/spl-dkms.spec.in | |
| --- spl-0.6.5.8.orig/rpm/generic/spl-dkms.spec.in 2017-01-23 14:36:09.403082000 -0500 | |
| +++ spl-0.6.5.8/rpm/generic/spl-dkms.spec.in 2017-01-23 14:36:23.151812000 -0500 | |
| @@ -18,7 +18,7 @@ | |
| Requires: dkms >= 2.2.0.2 | |
| Requires: gcc, make, perl | |
| -Requires: kernel-devel | |
| +Requires: kernel-uek-devel | |
| Provides: %{module}-kmod = %{version} |
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 | |
| kafkacat -t test -b localhost -u -q | pv -l > /dev/null |
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 | |
| command -v aws >/dev/null 2>&1 || { echo >&2 "I require awscli but it's not installed. Aborting."; exit 1; } | |
| command -v curl >/dev/null 2>&1 || { echo >&2 "I require curl but it's not installed. Aborting."; exit 1; } | |
| # Find local instance_id | |
| INSTANCE_ID=$(curl -s http://169.254.169.254/latest/meta-data/instance-id) | |
| # Find cloudformation stack-id | |
| STACK_ID=$(aws ec2 describe-instances --output text --instance-ids $INSTANCE_ID | grep -e 'TAGS\saws:cloudformation:stack-id' | awk '{print $3}') |
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 | |
| # enable forwarding | |
| echo 1 >| /proc/sys/net/ipv4/ip_forward | |
| # get softirq sharing between CPU cores for Receive Packet Steering | |
| # https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Performance_Tuning_Guide/network-rps.html | |
| for rxq in $(ls -1 /sys/class/net/*/queues/rx-*/rps_cpus) | |
| do | |
| echo $(taskset -p 1 | cut -d':' -f2 | tr -d '[:space:]') >| $rxq |
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
| problem: storing mac address (6 bytes) in rdbms efficiently | |
| options: | |
| char(6) | long/bigint (8 bytes) | char(12) | |
| byte array | decimal representation | hex characters in ascii | |
| --------------------------------------------------------------------- | |
| efficiency: n | efficiency: n+2 | efficiency: n+6 | |
| terminal safe: n | terminal safe: y | terminal safe: y | |
| human readable: ? | human readable: y | human readable: y | |
| range find: custom | range find: builtin | range find: custom |
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 | |
| while true | |
| do | |
| all="" | |
| for interface in $(dmesg | grep ^eth | grep 802.11 | cut -s -d: -f1) | |
| do | |
| # for each interface, get mac addresses of connected stations/clients | |
| maclist=$(wl -i $interface assoclist | cut -s -d" " -f2 | xargs -n 1 wl -i $interface sta_info | grep STA | cut -s -d" " -f3 | sed 's/.$//') | |
| # for each mac address in that list... |