Skip to content

Instantly share code, notes, and snippets.

@ivankatliarchuk
ivankatliarchuk / proxy-aws-sdk-v1.go
Last active February 15, 2025 22:49 — forked from jakexks/aws.go
Proxy in AWS SDK GO
package main
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"net/http"
"net/url"
)
@ivankatliarchuk
ivankatliarchuk / crypto-rand-override-test.go
Created December 29, 2024 12:55
how-to-override-rand-reader-behavior-golang
package main
package endpoint
import (
"encoding/base64"
"io"
"testing"
"crypto/rand"
@ivankatliarchuk
ivankatliarchuk / gist:f29437ffd84032fed41a5b5da92052e2
Created December 29, 2024 12:38
log-rus-how-to-test-log-Fatalf
package main
import (
"bytes"
"testing"
log "github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
)
package rds
import (
log "log/slog"
)
func Process(input string) string {
log.Info("process")
return input
}
@ivankatliarchuk
ivankatliarchuk / github-actions-notes.md
Created May 20, 2022 23:21 — forked from br3ndonland/github-actions-notes.md
Getting the Gist of GitHub Actions

Keybase proof

I hereby claim:

  • I am ivankatliarchuk on github.
  • I am ivankat (https://keybase.io/ivankat) on keybase.
  • I have a public key ASCs6_5-hESvQ9fPRHAd1rXUGvQNxAoBowZFKUvwX0rlRwo

To claim this, I am signing this object:

@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:
@ivankatliarchuk
ivankatliarchuk / traefik-compose
Created April 16, 2020 07:08
traefik 2 with docker-compose
version: '3.7'
networks:
traefik:
external: true
volumes:
db_data:
secrets:
@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 / 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