Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Dmitriy Kagarlickij kagarlickij

🏠
Working from home
View GitHub Profile
@kagarlickij
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
kagarlickij / send_email.py
Created Apr 18, 2020
Python snippet to send email
View send_email.py
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 Jan 24, 2020
Sample Ansible playbook that uses Windows hostname for creating file and running command
View EXEC_CMD.md

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 Dec 16, 2019
Snippet creates AWS S3 bucket using Python with Boto3
View s3.py
# 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 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": [
"https"
],
"paths": {
View EC2WindowsCloudWatch.json
{
"schemaVersion": "1.0",
"description": "CloudWatch for Windows Instances",
"runtimeConfig": {
"aws:cloudWatch": {
"properties": {
"EngineConfiguration": {
"PollInterval": "00:00:15",
"Components": [
{
@kagarlickij
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 https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="powerlevel9k/powerlevel9k"
View db_restore_from_sftp.ps1
<#
.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 Jun 7, 2018
Jenkins scripted pipeline parallel execution
View Jenkinsfile
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') {
@kagarlickij
kagarlickij / Jenkinsfile
Created Mar 30, 2018
This is demo pipeline to check IF conditions in declarative way
View Jenkinsfile
pipeline {
agent any
stages {
stage ('First') {
steps {
echo "First"
}
}
if (env.BRANCH_NAME == 'master') {