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
# https://kubernetes.io/docs/tutorials/k8s201/ | |
# https://cheatsheet.dennyzhang.com/kubernetes-yaml-templates | |
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: pod-with-http-healthcheck | |
spec: | |
containers: | |
- name: nginx | |
image: nginx |
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: ReplicationController | |
metadata: | |
name: nginx | |
spec: | |
replicas: 3 | |
selector: | |
app: nginx ##Must BE same to template/metadata/labels/app | |
template: | |
metadata: |
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
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql |
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
terraform { | |
backend "gcs" { | |
bucket = "bucket-ops-example" | |
prefix = "terraform/state" | |
} | |
} |
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 groovy.io.FileType | |
/* groovylint-disable-next-line CompileStatic */ | |
pipeline { | |
agent { | |
label '' | |
} | |
stages { | |
stage('1') { | |
steps { |
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
$router->get('/', function () use ($router) { | |
return $router->app->version(); | |
}); | |
$router->get('products', function () use ($router) { | |
return response(['Product 1', 'Product 2', 'Product 3'],200); | |
}); | |
$router->post('status', function() { | |
return response()->json([ |
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 shutil | |
import os | |
SOURCE= r'PATHA' | |
DESTINATION = r'PATHB' | |
for path, subdirs, files in os.walk(SOURCE): | |
for name in files: | |
filename = os.path.join(path, name) | |
print(filename) |
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 | |
files = os.listdir(os.curdir) | |
OUTPUT = "" | |
for file in files: | |
with open(file, encoding='utf-8') as f: | |
for line in f: | |
if not line.isspace(): |