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 / set-CloudWatchAlarms.ps1
Last active March 11, 2023 05:51
This one is for setting CloudWatch Alarms & actions
Import-Module -Name AWSPowerShell
$sns = "arn:aws:sns:eu-west-1:851073832283:Monitoring-ops"
$instance_id = (Invoke-Restmethod -uri http://169.254.169.254/latest/meta-data/instance-id)
$volume_id = (@(get-ec2volume) | Where-Object { $_.Attachments.InstanceId -eq $instance_id}).VolumeId
$DimensionInstance = New-Object 'Amazon.CloudWatch.Model.Dimension'
$DimensionInstance.Name = 'instance_id'
$DimensionInstance.Value = $instance_id
@kagarlickij
kagarlickij / get-currentJiraSprint.sh
Last active March 3, 2023 16:37
This one is to get current Jira sprint number
#!/bin/bash
# This one is to be executed once to figure out rapidBoardId
#curl -u kagarlickij:Password -X GET -H "Content-Type: application/json" 'https://kagarlickij.atlassian.net/rest/greenhopper/1.0/rapidviews/list'
curl -u USER:PASSWORD -X GET -H "Content-Type: application/json" \
'https://JIRA.DOMAIN.NAME/rest/greenhopper/1.0/sprintquery/17?includeFutureSprints=true&includeHistoricSprints=false' \
| /usr/local/bin/jq '.sprints[] | select(.name | contains("PROJECTNAME")) | select(.state == "ACTIVE") | .name' | sed 's/[^0-9]*//g' > currentSprint.txt
echo "Current Sprint number in Jira is $(cat currentSprint.txt)"
@kagarlickij
kagarlickij / powerlevel9k.zsh-theme
Last active May 29, 2019 17:02
This is my config for Powerlevel9k theme for ZSH located in ~/.oh-my-zsh/custom/themes/powerlevel9k
# vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8
################################################################
# powerlevel9k Theme
# https://github.com/bhilburn/powerlevel9k
#
# This theme was inspired by agnoster's Theme:
# https://gist.github.com/3712874
################################################################
################################################################
@kagarlickij
kagarlickij / .gitignore_global
Last active March 19, 2019 10:17
This is my Git ignore config
# Visual Studio Code
.vscode/
# PyCharm
#.idea/
# Vagrant
.vagrant/
# Packer
#!/bin/bash
echo "Installing SqlCmd.."
if [[ $(sqlcmd | grep Version) != *"13."* ]]; then {
repoPrConf="/etc/yum/pluginconf.d/priorities.conf"
rm -f ${repoPrConf}
cat >> ${repoPrConf} << EOF
[main]
enabled = 0
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "AWS QuickStart Template for Tableau Server instance running on Windows QS(0040)",
"Parameters": {
"ContentAdminPassword": {
"Description": "The password for the initial Admin user for Tableau server",
"MinLength": "1",
"NoEcho": "true",
"Type": "String"
},
<#
.NOTES
===========================================================================
Created on: Jul 2017
Created by: Dmitriy Kagarlickij
Contact: dmitriy@kagarlickij.com
===========================================================================
.DESCRIPTION
ServiceFabricRPHelpers module is from: https://github.com/ChackDan/Service-Fabric/tree/master/Scripts/ServiceFabricRPHelpers
#>
@kagarlickij
kagarlickij / Jenkinsfile
Created March 30, 2018 10:13
This is demo pipeline to check IF conditions in declarative way
pipeline {
agent any
stages {
stage ('First') {
steps {
echo "First"
}
}
if (env.BRANCH_NAME == 'master') {
@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') {
<#
.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