Skip to content

Instantly share code, notes, and snippets.

@smijar
smijar / TestSSLClientMutualAuth.java
Last active December 22, 2021 06:04
Test SSL Client in java using mutual authentication.
import java.io.File;
import java.io.FileInputStream;
import java.io.StringWriter;
import java.security.KeyStore;
import javax.net.ssl.SSLContext;
import org.apache.commons.io.IOUtils;
import org.apache.http.HttpEntity;
@smijar
smijar / centos7-eth0-steps.snippets
Last active December 10, 2021 02:32
Steps on how to rename Centos 7 ethnxxxx interface to eth0
centos 7 setup-rename NIC to eth0
http://ask.xmodulo.com/change-network-interface-name-centos7.html
- This is achieved by editing /etc/default/grub and adding "net.ifnames=0" to GRUB_CMDLINE_LINUX variable.
- Then run this command to regenerate GRUB configuration with updated kernel parameters.
$ sudo grub2-mkconfig -o /boot/grub2/grub.cfg
- cat /sys/class/net/*/address
@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
@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 / 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
rsync -avz --exclude ./docker-volumes . <user>@<ip-address>:/user/<remote-folder>/
# 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
How I can see the used space / free space on a compute node with local storage?
vgdisplay cinder-volumes
or
pvdisplay
@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
@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"