Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View kagarlickij's full-sized avatar
🏠
Working from home

Dmytro Kaharlytskyi kagarlickij

🏠
Working from home
View GitHub Profile
@kagarlickij
kagarlickij / README.md
Created November 18, 2021 12:04
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
kagarlickij / pylint.svg
Last active June 28, 2020 11:46
Created via API
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kagarlickij
kagarlickij / send_email.py
Created April 18, 2020 15:20
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
kagarlickij / EXEC_CMD.md
Created January 24, 2020 10:45
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
kagarlickij / s3.py
Created December 16, 2019 09:05
Snippet creates AWS S3 bucket using Python with Boto3
# https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3.html#S3.Client.create_bucket
import json
import boto3
from botocore.exceptions import ClientError
# Default values
aws_region = 'eu-west-1'
client_name = 'kag'
environment = 'sbx'
@kagarlickij
kagarlickij / openapi.json
Last active March 26, 2019 09:41
AWS API Gateway PetStore sample
{
"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": [
"https"
],
"paths": {
{
"schemaVersion": "1.0",
"description": "CloudWatch for Windows Instances",
"runtimeConfig": {
"aws:cloudWatch": {
"properties": {
"EngineConfiguration": {
"PollInterval": "00:00:15",
"Components": [
{
@kagarlickij
kagarlickij / .zshrc
Last active August 12, 2019 10:47
This is ZSH config file located in ~/
# 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 https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="powerlevel9k/powerlevel9k"
<#
.NOTES
===========================================================================
Created on: Apr 2016
Created by: Dmitriy Kagarlickij
Contact: dmitriy@kagarlickij.com
Description: http://kagarlickij.com/download-restore-ms-sql-database-backup/
===========================================================================
.DESCRIPTION
This script should be executing with Administrator-level permissions
@kagarlickij
kagarlickij / Jenkinsfile
Created June 7, 2018 14:20
Jenkins scripted pipeline parallel execution
node {
stage ('clean') {
cleanWs()
}
stage ('checkout') {
git credentialsId: 'bla-bla-bla',
url: 'git@bitbucket.org:kagarlickij/myapp-pipeline.git'
}
parallel admin: {
stage ('myapp-admin-pipeline') {