Skip to content

Instantly share code, notes, and snippets.

@ivankatliarchuk
ivankatliarchuk / GPG and git on macOS.md
Created September 9, 2018 09:55 — forked from danieleggert/GPG and git on macOS.md
How to set up git to use the GPG Suite

GPG and git on macOS

Setup

No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.

  1. Install https://gpgtools.org -- I'd suggest to do a customized install and deselect GPGMail.
  2. Create or import a key -- see below for https://keybase.io
  3. Run gpg --list-secret-keys and look for sec, use the key ID for the next step
  4. Configure git to use GPG -- replace the key with the one from gpg --list-secret-keys

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@ivankatliarchuk
ivankatliarchuk / gist:18c6506816a11e3264fe62b5be42e45d
Created December 20, 2018 23:55 — forked from Miuler/gist:4134020
Benchmarks for Gatling: Gatling's simulation
package jmeter
import com.excilys.ebi.gatling.core.Predef._
import com.excilys.ebi.gatling.http.Predef._
import com.excilys.ebi.gatling.http.Headers.Names._
import bootstrap._
class JMeterBenchmark extends Simulation {
def apply = {
@ivankatliarchuk
ivankatliarchuk / Jenkinsfile
Created May 17, 2019 19:14 — forked from merikan/Jenkinsfile
Some Jenkinsfile examples
Some Jenkinsfile examples
@ivankatliarchuk
ivankatliarchuk / updateSecurityGroup.js
Created December 25, 2019 09:26 — forked from rowanu/updateSecurityGroup.js
Update an AWS Security Group to allow access by a specific AWS service.
'use strict';
const AWS = require('aws-sdk');
const https = require('https');
const ec2 = new AWS.EC2();
const ipRangesUrl = 'https://ip-ranges.amazonaws.com/ip-ranges.json';
const target = {
port: 5432,
protocol: 'tcp',
@ivankatliarchuk
ivankatliarchuk / DynamoEnumConverter
Created December 27, 2019 21:13 — forked from jvwing/DynamoEnumConverter
For use with Amazon DynamoDB DataModel API for .NET. This class can be used to automagically serialize enum properties to DynamoDB, by decorating the property with the attribute [DynamoDBProperty(typeof(DynamoEnumConverter<AccountStatus>))], where "AccountStatus" is the name of the enumerated type..
public class DynamoEnumConverter<TEnum> : IPropertyConverter
{
public object FromEntry(DynamoDBEntry entry)
{
string valueAsString = entry.AsString();
TEnum valueAsEnum = (TEnum)Enum.Parse(typeof(TEnum), valueAsString);
return valueAsEnum;
}
public DynamoDBEntry ToEntry(object value)
@ivankatliarchuk
ivankatliarchuk / aws-s3-gzip-compression.py
Created January 5, 2020 21:01 — forked from sukharevd/aws-s3-gzip-compression.py
Synchronizes directory with gzipped content of Amazon S3 bucket with local one to avoid redundant synchronization requests when files were not changed, but MD5 sums of Gzipped files are different.
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
AWS S3 Gzip compression utility
Author: Dmitriy Sukharev
Modified: 2013-09-11
-------
Synchronizes directory with gzipped content of Amazon S3 bucket with local
@ivankatliarchuk
ivankatliarchuk / brewv.sh
Created January 25, 2020 18:33 — forked from demosten/brewv.sh
Install specific version of a Homebrew formula
#!/bin/bash
#
# Install specific version of a Homebrew formula
#
# Usage: brewv.sh formula_name desired_version
#
# Notes:
# - this will unshallow your brew repo copy. It might take some time the first time
# you call this script
# - it will uninstall (instead of unlink) all your other versions of the formula.
@ivankatliarchuk
ivankatliarchuk / docker-compose.yml
Created May 14, 2020 07:01 — forked from smashnet/docker-compose.yml
Docker-Compose: Mastodon v3.1.3 with Traefik v2
version: '3'
# Variables to fill in:
# Line 23: <LETSENCRYPT_MAIL_ADDRESS> - your mail address for contact with Let's Encrypt
# Line 36: <TRAEFIK_DASHBOARD_ADMIN_PASSWORD> - MD5 hash of your password (use http://www.htaccesstools.com/htpasswd-generator/)
# Line 54: <POSTGRES_PASSWORD> - the password for the postgres db. Use the same during mastodon:setup!
# Lines 31, 85, 109: <DOMAIN> - e.g. social.yourdomain.com (Must have an A record pointing to your box' IP) (AAAA for IPv6 ;)
services:
traefik: