Skip to content

@DavidAnderegg
DavidAnderegg / .bashrc
Created January 29, 2025 07:03
Git Bash autostart ssh-agent
env=~/.ssh/agent.env
agent_load_env () { test -f "$env" && . "$env" >| /dev/null ; }
agent_start () {
(umask 077; ssh-agent >| "$env")
. "$env" >| /dev/null ; }
agent_load_env
@regohiro
regohiro / .bashrc
Created February 9, 2025 03:30
.bashrc
# bash theme - partly inspired by https://github.com/ohmyzsh/ohmyzsh/blob/master/themes/robbyrussell.zsh-theme
__bash_prompt() {
local userpart='`export XIT=$? \
&& [ ! -z "${GITHUB_USER:-}" ] && echo -n "\[\033[0;32m\]@${GITHUB_USER:-} " || echo -n "\[\033[0;32m\]@\h " \
&& [ "$XIT" -ne "0" ] && echo -n "\[\033[1;31m\]➜" || echo -n "\[\033[0m\]➜"`'
local gitbranch='`\
if [ "$(git config --get devcontainers-theme.hide-status 2>/dev/null)" != 1 ] && [ "$(git config --get codespaces-theme.hide-status 2>/dev/null)" != 1 ]; then \
export BRANCH="$(git --no-optional-locks symbolic-ref --short HEAD 2>/dev/null || git --no-optional-locks rev-parse --short HEAD 2>/dev/null)"; \
if [ "${BRANCH:-}" != "" ]; then \
echo -n "\[\033[0;36m\](\[\033[1;31m\]${BRANCH:-}" \
@matthewfritz
matthewfritz / .bashrc
Last active July 14, 2024 20:10
Git Bash .bashrc
# ~/.bashrc
# By Matthew Fritz
# This is primarily for Git Bash and also for my own purposes so your mileage may vary
#
# Current script version (GitHub Gist):
# https://gist.github.com/matthewfritz/0c379b45593b432867894cb4c7da07d6
HOME_DIR="/c/Users/mattf"
SSH_DIR="$HOME_DIR/.ssh"
GITHUB_SSH_KEY="$SSH_DIR/github_id_ed25519"
@linzj
linzj / .bashrc
Created July 9, 2024 23:53
bashrc example
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=10000000
HISTFILESIZE=20000000
@searge
searge / .bashrc
Created December 19, 2021 12:22
Kali Linux bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@EvilSupahFly
EvilSupahFly / .bashrc
Last active October 9, 2024 05:11
Python Virtual Environment Manager using PythonZ
RESET="\033[0m" # Normal
RED="\033[1m\033[1;31m" # Red
GREEN="\033[1m\033[1;32m" # Green
WHITE="\033[1m\033[1;37m" # White
pyvenv() {
local venv_name=${1:-$(read -p "Enter the virtual environment name: " name && echo "$name")}
local venv_home="$HOME/python-virtual-environs/$venv_name"
if [[ -z "$venv_name" ]]; then
@thedotslash
thedotslash / .bashrc
Created October 8, 2024 18:59
My FreeBSD Bashrc
[ -z "\$PS1" ] && return
HISTCONTROL=ignoredups:ignorespace
shopt -s histappend
HISTSIZE=10000
HISTFILESIZE=20000
HISTTIMEFORMAT="%F %T "
shopt -s checkwinsize
case "\$TERM" in
xterm-color) color_prompt=yes;;
esac
@itacud95
itacud95 / .bashrc
Created October 31, 2024 19:22
bashrc alias
// .bashrc
alias gita="git add -u"
alias gitp="git push"
alias gitpr="git pull --rebase"
alias gitpf="git push --force-with-lease"
alias gitd="git diff"
alias git-="git checkout -" # check out previous branch
alias gitb="git for-each-ref --count=15 --sort=-committerdate refs/heads --format='%(authordate:short) %(color:red)%(objectname:short) %(color:yellow)%(refname:short)%(color:reset) (%(color:green)%(committerdate:relative)%(color:reset))'"
alias pop="notify-send 'check it out'"
@rummykhan
rummykhan / .bashrc
Created April 23, 2021 19:53
Add open SSL binary to path to install swoole
export PATH="/usr/local/opt/openssl/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"
@mathklk
mathklk / .bashrc
Created February 26, 2024 14:41
PS1
# Red background if previous command failed
get_err_color() {
if [ $? -ne 0 ]; then
echo -e "\033[41m"
fi
}
# Red background if on master/main
get_git_branch_color() {
branch=$(__git_ps1 %s)