Skip to content

Instantly share code, notes, and snippets.

View skyrocknroll's full-sized avatar

Yuvaraj L skyrocknroll

View GitHub Profile
@skyrocknroll
skyrocknroll / victoriametrics.md
Last active August 7, 2020 17:21
[victoriametrics] #victoria #metrics
If i refer to the doc, vmagent stores the data in a buffer reference by "-remoteWrite.tmpDataPath". Am I right?
	Correct.
There for where are the data collected by vmagent stored when vmstorage doesn't respond?
	If vminsert fails to send data to a particular vmstorage node, then it falls back by sending the data to the remaining vmstorage nodes. This prevents from data loss on ingestion path. If all the vmstorage nodes are unavailable, then vminsert starts buffering incoming data in memory in the hope vmstorage nodes will appear soon. The buffer size is limited by -memory.allowedPercent command-line flag. When the buffer becomes full, then vminsert starts dropping newly incoming data and responding with 503 Service Unavailable status code. Conforming clients such as vmagent must retry sending the data if they receive responses with such status code.
For converting all the hyphens to u
@skyrocknroll
skyrocknroll / README.md
Last active December 29, 2023 16:43
[Archer C50] #openwrt #router firmware upgrade #printer
@skyrocknroll
skyrocknroll / thrash.fio
Created December 4, 2019 08:57 — forked from tobert/thrash.fio
fio config to do 50/50 r/w thrashing IO load across a few drives
# a 5 minute disk thrashing benchmark
# generates equal amounts of random read and write IO on every drive
# will generate metrics for each drive
[global]
ioengine=libaio
direct=1
unified_rw_reporting=1
rw=randrw
time_based=1
runtime=300s
@skyrocknroll
skyrocknroll / Install protobuf 3.6.1 on Ubuntu 16.04
Last active November 25, 2020 07:58 — forked from ryujaehun/Install protobuf 3.6.1 on Ubuntu 16.04
Install protobuf 3.6.1 on Ubuntu 16.04 #protobuf #grpc
#! /bin/bash
# Make sure you grab the latest version
curl -OL https://github.com/google/protobuf/releases/download/v3.6.1/protoc-3.6.1-linux-x86_64.zip
https://github.com/google/protobuf/releases/download/v3.6.1/protoc-3.6.1-linux-x86_64.zip
# Unzip
unzip protoc-3.6.1-linux-x86_64.zip -d protoc3
# Move protoc to /usr/local/bin/
sudo mv protoc3/bin/* /usr/local/bin/
@skyrocknroll
skyrocknroll / postgres_queries_and_commands.sql
Created July 25, 2019 16:44 — forked from rgreenjr/postgres_queries_and_commands.sql
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%'
@skyrocknroll
skyrocknroll / cgo1.go
Created April 4, 2019 20:59 — forked from tejainece/cgo1.go
Examples of calling C code from Golang
package main
//#include<stdio.h>
//void inC() {
// printf("I am in C code now!\n");
//}
import "C"
import "fmt"
func main() {
@skyrocknroll
skyrocknroll / go
Last active March 31, 2019 11:20
[foundationdb] #foundationdb #go
* install the latest fdb client
* go mod init fdblearn
* go get github.com/apple/foundationdb/bindings/go@release-6.0
* make sure you set apiVersion to <= 600
* because the client library installed is 6.0.18 which is 600. 610 can be used only when 6.1.x client libraries are installed
* invalidate the cache and restart if ide complains.
@skyrocknroll
skyrocknroll / High_Performance_Redis.md
Created March 12, 2019 05:42 — forked from neomantra/High_Performance_Redis.md
Notes on running Redis with HPC techniques

High Performance Redis

In response to this brief blog entry, @antirez tweeted for some documentation on high-performance techniques for Redis. What I present here are general high-performance computing (HPC) techniques. The examples are oriented to Redis. but they work well for any program designed to be single- or worker-threaded and asynchronous (e.g. uses epoll).

The motivation for using these techniques is to maximize performance of our system and services. By isolating work, controlling memory, and other tuning, you can achieve significant reduction in latency and increase in throughput.

My perspective comes from the microcosm of my own bare-metal (vs VM), on-premises deployment. It might not be suitable for all scenarios, especially cloud deployments, as I have little experience with HPC there. After some discussion, maybe this can be adapted as [redis.io documentation](https://redis.io/do

@skyrocknroll
skyrocknroll / consume.py
Created February 25, 2019 13:31
[apache pulsar] #python #client #seek #begining
import pulsar
from pulsar import MessageId
client = pulsar.Client('pulsar://pulsar.stage.x.com:6650',)
consumer = client.subscribe('persistent://public/default/my-topic-3', 'test-sub5',)
consumer.seek(pulsar.MessageId.earliest)
#consumer.seek(pulsar.MessageId.latest)
while True:
@skyrocknroll
skyrocknroll / readme.md
Last active January 7, 2019 11:18
pulsar client #mac #pulsar
  • export PULSAR_PATH="/Users/yuvaraj.loganathan/workspace/pulsar"
  • cd ${PULSAR_PATH}/pulsar-client-cpp/
  • brew install protobuf260 boost boost-python log4cxx jsoncpp
  • brew upgrade cmake
  • brew install boost-python3
  • brew install clang-format
  • brew install llvm --with-toolchain
  • ln -s "/usr/local/opt/llvm/bin/clang-format" "/usr/local/bin/clang-format"
  • ln -s "/usr/local/opt/llvm/bin/clang-tidy" "/usr/local/bin/clang-tidy"