Skip to content

Instantly share code, notes, and snippets.

@origox
origox / gist:b200b1e14c2ab0b58fa7cb6baf752db9
Created September 20, 2017 13:58
Display git branch name in bash prompt
Add the following to ~/.bashrc file:
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ "
@origox
origox / ssh-multi.sh
Created December 4, 2019 15:15
tmux - multi ssh
#!/usr/bin/env bash
# ssh-multi : a script to ssh multiple servers over multiple tmux panes
# nomad-fr : https://github.com/nomad-fr/scripts-systems
# Based on D.Kovalov work : https://gist.github.com/dmytro/3984680
# config
#user=$USER # user use for ssh connection
user=root
tmux_session_name="multi-ssh"
@origox
origox / README.md
Last active June 26, 2022 20:19
Proxmox Template with Cloud Image and Cloud Init

Introduction

Use cloud-init to configure cloud-images i.e. add SSH keys, set network settings, create users, install various packages

Cloud images are certified to run in public cloud services and as well Proxmox.

Create Proxmox Template

# SSH into Proxmox server
proxmox@proxmox:~#
@origox
origox / kubernetes_cheat_page.md
Last active September 17, 2022 12:24
Kubernetes Cheat Sheet

Kubernetes Taints & Tolerations

Set Taints

kubectl taint nodes <node name> <taint key>=<taint value>:<taint effect>

List Taints

kubectl get nodes -o=custom-columns=NodeName:.metadata.name,TaintKey:.spec.taints[*].key,TaintValue:.spec.taints[*].value,TaintEffect:.spec.taints[*].effect
@origox
origox / install-hs-vm.sh
Created February 19, 2023 18:45
Create Home Assistant VM in Proxmox 7.X
# Install needed utilities
root@pve3:~# apt update; apt install xz-utils
# Download and unpack image
root@pve3:~# mkdir /var/lib/vz/template/qcow; cd /var/lib/vz/template/qcow; wget https://github.com/home-assistant/operating-system/releases/download/9.5/haos_ova-9.5.qcow2.xz -nH --cut-dirs=6 -r -P ./; unxz haos_ova-9.5.qcow2.xz
# Create VM in proxmox
root@pve3:~# qm create 200 --name home-assistant --memory 2048 --cores 2 --machine q35 --net0 virtio,bridge=vmbr0 --bios ovmf --efidisk0 local-lvm:0,pre-enrolled-keys=1,efitype=4m --boot order=scsi0 --scsihw virtio-scsi-pci --scsi0 local-lvm:0,import-from=/var/lib/vz/template/qcow/haos_ova-9.5.qcow2
# Todo