Skip to content

Instantly share code, notes, and snippets.

@OleksandrKucherenko
OleksandrKucherenko / version-up.sh
Last active August 20, 2025 07:25
Calculate Next Suitable Version Tag for Your Git based project
#!/usr/bin/env bash
# shellcheck disable=SC2155
## Copyright (C) 2017, Oleksandr Kucherenko
## Last revisit: 2023-09-30
## Version: 2.0.2
## License: MIT
## Fix: 2023-10-01, prefix for initial INIT_VERSION was not applied
## Fix: 2023-10-01, correct extraction of latest tag that match version pattern
## Added: 2023-09-30, @mrares prefix modification implemented
@seanjensengrey
seanjensengrey / install_basho_otp_kerl.md
Last active July 3, 2019 17:52
Installing the Basho Maintained Erlang with Kerl

How to install Basho Erlang using Kerl.

note: Instructions for other platforms are available in the Erlang docs

install kerl

curl -O https://raw.githubusercontent.com/kerl/kerl/master/kerl
chmod +x kerl
@rponte
rponte / get-latest-tag-on-git.sh
Last active September 16, 2025 08:48
Getting latest tag on git repository
# The command finds the most recent tag that is reachable from a commit.
# If the tag points to the commit, then only the tag is shown.
# Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object
# and the abbreviated object name of the most recent commit.
git describe
# With --abbrev set to 0, the command can be used to find the closest tagname without any suffix:
git describe --abbrev=0
# other examples
@shino
shino / claimant-down-operation.md
Created July 22, 2015 15:11
Operation steps when claimant node is down in Riak cluster

Created 3-node healthy cluster. Node dev1 is claimant at this point.

% dev/dev1/bin/riak-admin member-status
================================= Membership ==================================
Status     Ring    Pending    Node
-------------------------------------------------------------------------------
valid      50.0%      --      'dev1@127.0.0.1'
valid      25.0%      --      'dev2@127.0.0.1'
valid      25.0%      --      'dev3@127.0.0.1'
@angstwad
angstwad / dict_merge.py
Last active December 22, 2024 16:02
Recursive dictionary merge in Python
import collections
def dict_merge(dct, merge_dct):
""" Recursive dict merge. Inspired by :meth:``dict.update()``, instead of
updating only top-level keys, dict_merge recurses down into dicts nested
to an arbitrary depth, updating keys. The ``merge_dct`` is merged into
``dct``.
:param dct: dict onto which the merge is executed
:param merge_dct: dct merged into dct
@cirrusUK
cirrusUK / .Xresources
Last active April 3, 2024 11:19
termite emulator orange theme and other stuff
! __ ___ __ ___ ___ ___ _ _ _ __ ___ ___ ___
! \ \/ / '__/ _ \/ __|/ _ \| | | | '__/ __/ _ \/ __|
! _ > <| | | __/\__ \ (_) | |_| | | | (_| __/\__ \
!(_)_/\_\_| \___||___/\___/ \__,_|_| \___\___||___/
!
!## Colors
#define S_base03 #191919
#define S_base02 #073642
#define S_base01 #586e75
#define S_base00 #657b83
timestamp_to_datetime(TimeStamp) ->
UnixEpochGS = calendar:datetime_to_gregorian_seconds({{1970, 1, 1}, {0, 0, 0}}),
GregorianSeconds = (TimeStamp div 1000) + UnixEpochGS,
calendar:universal_time_to_local_time(calendar:gregorian_seconds_to_datetime(GregorianSeconds)).
@efcasado
efcasado / eqc.md
Last active January 16, 2025 16:22
A gentle introduction to (Erlang) QuickCheck

Erlang QuickCheck

What is QuickCheck?

QuickCheck is a language for stating properties of programs.

?FORALL(X, nat(), X*X >= 0)
@DavidJFelix
DavidJFelix / HyperLogLogs_lab.md
Last active December 15, 2023 12:35
A lab for HyperLogLogs using Redis & Python, created with Ipython notebook

Redis is an in-memory network key/value store and nltk is the python natural language toolkit. We'll be using these libraries later for the lab.

    import redis
    import nltk

Setup our redis connection. It's on the VM, so local is fine.

@shamil
shamil / mount_qcow2.md
Last active October 18, 2025 21:10
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8