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 | |
TMP_CSV_FILE=$(mktemp /tmp/dcos-config.XXXXXX.csv) | |
TMP_CSV_FILE_SORT="${TMP_CSV_FILE}_sort" | |
#dcos marathon app list --json | jq '.[] | if (.container.docker.image != null ) then .id + ",Docker Application," + .container.docker.image else .id + ",DCOS Service," + .labels.DCOS_PACKAGE_VERSION end' -r > $TMP_CSV_FILE | |
dcos marathon app list --json | jq '.[] | .id + if (.container.type == "DOCKER") then ",Docker Container," + .container.docker.image else ",Mesos Container," + if(.labels.DCOS_PACKAGE_VERSION !=null) then .labels.DCOS_PACKAGE_NAME+":"+.labels.DCOS_PACKAGE_VERSION else "[ CMD ]" end end' -r > $TMP_CSV_FILE | |
sed -i "s|^/||g" $TMP_CSV_FILE | |
sort -t "," -k2,2 -k3,3 -k1,1 $TMP_CSV_FILE > ${TMP_CSV_FILE_SORT} | |
cnt=1 | |
printf '%.0s=' {1..150} |
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 | |
printf "\n %-15s %-18s%-18s%-10s%-15s%-10s\n" "Node Type" "Node IP" "Attribute" "Tasks" "Mem Free (MB)" "CPU Free" | |
printf '%.0s=' {1..90} | |
printf "\n" | |
TAB=`echo -e "\t"` | |
dcos node --json | jq '.[] | if (.type | contains("leader")) then "Master (leader)" elif ((.type | contains("agent")) and .attributes.public_ip != null) then "Public Agent" elif ((.type | contains("agent")) and .attributes.public_ip == null) then "Private Agent" else empty end + "\t"+ if(.type |contains("master")) then .ip else .hostname end + "\t" + (if (.attributes | length !=0) then (.attributes | to_entries[] | join(" = ")) else "NA" end) + "\t" + if(.type |contains("agent")) then (.TASK_RUNNING|tostring) + "\t" + ((.resources.mem - .used_resources.mem)| tostring) + "\t\t" + ((.resources.cpus - .used_resources.cpus)| tostring) else "\t\tNA\tNA\t\tNA" end' -r | sort -t"$TAB" -k1,1d -k3,3d -k2,2d | |
printf '%.0s=' {1..90} | |
printf "\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 | |
#1. SSH on node | |
#2. Create or edit file /var/lib/dcos/mesos-slave-common | |
#3. Add contents as : | |
# MESOS_ATTRIBUTES=<key>:<value> | |
# Example: | |
# MESOS_ATTRIBUTES=TYPE:DB;DB_TYPE:MONGO; | |
#4. Stop dcos-mesos-slave service | |
# systemctl stop dcos-mesos-slave |
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 | |
# Usage : bash installDCOSDataDogMetricsPlugin.sh <Datadog API KEY> | |
DDAPI=$1 | |
if [[ -z $DDAPI ]]; then | |
echo "[Datadog Plugin] Need datadog API key as parameter." | |
echo "[Datadog Plugin] Usage : bash installDCOSDataDogMetricsPlugin.sh <Datadog API KEY>." | |
fi |
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 | |
echo "DCOS Task Exec 2.0" | |
if [ "$#" -eq 0 ]; then | |
echo "Need task name or id as input. Exiting." | |
exit 1 | |
fi | |
taskName=$1 | |
taskCmd=${2:-bash} | |
TMP_TASKLIST_JSON=/tmp/dcostasklist.json |
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
AbortDocumentVersionUpload | |
AbortEnvironmentUpdate | |
AbortMultipartUpload | |
AbortVaultLock | |
AcceptAccountMapping | |
AcceptCertificateTransfer | |
AcceptDelegate | |
AcceptDirectConnectGatewayAssociationProposal | |
AcceptFxPaymentCurrencyTermsAndConditions | |
AcceptHandshake |
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 | |
CLUSTER_HOME=$HOME/redis-cluster | |
echo "Cluster Home is set to : $CLUSTER_HOME" | |
rm -rf $CLUSTER_HOME | |
mkdir -p $CLUSTER_HOME | |
cd $CLUSTER_HOME | |
wget http://download.redis.io/redis-stable/src/redis-trib.rb | |
chmod +x redis-trib.rb | |
mkdir 7000 7001 7002 7003 7004 7005 |
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 id in $(dcos node --json | jq --raw-output '.[] | select(.attributes.public_ip == "true") | .id'); | |
do | |
dcos node ssh --option StrictHostKeyChecking=no --option LogLevel=quiet --master-proxy --mesos-id=$id "curl -s ifconfig.co" | |
done 2>/dev/null |
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 | |
# Uage dcosAddUsers.sh <Users to add are given in list.txt, each user on new line> | |
for i in `cat users.list`; | |
do | |
echo $i | |
curl -X PUT -H "Authorization: Bearer $(dcos config show core.dcos_acs_token)" "$(dcos config show core.dcos_url)/acs/api/v1/users/$i" -d "{}" | |
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
#!/bin/bash | |
# Usage dcosDeleteUsers.sh <Users to delete are given in list.txt, each user on new line> | |
for i in `cat users.list`; | |
do | |
echo $i | |
curl -X DELETE -H "Authorization: Bearer $(dcos config show core.dcos_acs_token)" "$(dcos config show core.dcos_url)/acs/api/v1/users/$i" -d "{}" | |
done |
OlderNewer