Skip to content

Instantly share code, notes, and snippets.

Yuvaraj L skyrocknroll

Block or report user

Report or block skyrocknroll

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@skyrocknroll
skyrocknroll / thrash.fio
Created Dec 4, 2019 — forked from tobert/thrash.fio
fio config to do 50/50 r/w thrashing IO load across a few drives
View thrash.fio
# 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
View Install protobuf 3.6.1 on Ubuntu 16.04
#! /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/
View postgres_queries_and_commands.sql
-- 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 Apr 4, 2019 — forked from tejainece/cgo1.go
Examples of calling C code from Golang
View cgo1.go
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 Mar 31, 2019
[foundationdb] #foundationdb #go
View 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 Mar 12, 2019 — forked from neomantra/High_Performance_Redis.md
Notes on running Redis with HPC techniques
View High_Performance_Redis.md

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 Feb 25, 2019
[apache pulsar] #python #client #seek #begining
View consume.py
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 Jan 7, 2019
pulsar client #mac #pulsar
View readme.md
  • 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"
@skyrocknroll
skyrocknroll / jolokia.md
Last active Oct 4, 2019
[Jolokia JVM Metrics] #jolokia #jvm #metrics
View jolokia.md
  • java -javaagent:jolokia-jvm-1.6.0-agent.jar=port=8888,host=0.0.0.0 -jar target/in.hack4geek.sppring2-1.0-SNAPSHOT.jar
  • java -jar jolokia-jvm-1.6.0-agent.jar start <pid/regex> for already running process
  • http://localhost:8778/jolokia/read/java.lang:type=Threading/ThreadCount
  • Use visualVM or JvisulaVM to get the list of Mbeans.
  • Mbean with value http://localhost:8778/jolokia/read/java.lang:name=MarkSweepCompact,type=GarbageCollector
  • The order matters java.lang:name=MarkSweepCompact,type=GarbageCollector if you try this java.lang:type=GarbageCollector,name=MarkSweepCompact this fails
  • curl "http://localhost:8778/jolokia/read/java.lang:name=MarkSweepCompact,type=GarbageCollector/LastGcInfo/memoryUsageBeforeGc" | jq
@skyrocknroll
skyrocknroll / Vagrantfile
Last active Nov 13, 2019
[Vagrant] #vagrant #multimachine
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
BOX_IMAGE = "ubuntu/xenial64"
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
You can’t perform that action at this time.