Skip to content

Instantly share code, notes, and snippets.

View seregayoga's full-sized avatar
:octocat:
What's happening?

Sergey Fedchenko seregayoga

:octocat:
What's happening?
View GitHub Profile
@alexedwards
alexedwards / main.go
Last active March 11, 2024 10:20
Password hashing and verification with Argon2id
package main
import (
"crypto/rand"
"crypto/subtle"
"encoding/base64"
"errors"
"fmt"
"log"
"strings"
@jun06t
jun06t / vault-golang-login
Created July 13, 2018 15:56
Golang Vault Login Sample
package main
import (
"encoding/json"
"fmt"
"net/http"
"time"
"github.com/hashicorp/vault/api"
"github.com/hashicorp/vault/builtin/credential/aws"
@mjuric
mjuric / kafka-useful-commands.md
Last active September 6, 2023 03:59
Useful Kafka wrangling commands

Utilities you'll care about

All these are already installed on epyc.

  • kafkacat (conda install -c conda-forge kafkacat)

  • kt (grab it from https://github.com/fgeller/kt/releases)

  • kafka-* (come with kafka, if you yum install if from Confluent's repo, or via Docker if you're so inclined). Warning -- JVM based and dreadfully slow.

  • jq (conda install -c conda-forge jq or use your favorite package manager)

@ipbastola
ipbastola / jq to filter by value.md
Last active April 25, 2024 17:14
JQ to filter JSON by value

JQ to filter JSON by value

Syntax: cat <filename> | jq -c '.[] | select( .<key> | contains("<value>"))'

Example: To get json record having _id equal 611

cat my.json | jq -c '.[] | select( ._id | contains(611))'

Remember: if JSON value has no double quotes (eg. for numeric) to do not supply in filter i.e. in contains(611)

Установка дистрибутива на SD

Raspberry PI SD Installer OS X — простой консольный скрипт для записи любых .img или .iso образов на SD флешки. Использование на OSX или Linux:

sudo ./install ~/Downloads/raspbian.img

Нахождение Raspberry Pi в сети

Подключили ethernet кабель, вставили флешку с Raspbian и запустили, но нет лишнего HDMI монитора и клавиатуры? Выход есть и это — Adafruit Raspberry Pi Finder. Использование на OSX или Linux:

@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active May 1, 2024 13:31
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%'