Skip to content

Instantly share code, notes, and snippets.

View neiroc's full-sized avatar
🦥
Festina Lente

Enrico Marchelletta neiroc

🦥
Festina Lente
View GitHub Profile
@neiroc
neiroc / .vimrc
Created October 11, 2024 13:01
VIM CONFIG
set expandtab
set tabstop=2
set shiftwidth=2
set noautoindent
set nosmartindent
set nowrap
@neiroc
neiroc / bt_headset_audio_autoswitch.md
Created October 11, 2024 13:01
LINUX - Switch your main audio output to your headset when bluetooth connects

Auto switch audio output when a new Bluetooth device connects

Depending on the distro or DE/WM you are running and which programs you are using to manage your audio you maybe run into the hassle of having to switch audio outputs each time you connect a bluetooth device (headset/speaker). You can in fact make pulseaudio to autoswitch when connection is established and not do it manually.

To accomplish this you just need to check a condition in the default.pa config file located in /etc/pulse/ directory on your install and add the following line load-module module-switch-on-connect like in the code snippet below:

...

### Automatically load driver modules for Bluetooth hardware
@neiroc
neiroc / 1_README.md
Created October 11, 2024 13:01
Generate Rancher 2 cluster/node agent definitions

Generate Rancher 2 cluster/node agents definitions

This is not official documentation/tooling, use with caution

This generate the Kubernetes definitions of the cattle-cluster-agent Deployment and cattle-node-agent DaemonSet, in case it's accidentally removed/server-url was changed/certficates were changed. It is supposed to run on every cluster Rancher manages. If you have custom clusters created in Rancher, see Kubeconfig for Custom clusters created in Rancher how to obtain the kubeconfig to directly talk to the Kubernetes API (as usually it doesn't work via Rancher anymore). For other clusters, use the tools provided by the provider to get the kubeconfig.

IMPORTANT: You get the cluster/node agents definitions from Rancher, and you apply them to the cluster that is created/managed so you need to switch kubeconfig to point to that cluster before applying them.

Running it

{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
@neiroc
neiroc / vpn-network_manager.md
Created October 11, 2024 13:02
add openvpn plugin to network manger

Network Manager

Add openvpn plugin

  • Install using apt
sudo apt install network-manager-openvpn network-manager-openvpn-gnome
@neiroc
neiroc / bt_headset_audio_autoswitch.md
Created October 11, 2024 13:02
LINUX - Switch your main audio output to your headset when bluetooth connects

Auto switch audio output when a new Bluetooth device connects

Depending on the distro or DE/WM you are running and which programs you are using to manage your audio you maybe run into the hassle of having to switch audio outputs each time you connect a bluetooth device (headset/speaker). You can in fact make pulseaudio to autoswitch when connection is established and not do it manually.

To accomplish this you just need to check a condition in the default.pa config file located in /etc/pulse/ directory on your install and add the following line load-module module-switch-on-connect like in the code snippet below:

...

### Automatically load driver modules for Bluetooth hardware
@neiroc
neiroc / gitlab-k8s-integration-env-vars.md
Created October 11, 2024 13:02
Deploying Applications to Kubernetes Using GitLab CI/CD Without an Agent

Gitlab Kubernetes Integration

reference: https://medium.com/odds-team/deploying-applications-to-kubernetes-using-gitlab-ci-cd-without-an-agent-50a6cd81f461

Overview.

This document provides guideline on how to access kubenetes cluster from gitlab pipeline runner. The reason to use gitlab is to automate the Stakater stacks deployment on Kubernetes. Stacks global and release are used by other stack for deployment, but currently there is no way to deploy global and release stack automatically. Therefore gitlab will be used to deploy these stacks.

@neiroc
neiroc / merge-kubeconfig-files.md
Created October 11, 2024 13:02
merge multiple kubeconfig files

Merge multiple kubeconfig files

  1. Make a copy of your kubeconfig file
cp ~/.kube/config ~/.kube/config-backup
  1. Set the KUBECONFIG environment variable
@neiroc
neiroc / Mounting VirtualBox shared folders on Ubuntu Server 24.04.md
Created October 11, 2024 13:03
Mounting VirtualBox shared folders on Ubuntu Server 24.04

Mounting VirtualBox shared folders on Ubuntu Server 24.04 LTS

This guide will walk you through the steps on how to setup a VirtualBox 7 shared folder inside your Ubuntu Server guest.

Prerequisites

This guide assumes that you are using the following setup:

@neiroc
neiroc / dev-tools.sh
Created October 11, 2024 13:03
bash script for installing tools with asdf
#!/bin/bash
echo "Installing ASDF..."
ASDF_VERSION="v0.13.1"
if test -d ~/.asdf; then
echo "ASDF already present in ~/.asdf"
else
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch ${ASDF_VERSION}