Skip to content

Instantly share code, notes, and snippets.

View eyarz's full-sized avatar
🐐

Eyar Zilberman eyarz

🐐
View GitHub Profile
@eyarz
eyarz / commit-msg-hook.py
Last active December 15, 2021 17:57
Git commit-msg hook to verify commit message convention => https://datree.io/blog/git-commit-message-conventions-for-readable-git-log/
#!/usr/bin/env python
"""
Git commit hook:
.git/hooks/commit-msg
Check commit message according to guidelines
"""
import sys
import re
const fs = require('fs')
const path = require('path')
try {
fs.unlinkSync(path.join(__dirname, 'local.json'))
} catch (err) {}
const AWS = require('aws-sdk')
AWS.config.update({ region: 'us-east-1' })
const ssm = new AWS.SSM()
var serviceName = require('../package.json').name
@eyarz
eyarz / bad-practice-example.json
Last active September 12, 2019 09:02
How not to define packages in package.json
{
"name": "GitHub Octocat Generator",
"description": "Generate 1337 Octocats",
"repository": {
"type": "git",
"url": "https://github.com/datree/io.git"
},
"dependencies": {
"async": "latest",
"bower": "latest",
@eyarz
eyarz / bad-practice-example.yml
Last active September 12, 2019 09:23
How not to write a YAML file
apiVersion: v1
kind: Pod
metadata:
name: Octocat-service
labels:
purpose: Generate Octocats
spec:
containers:
- name: octocat-generator-container
image: docker.pkg.github.com/ubuntu:latest
kind: Service
apiVersion: v1
metadata :
name: my—service
spec:
selector:
app: MyApp
ports :
— protocol: TCP
port: 80
apiVersion: vl
kind: Service
metadata :
name: <my—nodeport—service>
labels:
<my-label-key>: <my-label-value>
spec :
selector:
<my-selector-key>: <my-selector-value>
type: NodePort // <-- This sets the "type"
livenessprobe:
httpGet:
path: /healthz
port: 8080
initialDetaySeconds: 3
periodSeconds: 3
resources:
requests:
memory: "64Mi"
cpu: "250m"
limits:
memory: "128Mi"
cpu: "500m"
apiVersion: v1
kind: Pod
metadata:
labels:
test: liveness
name: liveness—http
spec:
containers:
— name: liveness
image: some-random-image:v1.0
apiVersion: networking.k8s.io/v1
kind: networkPolicy