start new:
tmux
start new with session name:
tmux new -s myname
| #Install R and then following packages | |
| #repr failed to create | |
| yum install R-* | |
| install.packages("evaluate", dependencies = TRUE) | |
| install.packages("base64enc", dependencies = TRUE) | |
| install.packages("devtools", dependencies = TRUE) | |
| install_github('IRkernel/repr') | |
| install.packages("dplyr", dependencies = TRUE) | |
| install.packages("caret", dependencies = TRUE) | |
| install.packages("repr", dependencies = TRUE) |
| /* Expected exposure is the expected (average) credit exposure conditional on positive market values */ | |
| def expectedExposure(marketValues: Seq[Double]): Double = { | |
| val exposures = marketValues.filter(_ > 0f) | |
| if (exposures.size == 0) 0.0 | |
| else exposures.sum / exposures.size | |
| } | |
| /* A high percentile (95%) of the distribution of exposures at any particular future date. Also called Peak Exposure (PE) */ | |
| def potentialFutureExposure(marketValues: Seq[Double], confidenceLevel: Double): Double = { | |
| val exposures = marketValues.filter(_ > 0) |
| #!/bin/bash | |
| set -o nounset | |
| set -o errexit | |
| set -o pipefail | |
| TSDB_CMD=$( /usr/bin/which tsdb ) | |
| START_TIME="1y-ago" | |
| END_TIME="21d-ago" | |
| SLEEP=10 |
| #!/bin/bash | |
| set -o nounset | |
| set -o errexit | |
| set -o pipefail | |
| EXTRA_TAGS=${1} | |
| TSDB_CMD=$( /usr/bin/which tsdb ) | |
| START_TIME="1y-ago" | |
| END_TIME="45d-ago" |
| #!/usr/bin/env bash | |
| #Author: Ashrith | |
| #Arrays to store hosts and their regionsOnLine respectively | |
| declare -a HOSTS_ARRAY | |
| declare -a REGIONS_ARRAY | |
| message="" | |
| EXIT_STATUS=0 |
| #!/usr/bin/python | |
| import boto, json | |
| from boto.s3.connection import S3Connection | |
| from boto.gs.connection import GSConnection | |
| def compare_buckets(bucket_one_bucket_name, | |
| bucket_two_bucket_name, | |
| bucket_one_access_key_id, |
| --get running applications | |
| http://seregion02.cloud.hortonworks.com:8088/ws/v1/cluster/apps?states=accepted,running | |
| --get dag id for counters and callerId (hive session) for hive details | |
| http://seregion02.cloud.hortonworks.com:8188/ws/v1/timeline/TEZ_DAG_ID?limit=1000&primaryFilter=applicationId%3Aapplication_1458195563211_0034 | |
| --get counters on the fly | |
| http://seregion02.cloud.hortonworks.com:8088/proxy/application_1458195563211_0034/ws/v2/tez/verticesInfo?dagID=2&counters=org.apache.tez.common.counters.FileSystemCounter%2FHDFS_BYTES_WRITTEN%2CHDFS_BYTES_READ%3Borg.apache.tez.common.counters.TaskCounter%2FNUM_SPECULATIONS%2CREDUCE_INPUT_GROUPS | |
| http://seregion02.cloud.hortonworks.com:8088/proxy/application_1458195563211_0034/ws/v2/tez/verticesInfo?dagID=3&counters=* |
| #!/usr/bin/env bash | |
| apt_wait () { | |
| while sudo fuser /var/lib/dpkg/lock >/dev/null 2>&1 ; do | |
| sleep 1 | |
| done | |
| while sudo fuser /var/lib/apt/lists/lock >/dev/null 2>&1 ; do | |
| sleep 1 | |
| done | |
| if [ -f /var/log/unattended-upgrades/unattended-upgrades.log ]; then |
| #!/bin/bash | |
| # bash generate random alphanumeric string | |
| # | |
| # bash generate random 32 character alphanumeric string (upper and lowercase) and | |
| NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
| # bash generate random 32 character alphanumeric string (lowercase only) | |
| cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1 |