Skip to content

Instantly share code, notes, and snippets.

@lightisright
lightisright / commit.sh
Last active July 25, 2025 09:13
GIT CLI Commit script using whiptail
#!/bin/bash
check_exit_code() {
if [[ $1 -ne 0 ]]; then
exit $1
fi
}
if [ ! -x /usr/bin/whiptail ]; then
echo "ERROR: /usr/bin/whiptail is not installed"
@lightisright
lightisright / get-my-gists.sh
Last active August 17, 2025 16:10
Download & install my gists locally
#!/bin/sh
#
# First install:
#
# Create following alias
# > alias x-gists-update="curl --progress-bar https://gist.githubusercontent.com/lightisright/143504336da3d93cbbc1c0348541630d/raw/ -o /tmp/get-my-gists.sh && sh /tmp/get-my-gists.sh"
#
# then RUN:
# > x-gists-update
#
@lightisright
lightisright / ssh-bg-tun.sh
Created January 24, 2025 08:33
SSH background tunnel creation script
#!/bin/bash
#
# SSH background tunnel creation script
# ------------------------------------------
# Written with Argbash
# Example taken from http://argbash.readthedocs.io/en/stable/example.html
#
# ARG_POSITIONAL_SINGLE([host],[SSH host],[])
# ARG_POSITIONAL_SINGLE([local-port],[Local port to bind to distant port],[])
# ARG_POSITIONAL_SINGLE([distant-port],[Distant port service port],[])
@lightisright
lightisright / lightisright.zsh
Last active July 24, 2025 14:09
Oh-My-Zsh custom configuration
# ~/.oh-my-zsh/custom/lightisright.zsh
export PATH=${PATH}:${HOME}/bin:${HOME}/.oh-my-zsh/custom/bin
#export KUBECONFIG=${HOME}/.kube/config
alias ll='ls -al'
alias ssh-hosts='cat /etc/ssh/ssh_config.d/*.conf | grep -i "host " | sed "s/Host //"'
alias tm-rename-window="tmux rename-window ${1} && tmux select-pane -T ${1}"
alias tm-rename-pane="printf '\033]2;%s\033\\' '${1}'"
@lightisright
lightisright / .tmux.conf
Last active August 17, 2025 16:40
tmux_config
# sources:
# - https://tmuxcheatsheet.com
# - https://github.com/catppuccin/tmux/issues/53#issuecomment-1675211611
set-option -sa terminal-overrides ",xterm*:Tc"
set -g mouse on
set -g default-terminal "tmux-256color"
set-option -g set-clipboard external