Skip to content

Instantly share code, notes, and snippets.

View WoodProgrammer's full-sized avatar

Emir Özbir WoodProgrammer

View GitHub Profile
@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: v1
kind: Pod
metadata:
name: jenkins-dind-test
spec:
securityContext:
runAsUser: 1000
fsGroup: 2000
volumes:
- name: sec-ctx-vol
@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 . .
@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
import sys
class MalFriendInterface:
def __init__(self, MallikCount, MalFriendName):
self.MallikCount = MallikCount
self.MalFriendName = MalFriendName
def mallik(self):
pass
class MalFriendExecutor(MalFriendInterface):
def updateConfigMap(self):
readToken = open("/var/run/secrets/kubernetes.io/serviceaccount/token").read()
token = "Bearer {}".format(readToken)
headers = {"Content-Type": "application/merge-patch+json", "authorization":token}
r = requests.patch("{}/api/v1/namespaces/default/configmaps/nginx".format(self.kubernetes_master), verify=False, headers=headers, json=self.configData)
return r.content
jenkins:
securityRealm: null
authorizationStrategy: Unsecured
clouds:
- kubernetes:
name: kubernetes
serverUrl: asdsada
namespace: aa123
jenkins:
location:
url: http://jenkins/
jenkins:
location:
url: a.a.a.a:com
systemMessage: "Welcome to the demo setup for Jenkins Configuration as Code plugin. For more information look in the official repo with our demo setup: https://github.com/Praqma/praqma-jenkins-casc"
securityRealm:
local:
allowsSignup: false
users:
- id: demoAdmin
password: ${adminpw:-passw0rd}
version: '3.3'
services:
#jnlp-agent:
# depends_on:
# - jenkins
# image: jenkins/jnlp-slave
# command: -url http://jenkins:8080
# restart: always
# environment: