This file contains 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 -e | |
GRN="\033[0;32m" | |
NC="\033[0m" | |
generateUserEntry(){ | |
# set -x | |
local username=$1 | |
local groups=$2 | |
local keys=$3 | |
local web=$4 |
This file contains 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
#!/usr/bin/env bash | |
#/ | |
#/ :: ORACLE INSTANT CLIENT INSTALL SCRIPT :: | |
#/ | |
#/ Automate install instructions for | |
#/ | |
#/ https://github.com/oracle/node-oracledb/blob/master/INSTALL.md#-6-node-oracledb-installation-on-macos-with-instant-client | |
#/ | |
#/ WARNING: | |
#/ Download the sdk and basic instant client zip and place them in the same directory as this script |
This file contains 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
node('node-label'){ | |
stage('Deploy') { | |
withCredentials([[$class: 'SSHUserPrivateKeyBinding', credentialsId: "1dc9ca1e-a461-40c2-8478-969c66bea0b6", keyFileVariable: 'SSH_PRIVATE_KEY', passphraseVariable: '', usernameVariable: 'SSH_USERNAME']]){ | |
sh "ssh-agent /bin/bash" | |
sh """ | |
eval \$(ssh-agent) && ssh-add ${SSH_PRIVATE_KEY} && ssh-add -l && | |
ENVIRONMENT=${env.ENVIRONMENT} \ | |
PLAYBOOK=${env.PLAYBOOK} \ | |
BASTION_USER=${env.BASTION_USER} \ |
This file contains 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 region in $(aws ec2 describe-regions --output text | cut -f3); do | |
echo "REGIÃO -> $region" | |
aws ec2 describe-instances \ | |
--query 'Reservations[].Instances[?!not_null(Tags[?Key == `Owner`].Value)].{PUBLICIP:PublicIpAddress,EC2ID:InstanceId,TYPE:InstanceType,STATE:State.Name,TAGS:Tags[*].{Key:Key,Value:Value}} | []' --region $region | jq '.' | |
done |
This file contains 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 get-console-screenshot --instance-id ID --query "ImageData" --output text > f; cat f | base64 -D > console.jpg |
This file contains 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 | |
STEP=0 | |
bump_step(){ | |
STEP=$(($STEP+1)) | |
log "${BLU}[INFO] ($STEP) $1${NC}" | |
} | |
log() { echo -e "${BWHT}["$(date "+%Y%m%d${NC}T${BWHT}%H%M%S")"]${NC} $*"; } | |
separator() { SEP=$(printf '%*s' 105 | tr ' ' '#') && log "${GRN}[INFO] $SEP${NC}"; } |
This file contains 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 | |
#/ Define properties and sort them in a file | |
#/ Usage: | |
#/ set_property key value filename | |
#/ Alternative: | |
#/ | |
#/ export PROPERTIES_FILE=myproperties | |
#/ set_property key value | |
#/ -------------------------------------------------------------------------------- | |
#/ Author: Rogério Peixoto (rcbpeixoto@gmail.com) |
This file contains 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
FROM node:8-alpine | |
LABEL MAINTAINER="rcbpeixoto@gmail.com" | |
ARG NODEJS_VERSION="8" | |
ARG IONIC_VERSION="3.20.0" | |
ARG GRADLE_VERSION="3.2" | |
ARG ANDROID_SDK_VERSION="4333796" | |
ARG ANDROID_HOME="/opt/android-sdk" | |
ARG GRADLE_HOME="/opt/gradle" |
This file contains 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
curl -L https://ip-ranges.amazonaws.com/ip-ranges.json | jq '.prefixes[] | select(.region=="sa-east-1") ' | jq --slurp -r '. | map([.ip_prefix, .region, .service] | join(", ")) | join("\n")' |
This file contains 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 | |
cmd='' | |
for i in "$@"; do | |
i="${i//\\/\\\\}" | |
cmd="$cmd \"${i//\"/\\\"}\"" | |
done |