Skip to content

Instantly share code, notes, and snippets.

@carlosocarvalho
carlosocarvalho / commands-swapfile.sh
Created August 2, 2017 02:34
Lack of free swap space on Zabbix server
sudo dd if=/dev/zero of=/var/swapfile bs=1M count=2048 && \
sudo chmod 600 /var/swapfile && \
sudo mkswap /var/swapfile && \
echo /var/swapfile none swap defaults 0 0 | sudo tee -a /etc/fstab && \
sudo swapon -a
@gajoseph
gajoseph / Db2auditsetup
Last active January 24, 2020 09:09
Db2 audit setup
###########################################################################################
### make a directory to store audit and archievd audcit file
###########################################################################################
export BASE_PATH=/home ###### THIS HAS TO BE SET where the auidt data and archived audit stuff goes
###### THIS HAS TO BE SET
export DB2_HOME=/home/db2inst1
###### THIS HAS TO BE SET :: SCHEMA onto which data will be loaded
export DB2_SCHEMA=AUDIT
###### THIS HAS TO BE SET:: Set the Extract location
echo -e "\n\nDB2_HOME: $DB2_HOME\nDB2_SCHEMA: $DB2_SCHEMA\nEXTRACT_LOC_PATH: $EXTRACT_LOC_PATH\n\n"
@chusiang
chusiang / teams-chat-post-for-workflows.sh
Last active September 2, 2025 07:39
Post a message to Microsoft Teams with bash script.
#!/bin/bash
# =============================================================================
# Author: Chu-Siang Lai / chusiang (at) drx.tw
# Filename: teams-chat-post-for-workflows.sh
# Modified: 2024-07-22 11:44 (UTC+08:00)
# Description: Post a message to Microsoft Teams via "Post to a chat when a webhook request is received" workflows.
# Reference:
#
# - https://gist.github.com/chusiang/895f6406fbf9285c58ad0a3ace13d025
# - https://devblogs.microsoft.com/microsoft365dev/retirement-of-office-365-connectors-within-microsoft-teams/
@Machy8
Machy8 / readme.md
Last active August 6, 2023 13:38
Start Kubernetes proxy server automatically
  1. Create an empty file and paste the content bellow into it /lib/systemd/system/kubectlproxy.service
[Unit]
Description=kubectl proxy 8080
After=network.target

[Service]
User=root
ExecStart=/bin/bash -c "/usr/bin/kubectl proxy --address=127.0.0.1 --port=8080"
@ruanbekker
ruanbekker / promtail_docker_logs.md
Last active September 12, 2025 07:03
Docker Container Logging using Promtail
##
# Configure the Azure Provider
##
provider "azurerm" {
version = "=2.8.0"
features {}
}
##
# Define variables for location, service principal for AKS and Bastion VM Admin
@trisberg
trisberg / local-registry.md
Last active August 18, 2025 14:56
Using a Local Registry with Minikube

Using a Local Registry with Minikube

Install a local Registry

These instructions include running a local registry accessible from Kubernetes as well as from the host development machine at registry.dev.svc.cluster.local:5000.

  1. Use the docker CLI to run the registry:2 container from Docker, listening on port 5000, and persisting images in the ~/.registry/storage directory.
@nirbhabbarat
nirbhabbarat / gitlab-on-minikube-helm3.md
Last active October 16, 2024 08:32
setup gitlab on minikube using helm3

Setup gitlab on minikube using helm3

Start minikube with virtualbox driver

minikube start \
  --driver=virtualbox \
  --cpus 4 \
  --memory 8192

Recomended: 8 CPU and 30 GB RAM (for demo we are going to use minimal setup)