Skip to content

Instantly share code, notes, and snippets.

View yanniszark's full-sized avatar
🤹‍♂️
overcommitting

Yannis Zarkadas yanniszark

🤹‍♂️
overcommitting
View GitHub Profile
@yanniszark
yanniszark / sir_testalot.py
Last active May 7, 2022 15:23
COMS 4113: Script to run tests automatically...
#!/usr/bin/env python3
import argparse
import sys
import logging
import subprocess
log = logging.getLogger(__name__)
@yanniszark
yanniszark / .config
Last active January 2, 2022 19:17
Kernel config for BPF
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 5.12.0 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=90300
CONFIG_CLANG_VERSION=0
CONFIG_LD_IS_BFD=y
CONFIG_LD_VERSION=23400
@yanniszark
yanniszark / rebase_demo.sh
Last active February 4, 2021 15:14
Trigger git rebase directory detection breakdown
#!/bin/bash
# Create demo repo
rm -rf /tmp/demo
mkdir /tmp/demo && cd /tmp/demo
git init
# Create upstream branch
git checkout -b upstream
for p in a b c d e f g h i j k l m n o p q r s t u v w x y z a1 a2 a3 a5
apiVersion: rbac.istio.io/v1alpha1
kind: ServiceRole
metadata:
name: access-server
namespace: test-istio-rbac
spec:
rules:
- services:
- 'server.*'
name: Go
on:
pull_request:
branches: [ master ]
jobs:
ci:
name: CI
@yanniszark
yanniszark / example_workflow.yaml
Last active August 21, 2020 18:20
2020-08-17-kubernetes-e2e-testing-made-easy
name: Greet Everyone
# This workflow is triggered on pushes to the repository.
on: [push]
jobs:
build:
# Job name is Greeting
name: Greeting
# This job runs on Linux
runs-on: ubuntu-latest
@yanniszark
yanniszark / split_yaml.go
Created April 15, 2020 11:54
Golang: Multiple YAML Documents / Split YAML
import goyaml "github.com/go-yaml/yaml"
func SplitYAML(resources []byte) ([][]byte, error) {
dec := goyaml.NewDecoder(bytes.NewReader(resources))
var res [][]byte
for {
var value interface{}
err := dec.Decode(&value)
@yanniszark
yanniszark / update-k8s-deps.py
Created March 14, 2020 14:27
Update K8s dependencies - Go Modules Enabled
#!/usr/bin/env python3
import os
import sys
from subprocess import run
deps = [
"k8s.io/api@kubernetes-{version}",
"k8s.io/apiextensions@kubernetes-{version}",
"k8s.io/apimachinery@kubernetes-{version}",
@yanniszark
yanniszark / cass-stress-gen.py
Created December 6, 2019 10:41
Cassandra Stress Job Generating Script
#!/usr/bin/env python3
import argparse
import sys
import os
template = """
apiVersion: batch/v1
kind: Job
metadata:
name: {d.name}-{}
@yanniszark
yanniszark / cpu_manager.sh
Created December 2, 2019 17:58
GKE CPU Pinning Script - Run this as a DaemonSet
#!/bin/bash
HOSTFS="/mnt/hostfs"
function sleep_forever() {
while true; do sleep 100; done
}
function setup_kubectl() {
# Setup kubectl