K8s on Ubuntu

1. Install using snap and proxy: neu.lu/2016/06/ubuntu-snap-mit-proxy/ 2. sudo snap install conjure-up –classic 3. sudo snap install kubectl –classic 4. sudo apt-get update && apt-get install -y apt-transport-https 5. apt-get update && apt-get install -y apt-transport-https curl -s packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add – cat </etc/apt/sources.list.d/kubernetes.list deb apt.kubernetes.io/ kubernetes-xenial main EOF apt-get update apt-get install -y kubelet kubeadm kubectl 6. export KUBECONFIG=/etc/kubernetes/admin.conf als root

Secure Kibana with basic_auth and nginx

If you don’t have the money to afford x-pack, but you want to secure your Kibana at least with basic authentication using nginx, the following entries in default.conf. The target is a kibana instance within the same Docker swarm network.

location /app/kibana {
auth_basic "Restricted Content"; auth_basic_user_file "/etc/nginx/.htpasswd"; proxy_pass kibana:5601/app/kibana;
}
location /app/timelion {
auth_basic "Restricted Content"; auth_basic_user_file "/etc/nginx/.htpasswd"; proxy_pass kibana:5601/app/timelion;
}
location /bundles {
auth_basic "Restricted Content"; auth_basic_user_file "/etc/nginx/.htpasswd"; proxy_pass kibana:5601/bundles;
}
location /ui {
auth_basic "Restricted Content"; auth_basic_user_file "/etc/nginx/.htpasswd"; proxy_pass kibana:5601/ui;
}
location /plugins {
auth_basic "Restricted Content"; auth_basic_user_file "/etc/nginx/.htpasswd"; proxy_pass kibana:5601/plugins;
}
location /api/console {
auth_basic "Restricted Content"; auth_basic_user_file "/etc/nginx/.htpasswd"; proxy_pass kibana:5601/api/console;
}
location /api/status {
auth_basic "Restricted Content"; auth_basic_user_file "/etc/nginx/.htpasswd"; proxy_pass kibana:5601/api/status;
}
location /status {
auth_basic "Restricted Content"; auth_basic_user_file "/etc/nginx/.htpasswd"; proxy_pass kibana:5601/status;
}
location ~* /api/(.*)$ {
auth_basic "Restricted Content"; auth_basic_user_file "/etc/nginx/.htpasswd"; proxy_pass kibana:5601/api/$1$is_args$args;
}
location ~* /elasticsearch/(.*)$ {
auth_basic "Restricted Content"; auth_basic_user_file "/etc/nginx/.htpasswd"; proxy_pass kibana:5601/elasticsearch/$1$is_args$args;
}

Set JAVA_HOME on Mac OS

Props to: coderwall.com/p/esa4sg/set-default-jdk-on-mac-os-x
To set to JDK 6


export JAVA_HOME=$(/usr/libexec/java_home -v 1.6) To set JDK 7
export JAVA_HOME=$(/usr/libexec/java_home -v 1.7) To set JDK 8
export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)
Created aliases for my zsh
alias setjdk16='export JAVA_HOME=$(/usr/libexec/java_home -v 1.6)' alias setjdk17='export JAVA_HOME=$(/usr/libexec/java_home -v 1.7)' alias setjdk18='export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)'