Skip to content

Instantly share code, notes, and snippets.

View mstrzele's full-sized avatar

Maciej Strzelecki mstrzele

View GitHub Profile
---
apiVersion: batch/v1
kind: Job
metadata:
name: kube-bench
spec:
template:
spec:
hostPID: true
containers:
#!/usr/bin/env bash
namespace=$1
mapfile -t api_resources < <(kubectl api-resources --namespaced -o name --sort-by=name --verbs=list)
options=()
if [[ -n $namespace ]]; then
options+=("-n $namespace")
fi
@mstrzele
mstrzele / helm-tiller-rbac-config.yaml
Last active April 21, 2022 10:14
Service account with cluster-admin role
apiVersion: v1
kind: ServiceAccount
metadata:
name: tiller
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: tiller
package solution
// you can also use imports, for example:
// import "fmt"
// import "os"
// you can write to stdout for debugging purposes, e.g.
// fmt.Println("this is a debug message")
func Solution(A []int) int {
@mstrzele
mstrzele / log-format-upstream.json
Created July 28, 2017 09:05
NGINX Ingress Google Cloud Platform Log Format
{
"timestamp": "$time_iso8601",
"httpRequest": {
"requestMethod": "$request_method",
"requestUrl": "$scheme://$host$request_uri",
"requestSize": "$request_length",
"status": "$status",
"responseSize": "$bytes_sent",
"userAgent": "$http_user_agent",
"remoteIp": "$proxy_protocol_addr",
@mstrzele
mstrzele / brew-cask-upgrade.sh
Last active January 29, 2018 10:35
Homebrew-Cask upgrade
#!/usr/bin/env bash
outdated() {
local token="${1}"
local info
local cask
local path
mapfile -t info < <(brew cask info "${token}")
read -r -a cask <<< "${info[0]}"

Keybase proof

I hereby claim:

  • I am mstrzele on github.
  • I am mstrzele (https://keybase.io/mstrzele) on keybase.
  • I have a public key whose fingerprint is 047C 8710 8831 1415 1D3F B64C CAD4 0772 6C9F D124

To claim this, I am signing this object:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>ssh-add</string>
<key>Program</key>
<string>/usr/bin/ssh-add</string>
<key>ProgramArguments</key>
<array>
syn case match
syn match sshconfigHostPort "\(host \)\@<=.\+"
syn keyword sshconfigKeyword host
syn case ignore
syn keyword sshconfigMatchSect Match
#!/bin/sh
# SEE: http://blog.backslasher.net/growroot-centos.html
yum -y install epel-release
yum -y install dracut-modules-growroot
dracut -f -v