Skip to content

Instantly share code, notes, and snippets.

View leonj1's full-sized avatar
💭
Coding on the brain

Jose M Leon leonj1

💭
Coding on the brain
View GitHub Profile
#!/bin/bash
sudo curl -sSL https://get.docker.com | sh
sudo usermod -aG docker $USER
# show the installed version
docker version
#!/bin/bash
# This is NOT for Raspberry Pi.
# For RasPi try a diff script in my gists
apt-get -y remove docker docker-engine docker.io
apt-get update
apt-get -y install \
apt-transport-https \
ca-certificates \
curl \
@leonj1
leonj1 / zook_grow.md
Created June 13, 2018 18:17 — forked from miketheman/zook_grow.md
Adding nodes to a ZooKeeper ensemble

Adding 2 nodes to an existing 3-node ZooKeeper ensemble without losing the Quorum

Since many deployments may start out with 3 nodes and so little is known about how to grow a cluster from 3 memebrs to 5 members without losing the existing Quorum, here is an example of how this might be achieved.

In this example, all 5 nodes will be running on the same Vagrant host for the purpose of illustration, running on distinct configurations (ports and data directories) without the actual load of clients.

YMMV. Caveat usufructuarius.

Step 1: Have a healthy 3-node ensemble

# setup Idea
export ANT_OPTS="-Xmx1024m -Xss1g"
ant idea
# build
cd /<source_root>/solr
ant ivy-bootstrap
ant compile
ant server
# verification
cd /bin
@leonj1
leonj1 / gist:05530441ed021461d787201e42602ef6
Created April 5, 2018 16:13 — forked from lttlrck/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
curl -O https://releases.hashicorp.com/vagrant/2.0.2/vagrant_2.0.2_x86_64.deb
curl -O https://releases.hashicorp.com/vagrant/2.0.2/vagrant_2.0.2_SHA256SUMS
curl -O https://releases.hashicorp.com/vagrant/2.0.2/vagrant_2.0.2_SHA256SUMS.sig
curl -sS https://keybase.io/hashicorp/key.asc | gpg --import
gpg --verify vagrant_2.0.2_SHA256SUMS.sig vagrant_2.0.2_SHA256SUMS
shasum -a 256 -c <(cat vagrant_2.0.2_SHA256SUMS | grep 64.deb) -s
sudo apt install ./vagrant_2.0.2_x86_64.deb

Flexvolume notes

  • Steps takes to attempt to get FlexVolume working in Kubernetes 1.6.6, 1.7.1, and 1.7.4
  • Test performed in Vagrant with 1 node (w1)

Environment

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.6", GitCommit:"7fa1c1756d8bc963f1a389f4a6937dc71f08ada2", GitTreeState:"clean", BuildDate:"2017-06-16T18:34:20Z", GoVersion:"go1.7.6", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.6", GitCommit:"7fa1c1756d8bc963f1a389f4a6937dc71f08ada2", GitTreeState:"clean", BuildDate:"2017-06-16T18:21:54Z", GoVersion:"go1.7.6", Compiler:"gc", Platform:"linux/amd64"}
@leonj1
leonj1 / install_go_in_raspi.txt
Last active August 20, 2017 14:15
How to install Go and ffmpeg in Raspberry Pi
mkdir -p /tmp/go
cd /tmp/go
wget https://storage.googleapis.com/golang/go1.8.3.linux-armv6l.tar.gz
sudo tar -C /usr/local -xzf go1.8.3.linux-armv6l.tar.gz
export PATH=$PATH:/usr/local/go/bin
echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.profile
. ~/.profile
mkdir -p ~/go/src
mkdir -p ~/go/bin
@leonj1
leonj1 / steps.txt
Created August 19, 2017 01:45
How I create a Certificate for REST endpoints and import into Java Keystore
# Create cert and store
openssl genrsa -out server.key 2048
openssl rsa -in server.key -out server.key
openssl req -sha256 -new -key server.key -out server.csr -subj '/CN=localhost'
openssl x509 -req -sha256 -days 365 -in server.csr -signkey server.key -out localhost.crt
# convert to pkcs12, and then convert to Java keystore
openssl pkcs12 -export -in localhost.crt -inkey server.key -out server.p12 -name localhost -CAfile ca.crt -caname root
keytool -importkeystore -deststorepass changeit -destkeypass changeit -destkeystore keystore.jks -srckeystore server.p12 -srcstoretype PKCS12 -srcstorepass changeit -alias localhost