Skip to content

Instantly share code, notes, and snippets.

View ambud's full-sized avatar

Ambud ambud

View GitHub Profile
apt-get update && apt-get install -y make cmake gcc g++ patch
curl -sSL https://github.com/protocolbuffers/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.gz | tar zx -C /opt/
cd /opt/protobuf-2.5.0
curl -L -O https://gist.githubusercontent.com/liusheng/64aee1b27de037f8b9ccf1873b82c413/raw/118c2fce733a9a62a03281753572a45b6efb8639/protobuf-2.5.0-arm64.patch
patch -p1 < protobuf-2.5.0-arm64.patch
./configure --disable-shared
make
ls -l src/protoc
@ambud
ambud / Dockerfile
Created July 22, 2022 23:58 — forked from liusheng/Dockerfile
Fix Hadoop Installation aarch64
FROM ubuntu:bionic
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
######
# Install common dependencies from packages. Versions here are either
# sufficient or irrelevant.
#
# WARNING: DO NOT PUT JAVA APPS HERE! Otherwise they will install default
# Ubuntu Java. See Java section below!
@ambud
ambud / MultiWiiConf.pde
Created May 7, 2021 15:59
Multiwii fixed code
// GNU GPL v3
// Original source code in https://code.google.com/archive/p/multiwii/
import controlP5.*;
import processing.serial.Serial; // serial library
import processing.opengl.*;
import java.lang.StringBuffer; // for efficient String concatemation
import javax.swing.SwingUtilities; // required for swing and EDT
import javax.swing.JFileChooser; // Saving dialogue
@ambud
ambud / config.props
Created April 10, 2018 20:34
Config
storage.engine=com.srotya.sidewinder.core.storage.disk.DiskStorageEngine
data.dir=
index.dir=
default.bucket.size=40960000
default.series.retention.hours=8952
gc.enabled=false
malloc.file.max=1073741824
malloc.buf.increment=8192
malloc.file.increment=268435456
malloc.ptrfile.increment=536870912
package com.srotya.sidewinder.test;
import java.nio.charset.Charset;
public class SimpleStringCompression {
private static Charset UTF8 = Charset.forName("utf-8");
private static Charset UTF16 = Charset.forName("utf-16");
public static void main(String[] args) {
@ambud
ambud / remove.sh
Created February 10, 2018 22:09
Git scripts
# Make a fresh clone of YOUR_REPO
git clone YOUR_REPO
cd YOUR_REPO
# Create tracking branches of all branches
for remote in `git branch -r | grep -v /HEAD`; do git checkout --track $remote ; done
# Remove DIRECTORY_NAME from all commits, then remove the refs to the old commits
# (repeat these two commands for as many directories that you want to remove)
git filter-branch --index-filter 'git rm -rf --cached --ignore-unmatch DIRECTORY_NAME/' --prune-empty --tag-name-filter cat -- --all
@ambud
ambud / Links.txt
Created October 20, 2017 01:45
JVM GC
@ambud
ambud / KVMetricsSource.java
Created October 17, 2017 01:26
Spark Custom Metrics Source
/**
* Copyright 2017 Ambud Sharma
*
* Licensed 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
*
* Unless required by applicable law or agreed to in writing, software
@ambud
ambud / Btree.java
Last active September 7, 2017 23:37
Btree Implementation
/**
* Copyright 2017 Ambud Sharma
*
* Licensed 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
*
* Unless required by applicable law or agreed to in writing, software
@ambud
ambud / kafka.py
Last active June 12, 2017 21:54
Ambari Kafka Rackawareness
rack="/default-rack"
i=0
for host in params.all_hosts:
if host == params.hostname:
rack=params.all_racks[i]
break
i=i+1
kafka_server_config['broker.rack']=rack