Skip to content

Instantly share code, notes, and snippets.

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

Maksim Skutin mskutin

🪄
Evanesco! 🪄
View GitHub Profile
@krisleech
krisleech / renew-gpgkey.md
Last active April 22, 2024 20:13
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:

@ahanoff
ahanoff / gist:a79e58018ff714a34a93e7387ca8f861
Created September 26, 2017 15:54
Hackertrail assignment
using System;
using System.Collections.Generic;
using System.Linq;
namespace hackertrail
{
public class Helper
{
public static IEnumerable<IEnumerable<T>> GetPermutations<T>(IEnumerable<T> items, int count)
{
@HyperBrain
HyperBrain / lifecycle-cheat-sheet.md
Last active March 20, 2024 00:17
Serverless Lifecycle Cheat Sheet

Serverless plugin author's cheat sheet

This cheat sheet provides a detailed overview of the exposed lifecycle events and available commands (and entrypoints) of the Serverless framework, that can be hooked by plugins (internal and external ones). The document is structured by the commands invoked by the user.

Lifecycle events are shown as the globally available outer events (all providers) and sub lifecycle events that are provider specific in the called order. Currently only the AWS provider is shown. If you have information about the other provider,

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

  2. Unfollow

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

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

var a = document.querySelectorAll('[aria-label$="Following"]');
@jonico
jonico / Jenkinsfile
Last active January 31, 2024 09:43
Example for a full blown Jenkins pipeline script with CodeQL analysis steps, multiple stages, Kubernetes templates, shared volumes, input steps, injected credentials, heroku deploy, sonarqube and artifactory integration, Docker containers, multiple Git commit statuses, PR merge vs branch build detection, REST API calls to GitHub deployment API, …
#!groovy
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
def label = "mypod-${UUID.randomUUID().toString()}"
podTemplate(label: label, yaml: """
spec:
containers:
- name: mvn
image: maven:3.3.9-jdk-8
@dfetterman
dfetterman / lambda_function-ECS-cloudwatch-slack.py
Last active April 6, 2024 14:40
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
@yefim
yefim / Dockerrun.aws.json
Last active April 7, 2023 16:11
Build a Docker image, push it to AWS EC2 Container Registry, then deploy it to AWS Elastic Beanstalk
{
"AWSEBDockerrunVersion": "1",
"Image": {
"Name": "<AWS_ACCOUNT_ID>.dkr.ecr.us-east-1.amazonaws.com/<NAME>:<TAG>",
"Update": "true"
},
"Ports": [
{
"ContainerPort": "443"
}
@delemach
delemach / slackNotify.js
Last active November 1, 2018 18:41 — forked from turret-io/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'
};
@RobertoSchneiders
RobertoSchneiders / deploy_with_ebcli3_on_circleci.md
Last active December 4, 2023 09:07
Settings to deploy to AWS Elastic Beanstalk on CircleCi (EB Cli 3)

This is how I configured the deploy of my rails apps to AWS Elastic Beanstalk through CircleCI 1.0.

If you are using the Circle CI 2.0, take a look at this article from ryansimms

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.