- An active LastPass account
- LastPass cli installed, see here
name
: my-super-secretusername
: my-super-secret-usernamepassword
: my-super-secret-password
JUMPBOX_NAME="<name of ec2 instance>" | |
INSTANCE_ID=$(aws ec2 describe-instances --filters "Name=tag:Name,Values=$JUMPBOX_NAME" \ | |
--output text --query 'Reservations[*].Instances[*].InstanceId') | |
aws ssm start-session --target "$INSTANCE_ID" |
name
: my-super-secretusername
: my-super-secret-usernamepassword
: my-super-secret-passwordexport FILE_NAME="cf-2.2.7-build.8.pivotal" # This is the name of the file (tile) to upload to om | |
export OM_USER="admin" | |
export OM_PWD="supersecurepassword" | |
export OM_TARGET="ops-manager address" | |
export OM_TIMEOUT=86400 # set a high timeout incase upload takes a while | |
om -t $OM_TARGET -u $OM_USER -p $OM_PWD -k upload-product -p $FILE_NAME -r $OM_TIMEOUT |
export PIVNET_TOKEN="123456" # Get from network.pivotal.io | |
export DEPLOYMENT_URL="http://network.pivotal.io" # This is the API download URL for your release | |
export FILE_NAME="ert.zip" # This is the name of the file that gets created locally | |
# download from pivnet | |
wget -O "$FILE_NAME" --post-data="" --header="Authorization: Token $PIVNET_TOKEN" "$DEPLOYMENT_URL" | |
# download from pivnet (with special sauce for flaky connections) | |
wget -c --tries=0 --retry-connrefused --timeout=2 --wait=1 -O "$FILE_NAME" --post-data="" --header="Authorization: Token $PIVNET_TOKEN" "$DEPLOYMENT_URL" |
source /etc/os-release | |
echo $UBUNTU_CODENAME # xenial |
cd /var/log | |
touch syslog | |
chown syslog:adm syslog | |
service rsyslog restart | |
logger "Didier MISSON logger test" |
# 1) ssh into gorouter | |
# 2) get router_status credentials from /var/vcap/jobs/gorouter/config/gorouter.yml or from bosh manifest router job | |
# 3) get routes | |
curl "http://router_status:<router_status password>@127.0.0.1:8080/routes" | python -m json.tool |
#!/bin/bash | |
SUDO_PWD=superSecurePassword | |
ROOT_USER=root | |
SERVER=10.0.0.097879879 | |
SCRIPT_TO_RUN=script_to_run.sh | |
SUDO_ECHO_SCRIPT=sudo_echo.sh | |
# generate script to run on remote server |
[to_entries[] | {(.key) : .value.value}] | reduce .[] as $item ({}; . + $item) |
PLANS_PROPERTY=".properties.rds_postgres_plans" | |
PLAN_NAME=".properties.rds_postgres_plans" | |
jq --arg plans_property "$PLANS_PROPERTY" --arg plan_name "$PLAN_NAME" '.properties | to_entries[] | select(.key == $plans_property) | .value.value[] | select(.name.value == $plan_name)' |