Skip to content

Instantly share code, notes, and snippets.

View dgierejkiewicz's full-sized avatar

Dariusz Gierejkiewicz dgierejkiewicz

View GitHub Profile
@dgierejkiewicz
dgierejkiewicz / 00_README.md
Created February 11, 2020 10:07 — forked from YumaInaura/00_README.md
Golang — Understanding channel, buffer, blocking, deadlock and happy groutines.

Golang — Understanding channel, buffer, blocking, deadlock and happy groutines.

I was so confused to understand behaviior of Golang channels, buffer, blocking, deadlocking and groutines.

I read Go by Example topics.

@dgierejkiewicz
dgierejkiewicz / Update-branch.md
Created February 19, 2020 10:55 — forked from santisbon/Update-branch.md
Bring your feature branch up to date with master. Deploying from Git branches adds flexibility. Bring your branch up to date with master and deploy it to make sure everything works. If everything looks good the branch can be merged. Otherwise, you can deploy your master branch to return production to its stable state.

Updating a feature branch

First we'll update your local master branch. Go to your local project and check out the branch you want to merge into (your local master branch)

$ git checkout master

Fetch the remote, bringing the branches and their commits from the remote repository. You can use the -p, --prune option to delete any remote-tracking references that no longer exist in the remote. Commits to master will be stored in a local branch, remotes/origin/master

@dgierejkiewicz
dgierejkiewicz / main_test.go
Created February 20, 2020 10:09 — forked from phemmer/main_test.go
Golang benchmark check buffered channel has ready-to-read value
# go test -bench=.
goos: linux
goarch: amd64
pkg: tmp/eh4
BenchmarkSelect-8 200000000 7.65 ns/op
BenchmarkLen-8 2000000000 1.07 ns/op
PASS
ok tmp/eh4 4.580s
@dgierejkiewicz
dgierejkiewicz / README-Template.md
Created March 2, 2020 19:31 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@dgierejkiewicz
dgierejkiewicz / infra-secret-management-overview.md
Created March 3, 2020 12:37 — forked from maxvt/infra-secret-management-overview.md
Infrastructure Secret Management Software Overview

Currently, there is an explosion of tools that aim to manage secrets for automated, cloud native infrastructure management. Daniel Somerfield did some work classifying the various approaches, but (as far as I know) no one has made a recent effort to summarize the various tools.

This is an attempt to give a quick overview of what can be found out there. The list is alphabetical. There will be tools that are missing, and some of the facts might be wrong--I welcome your corrections. For the purpose, I can be reached via @maxvt on Twitter, or just leave me a comment here.

There is a companion feature matrix of various tools. Comments are welcome in the same manner.

@dgierejkiewicz
dgierejkiewicz / tsdb_blog.md
Created May 18, 2020 15:08 — forked from sacreman/tsdb_blog.md
Time Series DB Smack Down

Databases are a crazy topic and it seems everyone has an opinion. The trouble is that opinions are like belly buttons. Just because everyone has one it doesn’t mean they are useful for anything.

Time series databases (TSDB’s) in particular always provoke the usual “have you tried X”, where X is some obscure project with 50 commits back in 2009. Invariably, if X is something a bit more mainstream then yes, it probably has been played with. It’s probably good at certain things and bad at others like all software.

With all of the above in mind I decided to pen a magnum opus of my own opinions. Something I can point the HaveYouTriedX’ers at next time they make an appearance. So here it is..

My Top10 TSDB’s:

  1. DalmatinerDB (no surprise here)
  2. InfluxDB
@dgierejkiewicz
dgierejkiewicz / postgres_queries_and_commands.sql
Created November 30, 2020 18:11 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@dgierejkiewicz
dgierejkiewicz / ufw_docker
Created March 8, 2021 09:27 — forked from kireal/ufw_docker
ufw docker
Running Docker behind the ufw firewall
Ubuntu ships with a very nice and simple frontend for iptables called ufw (uncomplicated firewall). Ufw makes it possible to setup a firewall without having to fully understand iptables itself. When you however are using Docker and you want to combine Docker with the ufw service. Things do get complicated.
The docker service talks directly to iptables for networking, basically bypassing everything that’s getting setup in the ufw utility and therefore ignoring the firewall. Additional configuration is required to prevent this behavior. The official Docker documentation however, seems to be incomplete.
Configure DEFAULT_FORWARD_POLICY and port 2375
Connections from docker containers get routed into the (iptables) FORWARD chain, this needs to be configured to allow connections through it. The default is to DROP the connections so a change is required:
@dgierejkiewicz
dgierejkiewicz / postgres_config.md
Created March 15, 2021 21:21 — forked from rgreenjr/postgres_config.md
PostgreSQL Configuration Optimization

PostgreSQL Configuration Optimization

Memory

Only four values really matter:

  • shared-buffers: below 2GB: set it to 20% of full memory; below 32GB: 25% of your full memory.
@dgierejkiewicz
dgierejkiewicz / golang-tls.md
Created April 7, 2021 11:01 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples
Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)