Skip to content

Instantly share code, notes, and snippets.

Title:
Incident date:
Owner:
Peer-review committee:
Tags:
Summary:
Supporting data:
Customer Impact:
Incident Response Analysis:
Post-Incident Analysis:
@dchakro
dchakro / pi.status.sh
Last active December 5, 2021 11:03
Bash shell script to print stats about a Raspberry Pi running pihole
#!/usr/bin/env bash
# Define colors
RED='\033[91m'
RED_solid='\033[101m'
GREEN='\033[92m'
GREEN_solid='\033[42m'
CYAN='\033[96m'
NC='\033[0m'
BLUE_solid='\e[44m'
@ruanbekker
ruanbekker / promtail_docker_logs.md
Last active May 18, 2024 14:27
Docker Container Logging using Promtail
@smijar
smijar / k3d-install-dashboard.md
Created April 22, 2020 00:50
k3d-install-dashboard

ref

https://rancher.com/docs/k3s/latest/en/installation/kube-dashboard/

install

Deploying the Kubernetes Dashboard

GITHUB_URL=https://github.com/kubernetes/dashboard/releases
VERSION_KUBE_DASHBOARD=$(curl -w '%{url_effective}' -I -L -s -S ${GITHUB_URL}/latest -o /dev/null | sed -e 's|.*/||')
kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/${VERSION_KUBE_DASHBOARD}/aio/deploy/recommended.yaml
@colorwebdesigner
colorwebdesigner / slackIPChangeInfo.rsc
Last active May 23, 2020 10:36
Mikrotik script for send message to Slack on IP change
:global ipCurrent "$ipCurrent";
{
# Change to your settings
# -----------------------
:local wanInterface "eth1";
:local slackHookUrl "https://hooks.slack.com/services/YOUR/APP/SECRET";
# -----------------------
:local ipNew [/ip address get [find interface=$wanInterface] address];
@mark05e
mark05e / getInstalledAppsFromRegistry-notes.md
Created February 29, 2020 12:09
Get list of all installed applications from registry in 32- or 64-bit Powershell

getInstalledAppsFromRegistry.ps1

Source: Technet Script Center

Example:

.\getInstalledAppsFromRegistry.ps1
$apps = Get-InstalledAppsFromRegistry
$apps | where {$_.DisplayName -like "*Firefox*"}
@mexisme
mexisme / get-image.sh
Created February 27, 2020 22:23
Download an AWS ECR image using Skopeo instead of Docker (e.g. running within a container)
#!/usr/bin/env bash
set -eu
# set -o pipefile
docker_version=${REPO_TAG}
docker_image=${REPO_IMAGE}
# docker_creds=$(aws ecr get-authorization-token --output json |jq -r '.authorizationData[].authorizationToken' |base64 -d)
docker_creds="AWS:$(aws ecr get-login-password)"
@riedel
riedel / sshagent-bridge
Last active August 22, 2023 09:34
Bridge Windows 10 buildin OpenSSH agent to cygwin using socat and putty plink
#!/bin/sh
SOCKDIR=`mktemp.exe -d /tmp/ssh-XXXXXXXXX`
SSH_AUTH_SOCK=$SOCKDIR/agent.$$;export SSH_AUTH_SOCK;
[ -z ${1+x} ] && echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK;export SSH_AUTH_SOCK;"
socat UNIX-LISTEN:$SSH_AUTH_SOCK,umask=066,fork EXEC:"PLINK.EXE -serial //./pipe/openssh-ssh-agent",pipes &
SSH_AGENT_PID=$!; export SSH_AGENT_PID;
@ahmedsadman
ahmedsadman / create-service.sh
Last active May 15, 2024 06:44
Bash script to create systemd service
#!/usr/bin/bash
##
## Creates Service file based on JSON data
##
# Sample JSON file:
# {
# "service_name": "test_service",
# "description": "Netcore dev server",
@elalemanyo
elalemanyo / README.md
Last active April 23, 2024 18:25
Debug zsh startup time

Debug zsh startup time

  1. Inject profiling code

    At the beginning of your .zshrc add following: zmodload zsh/zprof

    and at the end add: zprof

    This will load zprof mod and display what your shell was doing durung your initialization.