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 / 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 /
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 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 /
Created May 21, 2018
Install latest Vagrant using command line
apt-get install -y --no-install-recommends ca-certificates curl jq
VAGRANT_LATEST_VERSION=$(curl -s | jq -r -M '.current_version')
curl${VAGRANT_LATEST_VERSION}/vagrant_${VAGRANT_LATEST_VERSION}_x86_64.deb --output /tmp/vagrant_x86_64.deb
apt install -y /tmp/vagrant_x86_64.deb
rm /tmp/vagrant_x86_64.deb
ruzickap /
Created May 21, 2018
Install latest Packer using command line
apt-get install -y --no-install-recommends curl jq unzip
PACKER_LATEST_VERSION=$(curl -s | jq -r -M '.current_version')
unzip /tmp/ -d /usr/local/bin/
rm -f /tmp/
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 / appveyor_minikube.yml
Created Apr 20, 2018
Appveyor file which runs minikube for testing Kubernetes
View appveyor_minikube.yml
image: ubuntu
# Download ans install minikube
# Download kubectl, which is a requirement for using minikube
- curl -sL$(curl -s -o kubectl
- chmod +x kubectl
- sudo mv kubectl /usr/local/bin/
# Download minikube
- curl -sL -o minikube
ruzickap /
Last active Apr 18, 2018
Install Kubernetes Multinode Cluster using kubeadm
### Master node installation
# SSH to the first VM which will be your Master node:
ssh root@node1
# Set the Kubernetes version which will be installed:
# Set the proper CNI URL:
You can’t perform that action at this time.