Skip to content

Instantly share code, notes, and snippets.

View janosmiko's full-sized avatar

Janos Miko janosmiko

View GitHub Profile
git config --global alias.lg "log --color --graph --all --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
## on the old server
# ssh-keygen -f /tmp/id_rsa -t rsa -N ''
# ssh-copy-id -i /tmp/id_rsa.pub root@{new-servers-ip}
## on the old server
# su - zimbra -c "zmcontrol stop"
# rsync -Pavrz --delete -e 'ssh -i /tmp/id_rsa' /opt/zimbra/ \
{new-servers-ip}:/opt/zimbra/
# tar -zcvp --exclude=/dev --exclude=/proc --exclude=/sys \
--exclude=/opt --exclude=/tmp/id_rsa / | ssh -i /tmp/id_rsa \
root@{new-servers-ip} "(cat > /data/old-$(date +%d-%m-%Y).full-fs.tgz)"
@janosmiko
janosmiko / 01_longhorn_bestpractices.md
Created January 24, 2024 20:45 — forked from ifeulner/01_longhorn_bestpractices.md
Longhorn hcloud best practices

Longhorn best practices

The following settings are provided as an example how longhorn should be configured in a production cluster, especially if it is deployed on Hetzner Cloud infrastructure.

Hetzner server nodes provide local storage and allow up to five attached volumes (with a size of up to 10TiB each) Local storage is provided by NVMe storage and therefore is much faster than the attached volumes, but limited in size (max 300GiB usable).

It is assumed that the cluster creation is already done, e.g. via terraform scripts provided by the great kube-hetzner project.

Initial configuration

@janosmiko
janosmiko / tf.sh
Created May 27, 2024 07:55
Terraform output only show name and change type without diffs
terraform plan -out tfplan
terraform show -json tfplan | jq -r '.resource_changes[] | select (.change.actions | inside(["create","update","delete"])) | [ .address, ( .change.actions | join(" ")) ] | @csv' | sed -e "s/delete\screate/replace/g" -e "s/create\sdelete/replace/g"