Skip to content

Instantly share code, notes, and snippets.

View prb112's full-sized avatar

Paul Bastide prb112

View GitHub Profile
@prb112
prb112 / configuration-map-krb.json
Created June 10, 2019 17:24
Port forwarding for Zookeeper (to 5 remote hosts behind a firewall)
{
"88" : {
"auth-1" : 8088
}
}
package demo.kerberos;
import javax.security.auth.*;
import javax.security.auth.login.*;
import javax.security.auth.callback.*;
import javax.security.auth.kerberos.*;
import java.io.*;
public class App {
public static void main(String[] args) {
curl -k -X GET -H "Content-type:application/json" "http://<kms-node>:16000/kms/v1/keyversion/<key-version>/_eek?ee_op=decrypt&user.name=hdfs" -v
@prb112
prb112 / liquibase-change-log.sh
Created July 7, 2018 12:02
Dump Change Log in Liquibase
[PEM@db db2-updater]$ bin/tool/liquibase/liquibase --changeLogFile=`pwd`/bin/tool/liquibase/masterchangelog.xml --username=usernameXYZ --password=XYZPASS --url=jdbc:db2:DBP changelogSyncSQL
Liquibase Home: /home/myhomedir/db2-updater/bin/tool/liquibase
-- *********************************************************************
-- SQL to add all changesets to database history table
-- *********************************************************************
-- Change Log: /home/myhomedir/db2-updater/bin/tool/liquibase/masterchangelog.xml
-- Ran at: 7/6/18 3:43 PM
-- Against: XYZ@jdbc:db2:DBP
-- Liquibase version: 3.5.3
-- *********************************************************************
@prb112
prb112 / server.xml
Created May 13, 2017 12:01
Server DataSource Server Demonstration
<server description="Database Server Demonstration ">
<featureManager>
<feature>webProfile-7.0</feature>
<feature>localConnector-1.0</feature>
</featureManager>
<httpEndpoint host="*" httpPort="9080" httpsPort="9443"
id="defaultHttpEndpoint" />
<applicationManager autoExpand="true" />
@prb112
prb112 / restartAllTasks.sh
Created May 13, 2017 11:41
Restart all tasks for a given cluster in Ambari
#!/bin/bash
#https://cwiki.apache.org/confluence/display/AMBARI/Add+a+host+and+deploy+components+using+APIs
CLUSTER=cluster
IP=localhost
curl -H 'X-Requested-By: ambari' --user admin:admin -i -X GET http://${IP}:8080/api/v1/clusters/${CLUSTER}/hosts -o /tmp/hosts.txt
for host in `cat /tmp/hosts.txt | grep -i host_name | awk '{print $NF}' | sed 's|"||g'`
@prb112
prb112 / log4j.properties
Created January 18, 2017 00:47
Phoenix logging
log4j.rootLogger=TRACE, A1
log4j.appender.A1=org.apache.log4j.RollingFileAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.maxFileSize=100GB
log4j.appender.A1.File=/tmp/phoenix-query.log
# Print the date in ISO 8601 format
log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
#Adding properties to dump the SQL into the log file
CREATE DATABASE MODULE Test2_Database
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
SET Environment.Variables =
THE (SELECT T.* FROM Database.EMP AS T);
RETURN TRUE;
END;
END MODULE;
CREATE COMPUTE MODULE CreateData_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
DECLARE Source CHARACTER 'Production' ;
DECLARE DBSchema CHARACTER 'DB2ADMIN';
DECLARE Table CHARACTER 'EMPLOYEE';
SET OutputRoot = InputRoot;
DECLARE EMPNO1 REFERENCE TO InputRoot.JSON.Data.EMPNO;
@prb112
prb112 / enumeration.yaml
Created September 4, 2015 00:30
Example of a Swagger Enumeration in YAML
#YAML Demonstration
swagger: '2.0'
info:
title: Demonstration of Swagger Yaml with Enumeration
description: Simple Demonstration of Enumeration
version: "1.0.0"
host: api.bastide.org
schemes:
- https
basePath: /1