Skip to content

Instantly share code, notes, and snippets.

How I can see the used space / free space on a compute node with local storage?
vgdisplay cinder-volumes
or
pvdisplay
@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:
@smijar
smijar / get-ip-of-docker-bridge.snippets
Last active May 25, 2017 18:40
get gateway ip of docker bridge
export INTERNAL_DOCKER_HOST="tcp://$(docker run --rm busybox ip route show | grep ^default | cut -f3 -d ' '):2375"
@smijar
smijar / docker-connect-to-host.snippets
Last active May 25, 2017 18:40
This gist provides a way to connect to a docker host
# provide an alias to the host local loopback
sudo ifconfig lo0 alias 172.20.123.1
# check alias
ifconfig|more
# ping alias from within docker
docker run -it --rm busybox ping 172.20.123.1
# check that the host services are accessible from the aliased IP
# To disable firewalld, run the following command as root:
systemctl disable firewalld
# To stop firewalld, run the following command as root:
systemctl stop firewalld
# start firewalld
systemctl start firewalld
# status
rsync -avz --exclude ./docker-volumes . <user>@<ip-address>:/user/<remote-folder>/
@smijar
smijar / docker-compose-recreate-images.snippets
Last active May 25, 2017 18:41
Forces docker compose to recreate images for its components
docker-compose up --force-recreate
@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 / 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