Skip to content

Instantly share code, notes, and snippets.

View dnegi-dev's full-sized avatar
💻
Working

Daniel Negi dnegi-dev

💻
Working
View GitHub Profile
@dnegi-dev
dnegi-dev / install_zsh_plugins.sh
Created December 18, 2023 07:13
install_zsh_plugins.sh
#!/bin/bash
# Check if zsh is installed
if ! command -v zsh &> /dev/null; then
echo "Zsh is not installed. Please install it first."
exit 1
fi
if ! command -v git &> /dev/null; then
echo "Git is not installed, Please install it first."
@dnegi-dev
dnegi-dev / cinder-k8s.md
Last active August 27, 2023 10:24
Mount a Openstack Cinder Volume in Kubernetes

How to mount a already existing Volume in K8s with the openstack cloud controler

1) check out the id of the volume

openstack_volume

its the ID Value

Create a PV with the following settings

Enable Fractional Scaling Support on Wayland for Electron Applications

VSCode

vim .local/share/applications/code.desktop
[Desktop Entry]
Name=Visual Studio Code
#!/usr/bin/env bash
################################################################################
# This script checks for the Linux operating system and uses the appropriate
# package manager to install the zsh shell, tmux, and byobu. To run this script
# directly from GitHub Gist, use the following command:
#
# bash <(curl -s https://gist.githubusercontent.com/dnegi-dev/af4bd1abc162413b3236f4cd9c2de4f1/raw/4e9c8ecd3fc82fe97e9792850844b3ab588c53a0/install_zsh_and_byobu.sh)
#
# The script will automatically detect the package manager used by the system
@dnegi-dev
dnegi-dev / create_k8s_ha_ubuntu.sh
Last active February 27, 2023 00:11
Create a HA Kubernetes Cluster on Ubuntu 22.04
#!/usr/bin/env bash
# This script is used to install k8s on ubuntu 22.04 amd64 server with CRI-O as container runtime and kubeadm as k8s installer.
# To run this script, use the following command:
# curl -sSL https://gist.githubusercontent.com/dnegi-dev/27a65a4417601d9900d32b092613d8ec/raw/48d4e41789ac43eec5064f4a0651ab8392d5d5de/create_k8s_ha_ubuntu.sh -o create_k8s_ha_ubuntu.sh && sudo bash create_k8s_ha_ubuntu.sh
LOG_FILE=/var/log/k8s-install.log
if [ $EUID != 0 ]; then
echo "This script must be run as root."

Upgrade your Linux OS

Check your OS Version (systemd only)

hostnamectl | grep "Operating System"

Ubuntu Focal (20.04) to Jammy (22.04)

sudo sed -i 's/focal/jammy/g' /etc/apt/sources.list
sudo apt update &amp;&amp; sudo apt full-upgrade -y

Uxplay firewalld and systemd service

First create a firewalld service file

If you want to use Vi as an editor, type in your terminal:

$ sudo vi /etc/firewalld/services/uxplay.xml

Or if you want to use nano type:

$ sudo nano /etc/firewalld/services/uxplay.xml
@dnegi-dev
dnegi-dev / microk8s-firewalld-service.md
Last active February 2, 2025 09:01
Microk8s Firewalld Service

MicroK8s firewalld service

Create a firewalld service file

foo@bar:~$ sudo vi /etc/firewalld/services/microk8s.xml
<?xml version="1.0" encoding="utf-8"?>
<service>
@dnegi-dev
dnegi-dev / systemd-timers-example.md
Last active April 1, 2023 19:33
Systemd Timers

Systemd Timer Example

Create systemd timer file

$ vi /etc/systemd/system/<TIMER_NAME>.timer
[Unit]
Description=<Describe your Timer>

[Timer]