Skip to content

Instantly share code, notes, and snippets.

View TheBigRoomXXL's full-sized avatar
⚗️
experimenting

TheBigRoomXXL TheBigRoomXXL

⚗️
experimenting
View GitHub Profile
@TheBigRoomXXL
TheBigRoomXXL / aws_assume.sh
Last active April 10, 2025 08:42
Assume an AWS profile from SSO with a single command and autocomplete
# Before you use this script you need to configure your AWS SSO profile with `aws configure sso`
# Usage: assume AWS_PROFILE
assume () {
aws sso login --profile $1
eval "$(aws configure export-credentials --profile $1 --format env)"
}
# This function provide autocompletion
_assume() {
@TheBigRoomXXL
TheBigRoomXXL / ps1.sh
Last active April 14, 2026 09:10
A portable script for a powerline like prompt
build_powerline_prompt() {
# Capture the exit code of the last command immediately
local EXIT="$?"
# String where we accumulate everything
local prompt=""
# Define color palette
local reset='\e[0m'
@sarkrui
sarkrui / install-cloudflared.md
Created May 31, 2023 12:19
Install Cloudflared on Alpine Linux

Cloudflared Setup Guide

This guide will walk you through setting up Cloudflared on your system.

Pre-Requisites

You need to have administrative (sudo) access to your system.

Here are the steps to install Cloudflared.

@MelchiSalins
MelchiSalins / http-rate-limit.go
Last active February 16, 2026 15:34
GoLang HTTP Client with Rate Limiting
package main
import (
"context"
"fmt"
"net/http"
"time"
"golang.org/x/time/rate"
)
@dsample
dsample / README.md
Last active May 13, 2026 11:49
ASCII art diagrams

ASCI art characters for creating diagrams

Characters:

Single line

  • ASCII code 191 = ┐ ( Box drawing character single line upper right corner )
  • ASCII code 192 = └ ( Box drawing character single line lower left corner )
  • ASCII code 193 = ┴ ( Box drawing character single line horizontal and up )
  • ASCII code 194 = ┬ ( Box drawing character single line horizontal down )
# get total requests by status code
awk '{print $9}' /var/log/nginx/access.log | sort | uniq -c | sort -rn
# get top requesters by IP
awk '{print $1}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head | awk -v OFS='\t' '{"host " $2 | getline ip; print $0, ip}'
# get top requesters by user agent
awk -F'"' '{print $6}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head
# get top requests by URL