Skip to content

Instantly share code, notes, and snippets.

View orendain's full-sized avatar

Edgar Orendain orendain

View GitHub Profile
@orendain
orendain / jupyter-and-python3
Created May 21, 2018 01:16
Install Python3 and Jupyter on HDP sandbox 2.6.4
yum install -y python34 python34-pip python34-devel gcc-c++
pip3 install --upgrade pip
pip3 install jupyter
@orendain
orendain / deploy-cda.sh
Last active June 1, 2018 22:24
Deploy CDA - 04172018
#!/usr/bin/env bash
docker run --privileged --name sandbox-hdp-security -h sandbox-hdp.hortonworks.com --network=cda --network-alias=sandbox-hdp.hortonworks.com -d hortonworks/sandbox-hdp-standalone:2.6.4 /usr/sbin/sshd -D
docker exec -d sandbox-hdp-security /root/start-sandbox-hdp.sh
sed -i 's/hdpEnabled=false/hdpEnabled=true/g' /sandbox/proxy/generate-proxy-deploy-script.sh
bash /sandbox/proxy/generate-proxy-deploy-script.sh
#!/bin/bash
echo "Waiting for docker daemon to start up:"
until docker ps 2>&1| grep STATUS>/dev/null; do sleep 1; done; >/dev/null
docker ps -a | grep sandbox-hdp
if [ $? -eq 0 ]; then
docker start sandbox-hdp
else
docker run --name sandbox-hdp --hostname "sandbox-hdp.hortonworks.com" --privileged -d \
-p 15500:15500 \
-p 15501:15501 \
#version=DEVEL
# System authorization information
auth --enableshadow --passalgo=sha512
# Use CDROM installation media
cdrom
# Use graphical install
graphical
# Run the Setup Agent on first boot
firstboot --enable
ignoredisk --only-use=sdb
@orendain
orendain / start_sandbox-hdp.sh
Created February 8, 2018 01:43
Temporary Sandbox HDP startup script
#!/bin/bash
echo "Waiting for docker daemon to start up:"
until docker ps 2>&1| grep STATUS>/dev/null; do sleep 1; done; >/dev/null
docker ps -a | grep sandbox-hdp
if [ $? -eq 0 ]; then
docker start sandbox-hdp
else
docker run --name sandbox-hdp --hostname "sandbox-hdp.hortonworks.com" --privileged -d \
-p 15500:15500 \
-p 15501:15501 \
@orendain
orendain / sandbox-deploy.sh
Created September 29, 2017 16:13
WIP deployment commands
#!/usr/bin/env bash
# Platform options:
# orendain/sandbox-hdf-base
# orendain/sandbox-hdf-streaming
# orendain/sandbox-hdf-analytics
# No longer using opts: --security-opt seccomp=unconfined --cap-add SYS_ADMIN
docker run --privileged --name sandbox-hdf-streaming -h sandbox-hdf.hortonworks.com -itd \

Questions regarding Hive SQL synax

Q1

CREATE TABLE FIREWALL_LOGS(
  time STRING,
  ip STRING,
  country STRING,
 status INT
#!/bin/bash
echo "Waiting for docker daemon to start up:"
until /usr/bin/docker ps 2>&1| grep STATUS>/dev/null; do sleep 1; done; >/dev/null
/usr/bin/docker ps -a | grep sandbox
if [ $? -eq 0 ]; then
/usr/bin/docker start sandbox
else
docker run -v hadoop:/hadoop --name sandbox --hostname "sandbox.hortonworks.com" --privileged -d \
-p 6080:6080 \
-p 18081:18081 \
@orendain
orendain / start-sandbox-hdp-25.ps1
Last active January 17, 2019 02:34
Start HDP 2.5 Sandbox script for Windows
Write-Host "Checking docker daemon..."
If ((Get-Process | Select-String docker) -ne $null) {
Write-Host "Docker is up and running"
}
Else {
$Host.UI.WriteErrorLine("Please start Docker service. https://docs.docker.com/docker-for-windows/")
return
}
If ((docker images | Select-String sandbox) -ne $null) {