- Test-Driven Development (TDD) with pytest: Always write a failing test before writing implementation code (Red-Green-Refactor). Use
pytest
andpytest-fixtures
for test setup, execution, and teardown. - KISS (Keep It Simple, Stupid): Favor the simplest solution that meets the requirements.
- DRY (Don't Repeat Yourself): Avoid code duplication. Extract reusable logic into functions or classes.
- Standard Libraries and Tools: Utilize standard Python libraries (like
datetime
for date/time,requests
for HTTP requests, andlogging
) and external libraries, includingBeautifulSoup4
for HTML parsing, to avoid reinventing the wheel. Favor well-maintained and widely-used libraries. - YAGNI (You Ain't Gonna Need It): Don't implement features or functionality unless they are currently required.
- SOLID Principles & Extensibility: Adhere to SOLID principles, promoting maintainability, testability, and future extension. Consider potential future requi
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: ConfigMap | |
metadata: | |
name: ceph-before-reboot-script | |
namespace: rook-ceph | |
data: | |
status-check.sh: |- | |
#!/bin/bash | |
# preflightCheck checks for existence of "dependencies" | |
preflightCheck() { |
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
#cloud-config | |
packages: | |
- apt-transport-https | |
- ca-certificates | |
- curl | |
- gnupg-agent | |
- software-properties-common | |
# Enable ipv4 forwarding, required on CIS hardened machines |
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
--- | |
# Source: drone/templates/deployment-runner.yaml | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: drone-kube-runner | |
namespace: pipeline | |
labels: | |
app: drone | |
chart: "drone-2.2.0" |
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
--- | |
kind: ConfigMap | |
apiVersion: v1 | |
metadata: | |
name: dd-agent-config | |
namespace: datadog-monitor | |
data: | |
kube_apiserver_metrics.yaml: | | |
init_config: |
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/v1 | |
kind: DaemonSet | |
metadata: | |
name: datadog-agent | |
namespace: datadog-monitor | |
spec: | |
selector: | |
matchLabels: | |
app: datadog-agent | |
updateStrategy: |
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
# import config. | |
# You can change the default config with `make cnf="config_special.env" build` | |
cnf ?= config.env | |
include $(cnf) | |
export $(shell sed 's/=.*//' $(cnf)) | |
# import deploy config | |
# You can change the default deploy config with `make cnf="deploy_special.env" release` | |
dpl ?= deploy.env | |
include $(dpl) |
gem install travis
ssh-keygen -t rsa -b 4096 -f 'github_deploy_key' -N ''
cat github_deploy_key.pub | pbcopy
set public key as deploy key on github e.g https://github.com/USER/REPO/settings/keys
rm 'github_deploy_key.pub'
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/sh | |
ORG="deck15" | |
curl -s https://api.github.com/orgs/$ORG/repos?per_page=200 | jq -r '.[].ssh_url' | xargs -I {} git clone {} | |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
NewerOlder