Skip to content

Instantly share code, notes, and snippets.

@Omerr
Omerr / git lol.md
Last active March 11, 2024 06:09
git lol - an alias to Git that shows the commit graph in a pretty format

log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit

To configure as an alias git lol:

git config --global alias.lol "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)&lt;%an&gt;%Creset' --abbrev-commit"

#!/bin/bash
access_token="$( az account get-access-token --resource-type arm | jq -r '.accessToken' )"
# echo "${access_token}" | jq -R 'split(".")|.[1]|@base64d|fromjson'
subscriptionId="706df49f-998b-40ec-aed3-7f0ce9c67759"
# IFS='' read -r -d '' azureResourceGraphQuery <<'EOF'
# SpotResources
@PedroCavaleiro
PedroCavaleiro / mount-vmdk-linux.md
Last active February 23, 2024 16:01
Mount VMDK on Linux

Read VMDK on Linux

VMDK is a virtual disk file from VMWare, reading without any "special" software is rather useful specially because I didn't want to install VMWare software

It's possible that this works with vhd and vhdx but I didn't test it... If someone does test it let me know

The steps are rather easy

Mounting VMDK

@brian9206
brian9206 / loki.yml
Last active September 23, 2022 19:11
Single-node small & lightweight Grafana Loki deployment
auth_enabled: false
analytics:
reporting_enabled: false
server:
http_listen_port: 3100
common:
path_prefix: /var/loki
@DavidWells
DavidWells / javascript-proxy-as-rest-client.js
Last active October 6, 2023 18:39
Using a javascript proxy as low code REST client
/* Using a JavaScript proxy for a super low code REST client */
// via https://dev.to/dipsaus9/javascript-lets-create-aproxy-19hg
// also see https://towardsdatascience.com/why-to-use-javascript-proxy-5cdc69d943e3
// also see https://github.com/fastify/manifetch
// also see https://github.com/flash-oss/allserver
// and https://gist.github.com/v1vendi/75d5e5dad7a2d1ef3fcb48234e4528cb
const createApi = (url) => {
return new Proxy({}, {
get(target, key) {
@LittleWat
LittleWat / notify_azure_cost.py
Last active June 9, 2022 21:17
Notify Azure Cost from AWS Lambd with python
import json
import os
from datetime import datetime
import requests
SLACK_WEBHOOK_URL = os.environ['SLACK_WEBHOOK_URL']
ENV = os.environ['ENV']
SUBSCRIPTION_ID = os.environ["SUBSCRIPTION_ID"]
TENANT = os.environ["TENANT"]
@rsmitty
rsmitty / vsphere.sh
Created January 6, 2022 18:12
A little script to automate creation of talos clusters in vsphere
#!/bin/bash
set -e
## The following commented environment variables should be set
## before running this script
# export GOVC_USERNAME='administrator@vsphere.local'
# export GOVC_PASSWORD='xxx'
# export GOVC_INSECURE=true
@saiyam1814
saiyam1814 / install.sh
Last active April 14, 2024 17:05
Kubernetes + containerd 1.23 setup for Ubuntu 20.04
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
echo "step1"
echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
echo "kubeadm install"
sudo apt update -y
sudo apt -y install vim git curl wget kubelet=1.23.0-00 kubeadm=1.23.0-00 kubectl=1.23.0-00
echo "memory swapoff"
sudo sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab
sudo swapoff -a
sudo modprobe overlay
#!/bin/bash
############################################################################
## ██╗ ██████╗ █████╗ ███████╗███████╗ ███████╗███████╗██╗ ██╗ ##
## ██║ ██╔══██╗██╔══██╗██╔════╝██╔════╝ ██╔════╝██╔════╝██║ ██║ ##
## ██║ ██████╔╝███████║███████╗███████╗█████╗███████╗███████╗███████║ ##
## ██║ ██╔═══╝ ██╔══██║╚════██║╚════██║╚════╝╚════██║╚════██║██╔══██║ ##
## ███████╗██║ ██║ ██║███████║███████║ ███████║███████║██║ ██║ ##
## ╚══════╝╚═╝ ╚═╝ ╚═╝╚══════╝╚══════╝ ╚══════╝╚══════╝╚═╝ ╚═╝ ##
############################################################################
## Preparation:

Installing K3s on Raspberry Pi Cluster

Description

This article will document how to deploy K3s to a cluster of Raspberry Pis.

Requirements

I am using the following: