Skip to content

Instantly share code, notes, and snippets.

@ivanitskiy
ivanitskiy / aarm64-debian-vm-on-intel-macos.md
Last active January 22, 2024 20:47
Running ARM64 Debian VM on MAC OS Intel (13.6) with qemu

Running ARM64 Debian on MAC OS (13.6) with qemu

# install qemu

brew install qemu
qemu-system-aarch64 --version

mkdir aarm64
@ivanitskiy
ivanitskiy / install-clang.sh
Created October 17, 2023 00:38 — forked from sergey-shambir/install-clang.sh
install clang on Debian 9
# Add apt.llvm.org repository and install clang
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
sudo apt-add-repository "deb http://apt.llvm.org/stretch/ llvm-toolchain-stretch main"
sudo apt-get update
sudo apt-get install -y clang clang-format clang-tidy lldb libc++-8-dev libc++abi-8-dev
# Check version
clang --version
clang++ --version
@ivanitskiy
ivanitskiy / .eslintrc.json
Last active August 1, 2023 20:47
NJS + NPM + TS
{
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"ignorePatterns": ["**/node_modules/", "/dist/", "/lib/"],
"parserOptions": {
"sourceType": "module"
},
@ivanitskiy
ivanitskiy / ca.md
Created May 13, 2020 16:30 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@ivanitskiy
ivanitskiy / Cargo.toml
Last active March 17, 2020 20:43
Example of using ARC (Atomically Reference Counted)
[package]
name = "clumpctrl"
version = "0.1.0"
authors = ["Maxim Ivanitskiy <m.ivanitskiy@f5.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
rocket = "0.4.4"

https://www.slideshare.net/ConfluentInc/connecting-kafka-across-multiple-aws-vpcs

https://dvirgiln.github.io/exposing-kafka-throw-different-aws-vpcs/

https://dvirgiln.github.io/exposing-kafka-throw-different-aws-vpcs/

@ivanitskiy
ivanitskiy / get-latest-tag-on-git.sh
Created January 30, 2020 20:10 — forked from rponte/get-latest-tag-on-git.sh
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
@ivanitskiy
ivanitskiy / gist:075662907d8e7b469bd020d8e64e2360
Last active January 30, 2020 17:47
Read data from mysql SQL and insert into clickhouse
SQL=$(cat <<EOF
SELECT
id, DATE_FORMAT(created_at, "%Y-%m-%d"),
type, user_id, location_id, UNIX_TIMESTAMP(created_at)
FROM hits
EOF
)
mysql -h source_db_host mydb -BNe "$sql" > hist.txt
cat hist.txt | clickhouse-client -d mydb --query="INSERT INTO hits FORMAT TabSeparated"
@ivanitskiy
ivanitskiy / service-checklist.md
Created September 6, 2019 05:31 — forked from acolyer/service-checklist.md
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
@ivanitskiy
ivanitskiy / validate_tag_advanced.go
Created April 11, 2019 00:34
Golang tag validator
package main
import (
"fmt"
"reflect"
"regexp"
"strings"
)
// Name of the struct tag used in examples.