Skip to content

Instantly share code, notes, and snippets.

View WoodProgrammer's full-sized avatar

Emir Özbir WoodProgrammer

View GitHub Profile
import sys
class MalFriendInterface:
def __init__(self, MallikCount, MalFriendName):
self.MallikCount = MallikCount
self.MalFriendName = MalFriendName
def mallik(self):
pass
class MalFriendExecutor(MalFriendInterface):
@WoodProgrammer
WoodProgrammer / docker_attach
Created October 9, 2018 16:23 — forked from miki725/docker_attach
Attach to docker container via nsenter
#!/bin/bash
USAGE="Attach to Docker Container
--------------------------
Attach to Docker Container even if the container does not run
ssh daemon. This is accomplished by using linux containers
directly via 'nsenter' (see http://bit.ly/docker_nsenter).
To install 'nsenter', just execute:
$ docker run -v /usr/local/bin:/target jpetazzo/nsenter
@WoodProgrammer
WoodProgrammer / Dockerfile
Created October 14, 2018 12:18 — forked from alexellis/Dockerfile
Go with of-watchdog
FROM golang:1.8.3-alpine3.6
RUN apk --no-cache add curl \
&& echo "Pulling watchdog binary from Github." \
&& curl -sSL https://github.com/openfaas-incubator/of-watchdog/releases/download/0.2.2/of-watchdog > /usr/bin/fwatchdog \
&& chmod +x /usr/bin/fwatchdog \
&& apk del curl --no-cache
WORKDIR /go/src/handler
COPY . .
apiVersion: v1
kind: Pod
metadata:
name: jenkins-dind-test
spec:
securityContext:
runAsUser: 1000
fsGroup: 2000
volumes:
- name: sec-ctx-vol
@WoodProgrammer
WoodProgrammer / di_terraform.tf
Created April 5, 2019 22:41 — forked from arunvelsriram/di_terraform.tf
Terraform dependency injection style de-coupling resources
# di_terraform.tf
# Example Terraform configuration that shows de-coupling resources (Amazon S3 bucket and bucket policy)
# with the help of modules analogous to dependency injection technique
# modules/s3_bucket/main.tf
# Base S3 bucket that can be attached a policy
variable "bucket_name" {}
variable "region" {
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: cloudsecrets.woodprogrammer.cloudops.local
spec:
group: woodprogrammer.cloudops.local
version: v1
scope: Namespaced
names:
plural: cloudsecrets
apiVersion: apps/v1
kind: Deployment
metadata:
name: af-deployment
labels:
app: nginx
spec:
replicas: 2
selector:
matchLabels:
---
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: podinfo
spec:
scaleTargetRef:
apiVersion: extensions/v1beta1
kind: Deployment
name: deployment-first
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: deployment-first
spec:
replicas: 2
template:
metadata:
labels:
jobs:
- script: >
pipelineJob('default-agent') {
definition {
cps {
script("""\
pipeline {
agent any
stages {