Skip to content

Instantly share code, notes, and snippets.

Working from home

Dmitriy Kagarlickij kagarlickij

Working from home
View GitHub Profile
kagarlickij /
Created Nov 18, 2021
Clean history of Git branch

git checkout --orphan TEMP_BRANCH
git add -A
git commit -am "cleanup"
git branch -D master
git branch -m master
git push -f origin master

kagarlickij / pylint.svg
Last active Jun 28, 2020
Created via API
View pylint.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
kagarlickij /
Created Apr 18, 2020
Python snippet to send email
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import smtplib
import sys
import os
smtpLogin = sys.argv[1]
smtpPassword = sys.argv[2]
smtpServer = sys.argv[3]
smtpPort= sys.argv[4]
kagarlickij /
Created Jan 24, 2020
Sample Ansible playbook that uses Windows hostname for creating file and running command

ansible-playbook -vvvv -i hosts playbook.yml --extra-vars='ansible_user=ansible ansible_password=A****0+ ansible_connection=winrm ansible_winrm_server_cert_validation=ignore var1=value1'

kagarlickij /
Created Dec 16, 2019
Snippet creates AWS S3 bucket using Python with Boto3
import json
import boto3
from botocore.exceptions import ClientError
# Default values
aws_region = 'eu-west-1'
client_name = 'kag'
environment = 'sbx'
kagarlickij / openapi.json
Last active Mar 26, 2019
AWS API Gateway PetStore sample
View openapi.json
"swagger": "2.0",
"info": {
"description": "Your first API with Amazon API Gateway. This is a sample API that integrates via HTTP with our demo Pet Store endpoints",
"title": "PetStore"
"schemes": [
"paths": {
View EC2WindowsCloudWatch.json
"schemaVersion": "1.0",
"description": "CloudWatch for Windows Instances",
"runtimeConfig": {
"aws:cloudWatch": {
"properties": {
"EngineConfiguration": {
"PollInterval": "00:00:15",
"Components": [
kagarlickij / .zshrc
Last active Aug 12, 2019
This is ZSH config file located in ~/
View .zshrc
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/Users/kagarlickij/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See
View db_restore_from_sftp.ps1
Created on: Apr 2016
Created by: Dmitriy Kagarlickij
This script should be executing with Administrator-level permissions
kagarlickij / Jenkinsfile
Created Jun 7, 2018
Jenkins scripted pipeline parallel execution
View Jenkinsfile
node {
stage ('clean') {
stage ('checkout') {
git credentialsId: 'bla-bla-bla',
url: ''
parallel admin: {
stage ('myapp-admin-pipeline') {