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 / aws_create_site.yml
Created Feb 16, 2017
Ansible playbook which creates instances and tag volumes
View aws_create_site.yml
- name: Create Instance in AWS
hosts: localhost
connection: local
gather_facts: false
aws_access_key: "xxxxxx"
aws_secret_key: "xxxxxx"
security_token: "xxxxxx"
ruzickap / git-repository-gpg-crypt
Created Nov 1, 2019
Make git repository encrypted with generated GPG key which can be used by CI/CD to access the git repo when using GitHub Actions
View git-repository-gpg-crypt
# Make sure you are using gpg2
git config --global gpg.program gpg2
# Clone empty repository
git clone
# Configure a repository to use git-crypt
cd terraform-gitops
git-crypt init
# Connect to PostgreSQL database internally
kubectl run -i --tty --rm psql --image=postgres --env "PGPASSWORD=user_password" --command -- \
psql -U myuser -h patroni.patroni.svc.cluster.local my_database
# Port forwarding to service
kubectl port-forward -n harbor service/harbor 8080:443
ruzickap /
Last active Aug 27, 2019
Decode RAW files form camera using darktable-cli + XMP to JPEG
#!/bin/bash -eu
for XMP_FILE in *.xmp; do
RAW_FILE=`awk -F \" '/xmpMM:DerivedFrom=/ { print $2 }' $XMP_FILE`
echo "*** $XMP_FILE [$RAW_FILE] [$FILE_NAME]"
if [ "$RAW_FILE_NAME" != "$RAW_FILE" ]; then
ruzickap /
Created Sep 27, 2014
OVFTool installation on ESXi
#Download OVF tools
wget -q -O /vmfs/volumes/My_Datastore/vmware-ovftool.tar.gz
# Extract ovftool content to /vmfs/volumes/My_Datastore
tar -xzf /vmfs/volumes/My_Datastore/vmware-ovftool.tar.gz -C /vmfs/volumes/My_Datastore/
rm /vmfs/volumes/My_Datastore/vmware-ovftool.tar.gz
# Modify the ovftool script to work on ESXi
sed -i 's@^#!/bin/bash@#!/bin/sh@' /vmfs/volumes/My_Datastore/vmware-ovftool/ovftool
ruzickap /
Created Jul 10, 2019
This script is trying to produce the same stats as CrystalDiskMark for Windows using fio.
#!/bin/bash -eu
# This script is trying to produce the same stats as CrystalDiskMark for Windows
# using fio.
# If you specify the raw disk (like /dev/sdc) the all it's content will be removed!
# The script should not run longer than 20 minutes
TMP_FILE=${TMP_FILE:-/tmp/$(basename $0).tmp}
ruzickap /
Created Apr 7, 2014
OpenWrt vnStat configuration
opkg install luci-app-vnstat vnstati
mkdir /etc/vnstat /www3/myadmin/vnstat
sed -i 's@^\(DatabaseDir\).*@\1 "/etc/vnstat"@' /etc/vnstat.conf
vnstat -u -i eth2
vnstat -u -i wlan0
vnstat -u -i br-lan
echo "*/5 * * * * vnstat -u" >> /etc/crontabs/root
ruzickap /
Created Jun 4, 2019
Debug service on OpenWrt
sed -r -i 's%^(#!.*)%\1\nset -x -v\nexec \&>/tmp/ddns-init.log%' /etc/init.d/ddns
sed -r -i 's%^(#!.*)%\1\nset -x -v\nexec \&>/tmp/ddns-hotplug.log%' /etc/hotplug.d/iface/95-ddns
sed -r -i 's%^(#!.*)%\1\nset -x -v\nexec \&>/tmp/ddns-updater.log%' /usr/lib/ddns/
# $ head -5 /etc/init.d/ddns
# #!/bin/sh /etc/rc.common
# set -x -v
# exec &>/tmp/ddns-init.log
# START=95
# STOP=10
ruzickap /
Last active May 23, 2019
Delete and remove VM in Virtualbox
VBoxManage list vms
VBoxManage controlvm 6d3e674d-7626-4142-969f-8017b679fbd0 poweroff
VBoxManage unregistervm --delete 6d3e674d-7626-4142-969f-8017b679fbd0
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 )
You can’t perform that action at this time.