Skip to content

Instantly share code, notes, and snippets.

@vterdunov
vterdunov / vterdunov.zsh-theme
Last active December 20, 2020 16:49
vterdunov.zsh-theme
DARK_BLUE="\033[0;36m"
br_name () {
local name
name=$(git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null)
if [[ -n $br_name ]]; then
echo "->${name}"
fi
}
@vterdunov
vterdunov / tasks.yml
Created November 13, 2019 15:09
remove old backuped files but keep 2 newest
- name: Find backuped files
find:
paths: /path/to/files/
patterns: file.yml.*
register: backuped_files
- debug:
msg: "{{ item.path }}"
loop: "{{ (backuped_files.files | sort(attribute='ctime',reverse=true))[2:] | list }}"
@vterdunov
vterdunov / config
Last active May 25, 2019 10:19
i3wm config
# ------------------------------------------------------------
# GENERAL
# ------------------------------------------------------------
set $mod Mod4
set $terminal terminator
set $primary_display DP1
set $secondary_display HDMI3
set $bw 2
# font
.PHONY: help
help: ## Display this help message.
@echo "Please use \`make <target>\` where <target> is one of:"
@cat $(MAKEFILE_LIST) | grep -e "^[a-zA-Z_\-\.]*: *.*## *" | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
@vterdunov
vterdunov / conn.go
Created August 16, 2018 21:15
Golang accept connection
conn, err := ln.Accept()
if err != nil {
if pe, ok := err.(net.Error); ok && pe.Temporary() {
continue
}
return error.Errof("cannot process conns at %s: %s", ln.Addr(), err)
}
@vterdunov
vterdunov / log.md
Created April 2, 2018 15:11
kubespray log
TASK [kubernetes-apps/cluster_roles : Check if vsphere-cloud-provider ClusterRole exists] *********************************************************************************************************************************************************************
Monday 02 April 2018  18:07:24 +0300 (0:00:00.037)       0:15:05.745 ********** 
[DEPRECATION WARNING]: Using tests as filters is deprecated. Instead of using `result|version_compare` instead use `result is version_compare`. This feature will be removed in version 2.9. Deprecation warnings can be disabled by setting 
deprecation_warnings=False in ansible.cfg.
skipping: [k8s-master1.lab.vi.local]

TASK [kubernetes-apps/cluster_roles : Write vsphere-cloud-provider ClusterRole manifest] **********************************************************************************************************************************************************************
Monday 02 April 2018  18:07:24 +0300 (0:00:00.047)       0:15:05.793 ********** 
fatal: [k8s-master1.lab
@vterdunov
vterdunov / cloudSettings
Last active July 9, 2020 10:44
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-02-27T13:35:09.776Z","extensionVersion":"v3.4.3"}
FROM rabbitmq:3.6
ENV RABBITMQ_USER user
ENV RABBITMQ_PASSWORD password
ARG PLUGIN_ADDRESS_AUTH_BACKEND_HTTP=https://bintray.com/rabbitmq/community-plugins/download_file?file_path=rabbitmq_auth_backend_http-3.6.x-1b27d722.ez
ARG PLUGIN_ADDRESS_MANAGEMENT_VISUALIZATOR=https://bintray.com/rabbitmq/community-plugins/download_file?file_path=rabbitmq_auth_backend_http-3.6.x-1b27d722.ez
# RUN curl -i -u guest:guest -H "content-type:application/json" \
# -XPUT -d'{"type":"direct","durable":true}' \
@vterdunov
vterdunov / bashrc
Last active June 16, 2020 10:43
Gets tracking branch name
get_branch_tr_name() {
local br_name
br_name=$(git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null)
if [[ -n $br_name ]]; then
echo "[$(__git_ps1 "%s")->${br_name}]"
else
__git_ps1 ["%s"]
fi
}

Keybase proof

I hereby claim:

  • I am vterdunov on github.
  • I am vterdunov (https://keybase.io/vterdunov) on keybase.
  • I have a public key whose fingerprint is 0879 17BB A52C BE03 EF1F 7E01 34D3 9B6B 00A1 F72C

To claim this, I am signing this object: