Skip to content

Instantly share code, notes, and snippets.

@uprush
uprush / gist:5ae1a346ce31ab33eb6eae9f75d68ed7
Created March 22, 2017 02:03
HDC Post-install Recipe
#!/bin/bash
echo "Post-install recipe executed at `date`." > /tmp/post-install.out
@uprush
uprush / gist:726be1be83434783cf12ac7b59633088
Last active March 22, 2017 02:01
HDC pre-install recipe
#!/bin/bash
echo "Pre-install recipe executed at `date`." > /tmp/pre-install.out
# Save below scripts as stopeth.sh
#!/bin/sh
ip link set eth0 down
sleep 60
ip link set eth0 up
# Execute the script
$ sudo nohup ./stopeth.sh &
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
#!/bin/bash
AMBARI_USER='admin'
AMBARI_PASSWORD='admin'
AMBARI_HOST='localhost'
CLUSTER_NAME='mitate'
MOVE_FROM='old-host.mitate.com'
MOVE_TO='new-host.mitate.com'
# Tell to ambari we want to install this component on new_host
@uprush
uprush / hdp-vagrantfile.rb
Last active September 4, 2019 03:02
Vagrantfile for a 4 nodes HDP cluster on Vagrant.
# -*- mode: ruby -*-
# vi: set ft=ruby :
$script = <<SCRIPT
sudo yum -y install ntp
sudo chkconfig ntpd on
sudo /etc/init.d/ntpd start
sudo chkconfig iptables off
sudo /etc/init.d/iptables stop
sudo setenforce 0
@uprush
uprush / pp-dus
Created January 8, 2014 07:56
Pretty print HDFS usage
# Pretty print HDFS usage
include Java
import org.apache.hadoop.util.StringUtils
path = ARGV[0]
dus = %x[$HADOOP_HOME/bin/hadoop fs -dus #{path}]
splited = dus.split
byteDesc = StringUtils.byteDesc(splited[0].to_i)
puts splited[1] + "\t" + byteDesc