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 | |
THIS_YEAR=$(date "+%Y") | |
LAST_YEAR=$(($THIS_YEAR-1)) | |
# The path to where you checked out corp-hugo: | |
MY_USERNAME='david.lentz' | |
CORP_HUGO_PATH="/Users/$MY_USERNAME/corp-hugo/site" | |
# The slug of the report we're staging |
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 | |
# Based on the fine work shown at https://stackoverflow.com/questions/48515400/calculate-difference-in-months-between-two-dates-in-unix | |
# K8s release dates taken from https://en.wikipedia.org/wiki/Kubernetes | |
MONTHNOW=$(date '+%Y%m') | |
RELEASEMONTH1DOT0=201507 | |
RELEASEMONTH1DOT1=201511 | |
RELEASEMONTH1DOT2=201603 | |
RELEASEMONTH1DOT3=201607 | |
RELEASEMONTH1DOT4=201609 |
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
apiVersion: consul.hashicorp.com/v1alpha1 | |
kind: ProxyDefaults | |
metadata: | |
name: global | |
spec: | |
config: | |
envoy_dogstatsd_url: "udp://${HOST_IP}:8125" | |
envoy_extra_static_clusters_json: | | |
{ | |
"name": "datadog_8126", |
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: | |
name: consul | |
datacenter: dc1 | |
image: hashicorp/consul:1.10.1 | |
imageEnvoy: envoyproxy/envoy:v1.18.3 | |
imageK8S: hashicorp/consul-k8s:0.26.0 | |
metrics: | |
enabled: true | |
enableAgentMetrics: true | |
server: |
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
COMP10228:ekswork david.lentz$ kubectl top node ip-192-168-64-107.us-west-2.compute.internal | |
NAME CPU(cores) CPU% MEMORY(bytes) MEMORY% | |
ip-192-168-64-107.us-west-2.compute.internal 54m 2% 467Mi 83% | |
COMP10228:ekswork david.lentz$ kubectl top node fargate-ip-192-168-158-100.us-west-2.compute.internal | |
NAME CPU(cores) CPU% MEMORY(bytes) MEMORY% | |
fargate-ip-192-168-158-100.us-west-2.compute.internal 499m 24% 161Mi 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
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: my-nginx | |
labels: | |
run: my-nginx | |
annotations: | |
ad.datadoghq.com/service.check_names: '["http_check"]' | |
ad.datadoghq.com/service.init_configs: '[{}]' | |
ad.datadoghq.com/service.instances: | |
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
kind: Service | |
apiVersion: v1 | |
metadata: | |
name: postgres | |
annotations: | |
ad.datadoghq.com/service.check_names: '["postgres"]' | |
ad.datadoghq.com/service.init_configs: '[{}]' | |
ad.datadoghq.com/service.instances: |- | |
[ | |
{ |
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 | |
curl http://localhost:8080/commands | sed 's/^\(.*\)commands\(.*\)">\(.*\)$/curl http:\/\/localhost:8080\/commands\2/g' | sed 's/<br\/>//g' | sort | uniq > allcommands | |
counter=0 | |
# TODO: scoping problem and I can't use this inside the while loop: | |
#commandcount=`wc -l allcommand | cut -d' ' -f1` | |
echo "{" |
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 myproject import app | |
if __name__ == "__main__": | |
app.run() |
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 logging | |
from flask import Flask | |
import time | |
app = Flask(__name__) | |
@app.route("/") | |
def hello(): | |
# logHandler = logging.FileHandler('/var/log/myproject/app.log') | |
# logHandler.setLevel(logging.INFO) | |
# app.logger.addHandler(logHandler) |
NewerOlder