Skip to content

Instantly share code, notes, and snippets.

View vicenteherrera's full-sized avatar
💭
hitting all the keys

Vicente Herrera vicenteherrera

💭
hitting all the keys
View GitHub Profile
@vicenteherrera
vicenteherrera / deploy_kubeflow_locallly.md
Last active February 22, 2024 15:05
Deploy Kubeflow locally
@vicenteherrera
vicenteherrera / check_pss_levels.sh
Created November 4, 2022 10:57
Script to get recommended Pod Security Standard level for all namespaces in a running cluster
#!/bin/bash
set -e
echo "" > test_psa.log
ALL_NAMESPACES=$(kubectl get namespaces -o name)
for NAMESPACE in $ALL_NAMESPACES
do
@vicenteherrera
vicenteherrera / Kubernetes_RBAC_apiGroups_resources_verbs.md
Last active October 26, 2024 22:17
How to obtain all Kubernetes apigroups, resources and corresponding verbs available to set up RBAC

Kubernetes RBAC apiGroups, resources and verbs

List all RBAC verbs for resources

Start your Kubernetes cluster.

On one terminal window:

# Open connection from another terminal window
@vicenteherrera
vicenteherrera / mount_on_wsl2.bat
Last active July 20, 2022 18:49
Mount hard drive ext4 partition on WSL2 Linux on Windows
@setlocal disabledelayedexpansion enableextensions
@echo off
:: Admin check
fltmc >nul 2>nul || set _=^"set _ELEV=1^& cd /d """%cd%"""^& "%~f0" %* ^"&&((if "%_ELEV%"=="" (echo Requesting administrator privileges...&((powershell -nop -c start cmd -args '/d/x/s/v:off/r',$env:_ -verb runas >nul 2>nul) || (mshta vbscript:execute^("createobject(""shell.application"").shellexecute(""cmd"",""/d/x/s/v:off/r ""&createobject(""WScript.Shell"").Environment(""PROCESS"")(""_""),,""runas"",1)(window.close)"^) >nul 2>nul))) else (echo This script requires administrator privileges.& pause))& exit /b)
echo Has admin permissions
:: echo Working dir: "%cd%"
:: echo Script dir: "%~dp0"
:: echo Script path: "%~f0"
@vicenteherrera
vicenteherrera / sshd_wsl2.md
Last active July 27, 2022 20:49
How to enable SSH server to WSL2 in Windows
@vicenteherrera
vicenteherrera / boniepub.sh
Created February 15, 2022 19:23
Script to generate epub publication with latest Bonilista articles
#!/bin/bash
echo "Parsing articles"
URL="https://us2.campaign-archive.com/home/?u=374c664073e1a1fa3deca53b4&id=e67967d43f"
POSTS=$(curl -Lk "$URL" | tr '"' '\n' | tr "'" '\n' | grep -e '^http://eepurl.com/' | sed 1d | awk '{ printf("%s ", $0) }')
echo "Building epub"
docker run --rm \
@vicenteherrera
vicenteherrera / Install Sysdig agent on local Minikube
Last active October 22, 2021 09:28
Instructions to instal Sysdig agent on local Minikube so it can be used to learn Kubernetes without a cloud account
# We will create a VM with Debian, and inside it execute Minikube with driver=none
# This way we avoid using Minikube's VM on Windows or Macos, that has a custom kernel
# You need to install VirtualBox and Vagrant on your host machine before you continue
# This works for latest versions on 2021-10-22. It doesn't work using Win+WSL2
# Use the following repository to download Vagrant boxes definition
git clone https://github.com/sysdiglabs/falco-workshop.git
# Use box4 that includes Docker, Kubectl, Minikube and many other tools
cd box4
vagrant box update
#!/bin/bash
# Download and compile xmrig
sudo apt-get install git build-essential cmake libuv1-dev libssl-dev libhwloc-dev
git clone https://github.com/xmrig/xmrig.git
mkdir xmrig/build && cd xmrig/build
cmake ..
make -j$(nproc)
@vicenteherrera
vicenteherrera / sysdig_inline_scan_from_registry.sh
Last active October 21, 2020 16:28
Unprivileged Sysdig Inline Scanning from private registry, bash script example
#!/bin/bash
# Uses sysdiglabs/secure-inline-scan:2
# This is an example script that scans from a private registry
# with Sysdig without requiring priviledges.
# It creates a temporary docker-config.json auth file for dockerhub registry,
# but can be replaced to use any other registry using Docker credentials.
@vicenteherrera
vicenteherrera / keys.ahk
Last active October 21, 2020 16:21
Autohotkey easier one handed keyboard
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#SingleInstance
DetectHiddenWindows, On
; --- Small keyboard tweaks ---------------------------------------