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
worker_processes auto; | |
rtmp_auto_push on; | |
events {} | |
rtmp { | |
server { | |
listen 1935; | |
listen [::]:1935 ipv6only=on; | |
application live { | |
live on; |
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
429147289 | |
400651899 | |
856483199 |
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
[ | |
{ | |
"targets": [ | |
"prometheus.io" | |
], | |
"labels": { | |
"__meta_datacenter": "london", | |
"__meta_prometheus_job": "node" | |
} | |
} |
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
cat <<EOF | curl --data-binary @- http://localhost:9091/metrics/job/inventory/cloud/aws | |
$(aws ec2 describe-regions --region us-east-1 | jq -r '.Regions[].RegionName' | sort | while read REGION; do | |
aws resourcegroupstaggingapi get-resources --region $REGION | jq --arg Region $REGION -r '.ResourceTagMappingList[].ResourceARN'; | |
done | while read LINE; do echo 'resource_item{partition="'$(echo ${LINE//\//:} | cut -d ':' -f2)'",service="'$(echo ${LINE//\//:} | cut -d ':' -f3)'",region="'$(echo ${LINE//\//:} | cut -d ':' -f4)'",account_id="'$(echo ${LINE//\//:} | cut -d ':' -f5)'",resource_type="'$(echo ${LINE//\//:} | cut -d ':' -f6)'",resource_id="'$(echo ${LINE//\//:} | cut -d ':' -f7)'"} 1'; done| sort -u) | |
EOF |
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
aws ec2 describe-regions --region us-east-1 | jq -r '.Regions[].RegionName' | sort | while read REGION; do aws resourcegroupstaggingapi get-resources --region $REGION | jq --arg Region $REGION -r '.ResourceTagMappingList[]|"\($Region):\(.ResourceARN)"'; 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
aws ec2 describe-regions --region us-east-1 | jq -r '.Regions[].RegionName' | sort | while read REGION; do aws --region $REGION ec2 describe-instances | jq -r '.Reservations[].Instances[]|select(.State.Name|match("running"))|"\(.InstanceType)"'| sort | uniq -c > /tmp/instances; aws --region $REGION ec2 describe-reserved-instances | jq -r '.ReservedInstances[]|select(.State|match("active"))|" \(.InstanceCount) \(.InstanceType)"'| sort > /tmp/reservations; [[ -s /tmp/instances || -s /tmp/reservations ]] && echo -ne "Region: $REGION\n-Instances:\n$(cat /tmp/instances)\n-Reservations:\n$(cat /tmp/reservations)\n"; 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
#!/bin/bash | |
# Before run you need to cache policies files running: | |
# $ mkdir policies | |
# $ i=0 aws iam list-policies | jq -r '.Policies[]|"\(.PolicyName) \(.Arn) \(.DefaultVersionId)"' | while read name arn version; do echo $((i++)); aws iam get-policy-version --policy-arn $arn --version-id $version > policies/${name}.json; done | |
# And map policy name and ARN | |
# $ aws iam list-policies | jq -r '.Policies[]|"\(.PolicyName) \(.Arn)"' > policies-arn | |
# To do: handle inline policies | |
# usage example to get all users who have s3 action on my-bucket: `$ bash policy-inspector.sh 's3:' "arn:aws:s3:::my-bucket" policies/*` |
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 | |
# Usage: curl https://gist.githubusercontent.com/andreyev/32d175147f7b31e73d1a2b84880e0906/raw/puppet-installer.sh | bash -s -- PUPPETENV | |
PUPPETENV=$1 | |
which puppet || { | |
OS_MAJ_VERSION=$(rpm -qa \*-release | grep -Ei "centos" | cut -d"-" -f3) | |
[[ -z "$OS_MAJ_VERSION" ]] && { echo "Distro not supported"; exit 1;} | |
yum install -y https://yum.puppetlabs.com/puppetlabs-release-pc1-el-"$OS_MAJ_VERSION".noarch.rpm | |
yum install -y puppet |
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 | |
STRING="$*" | |
FILE=/tmp/${STRING// /_}.mp3 | |
test -f $FILE || wget -q -U Mozilla -O ${FILE} "http://translate.google.com/translate_tts?ie=UTF-8&total=1&idx=0&textlen=32&client=tw-ob&q=${1}&h&tl=pt-BR" | |
mplayer ${FILE} &>/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
import com.onresolve.scriptrunner.runner.rest.common.CustomEndpointDelegate | |
import groovy.json.JsonBuilder | |
import groovy.transform.BaseScript | |
import com.atlassian.jira.component.ComponentAccessor | |
import javax.servlet.http.HttpServletRequest | |
import javax.ws.rs.core.MultivaluedMap | |
import javax.ws.rs.core.Response | |
import com.atlassian.jira.component.ComponentAccessor | |
NewerOlder