Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Setup
CMNODE=`hostname -A | cut -d' ' -f1`
BASE=http://$CMNODE:7180/api/v8
USERNAME="admin"
USERPASS="admin"
CLUSTER=$(curl -X GET -u "$USERNAME:$USERPASS" -i $BASE/clusters | grep '"name"' | awk -F'"' '{print $4}')
nodes=$(curl -X GET -u "$USERNAME:$USERPASS" -i $BASE/hosts | grep hostname | awk -F'"' '{print $4}')
@azurecube
azurecube / nnha.sh
Last active December 7, 2015 11:51
#!/bin/bash
# !!Note Please execute this on more than 4 node cluster!!
# Setting HA as following
# node1: Active NN zk1
# Node2: Standby NN jn1 zk2
# Node3: jn2 zk3
# Node4: jn3
@azurecube
azurecube / iodbc_impala.sh
Last active August 29, 2015 14:15
Connect to Impala with iODBC
# This is tested on CDH 5.3/CentOS6.2
# C part is based on the samples from http://www.easysoft.com/developer/languages/c/odbc_tutorial.html
# Create target Table via Impala
impala-shell <<EOF
create table test (c1 int);
insert into test values (1);
EOF
# Package Installation
@azurecube
azurecube / odbc_impala.sh
Last active August 29, 2015 14:13
ODBC sample for Cloudera Impala
# This is tested on CDH 5.4/CentOS6.4
# C part is based on the samples from http://www.easysoft.com/developer/languages/c/odbc_tutorial.html
# Create target Table via Impala
impala-shell <<EOF
create table test (c1 int);
insert into test values (1);
EOF
# Package Installation
@azurecube
azurecube / cm_rest.sh
Created December 19, 2014 08:33
Install CDH with CM API using Local Parcel Repository
#!/bin/bash
# This script checked on CM5.2.1 and CDH5.2.1
# This assumes cm agents started up on each nodes
# Properties
CMNODE="node3.cloudera.com"
TARGET="node4.cloudera.com node3.cloudera.com"
CLUSTER="Cluster1"
ROOT_PASS="cloudera"
BASE=http://$CMNODE:7180/api/v8
#!/bin/bash
# This script checked on CM5.2.1 and CDH5.2.1
# Properties
CMNODE="node1.cloudera.com"
TARGET="node1.cloudera.com node2.cloudera.com node3.cloudera.com"
CLUSTER="Cluster1"
ROOT_PASS="cloudera"
BASE=http://$CMNODE:7180/api/v8
#!/bin/bash
#check oplion by command first character
op=$(echo $(basename $0 ) | cut -b 1)
# parent process list
plist=("$$")
# add parent processes
ppid() {
@azurecube
azurecube / script-fu-resize-export
Created November 5, 2012 15:40
Small Script-foo sample
(define (script-fu-resize-export img)
(let*
((filename (car (reverse (strbreakup (car (gimp-image-get-filename img)) "/"))))
(dirname (foldr (lambda (base elm) (string-append base elm "/")) "" (reverse (cdr (reverse (strbreakup (car (gimp-image-get-filename img)) "/"))))))
(drawable (car (gimp-image-get-active-layer img)))
(retouch (string-append dirname "retouch/" filename))
(resize (string-append dirname "retouch/" "resize/" filename)))
; (file-jpeg-save RUN-NONINTERACTIVE img drawable retouch retouch 1 0 1 0 "" 0 1 0 0)
(gimp-file-save RUN-NONINTERACTIVE img drawable retouch retouch)
(gimp-image-scale img (* 0.32 (car (gimp-image-width img))) (* 0.32 (car (gimp-image-height img))))
@azurecube
azurecube / shibuya-el-position-paper.md
Created September 5, 2012 07:03 — forked from ainame/shibuya-el-position-paper.md
shibuya.elのポジションペーパーです。githubアカウントをお持ちの方はforkしてお使いください。

Shibuya.el#1 ポジションペーパー

Personal

  • Twitter or Facebookのアカウント or HN等
    • @arte_nut (github:azurecube)

Work