Skip to content

Instantly share code, notes, and snippets.

View kvaps's full-sized avatar
🔳
This mess is mine!

Andrei Kvapil kvaps

🔳
This mess is mine!
View GitHub Profile
@kvaps
kvaps / .gitignore
Created July 25, 2023 20:06 — forked from mcastelino/.gitignore
cloud-init ubuntu nocloud example with network config
*.img
*.raw
@kvaps
kvaps / .gitignore
Created March 10, 2023 15:08 — forked from smoser/.gitignore
cloud-init ubuntu nocloud example with network config
*.img
*.raw
@kvaps
kvaps / convert-deploymentconfig-to-deployment.md
Created January 25, 2022 09:10 — forked from bmaupin/convert-deploymentconfig-to-deployment.md
Convert OpenShift DeploymentConfig to Kubernetes Deployment
  1. Change apiVersion from:

    - apiVersion: v1

    (or apiVersion: apps.openshift.io/v1)

    to:

@kvaps
kvaps / raw_mode_posix.go
Created August 22, 2021 22:09 — forked from EddieIvan01/raw_mode_posix.go
syscall to set raw-mode-input terminal in Go (Posix/Windows)
// +build darwin linux
package main
import (
"os"
"syscall"
"unsafe"
)
@kvaps
kvaps / .gitlab-ci.yml
Created March 27, 2020 20:56 — forked from shalkam/.gitlab-ci.yml
using service account
stages:
- deploy
deploy_app:
image: bitnami/kubectl:latest
stage: deploy
environment: production
script:
- USER_TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)
- CERTIFICATE_AUTHORITY_DATA=$(cat /var/run/secrets/kubernetes.io/serviceaccount/ca.crt | base64 -i -w0 -)
- kubectl config set-cluster k8s --server="https://kubernetes.default.svc"
@kvaps
kvaps / 01-undeploy.log
Created October 23, 2019 18:16 — forked from mrschyte/01-undeploy.log
Debug logs for linstor_un undeploy/redeploy
[Wed Oct 23 19:53:45 CEST 2019] /var/lib/one/remotes/tm/linstor_un/mv nebula01:/var/lib/one//datastores/106/192/disk.0 nebula01:/var/lib/one//datastores/106/192/disk.0 192 107
+ '[' 1 '!=' 1 ']'
+ SRC=nebula01:/var/lib/one//datastores/106/192/disk.0
+ DST=nebula01:/var/lib/one//datastores/106/192/disk.0
+ VMID=192
+ DSID=107
+ '[' -z '' ']'
+ TMCOMMON=/var/lib/one/remotes/tm/tm_common.sh
++ dirname /var/lib/one/remotes/tm/linstor_un/mv
+ DRIVER_PATH=/var/lib/one/remotes/tm/linstor_un
@kvaps
kvaps / kubernetes_add_service_account_kubeconfig.sh
Last active July 4, 2019 20:06 — forked from StevenACoffman/kubernetes_add_service_account_kubeconfig.sh
Create a service account and generate a kubeconfig file for it - this will also set the default namespace for the service account, and RBAC
#!/bin/bash -e
# Add user to k8s 1.6+ using service account, RBAC for jobs and extensions only
if [[ -z "$1" ]] || [[ -z "$2" ]];then
echo "usage: $0 <service-account> <namespace (stg|prod)>"
exit 1
fi
SERVICE_ACCOUNT_NAME=$1
NAMESPACE=$2
@kvaps
kvaps / kubernetes_add_service_account_kubeconfig.sh
Created May 7, 2019 06:42 — forked from innovia/kubernetes_add_service_account_kubeconfig.sh
Create a service account and generate a kubeconfig file for it - this will also set the default namespace for the user
#!/bin/bash
set -e
set -o pipefail
# Add user to k8s using service account, no RBAC (must create RBAC after this script)
if [[ -z "$1" ]] || [[ -z "$2" ]]; then
echo "usage: $0 <service_account_name> <namespace>"
exit 1
fi
@kvaps
kvaps / git-pull-all
Created July 31, 2018 11:43 — forked from grimzy/git-pull-all
Git pull all remote branches
#!/usr/bin/env bash
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all
# setting up irq affinity according to /proc/interrupts
# 2008-11-25 Robert Olsson
# 2009-02-19 updated by Jesse Brandeburg
#
# > Dave Miller:
# (To get consistent naming in /proc/interrups)
# I would suggest that people use something like:
# char buf[IFNAMSIZ+6];
#
# sprintf(buf, "%s-%s-%d",