Skip to content

Instantly share code, notes, and snippets.

View mikron's full-sized avatar
🦚
Focusing

Davit Harutyunyan mikron

🦚
Focusing
  • SFL LLC
  • Armenia, Yerevan
View GitHub Profile
@mikron
mikron / psql_useful_stat_queries.sql
Created May 22, 2024 09:29 — forked from anvk/psql_useful_stat_queries.sql
List of some useful Stat Queries for PSQL
--- PSQL queries which also duplicated from https://github.com/anvk/AwesomePSQLList/blob/master/README.md
--- some of them taken from https://www.slideshare.net/alexeylesovsky/deep-dive-into-postgresql-statistics-54594192
-- I'm not an expert in PSQL. Just a developer who is trying to accumulate useful stat queries which could potentially explain problems in your Postgres DB.
------------
-- Basics --
------------
-- Get indexes of tables
@mikron
mikron / Chromium Linux.md
Created January 11, 2023 13:41 — forked from marians/Chromium Linux.md
How to install CA certificates and PKCS12 key bundles on different platforms

We install certutil and pk12util if necessary:

sudo apt install libnss3-tools

On Linux, Chromium uses the NSS Shared DB. Check if you have the ~/.pki/nssdb directory:

ls $HOME/.pki/nssdb
@mikron
mikron / git-stats.sh
Last active December 17, 2020 10:35
Git statistics shell script
#!/bin/bash
LOGOPTS=()
END_AND_BEGIN=()
#argument parsing
while [ -n "$1" ]; do
case "$1" in
"-s")
shift
END_AND_BEGIN+=("--after=$1")
;;

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

#!/bin/bash
# Script to install FFmpeg on GNU/Linux
# Website: https://www.johnvansickle.com/ffmpeg/
# Created by q3aql (q3aql@protonmail.ch)
# Builds by John Van Sickle (john.vansickle@gmail.com)
# Licensed by GPL v.2
# Date: 22-03-2019
# --------------------------------------
VERSION=1.2.1
@mikron
mikron / read-access.sql
Created May 15, 2019 11:10 — forked from oinopion/read-access.sql
How to create read only user in PostgreSQL
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
-- Grant access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess;

Kafka 0.11.0.0 (Confluent 3.3.0) added support to manipulate offsets for a consumer group via cli kafka-consumer-groups command.

  1. List the topics to which the group is subscribed
kafka-consumer-groups --bootstrap-server <kafkahost:port> --group <group_id> --describe

Note the values under "CURRENT-OFFSET" and "LOG-END-OFFSET". "CURRENT-OFFSET" is the offset where this consumer group is currently at in each of the partitions.

  1. Reset the consumer offset for a topic (preview)
@mikron
mikron / README.md
Created May 17, 2018 08:38 — forked from BoGnY/README.md
[WINDOWS] How to enable auto-signing Git commits with GnuPG for programs that don't support it natively

[WINDOWS] How to enable auto-signing Git commits with GnuPG for programs that don't support it natively

This is a step-by-step guide on how to enable auto-signing Git commits with GPG for every applications that don't support it natively (eg. GitHub Desktop, Eclipse, Git Tower, ...)

Requirements

  • Install GPG4Win: this software is a bundle with latest version of GnuPG v2, Kleopatra v3 certificate manager, GNU Privacy Assistant (GPA) v0.9 which is a GUI that uses GTK+, GpgOL and GpgEX that are respectively an extension for MS Outlook and an extension for Windows Explorer shell
  • Install Git for Windows: so you can have a *nix based shell, this software is a bundle with latest version of Git which use MINGW environment, a Git bash shell, a Git GUI and an extension for Windows Explorer shell (Make sure your local version of Git is at least 2.0, otherwise Git don't have support for automatically sign your commits)
  • Verify
@mikron
mikron / Translit.java
Created October 24, 2016 11:26 — forked from alexzaitsev/Translit.java
Transliteration from English to Russian
package com.yalantis.util;
import android.text.TextUtils;
import java.util.HashMap;
import java.util.Map;
/**
* Created by Aleksandr on 05.10.2015.
*/