Skip to content

Instantly share code, notes, and snippets.

@chsegala
chsegala / aws-login
Created January 8, 2026 10:47
aws-login
#!/bin/bash
# AWS SSO Login Script
# Logs into multiple AWS profiles using AWS SSO
set -e
SCRIPT_NAME="aws-login"
AWS_CLI_CMD="aws"
@chsegala
chsegala / .zshrc
Last active October 19, 2023 13:15
AWS SSO login helper for multiple profiles, with partial match selection
# to use aws-sso with zsh, add the following alias to .zshrc
alias aws-sso='f() { ~/.local/bin/aws-sso "$@" -- exec zsh; unset -f f; }; f'
@chsegala
chsegala / default-browser.sh
Created September 18, 2023 17:14
Zenity PopUp to select a browser from a list
#!/usr/bin/env bash
SCRIPT_DIR=$(dirname -- $0)
APPLICATIONS_DIR="${HOME}/.local/share/applications/"
DEFAULT_BROWSER_DESKTOP="${APPLICATIONS_DIR}/default-browser-selector.desktop"
if [ ! "$(command -v zenity)" ]; then
sudo apt-get install zenity
fi
@chsegala
chsegala / togglebt
Created November 24, 2021 17:43
Toggle Headset Bluetooth Audio Profile on Linux
#! /usr/bin/env bash
readarray -t CARDS < <(pactl list short cards | grep "bluez" | awk '{print $2}')
if [[ ${#CARDS[@]} > 1 ]]; then
echo "Please select the card from the list bellow:"
for i in "${!CARDS[@]}"; do
printf " %s: %s\n" "$i" "${CARDS[$i]}"
done
read opt
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""XPlane-xranrd.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1kzmAZTVEkIjbxRJtK9Fc4YBJiW7HFgGU
# Introduction