Skip to content

Instantly share code, notes, and snippets.

View mskutin's full-sized avatar
🪄
Evanesco! 🪄

Maksim Skutin mskutin

🪄
Evanesco! 🪄
View GitHub Profile
@mskutin
mskutin / slackNotify.js
Created September 11, 2016 17:39 — forked from delemach/slackNotify.js
Parse SNS notification from Elastic Beanstalk and publish to Slack channel
var http = require('https');
var querystring = require('querystring');
// set the post request options
var reqOptions = {
hostname: 'hooks.slack.com',
port: 443,
path: '/services/YOUR/SLACK/HOOK_HERE',
method: 'POST'
};
@mskutin
mskutin / deploy_with_ebcli3_on_circleci.md
Last active September 21, 2016 18:55 — forked from RobertoSchneiders/deploy_with_ebcli3_on_circleci.md
Settings to deploy to AWS Elastic Beanstalk on CircleCi (EB Cli 3)

###Rails apps to AWS Elastic Beanstalk through CircleCI.

Configure Environments Variables

On Project Settings > Environment Variables add this keys:

  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY
    The aws user must have the right permissions. This can be hard, maybe, this can help you.

Create a bash script to create the eb config file

  1. заходим в news feed preferences

  2. Unfollow

  3. Скроллим до упора вниз

  4. Выполняем в консоли

var a = document.querySelectorAll('[aria-label$="Following"]');
@mskutin
mskutin / sts-assume.log
Created February 4, 2019 06:57
Error configuring the backend "s3": The role "arn:aws:iam::##REPLACED_AWS_ACCOUNT_ID##:role/Terragrunt" cannot be assumed.
ms at ms in ~/Documents/src/bitbucket/sb/sb/sb-mono/infra/live/accounts/sb-dev/ap-southeast-1/dev/vpc (add-terraform-template●●)
$ TF_LOG=trace AWS_PROFILE=sb-dev@ms terragrunt plan --terragrunt-iam-role arn:aws:iam::##REPLACED_AWS_ACCOUNT_ID##:role/Terragrunt >> assume.log
[terragrunt] [/Users/ms/Documents/src/bitbucket/sb/sb/sb-mono/infra/live/accounts/sb-dev/ap-southeast-1/dev/vpc] 2019/02/04 12:47:39 Running command: terraform --version
[terragrunt] 2019/02/04 12:47:39 Reading Terragrunt config file at /Users/ms/Documents/src/bitbucket/sb/sb/sb-mono/infra/live/accounts/sb-dev/ap-southeast-1/dev/vpc/terraform.tfvars
[terragrunt] 2019/02/04 12:47:41 Assuming IAM role arn:aws:iam::##REPLACED_AWS_ACCOUNT_ID##:role/Terragrunt
[terragrunt] 2019/02/04 12:47:41 WARNING: no double-slash (//) found in source URL /terraform-aws-modules/terraform-aws-vpc.git. Relative paths in downloaded Terraform code may not work.
[terragrunt] 2019/02/04 12:47:41 Terraform files in /Users/ms/Documents/src/bitbucket/sb/sb/sb-mono/
# config file for ansible -- https://ansible.com/
# ===============================================
# nearly all parameters can be overridden in ansible-playbook
# or with command line flags. ansible will read ANSIBLE_CONFIG,
# ansible.cfg in the current working directory, .ansible.cfg in
# the home directory or /etc/ansible/ansible.cfg, whichever it
# finds first
[defaults]
@mskutin
mskutin / lambda_function-ECS-cloudwatch-slack.py
Created April 19, 2017 04:19 — forked from dfetterman/lambda_function-ECS-cloudwatch-slack.py
Lambda function that takes ECS Cloudwatch events and sends a notification to Slack
# Written by Dane Fetterman on 12/1/2016
# https://aws.amazon.com/blogs/compute/monitor-cluster-state-with-amazon-ecs-event-stream/
# Where they use a cloud watch event from ECS to notify a SNS topic. We're
# sending a notification directly to slack instead
import requests
import json
from boto3 import session, client
@mskutin
mskutin / renew-gpgkey.md
Created August 11, 2020 16:37 — forked from krisleech/renew-gpgkey.md
Renew Expired GPG key

Renew GPG key

Given that your key has expired.

$ gpg --list-keys
$ gpg --edit-key KEYID

Use the expire command to set a new expire date:

@mskutin
mskutin / get-apigw-usage.ps1
Last active November 12, 2020 17:41
Posh script to generate an API Gateway weekly usage report in plain HTML. Ensure you have AWS Tools installed https://aws.amazon.com/powershell/
Import-Module -Name AWSPowerShell
Set-DefaultAWSRegion 'ap-southeast-1'
$numberOfDays = 7
$fileName = ('Gateways-' + (get-date -f yyyy-MM-dd-HH-mm-s) + '.html')
$reportLocation = Join-Path (Get-Location).path $fileName
$withMetrics = @()
$Header = @"
@mskutin
mskutin / pwnd.gif
Last active December 22, 2020 18:24
Mother Russia
pwnd.gif