Skip to content

Instantly share code, notes, and snippets.

View dstreev's full-sized avatar

David W. Streever dstreev

  • Cloudera
  • Atlanta, GA
View GitHub Profile
@mresetar
mresetar / readMail.groovy
Created January 29, 2012 15:21
Read e-mail Groovy script
import javax.mail.*;
import javax.mail.internet.*;
@GrabConfig(systemClassLoader=true)
@Grapes(
@Grab(group='javax.mail', module='mail', version='1.4.4')
)
// setup connection
Properties props = new Properties();
def host = "localhost";
@randerzander
randerzander / control.sh
Last active November 22, 2022 11:54
Ambari Service Start/Stop script
USER='admin'
PASS='admin'
CLUSTER='dev'
HOST=$(hostname -f):8080
function start(){
curl -u $USER:$PASS -i -H 'X-Requested-By: ambari' -X PUT -d \
'{"RequestInfo": {"context" :"Start '"$1"' via REST"}, "Body": {"ServiceInfo": {"state": "STARTED"}}}' \
http://$HOST/api/v1/clusters/$CLUSTER/services/$1
}
@rajkrrsingh
rajkrrsingh / KNOX over HS2 HA
Last active June 26, 2020 08:28
steps to configure KNOX over HiveServer2 HA on HDP-2.5
1. under Ambari-> knox -> Advanced topologies
2. add following snippet in advanced topologies
<provider>
<role>ha</role>
<name>HaProvider</name>
<enabled>true</enabled>
<param>
<name>HIVE</name>