Skip to content

Instantly share code, notes, and snippets.

@sergkondr
sergkondr / Makefile
Last active September 4, 2023 14:49
yp_run_tests
.PHONY: clear build test
APPS = server agent
BRANCH = $(shell git rev-parse --abbrev-ref HEAD)
test: build static-test ${BRANCH}-test clear
build:
for app in ${APPS}; do go build -buildvcs=false -o ./bin/$$app ./cmd/$$app; chmod +x ./bin/$$app; done
@sergkondr
sergkondr / _k8s-handle
Last active July 28, 2023 16:04
k8s-handle autocompletion for oh-my-zsh
#compdef k8s-handle
# Installation:
# - Put this file to $ZSH/plugins/k8s-handle/_k8s-handle
# - Add `k8s-handle` to the `plugins` section in the zshrc config file(usually ~/.zshrc)
local -a _k8s_handle_cmds opt_args
_k8s_handle_cmds=(
'apply:Do attempt to deploy K8S resource from the existing spec'
'destroy:Do attempt to destroy K8S resources of the selected section'
#!/bin/bash
VERSION=$1
DOWNLOAD_FILE=/tmp/terraform.zip
if [[ $# -ne 1 ]]; then
echo "update_terraform 0.12.24"
exit 1
fi
frets = 24
_notes = ["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"] * int(frets/12 + 1)
def get_chord(n):
current = _notes
if n.find("m") == -1:
key = "maj"
else:
#########################################################
# Get Public IP of EC2-instances by tag:
aws ec2 describe-instances \
--profile=XXX \
--region=eu-west-1 \
--output=table \
--filter Name=tag:Name,Values=XXX \
--query 'Reservations[].Instances[].[PublicIpAddress]'

Keybase proof

I hereby claim:

  • I am sergkondr on github.
  • I am sergkondr (https://keybase.io/sergkondr) on keybase.
  • I have a public key ASCfzW4zo37kO7hBGCfjI6xr-N5S9OKGIpzqCtsVYTTjJAo

To claim this, I am signing this object:

package main
import (
"flag"
"fmt"
"math/rand"
"time"
)
var (
history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | grep -v "#" | sort -nr | nl | column -c3 -s " " -t | head -10
import paramiko
import time
import warnings
warnings.filterwarnings(action='ignore', module='.*paramiko.*')
class ParamikoWraper:
def __init__(self, host, user, password, port=22):
self.client = paramiko.SSHClient()
self.client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
# -*- mode: ruby -*-
# vi: set ft=ruby :
os = "ubuntu/bionic64"
domain = "my.lab"
additional_disk = false
hosts = {
"server01" => "192.168.33.10",
# "server02" => "192.168.33.11",