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 / setup-gh-cli-auth-2fa.md
Created May 13, 2018 16:12 — forked from ateucher/setup-gh-cli-auth-2fa.md
Setup git on the CLI to use 2FA with GitHub

These are instructions for setting up git to authenticate with GitHub when you have 2-factor authentication set up. This authentication should be inherited by any GUI client you are using. These are intentionally brief instructions, with links to more detail in the appropriate places.

  1. Download and install the git command-line client (if required).

  2. Open the git bash window and introduce yourself to git (if required):

    git config --global user.name 'Firstname Lastname'
    git config --global user.email '[email protected]'
    
@naumvd95
naumvd95 / saltmaster_install.sh
Last active May 21, 2018 08:05
saltmaster_install.sh
# Required variables:
# nodes_os - operating system (centos7, trusty, xenial)
# node_hostname - hostname of this node (mynode)
# node_domain - domainname of this node (mydomain)
# node_cluster - clustername, used to classify this node (virtual_mcp11_k8s)
# config_host - IP/hostname of salt-master (192.168.0.1)
#
# private_key - SSH private key, used to clone reclass model
# reclass_address - address of reclass model (https://github.com/user/repo.git)
# reclass_branch - branch of reclass model (master)
@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.
@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 / 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 / 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 / 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 / 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 / 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 / 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