Skip to content

Instantly share code, notes, and snippets.

View marijus-ravickas's full-sized avatar
🌴

Marijus Ravickas marijus-ravickas

🌴
  • Vilnius, Lithuania
View GitHub Profile
@phortuin
phortuin / signing-git-commits.md
Last active November 16, 2024 07:44
Set up a GPG key for signing Git commits on MacOS (M1)

Based on this blogpost.

To sign Git commits, you need a gpg key. GPG stands for GNU Privacy Guard and is the de facto implementation of the OpenPGP message format. PGP stands for ‘Pretty Good Privacy’ and is a standard to sign and encrypt messages.

Setting up

Install with Homebrew:

$ brew install gpg
@kareiva
kareiva / -
Created November 8, 2019 08:09
provider "openstack" {
user_name = "admin"
tenant_name = "containers"
}
data "openstack_networking_floatingip_v2" "fip_jump" {
address = "193.219.144.110"
}
data "openstack_networking_floatingip_v2" "fip_master1" {

Building Kafka from the Hardware - up

  • Higher Message Retention ? - Increase disk size
  • Higher Message Throughput ? - Increase network capacity
  • Higher Producer Performance ? - Increase Disk I/O speed
  • Higher Consumer Performance ? - Increase Memory

Critical Configurations (Consumer)

  • queued.min.messages
  • fetch.wait.max.ms
  • socket.blocking.max.ms
@wrzasa
wrzasa / 00_Comment.md
Last active April 27, 2022 11:52
Ruby 2.4 hash performance benchmark

This is a comment for blog post about improved Ruby 2.4 performance http://blog.redpanthers.co/behind-scenes-hash-table-performance-ruby-2-4/ The post describes improvements in Ruby 2.4 hash implementation and suggests 3x performance improvements.

The article proves that the benchmark presented at the beginning is misleading and suggests invalid conclusions. Since in 2.4 Hash stores list of its entries in sequential array, so the hash.values operation is immediate -- just need to copy the array. So there is significant performance gain comparing to 2.3, but it has nothing to do with performance of usual hash operations: insert, find, delete. Results of the presented benchmark cannot be used to predict performance gain of the other hash operations.

I repeated the experiment (like good physicists did in good old times recalled by Dijkstra) and added some more to test performance of the other operations. The benchmark and results can be found here: https://gist.github.com/wrzasa/6b456f73012ce98ae6feb6aaa4ba9

@jgrodziski
jgrodziski / docker-aliases.sh
Last active November 9, 2024 17:50
Useful Docker Aliases
############################################################################
# #
# ------- Useful Docker Aliases -------- #
# #
# # Installation : #
# copy/paste these lines into your .bashrc or .zshrc file or just #
# type the following in your current shell to try it out: #
# wget -O - https://gist.githubusercontent.com/jgrodziski/9ed4a17709baad10dbcd4530b60dfcbb/raw/d84ef1741c59e7ab07fb055a70df1830584c6c18/docker-aliases.sh | bash
# #
# # Usage: #
@soardex
soardex / gist:e95cdc230d1ac5b824b3
Created May 9, 2015 01:15
Install rbenv in CentOS 7
# install build dependencies
sudo yum install -y git-core zlib zlib-devel gcc-c++ patch readline readline-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison curl sqlite-devel
# clone and install rbenv environment
cd ~
git clone git://github.com/sstephenson/rbenv.git .rbenv
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
@arangamani
arangamani / chef_attribute_converge.rb
Last active February 20, 2023 02:44
Dynamically update attribute of a Chef resource during converge phase (Node variable assignment in Compile vs Converge)
# In Chef, when a resource is defined all its variables are evaluated during
# compile time and the execution of the resource takes place in converge phase.
# So if the value of a particular attribute is changed in converge
# (and not in compile) the resource will be executed with the old value.
# Example problem:
# Let's consider this situation where there are two steps involved in a recipe
# Step 1 is a Ruby block that changes a node attribute. Rubyblocks get executed
# in converge phase
# Step 2 is a Chef resource that makes use of the node attribute that was