Skip to content

Instantly share code, notes, and snippets.

@smijar
smijar / osx-port-listening.md
Created April 23, 2020 04:54
OS X process on which port
lsof -iTCP -sTCP:LISTEN -n -P
# utility function
listening() {
    if [ $# -eq 0 ]; then
        sudo lsof -iTCP -sTCP:LISTEN -n -P
 elif [ $# -eq 1 ]; then
@smijar
smijar / k3d-install-dashboard.md
Created April 22, 2020 00:50
k3d-install-dashboard

ref

https://rancher.com/docs/k3s/latest/en/installation/kube-dashboard/

install

Deploying the Kubernetes Dashboard

GITHUB_URL=https://github.com/kubernetes/dashboard/releases
VERSION_KUBE_DASHBOARD=$(curl -w '%{url_effective}' -I -L -s -S ${GITHUB_URL}/latest -o /dev/null | sed -e 's|.*/||')
kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/${VERSION_KUBE_DASHBOARD}/aio/deploy/recommended.yaml
@smijar
smijar / k3d-ingress-nport-demo.md
Last active April 22, 2020 00:51
k3d ingress and nodeport demos
@smijar
smijar / k3d-lb-demo.md
Last active July 13, 2023 01:14
k3d loadbalancer demo
@smijar
smijar / k3d-create-cluster-no-traefik.sh
Last active March 27, 2025 17:14
k3d create cluster without traefik and serverlb
# Possibly obsolete: k3d create --name testcls1 --workers 3
k3d create --name testcls1 --workers 3 --server-arg "--no-deploy=traefik" --server-arg "--no-deploy=servicelb"
# UPDATE: in newer versions onwards, this has evolved to (thanks to comments below):
k3d cluster create --k3s-arg "--no-deploy=traefik@server:*"
@smijar
smijar / spark-pyspark-jupyter-osx.txt
Created July 26, 2017 18:49
Install spark jupyter for pyspark
# On OS X
$ vi ~/.bash_profile
# Add following for running spark, pyspark, jupyter
#-----
# FOR SPARK
#-----
#
# for PYSPARK
@smijar
smijar / python-ml-osx-packages.txt
Last active July 21, 2017 19:34
Installing python ML packages in a virtual environment on OS X
brew install numpy
brew install scipy
brew install matplotlib
---
*VirtualEnv*
$ mkvirtualenv ml
$ cd .virtualenvs/ml/
$ ln -s /usr/local/lib/python2.7/site-packages/{numpy,scipy}* lib/python2.7/site-packages/
$ workon ml
(ml) $ pip freeze | grep -i numpy
@smijar
smijar / using-slappasswd
Last active October 16, 2018 13:06
using slappasswd to generate SSHA password for ldap
slappasswd -h {SSHA} -s password
@smijar
smijar / new_gist_file_0
Created May 22, 2017 19:39
bash echo date with time
echo `date "+%Y-%m-%d-%H-%M-%S"`
# outptut - 2017-05-22-14-38-18
@smijar
smijar / install-nginx-centos7.snippets
Last active May 25, 2017 18:39
Installing nginx on centos 7
# from https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-centos-7
sudo yum install epel-release
sudo yum update
sudo yum install nginx
# start nginx
sudo systemctl start nginx
# If you are running a firewall, run the following commands to allow HTTP and HTTPS traffic: