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 zsh | |
# usage: strict-install elastic | |
dcos_url=$(dcos config show core.dcos_url) | |
dcos_acs_token=$(dcos config show core.dcos_acs_token) | |
secret_name="$1_secret" | |
service_account_id="$1" | |
ts=$(date "+%Y%m%d") | |
tmp="/tmp/install_$1_$ts" |
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
global: | |
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute. | |
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute. | |
# scrape_timeout is set to the global default (10s). | |
# Attach these labels to any time series or alerts when communicating with | |
# external systems (federation, remote storage, Alertmanager). | |
external_labels: | |
monitor: 'codelab-monitor' |
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
import os | |
print(os.stat('.')) |
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
{ | |
"id": "malinger-toggle", | |
"labels": {}, | |
"run": { | |
"cpus": 0.01, | |
"mem": 128, | |
"disk": 0, | |
"cmd": "curl -X POST http://malinger.marathon.l4lb.thisdcos.directory/toggle", | |
"env": {}, | |
"placement": { |
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
{ | |
"id": "/malinger", | |
"cmd": "cd $MESOS_SANDBOX && pip install flask && python malinger.py", | |
"cpus": 0.1, | |
"mem": 128, | |
"disk": 0, | |
"instances": 1, | |
"healthChecks": [ | |
{ | |
"portIndex": 0, |
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
{ | |
"id": "/statsd-emitter-docker", | |
"cmd": "/bin/statsd-emitter", | |
"container": { | |
"type": "DOCKER", | |
"volumes": [ | |
{ | |
"containerPath": "/bin/statsd-emitter", | |
"hostPath": "/opt/mesosphere/bin/statsd-emitter", | |
"mode": "RO" |
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
{ | |
"id": "/statsd-emitter-ucr", | |
"cmd": "/opt/mesosphere/bin/statsd-emitter", | |
"container": { | |
"type": "MESOS", | |
"volumes": [] | |
}, | |
"cpus": 0.001, | |
"disk": 0, | |
"instances": 1, |
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
{ | |
"id": "/malinger", | |
"cmd": "cd $MESOS_SANDBOX && pip install flask && python malinger.py", | |
"cpus": 0.1, | |
"mem": 128, | |
"disk": 0, | |
"instances": 1, | |
"container": { | |
"type": "DOCKER", | |
"docker": { |
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
(ns elements.six-seventeen) | |
(def sample [[ 1 2 3 4 5] | |
[ 6 7 8 9 10] | |
[11 12 13 14 15] | |
[16 17 18 19 20] | |
[21 22 23 24 25]]) | |
(defn top | |
[matrix] |
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
# Exercise: sort the words in an arbitrary string in place. | |
# For the purposes of this exercise, assume the string is | |
# lowercase and no two words start with the same character. | |
def take_word(sentence): | |
"""Generator; yields all words in a sentence""" | |
word = '' | |
for c in sentence: | |
if c == ' ': | |
yield word |
NewerOlder