This file contains hidden or 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: Pod | |
metadata: | |
name: pgcli | |
namespace: sandbox | |
spec: | |
containers: | |
- name: pgcli | |
image: jbergknoff/postgresql-client | |
command: ['sh', '-c', 'sleep 600'] |
This file contains hidden or 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: rbac.authorization.k8s.io/v1 | |
kind: ClusterRole | |
metadata: | |
name: ci-cd | |
rules: | |
- apiGroups: | |
- apps | |
- extensions | |
resources: | |
- deployments |
This file contains hidden or 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
const outage_avg = ()=>{ | |
const incidents = [...document.querySelectorAll('.incident-list')].map(node => [...node.querySelectorAll('.secondary.color-secondary')]); | |
let avg = incidents.map(inciList => { | |
return inciList.reduce( (acc , inci) => { | |
const timestamps = inci.innerText.substr(0, inci.innerText.length - 4).split('-'); | |
if (timestamps[1].indexOf(',') == -1) { | |
timestamps[1] = `${timestamps[0].split(',')[0]},${timestamps[1]}`; | |
} | |
acc.count++; | |
acc.average += (new Date(timestamps[1]).getTime() - new Date(timestamps[0]).getTime()) / 60000; |
This file contains hidden or 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
## Autoexport kubernetes configs | |
KUBECONFIG="" | |
for config in $(ls ~/.kube/*.yaml); do | |
if [[ ! -z $KUBECONFIG ]]; then | |
KUBECONFIG=$KUBECONFIG:$config | |
else | |
KUBECONFIG=$config | |
fi | |
done |
This file contains hidden or 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 | |
IFS=', ' read -r -a STATS <<< `nvidia-smi --query-gpu=temperature.gpu,memory.used,memory.free,utilization.gpu,utilization.memory --format=csv,nounits,noheader` | |
#echo ${STATS[@]} | |
# Send values to CloudWatch | |
aws cloudwatch put-metric-data --metric-name Temperature --namespace GPUStats --value ${STATS[0]} | |
aws cloudwatch put-metric-data --metric-name MemoryUsed --namespace GPUStats --unit Megabytes --value ${STATS[1]} | |
aws cloudwatch put-metric-data --metric-name MemoryFree --namespace GPUStats --unit Megabytes --value ${STATS[2]} | |
aws cloudwatch put-metric-data --metric-name GPUUtilization --namespace GPUStats --value ${STATS[3]} |