Skip to content

Instantly share code, notes, and snippets.

@smijar
smijar / install-mongodb-on-centos7.snippets
Last active September 22, 2020 05:35
Installing mongodb on centos 7
# from:https://quicktechnotes.wordpress.com/2017/01/02/how-to-install-mongodb-elasticsearch-and-graylog-on-centos-7/
# Install EPEL
sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum -y install pwgen
sudo yum -y update
# Add mongodb repo.
sudo vi /etc/yum.repos.d/mongodb-org-3.2.repo
@smijar
smijar / install-jdk-on-centos.snippets
Last active January 20, 2024 02:40
Installing JDK 7 or 8 on centos 7/8
# from https://www.digitalocean.com/community/tutorials/how-to-install-java-on-centos-and-fedora
# JDK 7
#------
# Change to your home directory and download the Oracle Java 7 JDK RPM with these commands:
cd ~
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.rpm"
# Then install the RPM with this yum command (if you downloaded a different release, substitute the filename here):
sudo yum localinstall jdk-7u79-linux-x64.rpm
@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
How I can see the used space / free space on a compute node with local storage?
vgdisplay cinder-volumes
or
pvdisplay
# 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 / install-pip-on-centos7.snippets
Last active July 24, 2022 13:24
install python-pip on Centos 7 minimal
# install epel-release on centos
yum -y install epel-release
yum -y update
# install python-pip from epel
yum -y install python-pip
# Verify using:
pip -V
@smijar
smijar / install-docker-on-centos7.snippets
Last active February 19, 2018 21:20
Installing docker-ce on Centos7 minimal
yum update
https://docs.docker.com/engine/installation/linux/centos/
yum install -y yum-utils
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum makecache fast
yum install docker-ce
docker