Skip to content

Instantly share code, notes, and snippets.

View nataz77's full-sized avatar
👻
Telling computers what to do

Simone Natalini nataz77

👻
Telling computers what to do
View GitHub Profile
k;double sin()
,cos();main(){float A=
0,B=0,i,j,z[1760];char b[
1760];printf("\x1b[2J");for(;;
){memset(b,32,1760);memset(z,0,7040)
;for(j=0;6.28>j;j+=0.07)for(i=0;6.28
>i;i+=0.02){float c=sin(i),d=cos(j),e=
sin(A),f=sin(j),g=cos(A),h=d+2,D=1/(c*
h*e+f*g+5),l=cos (i),m=cos(B),n=s\
in(B),t=c*h*g-f* e;int x=40+30*D*
@nataz77
nataz77 / logs.sh
Last active May 17, 2023 14:08
Extract and/or combine logs from multiple k8s pods
#!/usr/bin/env bash
# shellcheck shell=bash
# Usage: ./logs.sh -l app=app or ./logs.sh -l app=app -a combinedapplog.txt or
# Author: nataz77 (https://github.com/nataz77)
function printusage {
echo 'Log extractor';
echo 'eg: ./logs.sh -l app=app ';
echo 'eg: ./logs.sh -l app=app -n app ';
echo "eg: ./logs.sh -l app=app -a log.txt"
@nataz77
nataz77 / validation.sh
Created September 23, 2022 16:32
Use kubeval to validate multiple k8s manifests files
#!/bin/bash
function ensurekubeval {
wget https://github.com/instrumenta/kubeval/releases/latest/download/kubeval-linux-amd64.tar.gz 2> /dev/null
tar xf kubeval-linux-amd64.tar.gz
}
function main {
find . -type f -name "*.yaml" -exec ./kubeval {} \;
if [ "$?" -ne 0 ]
#!/usr/bin/env bash
DISK="/dev/sda"
# Zap the disk to a fresh, usable state (zap-all is important, b/c MBR has to be clean)
# You will have to run this step for all disks.
sgdisk --zap-all $DISK
# Clean hdds with dd
dd if=/dev/zero of="$DISK" bs=1M count=100 oflag=direct,dsync
@nataz77
nataz77 / rke2-commands.md
Created December 14, 2021 08:56 — forked from superseb/rke2-commands.md
RKE2 commands

RKE2 commands

Install

curl -sL https://get.rke2.io | sh
systemctl daemon-reload
systemctl start rke2-server
@nataz77
nataz77 / import.sh
Created December 7, 2021 10:07
Import exported .tar container images using Docker
#!/bin/sh
IMG=$(ls)
for i in $IMG
do
docker load < $i
done
@nataz77
nataz77 / Program.cs
Created July 5, 2021 13:21
Check if user is admin/su
//Install Mono.Posix.NETStandard
public static bool IsAdministrator =>
RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ?
new WindowsPrincipal(WindowsIdentity.GetCurrent())
.IsInRole(WindowsBuiltInRole.Administrator) :
Mono.Unix.Native.Syscall.geteuid() == 0;

Awesome microservices architectures on K8S components

Here's a list of various CNCF and non-CNCF projects and components we use to build cloud-native microservices architectures.

Kubernetes distributions

  • RKE is a CNCF-certified Kubernetes distribution that runs entirely within Docker containers. It works on bare-metal and virtualized servers. RKE solves the problem of installation complexity, a common issue in the Kubernetes community.
  • K3s is a highly available, certified Kubernetes distribution designed for production workloads in unattended, resource-constrained, remote locations or inside IoT appliances.
  • Metal³ exists to provide components that allow you to do bare metal host management for Kubernetes. works as a Kubernetes application, meaning it runs on Kubernetes and is managed through Kubernetes interfaces.
  • kops helps you create, destroy, u
@nataz77
nataz77 / aro.sh
Last active February 12, 2021 10:02
Azure Redhat Openshift creation script
#!/bin/bash
# shellcheck shell=bash
# AUTHOR: github.com/nataz77
# USAGE: ./aro.sh
function providers {
az provider register -n Microsoft.RedHatOpenShift --wait
az provider register -n Microsoft.Compute --wait
az provider register -n Microsoft.Storage --wait
}
@nataz77
nataz77 / dns-sync.sh
Created December 16, 2020 14:24 — forked from matthiassb/dns-sync.sh
Init.d script for keeping WSL resolv.conf in-sync with Windows
#! /bin/bash
### BEGIN INIT INFO
# Provides: dns-sync
# Required-Start:
# Required-Stop:
# Default-Start: S
# Default-Stop:
# Short-Description: Synchronizes /etc/resolv.conf in WLS with Windows DNS - Matthias Brooks
### END INIT INFO