Skip to content

Instantly share code, notes, and snippets.

View vancanhuit's full-sized avatar
🎯
Focusing

Canh Dinh vancanhuit

🎯
Focusing
View GitHub Profile
@vancanhuit
vancanhuit / create-container.sh
Created March 6, 2025 08:44
Incus RHEL profile with Macvlan network
#!/usr/bin/env bash
set -e
name=${1}
[[ -z ${name} ]] && {
echo "Name must be provided."
exit 1
}
@vancanhuit
vancanhuit / ansible.cfg
Created March 6, 2025 08:34
Ansible playbook for configuring Kubernetes nodes
[defaults]
interpreter_python = /usr/bin/python3
@vancanhuit
vancanhuit / ca.json
Last active August 18, 2024 15:04
Smallstep CA configuration
{
"root": "/etc/step-ca/certs/root_ca.crt",
"federatedRoots": null,
"crt": "/etc/step-ca/certs/intermediate_ca.crt",
"key": "/etc/step-ca/secrets/intermediate_ca_key",
"address": ":443",
"insecureAddress": "",
"dnsNames": [
"ca.lab.internal"
],
@vancanhuit
vancanhuit / selinux-incus-agent.sh
Last active September 11, 2024 13:04
Handling SELinux for incus-agent on Red Hat based VMs
# https://github.com/lxc/incus/commit/b2cd793ae4ce016ca7da128cc2d14544c041c801
# https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html/using_selinux/changing-selinux-states-and-modes_using-selinux#enabling-selinux-on-systems-that-previously-had-it-disabled_changing-selinux-states-and-modes
semanage fcontext -a -t bin_t /var/run/incus_agent/incus-agent
restorecon -R /run/incus_agent
fixfiles -F onboot
# EditorConfig is awesome: https://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
indent_style = space
indent_size = 4
@vancanhuit
vancanhuit / apply-network-config.sh
Last active December 5, 2024 06:00
Incus/LXD: cloud-init static ip for containers and VMs
cat cloud-init-static-ip-container.yaml | incus config set <name> cloud-init.network-config -
cat cloud-init-static-ip-vm.yaml | incus config set <name> cloud-init.network-config -
@vancanhuit
vancanhuit / create-instance.sh
Last active February 25, 2025 00:35
Incus/LXD RHEL-based distro profile for a basic initialization
incus launch images:rockylinux/9/cloud test --profile rhel
incus launch images:rockylinux/9/cloud test-vm --vm --profile rhel --profile vm-config
@vancanhuit
vancanhuit / init.lua
Last active April 21, 2024 02:24
Neovim Lua configuration
vim.opt.number = true
vim.opt.mouse = 'a'
vim.opt.ignorecase = true
vim.opt.smartcase = true
vim.opt.wrap = true
vim.opt.breakindent = true
vim.opt.tabstop = 2
vim.opt.shiftwidth = 2
vim.opt.expandtab = true
vim.opt.smarttab = true
@vancanhuit
vancanhuit / .tmux.conf
Last active March 16, 2024 03:59
TMUX configuration
set -s default-terminal "tmux-256color"
set -as terminal-overrides ",xterm*:Tc"
set -s escape-time 0
set -g history-limit 50000
set -g display-time 1000
set -g mode-keys vi
set -g base-index 1
set -g pane-base-index 1
set -g automatic-rename off
@vancanhuit
vancanhuit / linux-networking.md
Last active January 17, 2021 08:03
DNS in Linux

DNS

# /etc/hosts
# /etc/resolv.conf
# /etc/nsswitch.conf
$ nslookup google.com
$ dig facebook.com

Switching and Routing