Skip to content

Instantly share code, notes, and snippets.

View rgn's full-sized avatar
🏠
Working from home

rgn

🏠
Working from home
View GitHub Profile
left to right direction
node 8e1b16cc_d726_4065_8df7_92dbd56d56aa as "N1" {
node d810c581_6604_48f7_ab75_64e9325aecce as "N11" {
protocol 093813e0_2029_43fe_9bf2_34239fb8bbfd as "INOUT" {
C1
C2
C3
C4
C5
C6
@rgn
rgn / hdfs-fix-all-underreplicatedblocks.sh
Created February 1, 2019 18:56
Correct replication factor for all underreplicated blocks in HDFS.
!/bin/env bash
if [ -z ${1} ]; then
echo "Replication factor required."
exit 1
fi
TEMP_FILE=$(mktemp)
echo "Writing underreplicated files to $TEMP_FILE"
hdfs fsck / | grep 'Under replicated' | awk -F':' '{print $1}' >> $TEMP_FILE
@rgn
rgn / sdc-restart-pipeline.sh
Created February 1, 2019 18:54
(Re)start StreamSets pipeline
#!/bin/env bash
if [ -z "$1" ]; then
echo "SDC URL required."
exit 1
fi
if [ -z "$2" ]; then
echo "SDC user required."
exit 2
@rgn
rgn / zeppelin-run-notebook.sh
Created February 1, 2019 18:52
Run all paragraphs of the given notebook
#!/usr/bin/env bash
if [ -z ${1} ]; then
echo "Zeppelin URL required."
exit 1
fi
ZEPPELIN_URL=$1
if [ -z ${2} ]; then
@rgn
rgn / zeppelin-eximport-notebooks.sh
Created February 1, 2019 18:50
Export all notebook not in trash from source Zeppelin and import them to another Zeppelin instance.
#!/usr/bin/env bash
if [ -z ${1} ]; then
echo "Source URL required."
exit 1
fi
ZEPPELIN_SRC_URL=$1
if [ -z ${2} ]; then