Skip to content

Instantly share code, notes, and snippets.

View nalingarg2's full-sized avatar

nalin nalingarg2

View GitHub Profile
Smoke Test
curl -X GET -u "admin:admin" -i http://cm-host:7180/api/v9/tools/echo?message=hello
Cluster Creation
curl -X POST -u "admin:admin" -i \
-H "content-type:application/json" \
-d '{ "items": [
{
"name": "test",
"version": "CDH4"
<project>
<repositories>
<repository>
<id>cdh.repo</id>
<url>https://repository.cloudera.com/content/groups/cloudera-repos</url>
<name>Cloudera Repository</name>
</repository>
</repositories>
<dependencies>

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
useradd -m build
passwd build
yum list rpm*
yum install -y rpmdevtools rpm-build
exit
rpmdev-setuptree
@nalingarg2
nalingarg2 / gist:4ed98d98e6481c5fc165
Last active August 29, 2015 14:20
shell script to binary
yum install -y make
yum install gcc gcc-c++ kernel-devel
wget http://www.datsi.fi.upm.es/~frosal/sources/shc-3.8.7.tgz OR wget http://www.datsi.fi.upm.es/~frosal/sources/shc-3.8.9.tgz
tar xvfz shc-3.8.7.tgz
cd shc-3.8.7
make
#Test
./shc -v
@nalingarg2
nalingarg2 / gist:749852c6992ab18971e7
Created May 27, 2015 23:47
install mysql server
sudo yum install mysql-server
sudo service mysqld start
sudo yum install mysql-connector-java
Configuring MySQL
Configure MySQL to use a strong password and to start at boot.
Set the MySQL root password. Note that in the following procedure, your current root password is blank. Press the Enter key when you're prompted for the root password.
@nalingarg2
nalingarg2 / ambari.md
Last active August 29, 2015 14:22 — forked from lalyos/ambari.md

Ambari uses a local postgres db by default.This page describes how to use ambari-server with remote postgres server.

Install

Ambari is installed on centos 6.4 with the following command:

curl -so /etc/yum.repos.d/ambari.repo http://public-repo-1.hortonworks.com/ambari/centos6/1.x/GA/ambari.repo
yum repolist
yum -y install ambari-server
@nalingarg2
nalingarg2 / gist:3ebae4cd80eee8a200a9
Created June 15, 2015 19:59
sample shell script
#!/bin/bash
set -x
#IFS=":"
LIST="118 117 116 112 103 44"
for i in $LIST; do
ssh [email protected].$i '
passwd
mkdir -p ~/.ssh/authorized_keys
ssh-keygen -t rsa -P "" -f ~/.ssh/id_rsa
chkconfig iptables off
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.nalin.hbase</groupId>
<artifactId>hbasetest</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>hbasetest</name>
@nalingarg2
nalingarg2 / prereq.sh
Last active August 29, 2015 14:26
prereq for cluster setup
#!/bin/bash
set -x
#IFS=":"
LIST="87 90 89 88 91 85"
for i in $LIST; do
ssh [email protected].$i '
passwd
chkconfig iptables off