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
#!/user/bin/python | |
import csv | |
import re | |
file = open("redirs.csv", "r") | |
reader = csv.reader(file, delimiter=',') | |
for row in reader: | |
source = re.sub('^.*\.nl', '', row[0]) | |
dest = "https://www.trivento.nl" + row[1] | |
print("rewrite ^" + source + "$ "+ dest +" permanent;") |
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
HOST="http://localhost:3001" | |
for dash in $(curl -s -H "X-Forwarded-User: admin" $HOST/api/search\?query | jq -r '.[]'| jq -r '.uid'); do | |
echo $dash; | |
OUTPUT=$(curl -s -H "X-Forwarded-User: admin" $HOST/api/dashboards/uid/$dash); | |
TITLE=$(echo -E $OUTPUT | jq -r '.dashboard.title'| grep -v null) | |
echo $TITLE | |
echo -E $OUTPUT | jq | tee "$TITLE.json" | |
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
yum install -y docker | |
cat <<EOF > /etc/yum.repos.d/kubernetes.repo | |
[kubernetes] | |
name=Kubernetes | |
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64 | |
enabled=1 | |
gpgcheck=1 | |
repo_gpgcheck=1 | |
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg |
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
# Aanmaken van een extra / nieuwe master node (master-2) op bais van (master-0): | |
oc -n openshift-machine-api get machine sbx42-69jrk-master-0 -o json --export| sed -e s/master-0/master-2/g | jq 'del(.metadata.annotations)' | oc -n openshift-machine-api create -f - | |
# info ophalen over het cluster | |
oc get infrastructure cluster -o yaml | |
# delete completed (deployment) pods | |
oc delete po --field-selector=status.phase==Succeeded | |
# info over deploymentconfigs met cpu/memory requests & limits |
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
# controleer OpenShift credentials | |
oc get secret -n kube-system openstack-credentials --template='{{index .data "clouds.conf"}}' | base64 -d | |
oc get secret -n kube-system openstack-credentials --template='{{index .data "clouds.yaml"}}' | base64 -d | |
# controleer status van registry | |
oc get configs.imageregistry.operator.openshift.io/cluster -o json | jq '.status'\ | |
# delete OCS operator | |
oc patch cephcluster.ceph.rook.io/ocs-storagecluster-cephcluster -p '{"metadata":{"finalizers": []}}' --type=merge |
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
# cpu usage per container | |
sum(rate(container_cpu_usage_seconds_total{pod_name=~"nginx.*"}[5m])* 100000) by (pod_name,namespace)/2500 > 10 | |
# prometheus performance | |
rate(prometheus_tsdb_head_samples_appended_total[5m]) | |
topk(10, count({job=~".+"}) by(__name__)) | |
# Amount of projects we can deploy using 22GB memory request | |
sum(node_memory_MemFree_bytes{node=~"compute-.*"} / 1024 / 1024 / 1024) / 22 |
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
xpanes --ssh server-{1..3} |
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
- hosts: "{{ src_server }}" | |
gather_facts: false | |
any_errors_fatal: true | |
- block | |
rescue: | |
- set_fact: | |
failed_play: true | |
delegate_to: "{{ item }}" | |
delegate_facts: yes | |
with_items: |
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
- name: 3.6 - Get list of all PersistentVolumeClaim's | |
k8s_facts: | |
api_version: v1 | |
kind: PersistentVolumeClaim | |
namespace: "{{ env }}" | |
label_selectors: | |
- orig != glusterfs-gluster01 | |
host: "{{ openshift_api_url }}" | |
api_key: "{{ src_api_key }}" | |
verify_ssl: false |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# | |
# cpu = # cpu per VM | |
cpu = 3 | |
# | |
# mem = MB ram per VM | |
# | |
mem = 4096 |
NewerOlder