Skip to content

Instantly share code, notes, and snippets.

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

DrSnowbird DrSnowbird

🏄‍♀️
Focusing
View GitHub Profile
#!/bin/bash
## references:
## 1.) https://www.digitalocean.com/community/tutorials/openssl-essentials-working-with-ssl-certificates-private-keys-and-csrs
function usage() {
if [ $# -lt 1 ]; then
echo "----------------------------------------------------------------------"
echo "---------------------------- USAGE -----------------------------------"
echo "----------------------------------------------------------------------"
@DrSnowbird
DrSnowbird / generate-Docker-CA-cert-server-client-cert.sh
Created July 25, 2018 22:24
generate-Docker-CA-cert-server-client-cert
#!/bin/bash -x
# ref: https://docs.docker.com/engine/security/https/
mkdir CA-server-client-keys
cd CA-server-client-keys/
## Create a CA, server and client keys with OpenSSL
## ----------------------------------------------------------------------------
#
# example1-volume.yaml
#
- hosts: localhost
tasks:
- name: check if myvolume exists
command: docker volume inspect myvolume
register: myvolume_exists
failed_when: false
@DrSnowbird
DrSnowbird / global-replace.sh
Last active August 23, 2018 21:37
To search and replace for any matched pattern in the current directory including all the sub-directory.
#!/bin/bash -x
## Note: this script has dependency on "ack" utility.
if [ $# -lt 2 ]; then
echo "--------- Synopsis--------"
echo "Synopsis: Globally replace an old pattern withe a new text string for all directories given"
echo "Usage: $0 <old_pattern> <new_text> [directory, default: ./]"
echo "e.g."
echo " $0 '=logging\/' '/root/logging_files\/' /home/ec2-user/all/ansible/roles"
# Create a deployment
kubectl run hello-minikube --image=gcr.io/google_containers/echoserver:1.4 --port=8080
# Create a service
kubectl expose deployment hello-minikube --type=NodePort
# List the pods
kubectl get pod
# List the service
#!/bin/bash
# ------------------------------------
# maintainer: DrSnowbird@openkbs.org
# license: Apache License Version 2.0
# ------------------------------------
if [ $# -lt 2 ]; then
echo "*** ERROR ***"
echo "... Need two input arguments ..."
@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
@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 / docker-ce-install-CentOS7.sh
Last active August 13, 2019 08:34
Docker-CE install over CentOS 7.x
#!/bin/bash -x
# maintainer DrSnowbird@gmail.com
# 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 / ozone-userful-links.md
Created August 24, 2018 20:53
Ozone-useful links