Skip to content

Instantly share code, notes, and snippets.

@mrmichalis
mrmichalis / get-cmpasswd.sh
Last active January 6, 2019 20:33
Get list of password from Cloudera Manager embedded PostgreSQL DB and cloudera-scm
#!/usr/bin/env bash
#get-cmpasswd.sh
# password for amon, smon, hmon, rman, nav, scm
cat /etc/cloudera-scm-server/db*.properties | sed '/^#/ d'
# password for cloudera-scm
head -1 /var/lib/cloudera-scm-server-db/data/generated_password.txt
# password for hive
psql -U scm -W scm -h localhost -p 7432 -c "select attr,value from configs where attr like 'hive_metastore_database%' order by revision_id DESC limit 5;"
Here's an updated explanation, 3.9 kernel
[root@destiny ~]# cat /proc/meminfo
MemTotal: 16439720 kB
MemFree: 14309796 kB
Buffers: 67732 kB
Cached: 667072 kB
SwapCached: 0 kB
Active: 527128 kB
Inactive: 263504 kB
Active(anon): 112068 kB
@mrmichalis
mrmichalis / .screenrc
Last active December 19, 2015 04:59
~/.screenrc
# ~/.screenrc
# UTF-8 everywhere
defutf8 on
# disable Ctrl-S/Ctrl-Q "flow control"
defflow off
# skip intro
startup_message off
@mrmichalis
mrmichalis / blur.sh
Created June 20, 2013 01:33
Apache blur
git clone -b experimental-dev https://git-wip-us.apache.org/repos/asf/incubator-blur.git
@mrmichalis
mrmichalis / ks-u.cfg
Last active September 28, 2016 17:38
Ubuntu 12.04 LTS kickstart
#platform=x86, AMD64, or Intel EM64T
#version=DEVEL
# Firewall configuration
firewall --disabled --trust=eth0 --ssh
# Install OS instead of upgrade
install
# Use CDROM installation media
cdrom
# Root password
rootpw --iscrypted $1$dhsnLjk9$4Xx./mgXqMvEssQENwwZz.
#!/bin/bash
MSG=`sudo apt-get --yes dist-upgrade`
MSG_HEADING='sudo apt-get --yes dist-upgrade'
GmailSend.py -u [email protected] -p bla -t [email protected] -s "server update" -b "$MSG_HEADING \n\n $MSG"
@mrmichalis
mrmichalis / dotpath.sh
Last active December 17, 2015 19:38
Manage your PATH with a nice, one-directory-per-line file, rather than a gargantuan blob of colon-delimited text. https://gist.github.com/willurd/5648907
# Read the contents of ~/.path into $PATH, if ~/.path exists. ~/.path should be a file
# consisting of one path on each line, such as:
#
# ~$ cat ~/.path
# # vim: ft=sh
# ~/usr/bin
# /opt/local/bin
# ... etc ...
#
# Note that comments begin with a hash (#).
@mrmichalis
mrmichalis / hive-mysql-grants.sh
Last active December 17, 2015 08:19
WIP: shell to install hive metastore
for service in amon smon rman hmon nav hive; do
mysql -u root -e 'create database $service DEFAULT default character set utf8 collate utf8_general_ci;'
mysql -u root -e "grant all on $service.* TO '$service'@'localhost' IDENTIFIED BY 'password';"
mysql -u root -e "grant all on $service.* TO '$service'@'192-168-1-109.lunix.co' IDENTIFIED BY 'password';"
mysql -u root -e "grant all on $service.* TO '$service'@'%.lunix.co' IDENTIFIED BY 'password';"
done
mysql -u root -e 'show databases;'
@mrmichalis
mrmichalis / wordcount.sh
Created May 14, 2013 20:12
This script will download all of Shakespeare’s books from project, Gutenberg, upload them to HDFS and run a Map Reduce operation run a word count against the text.
#!/bin/bash
# curl -L "https://raw.github.com/sacharya/random-scripts/master/knife-rackspace-hadoop/wordcount.sh" | bash
set -x
hadoop fs -rmr /shakespeare
cd /tmp
wget http://homepages.ihug.co.nz/~leonov/shakespeare.tar.bz2
tar xjvf shakespeare.tar.bz2
now=`date +"%y%m%d-%H%M"`
hadoop fs -put /tmp/Shakespeare /shakespeare/$now/input
@mrmichalis
mrmichalis / .bash_profile
Last active December 15, 2015 18:39
Get latest Hadoop CHD4
# Installations directory
export INSTALLS=$HOME/Work/installs
# CDH Apache Hadoop and Ecosystem
export HADOOP_PREFIX=$INSTALLS/hadoop-2.0.0
export HADOOP_MR1_HOME=$INSTALLS/mr1-2.0.0
export HADOOP_LOG_DIR=$HADOOP_PREFIX/logs
export HADOOP_CONF_DIR=$HADOOP_PREFIX/etc/hadoop
#export HADOOP_MAPRED_HOME=$HADOOP_PREFIX/share/hadoop/mapreduce
#export HADOOP_YARN_HOME=$HADOOP_PREFIX/share/hadoop/mapreduce