Skip to content

Instantly share code, notes, and snippets.

View DrSnowbird's full-sized avatar
🏄‍♀️
Focusing

DrSnowbird DrSnowbird

🏄‍♀️
Focusing
View GitHub Profile
@DrSnowbird
DrSnowbird / docker-compose-install.sh
Last active December 16, 2018 02:05
docker-compose-install.sh
#!/bin/bash -x
# ref: https://docs.docker.com/compose/install/#install-compose
LATEST_VERSION=
function get_latest_release() {
REPO=${1:-docker}
COMPONENT=${2:-compose}
# basename `curl --silent https://github.com/docker/compose/releases/latest|cut -d'"' -f2`
LATEST_VERSION="$(basename `curl --silent https://github.com/${REPO}/${COMPONENT}/releases/latest|cut -d'"' -f2`)"
@DrSnowbird
DrSnowbird / findPort2Process.sh
Last active September 11, 2018 01:43
Linux Utility - find which process is using a specific port
#!/bin/bash
#### ------------------------- Use ----------------------------
#### To find our what PID/Process is binding to a specific port
#### ----------------------------------------------------------
if [ $# -lt 1 ]; then
echo "Usage: $0 <port-to-search-process>"
exit 1
fi
@DrSnowbird
DrSnowbird / Ambari-mpack-reinstall.sh
Last active September 10, 2018 14:56
Ambari mpack uninstall and install again
#!/bin/bash -x
# reinstall mpack
echo "step1: ambari-server stop"
sudo ambari-server stop
echo "step2: ambari-server uninstall-mpack --mpack-name=hdf-ambari-mpack --verbose"
sudo ambari-server uninstall-mpack --mpack-name=hdf-ambari-mpack --verbose
@DrSnowbird
DrSnowbird / automate-ambari-server-setup.exp
Created September 4, 2018 22:00
Automate Ambari Server install using Expect script
#!/usr/bin/expect --
## To use:
## expect -f ./automate-ambari-server-setup.exp
##
set timeout 300
spawn /usr/sbin/ambari-server setup
expect {
"Customize user account for ambari-server daemon " {
@DrSnowbird
DrSnowbird / Hadoop-Ambari-Query-scripts.sh
Last active September 8, 2018 18:48
Hadoop / Ambari REST scripts
#!/bin/bash -x
# ------------------------------------
# maintainer: [email protected]
# license: Apache License Version 2.0
# ------------------------------------
## -- change username and password and clustername according to yours --
#ambari_username=<ChangeMe>
@DrSnowbird
DrSnowbird / docker-ce-install-CentOS7.sh
Last active August 13, 2019 08:34
Docker-CE install over CentOS 7.x
#!/bin/bash -x
# maintainer [email protected]
# ref: https://docs.docker.com/install/linux/docker-ce/centos/#os-requirements
# Ref: https://docs.docker.com/install/linux/docker-ce/centos/#set-up-the-repository
# -- To Use Overlay2 driver or not: 1 (Yes), 0 (No) --
# -- Default 0 (NO): use default Docker setup, i.e., devicemapper loop (not for scaling!) --
OVERLAY2_DRIVER=${1:-0}
@DrSnowbird
DrSnowbird / docker-utilities.sh
Created August 21, 2018 23:23
Docker handy utilities
sudo docker rm -f $(dps -a|grep Exited|cut -d' ' -f1)
@DrSnowbird
DrSnowbird / python3.7-install-Ubuntu16.sh
Created August 16, 2018 18:06
Python3.7 installed to Ubuntu 16.04
# ref: https://serverfault.com/questions/918335/best-way-to-run-python-3-7-on-ubuntu-16-04-which-comes-with-python-3-5
# Install requirements
apt-get install -y build-essential
apt-get install -y checkinstall
apt-get install -y libreadline-gplv2-dev
apt-get install -y libncursesw5-dev
apt-get install -y libssl-dev
apt-get install -y libsqlite3-dev
apt-get install -y tk-dev
apt-get install -y libgdbm-dev
#!/bin/bash
# ------------------------------------
# maintainer: [email protected]
# license: Apache License Version 2.0
# ------------------------------------
if [ $# -lt 2 ]; then
echo "*** ERROR ***"
echo "... Need two input arguments ..."