Skip to content

Instantly share code, notes, and snippets.

View naumvd95's full-sized avatar
๐Ÿ™
breaking things, fixing things

Vladislav Naumov naumvd95

๐Ÿ™
breaking things, fixing things
View GitHub Profile
@naumvd95
naumvd95 / simple-coding-prettify-csv.go
Last active May 31, 2020 21:22
[Simple Coding tasks] parse and prettify csv data using Golang
package main
/*
Input:
csv string:
`
Username; Identifier;First name;Last name
booker12;9012;Rachel;Booker
grey07;2070;Laura;Grey
@naumvd95
naumvd95 / TerminalVim.scpt
Created April 24, 2020 09:50
Open text file in MacOs terminal Vim
#Open Automator
#Choose "New Document"
#Locate "Run AppleScript" and double-click it
#Paste the Applescript code into the box
#Save as /Applications/TerminalVim.app
#In Finder, select some file you want to open in Vim
#Hit โŒ˜I to open the โ€œGet Infoโ€ window.
#Under โ€œOpen with:โ€, choose TerminalVim.app. You may need to select โ€œOtherโ€ฆโ€ and then browse.
#Hit the โ€œChange Allโ€ฆโ€ button and confirm.
@naumvd95
naumvd95 / cfn-runner-k8s-boilerplate.sh
Last active May 10, 2020 13:20
Interactive bash dialog runner for AWS CFN stack management
#!/bin/bash
set -x
# check packages
AWS_CLI_PATH="/usr/local/bin/aws"
DIALOG_CLI_PATH="/usr/local/bin/dialog"
if ! $DIALOG_CLI_PATH 2&>/dev/null; then
echo "dialog package package doesnot installed, please install it"
fi
if ! $AWS_CLI_PATH --version 2&>/dev/null; then
@naumvd95
naumvd95 / aws-cfn-3-node-k8s-cluster.yaml
Created April 5, 2020 19:44
3-node setup for k8s cluster w/ cloud provider support
AWSTemplateFormatVersion: 2010-09-09
Description: A 3-node setup for k8s cluster w/ cloud provider support
##!/bin/bash
#set -ex
#if [ "${1}" = "create" ]; then
# aws cloudformation create-stack \
# --template-body file://cfn-elk-cluster.yaml \
# --stack-name k8s-test-cluster \
# --capabilities CAPABILITY_NAMED_IAM \
# --parameters \
@naumvd95
naumvd95 / docker_cleanup.sh
Created November 27, 2018 14:18
Cleanup useless docker stuff
#!/bin/bash
# investigate
docker system df
# prune all
docker system prune -a -f
# remove exited containers:
@naumvd95
naumvd95 / custom-lbaas-contrail.yaml
Created November 15, 2018 15:25
2 vms (simple http services running) + LB with customized contrail backend (opencontrail, haproxy, etc.) + Floating IP as external LB endpoint
heat_template_version: 2013-05-23
description: 2 vms (simple http services running) + LB with customized contrail backend (opencontrail, haproxy, etc.) + Floating IP as external LB endpoint
parameters:
internal_network_name:
type: string
description: Name of internal network
default: monitoring_workload_net
@naumvd95
naumvd95 / shutdown_alert_bot.sh
Last active October 10, 2018 12:27
[ProtocolSweetHome][Telegram] Send alert message in case of shutdown linux machine
#!/bin/bash
# text to @botFather
# get botID, chatID
# set env vars
echo "export ALARM_CHAT=YOUR_ID" >> .bashrc
echo "export ALARM_BOT_TOKEN=YOUR_TOKEN >> .bashrc
source .bashrc
###################################################
root@vnaumov-dev:~# cat /etc/systemd/system/start_and_stop.service
[Unit]
@naumvd95
naumvd95 / README-Template.md
Created September 6, 2018 09:58 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@naumvd95
naumvd95 / plugin_info.py
Last active August 27, 2018 10:05
Jenkins plugin information monitoring
#!/usr/bin/python
'''
requirements:
pip install python-jenkins
chmod u+x plugin_info.py
Example output:
./plugin_info.py -o=log.txt -f=longName,version
@naumvd95
naumvd95 / cleanup_docker.sh
Created June 26, 2018 19:14 — forked from ralphtheninja/cleanup_docker.sh
Cleanup and reset docker on Jenkins workers / slaves
#!/bin/bash
# This script should be located on each Jenkins slave, and the jenkins user should have permission to run it with sudo
# Attempts to cleanly stop and remove all containers, volumes and images.
docker ps -q | xargs --no-run-if-empty docker stop
docker ps -q -a | xargs --no-run-if-empty docker rm --force --volumes
docker volume ls -q | xargs --no-run-if-empty docker volume rm
docker images -a -q | xargs --no-run-if-empty docker rmi -f
# Stops the docker service, unmounts all docker-related mounts, removes the entire docker directory, and starts docker again.