Skip to content

Instantly share code, notes, and snippets.

Petr Ruzicka ruzickap

Block or report user

Report or block ruzickap

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
ruzickap /
Created Mar 14, 2018
Simple script for setting Description + Title into JPEG-Exif/Raw-XMP photos
#!/bin/bash -eux
SUBJECT_KEYWORDS="active, adventure, backpack, backpacker"
DESCRIPTION="My description"
TITLE="My title"
AUTHOR="Petr Ruzicka <>"
ruzickap /
Last active May 7, 2019
Create Vagrant lab environment with 3 separated networks with 3 VMs running MAAS and building 2 UEFI based VMs
# Install Vagrant and virsh command
dnf install -y libvirt-client vagrant-hostmanager vagrant-libvirt
# Allow to manage VMs via libvirt remotely (using TCP connection)
cat >> /etc/libvirt/libvirtd.conf << EOF
listen_tls = 0
listen_tcp = 1
listen_addr = ""
auth_tcp = "none"
ruzickap /
Last active May 16, 2019
Quick and Dirty script building Windows using Packer + Ansible + WinRM on QEMU (libvirt)
#!/bin/bash -x
mkdir test
cd test
curl | sed '/.*Microsoft-Windows-PnpCustomizationsWinPE.*/,/component>/d' > Autounattend.xml
wget -c
test -f packer || ( wget && unzip && rm )
ruzickap /
Last active Dec 1, 2017
kubectl commands + outputs on empty cluster build by Kubespray
root@kube01:~# kubectl get nodes
kube01 Ready master,node 7m v1.8.3+coreos.0
kube02 Ready master,node 7m v1.8.3+coreos.0
kube03 Ready node 7m v1.8.3+coreos.0
kube04 Ready node 7m v1.8.3+coreos.0
root@kube01:~# kubectl get componentstatuses
ruzickap /
Last active Apr 28, 2019
Create Kubernetes Cluster using Kubespray
# Create Virtual env for Kubespray and make it active
virtualenv --system-site-packages kubespray_virtenv
source kubespray_virtenv/bin/activate
# Install Ansible and Kubespray to virtualenv
pip install kubespray
# Create kubespray config file
cat > ~/.kubespray.yml << EOF
kubespray_git_repo: ""
ruzickap /
Last active Feb 23, 2018
Install Vagrant + libvirt and create Vagrantfile ale to run 3 VMs in KVM hypervisor
# Install Vagrant libvirt plugin (with all the dependencies like qemu, libvirt, vagrant, ...)
dnf install -y -q ansible git libvirt-client libvirt-nss python-netaddr python-virtualenv vagrant-libvirt
vagrant plugin install vagrant-libvirt
# Enable dns resolution of VMs taken from libvirt (
sed -i.orig 's/files dns myhostname/files libvirt libvirt_guest dns myhostname/' /etc/nsswitch.conf
# Start the libvirt daemon
service libvirtd start
ruzickap /
Last active Apr 30, 2019
Mount the virtio-win iso and run Packer
export VIRTIO_WIN_ISO_DIR=$(mktemp -d --suffix=_virtio-win-iso)
export NAME=windows-server-2016-standard-x64-eval
export WINDOWS_TYPE=server
export TMPDIR="/var/tmp/"
cd /var/tmp/packer_windows-server-2016-eval
# Download and mount virtio-win to provide basic virtio Windows drivers
wget -c
ruzickap /
Last active Apr 30, 2019
Create Packer template and Autounattended file for Windows Server 2016 Eval + download few helper scrips
# Prepare directory structure
mkdir -p /var/tmp/packer_windows-server-2016-eval/{scripts/win-common,http/windows-server-2016,ansible}
cd /var/tmp/packer_windows-server-2016-eval
# Download Autounattended file for Windows Server 2016 Evaluation
wget -c -P http/windows-server-2016
# Create some basic Ansible playbook for Windows provisioning
cat > ansible/win.yml << EOF
ruzickap /
Last active Dec 15, 2017
Install Packer with WinRM communicator / Ansible / Qemu and enable Packer's Winrm communicator in Fedora
# Install necessary packages
dnf install -y -q ansible qemu-img qemu-kvm wget unzip
# Download and unpack Packer
cd /tmp
unzip packer*.zip
# Use packerio as a binary name, because packer binary already exists in fedora : /usr/sbin/packer as part of cracklib-dicts package
mv packer /usr/local/bin/packerio
ruzickap /
Created Oct 23, 2017
Vagrant using KVM with WinRM installation in Fedora
# Uninstall Vagrant delivered in Fedora
dnf remove vagrant
# Install Vagrant from oficial rpm which has WinRM included
dnf install
# Install libvirt/KVM plugin ( for vagrant
vagrant plugin install vagrant-libvirt
You can’t perform that action at this time.