This file contains hidden or 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 | |
#DOCKER_VERSION=18.06.1~ce~3-0~ubuntu | |
COMPOSE_VERSION=1.23.2 | |
# TOOLS | |
sudo apt-get -y install curl wget make jq git make tree htop conntrack bash-completion build-essential python-pip python-virtualenv rsync unzip apache2-utils | |
# DOCKER ENGINE | |
sudo groupadd -f docker |
This file contains hidden or 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
improve... | |
--------- | |
-A INPUT -p tcp -m tcp --dport 20 -j ACCEPT | |
-A INPUT -p tcp -m tcp --dport 21 -j ACCEPT | |
# -A INPUT -p tcp -m tcp --dport 990 -j ACCEPT | |
-A INPUT -p tcp -m multiport --dports $MIN_PORT:$MAX_PORT -j ACCEPT | |
--------- |
This file contains hidden or 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 | |
URL=$2 # http://localhost:8888 | |
FILENAME=$3 # dashboard.json | |
if [ $1 == "export" ]; then | |
curl -i -X GET $URL/chronograf/v1/dashboards > $FILENAME | |
elif [ $1 == "import" ]; then | |
curl -i -X POST -H "Content-Type: application/json" $URL/chronograf/v1/dashboards -d @$FILENAME | |
else |
This file contains hidden or 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 | |
: ' | |
USAGE: | |
wget -O - <URL> | \ | |
bash -s <kubectl namespace> <secret name> <docker hub username> <docker hub password> <docker hub email> | |
' | |
NS=$1 | |
SNAME=$2 |
This file contains hidden or 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 | |
: ' | |
We'll see... | |
* Pod replicas | |
* Helm: The Kubernetes Package Manager | |
* Ingress resource: Exposes HTTP and HTTPS routes from outside the cluster to services within the cluster. | |
' | |
NS_HELLO=hello |
This file contains hidden or 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 | |
DB_HOST=$1 | |
DB_NAME=$2 | |
DB_USER=$3 | |
DB_PASS=$4 | |
psql "sslmode=verify-ca sslrootcert=server-ca.pem sslcert=client-cert.pem sslkey=client-key.pem hostaddr=$DB_HOST port=5432 user=postgres" << EOF | |
CREATE DATABASE $DB_NAME ; | |
CREATE USER $DB_USER WITH ENCRYPTED PASSWORD '$DB_PASS' ; |
This file contains hidden or 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 | |
echo | |
echo ">>>>>>>>>>>>>>>>> OS" | |
echo COMMAND: lsb_release -d | |
lsb_release -d | |
echo | |
echo ">>>>>>>>>>>>>>>>> CPU" | |
echo COMMAND: grep -c ^processor /proc/cpuinfo |
This file contains hidden or 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 | |
: ' | |
From root or sudoer user... | |
USAGE: | |
wget -O - URL | bash -s USERNAME | |
' | |
USERNAME=$1 | |
LOCATION=/home/$USERNAME |
This file contains hidden or 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
# split panes using | and -, make sure they open in the same path | |
bind | split-window -h -c "#{pane_current_path}" | |
bind - split-window -v -c "#{pane_current_path}" | |
unbind '"' | |
unbind % | |
# To enable mouse scroll in tmux pane | |
set -g mouse on | |
# Tmux to support colors |
This file contains hidden or 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 | |
LOGS_FOLDER=$1 | |
FILENAME=$2 | |
DEST_FOLDER=/etc/logrotate.d | |
cat << EOF > $DEST_FOLDER/$FILENAME | |
$LOGS_FOLDER/*.log { | |
rotate 7 | |
size 100M |