Skip to content

Instantly share code, notes, and snippets.

View RichardBronosky's full-sized avatar

Bruno Bronosky RichardBronosky

View GitHub Profile
@RichardBronosky
RichardBronosky / redir_test.sh
Last active August 17, 2023 15:39
A oneliner for testing redirects
#!/bin/bash
# The following line defines a bash function and is designed to be copy-pasta-ed into your terminal and used as shown on the last line of this file. I'm only putting it in a script to get it on gist
redir_test(){ curl -svLo /tmp/redir_test.out "$@" 2>&1 | grep -E '^(> Host|> GET|< HTTP|< location|[<>]\s*$)'; }
# BONUS: One super-useful use of this is to test your readiness to respond to future DNS changes. That can be done like so:
# redir_test -H 'Host: www.example.com' https://192.168.0.101/
# This assumes that your server at 192.168.0.101 is set up to serve www.example.com and this simulates what `curl https://www.example.com/` would do if DNS returned 192.168.0.101 when doing a lookup on www.example.com
redir_test "$@"

Assume-Role

AWS Assume-Role requiring only aws-cli and jq

Installation

Basic

git clone https://gist.github.com/80306011bb5da80c765ffd6aa2ecf89b.git arole
@RichardBronosky
RichardBronosky / README.md
Last active August 17, 2023 15:34
A bash plugin to make files executable

bash-plusx

A bash plugin to make files executable

Installation

Set up bash_plugins folder

(Skip this step if you already have a bash_plugins folder.)

{
# simply copy-pasta this whole block, or customize these vars and copy-pasta the rest
@RichardBronosky
RichardBronosky / README.md
Last active August 17, 2023 15:34
A bash plugin to make cd better

bash-cdl

A bash plugin to make cd better

Installation

Set up bash_plugins folder

(Skip this step if you already have a bash_plugins folder.)

{
# simply copy-pasta this whole block, or customize these vars and copy-pasta the rest
@RichardBronosky
RichardBronosky / README.md
Last active August 17, 2023 15:33
A bash plugin to manage plugins

bash-bashplug

A bash plugin to manage plugins

Installation

Set up bash_plugins folder

(Skip this step if you already have a bash_plugins folder.)

{
# simply copy-pasta this whole block, or customize these vars and copy-pasta the rest
@RichardBronosky
RichardBronosky / tmux-panes.sh
Last active August 17, 2023 15:10 — forked from dmckean/tmux-panes.sh
A combination of the tmux commands: list-sessions list-windows and list-panes
#! /usr/bin/env bash
hi_color=$(tput setaf 4) #blue
bold=$(tput bold)
underline=$(tput smul)
normal=$(tput sgr0)
read -r -d '' usage << DOC
Prints out a table of tmux sessons, windows, and panels.
@RichardBronosky
RichardBronosky / install_latest_tmux.sh
Last active August 17, 2023 15:09
TMUX added command prompt tab completion menus v3.2!
# SEE: https://github.com/tmux/tmux/blob/47923bd5f62f49924e20f3cabcff9350968449a2/CHANGES#L320-L323
# FROM: https://github.com/tmux/tmux#from-version-control
tmux -V
cd ~/src/
git clone https://github.com/tmux/tmux
cd tmux/
sudo apt install bison make pkg-config autotools-dev automake libevent-dev libncurses-dev
sh autogen.sh
@RichardBronosky
RichardBronosky / imgist.sh
Last active August 17, 2023 15:07
Imgur was down, so I created Imgist
#! /usr/bin/env bash
set -eu
_main(){
input_file="$1"
file_path="$(realpath -s "$input_file")"
file_name="$(basename "$file_path")"
cd "$(dirname "$(realpath -s "${BASH_SOURCE[0]}")")"
cp "$file_path" ./
git add "$file_name"

Want to fork your own gists? No fork button? No problem! Install this user script by clicking refork.user.js' "raw" link down below: ⇓

@RichardBronosky
RichardBronosky / Storing-git-Credentials.md
Last active July 30, 2023 05:34
Storing git Credentials