Skip to content

Instantly share code, notes, and snippets.

View prasanthj's full-sized avatar

Prasanth Jayachandran prasanthj

View GitHub Profile
@prasanthj
prasanthj / mvn-subminute-hive-build.txt
Last active October 16, 2017 23:44
Apache Hive sub-minute maven dev build
Build times for Apache Hive master on my Mac Book Pro
# No source code changes (first build not considered as mvn will download all dependencies and cache it locally)
# Base: Clean offline quite build
$ time mvn clean install -DskipTests -o -q
real 3m9.005s
user 7m14.864s
sys 0m40.295s
@prasanthj
prasanthj / lirc-pi3.txt
Last active January 5, 2023 01:35
Getting lirc to work with Raspberry Pi 3 (Raspbian Stretch)
Notes to make IR shield (made by LinkSprite) work in Raspberry Pi 3 (bought from Amazon [1]).
The vendor has some documentation [2] but that is not complete and sufficient for Raspbian Stretch.
Following are the changes that I made to make it work.
$ sudo apt-get update
$ sudo apt-get install lirc
# Add the following lines to /etc/modules file
lirc_dev
lirc_rpi gpio_in_pin=18 gpio_out_pin=17
@prasanthj
prasanthj / ats-extract-plan.py
Last active August 4, 2017 20:58 — forked from t3rmin4t0r/ats-extract-plan.py
ATS to Hive query plan extraction
import json
import os,sys
class ATSFile(object):
def __init__(self, name):
self.data = json.load(open(name))
self.name = name
def dump(self):
if "hive_query_id" in self.data:
info = self.data["hive_query_id"]["otherinfo"]
@prasanthj
prasanthj / orc-commit.txt
Created July 20, 2017 08:15
Apache ORC PR merge steps
$ cat .git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[remote "origin"]
url = https://git-wip-us.apache.org/repos/asf/orc.git
@prasanthj
prasanthj / leveldb-tuning.txt
Created June 28, 2017 08:52
configs to tune leveldb
These are tunings from https://github.com/basho/leveldb
Video: https://www.youtube.com/watch?v=vo88IdglU_8
https://github.com/google/leveldb/blob/master/include/leveldb/options.h#L83
- write buffer size - default 4MB (increase this for higher performance) (try 10x or 100x will get 72% performance)
https://github.com/google/leveldb/blob/master/db/skiplist.h#L98
- if increasing write buffer size, also increase skip list max height. Since skip list is probabilistic,
expected number of keys in write buffer has to specified ahead. (change it from 2^12 to 2^17, affects read and write performance)
@prasanthj
prasanthj / debug-notes.txt
Last active November 17, 2021 10:47
Debugging hadoop/tez/llap shuffle issues
# PDSH Usage
export PDSH_SSH_ARGS_APPEND="-q -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ~/.ssh/private.key"
pdsh -R ssh -w ^slaves.txt
# parallel-ssh Usage
parallel-ssh -x "-oStrictHostKeyChecking=no -i ~/.ssh/private.key" -i -h slaves.txt "sudo -u root jps | grep "LlapDaemon" | cut -f1 -d' '"
# remote heap-dump
# Add the following contents to jcmds.sh and use parallel-scp to copy the script to all hosts
#!/bin/bash
@prasanthj
prasanthj / native-mem-tracking.md
Last active March 2, 2024 15:00
Native memory tracking in JVM

Enable native memory tracking in JVM by specifying the following flag

-XX:NativeMemoryTracking=detail

Know the <PID> of the java process

jps

To print ps based RSS

ps -p <PID> -o pcpu,rss,size,vsize

To print native memory tracking summary

@prasanthj
prasanthj / init.lua
Last active April 8, 2024 21:14
Hammerspoon script for VPN auto-connect in OS X El Capitan
-- hot reload init.lua script
function reloadConfig(files)
doReload = false
for _,file in pairs(files) do
if file:sub(-4) == ".lua" then
doReload = true
end
end
if doReload then
hs.reload()
@prasanthj
prasanthj / vpn-autoconnect
Created July 18, 2016 08:39
VPN auto-connect OS X El Capitan (Run this from Script Editor)
set vpn_name to "'VPN_NAME'"
tell application "System Events"
set rc to do shell script "scutil --nc status " & vpn_name
if rc starts with "Connected" then
do shell script "scutil --nc stop " & vpn_name
else
-- get current clipboard contents as a string
set CurrentClipboard to the clipboard as string
@prasanthj
prasanthj / hive-log4j2.properties
Last active February 25, 2016 01:58
Apache Hive PerfLogger Log to Separate File
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#