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
| # clenup all exited containers | |
| docker rm -v $(docker ps -a -q -f status=exited) | |
| $(docker ps -a -q -f status=exited) | xargs -r docker rm -v | |
| # remove dangling images | |
| docker rmi $(docker images -f "dangling=true" -q) | |
| $(docker images -f "dangling=true" -q) | xargs -r docker rmi -v | |
| # remove dangling volumes | |
| docker volume rm $(docker volume ls -qf dangling=true) |
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
| #include <stdio.h> | |
| #include <string.h> | |
| #include <stdlib.h> | |
| #include <ctype.h> | |
| int main() { | |
| // your code goes here | |
| double sum = 0; | |
| const char *input = "300 - 400"; | |
| // const char *input = "1 + 3 / 5 * 8"; |
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 | |
| # | |
| # | |
| # | |
| # Start on runlevels 3, 4 and 5. Start late, kill early. | |
| # chkconfig: 345 95 05 | |
| # | |
| # | |
| #!/bin/bash |
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: apps/v1beta1 | |
| kind: DaemonSet | |
| metadata: | |
| name: prepull | |
| spec: | |
| selector: | |
| matchLabels: | |
| name: prepull | |
| template: | |
| metadata: |
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
| { | |
| "__inputs": [ | |
| { | |
| "name": "DS_PROM-V1", | |
| "label": "prom-v1", | |
| "description": "", | |
| "type": "datasource", | |
| "pluginId": "prometheus", | |
| "pluginName": "Prometheus" | |
| } |
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
| # python 3.6 | |
| # github3.py > 1.1.0 | |
| # developer token must have the repo & user outh2 scopes! | |
| import github3 | |
| from github3 import login | |
| from github3.git import Tag | |
| from urllib.parse import urlparse | |
| from pathlib import Path | |
| import datetime |
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
| podTemplate(label: 'mypod', containers: [ | |
| containerTemplate(name: 'docker', image: 'docker:dind', ttyEnabled: true, alwaysPullImage: true, privileged: true, | |
| command: 'dockerd --host=unix:///var/run/docker.sock --host=tcp://0.0.0.0:2375 --storage-driver=overlay') | |
| ], | |
| volumes: [emptyDirVolume(memory: false, mountPath: '/var/lib/docker')]) { | |
| node ('mypod') { | |
| stage 'Run a docker thing' | |
| container('docker') { | |
| stage 'Docker thing1' |
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
| #!/usr/bin/env bash | |
| set -eEo pipefail | |
| shopt -s inherit_errexit >/dev/null 2>&1 || true | |
| if [[ ! "$#" -eq 2 || "$1" != --bucket ]]; then | |
| echo -e "USAGE: $(basename "$0") --bucket <bucket>" | |
| exit 2 | |
| fi |
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
| # display VPC ID, CIDR Block and Name | |
| aws ec2 --output text --query 'Vpcs[*].{VpcId:VpcId,Name:Tags[?Key==`Name`].Value|[0],CidrBlock:CidrBlock}' describe-vpcs |
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
| # list pods only with enabled service links. | |
| kgpoall -o jsonpath='{range .items[*]}{"\n"}{.metadata.name}{":\t"}{.spec.enableServiceLinks}' | grep true | |
| # list images used in containers (but not in initContainers!). | |
| kubectl get pods --all-namespaces -o=jsonpath='{range .items[*]}{"\n"}{.metadata.namespace}{"/"}{.metadata.name}{":\t"}{range .spec.containers[*]}{.name}{"="}{.image}{", "}{end}{end}' |sort | |
| # list containers without memory limits | |
| kubectl get pods --all-namespaces -o=jsonpath='{range .items[*]}{"\n"}{.metadata.name}{":\t"}{range .spec.containers[*]}{.resources.limits.memory}{", "}{end}{end}' |sort | grep 0, | |
| # running a pod which immidiately exists - the restart policy is crticial |