Skip to content

Instantly share code, notes, and snippets.

View obalunenko's full-sized avatar
:octocat:
Clear is better than clever

Oleg Balunenko obalunenko

:octocat:
Clear is better than clever
View GitHub Profile

Kafka Topics

List existing topics

bin/kafka-topics.sh --zookeeper localhost:2181 --list

Describe a topic

bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic mytopic

Purge a topic

bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic mytopic --config retention.ms=1000

... wait a minute ...

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@obalunenko
obalunenko / countlines.sh
Created September 20, 2018 23:05
Count lines of code in git Go repo
#!/bin/sh
git ls-files |grep ".go" | grep -v "vendor"| xargs wc -l
@obalunenko
obalunenko / publickey-git-error.markdown
Created September 24, 2018 11:59 — forked from adamjohnson/publickey-git-error.markdown
Fix "Permission denied (publickey)" error when pushing with Git

"Help, I keep getting a 'Permission Denied (publickey)' error when I push!"

This means, on your local machine, you haven't made any SSH keys. Not to worry. Here's how to fix:

  1. Open git bash (Use the Windows search. To find it, type "git bash") or the Mac Terminal. Pro Tip: You can use any *nix based command prompt (but not the default Windows Command Prompt!)
  2. Type cd ~/.ssh. This will take you to the root directory for Git (Likely C:\Users\[YOUR-USER-NAME]\.ssh\ on Windows)
  3. Within the .ssh folder, there should be these two files: id_rsa and id_rsa.pub. These are the files that tell your computer how to communicate with GitHub, BitBucket, or any other Git based service. Type ls to see a directory listing. If those two files don't show up, proceed to the next step. NOTE: Your SSH keys must be named id_rsa and id_rsa.pub in order for Git, GitHub, and BitBucket to recognize them by default.
  4. To create the SSH keys, type ssh-keygen -t rsa -C "your_email@example.com". Th
@obalunenko
obalunenko / fix.sh
Created November 2, 2018 13:40
odd xcode CommandLineTools warnings fix
sudo ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework /Library/Frameworks/
sudo ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework /Library/Frameworks/
@obalunenko
obalunenko / main.go
Last active November 30, 2021 11:51
algoritms tasks solving
package main
import (
"fmt"
"reflect"
"sort"
)
func main() {

Keybase proof

I hereby claim:

  • I am obalunenko on github.
  • I am obalunenko (https://keybase.io/obalunenko) on keybase.
  • I have a public key ASBT3A5w3hYpe-Htc82Bp4xV74cZaNOQsGZ5jtWPAklCRQo

To claim this, I am signing this object:

@obalunenko
obalunenko / git-diff-files-master.sh
Created May 14, 2021 12:26
Get list of changed files against master bruch
#!/usr/bin/env bash
set -Eeuo pipefail
function cleanup() {
trap - SIGINT SIGTERM ERR EXIT
}
trap cleanup SIGINT SIGTERM ERR EXIT
@obalunenko
obalunenko / default.json
Created June 15, 2021 15:38
Iterm profile
{
"Use Non-ASCII Font" : false,
"Tags" : [
],
"Ansi 12 Color" : {
"Green Component" : 0.81066548824310303,
"Red Component" : 0.43880558013916016,
"Blue Component" : 0.99898606538772583
},
@obalunenko
obalunenko / install-protoc.sh
Created November 24, 2021 20:06
Install protoc
#!/bin/sh
set -eu
SCRIPT_NAME="$(basename "$0")"
echo "${SCRIPT_NAME} is running... "
PROTOC_VERSION=3.19.1
PROTOC_OS=""