Skip to content

Instantly share code, notes, and snippets.

View klizhentas's full-sized avatar
Be kind

Alexander Klizhentas klizhentas

Be kind
View GitHub Profile
@klizhentas
klizhentas / migrate.failed
Created February 12, 2021 19:18
MFA Migration failed
ERROR REPORT:
Original Error: *trace.BadParameterError MFA device named "otp" already exists
Stack Trace:
/home/sasha/go/src/github.com/gravitational/teleport/lib/services/authentication.go:48 github.com/gravitational/teleport/lib/services.ValidateLocalAuthSecrets
/home/sasha/go/src/github.com/gravitational/teleport/lib/services/local/resource.go:485 github.com/gravitational/teleport/lib/services/local.itemToLocalAuthSecrets
/home/sasha/go/src/github.com/gravitational/teleport/lib/services/local/resource.go:432 github.com/gravitational/teleport/lib/services/local.userFromUserItems
/home/sasha/go/src/github.com/gravitational/teleport/lib/services/local/users.go:101 github.com/gravitational/teleport/lib/services/local.(*IdentityService).getUsersWithSecrets
/home/sasha/go/src/github.com/gravitational/teleport/lib/services/local/users.go:64 github.com/gravitational/teleport/lib/services/local.(*IdentityService).GetUsers
/home/sasha/go/src/github.com/gravitational/teleport/lib/auth/auth.go:1886 gith
# OpenEBS storage pool claim.
apiVersion: openebs.io/v1alpha1
kind: StoragePoolClaim
metadata:
name: cstor-pool
spec:
name: cstor-pool
type: disk
poolSpec:
poolType: striped
@klizhentas
klizhentas / channel.py
Created May 8, 2019 00:35
This Zap creates a private slack channel for an interview candidate, and invites the candidate to the channel.
import requests
import datetime
import uuid
channel_name='int-'+uuid.uuid4().hex[:8]
candidate_email = input['candidate_email']
# Fetch the slack token from the encrypted storage
storage_secret = input['storage_secret']
storage_client = StoreClient(storage_secret)
deployment {
metadata: nginx-deployment
replicas: countNodes(label='nginx')
template: {
labels: app=nginx
containers: [
{name: nginx, image: 'nginx:1.7.9', ports: {containerPort: 80}}
]
}
}
@klizhentas
klizhentas / licensinator.py
Created September 28, 2016 05:06
License scanner
import os
import sys
import os.path
from difflib import SequenceMatcher
class License(object):
def __init__(self, filename, contents):
self.parts = [(filename, contents)]
def merge(self, other):
@klizhentas
klizhentas / gist:fb01554b3ab5ae8bc401
Created November 17, 2015 02:12
go plugins for emacs
; ==================
; Go plugins
; ==================
(setenv "GOPATH" "/home/alex/go")
(setenv "GOROOT" "/opt/go")
(setenv "PATH" (concat (getenv "PATH") ":/home/alex/go/bin" ":/opt/go/bin" ":~/.emacs.d/goflymake"))
(setq exec-path (append exec-path (list (expand-file-name "~/.emacs.d/goflymake"))))
(require 'go-mode)
(require 'go-flymake)
Jul 28 19:59:13 7193bd9b-8c8f-4e6d-a817-857cf95fc8ad wait-for-etcd.sh[1636]: Error: cannot sync with the cluster using endpoints http://127.0.0.1:4001
Jul 28 19:59:13 7193bd9b-8c8f-4e6d-a817-857cf95fc8ad wait-for-etcd.sh[1636]: Failed to set variable reconnecting to the cluster
Jul 28 19:59:14 7193bd9b-8c8f-4e6d-a817-857cf95fc8ad wait-for-etcd.sh[1636]: Error: cannot sync with the cluster using endpoints http://127.0.0.1:4001
Jul 28 19:59:14 7193bd9b-8c8f-4e6d-a817-857cf95fc8ad wait-for-etcd.sh[1636]: Failed to set variable reconnecting to the cluster
Jul 28 19:59:16 7193bd9b-8c8f-4e6d-a817-857cf95fc8ad wait-for-etcd.sh[1636]: cluster is healthy
Jul 28 19:59:16 7193bd9b-8c8f-4e6d-a817-857cf95fc8ad wait-for-etcd.sh[1636]: member ce2a822cea30bfca is healthy
Jul 28 19:59:16 7193bd9b-8c8f-4e6d-a817-857cf95fc8ad etcdctl[1672]: {"Network":"10.244.0.0/16", "Backend": {"Type": "vxlan"}}
Jul 28 19:59:16 7193bd9b-8c8f-4e6d-a817-857cf95fc8ad bash[1688]: waiting for write.
Jul 28 19:59:16 7193bd9b-8c8f-4e6d-a817-857cf9
@klizhentas
klizhentas / trace.js
Created January 13, 2015 17:19
Examples of structured logs
// HTTP, captured request and response headers
{"Req":{"Method":"GET","URL":"/hello","H":{"X-Req-A":["1","2"],"X-Req-B":["3","4"]}},"Resp":{"Code":200,"RTT":0.006653,"H":{"X-Re-1":["6","7"],"X-Re-2":["2","3"]}}}
{"Req":{"Method":"GET","URL":"/","TLS":{"V":"TLS12","Resume":false,"CS":"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256","Srv":"127.0.0.1"}},"Resp":{"Code":200,"RTT":0.002082,"H":null}}
@klizhentas
klizhentas / upstart.conf
Created January 12, 2015 01:32
Nginx upstart
# nginx
limit nofile 40000 40000
description "nginx http daemon"
author "George Shammas <georgyo@gmail.com>"
start on (filesystem and net-device-up IFACE=lo)
stop on runlevel [!2345]
env DAEMON=/opt/nginx/sbin/nginx
user www-data;
worker_processes auto;
worker_rlimit_nofile 32000;
pid /var/run/nginx.pid;
events {
use epoll;
multi_accept on;
}