This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
#get-cmpasswd.sh | |
# password for amon, smon, hmon, rman, nav, scm | |
cat /etc/cloudera-scm-server/db*.properties | sed '/^#/ d' | |
# password for cloudera-scm | |
head -1 /var/lib/cloudera-scm-server-db/data/generated_password.txt | |
# password for hive | |
psql -U scm -W scm -h localhost -p 7432 -c "select attr,value from configs where attr like 'hive_metastore_database%' order by revision_id DESC limit 5;" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
This script is supposed to be exported as "run only" | |
and crontabed | |
You must have a "WORKING_PLACE" category in Outlook | |
It'll simply ask you the location of working for today | |
and add a fullday event to your calendar | |
*) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} | |
function startWait(){ | |
curl -s -u $user:$pass -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Licensed to the Apache Software Foundation (ASF) under one | |
# or more contributor license agreements. See the NOTICE file | |
# distributed with this work for additional information | |
# regarding copyright ownership. The ASF licenses this file | |
# to you under the Apache License, Version 2.0 (the | |
# "License"); you may not use this file except in compliance | |
# with the License. You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# You must accept the Oracle Binary Code License | |
# http://www.oracle.com/technetwork/java/javase/terms/license/index.html | |
# usage: get_jdk.sh <jdk_version> <ext> | |
# jdk_version: 8(default) or 9 | |
# ext: rpm or tar.gz | |
jdk_version=${1:-8} | |
ext=${2:-rpm} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
"""a simple sensor data generator""" | |
import json | |
import time | |
import random | |
interval_secs = 500 / 1000.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create database if not exists tpcds_10_text; | |
use tpcds_10_text; | |
-- Table<store_sales (23 cols) partition=ss_sold_date_sk> | |
drop table if exists store_sales; | |
create external table if not exists store_sales( ss_sold_date_sk bigint | |
, ss_sold_time_sk bigint | |
, ss_item_sk bigint | |
, ss_customer_sk bigint | |
, ss_cdemo_sk bigint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with | |
ctr_ttl_rtrn_tbl as ( | |
select | |
sr_customer_sk as ctr_customer_sk, | |
sr_store_sk as ctr_store_sk, | |
sum(SR_FEE) as ctr_ttl_rtrn | |
from | |
store_returns, | |
date_dim | |
where |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
c.c_customer_id, | |
c.c_first_name, | |
c.c_last_name, | |
d.d_moy, | |
d.d_year, | |
SUM(s.sales_amount) AS total_sales | |
FROM | |
( | |
SELECT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
i_item_id, | |
AVG(ss_quantity) AS agg1, | |
AVG(ss_list_price) AS agg2, | |
AVG(ss_coupon_amt) AS agg3, | |
AVG(ss_sales_price AS agg4 | |
FROM | |
stor_sales | |
JOIN customer_demographics ON ss_cdemo_sk = cd_demo_sk | |
JOIN date_dim ON ss_sold_date_sk = d_date_sk |