Restructure repo to use pkgs subdirectory
This commit is contained in:
111
pkgs/bash/.bash_aliases
Normal file
111
pkgs/bash/.bash_aliases
Normal file
@@ -0,0 +1,111 @@
|
||||
# SPDX-FileCopyrightText: 2019-2022, 2025 Kris Lamoureux <kris@lamoureux.io>
|
||||
# SPDX-License-Identifier: 0BSD
|
||||
|
||||
# shellcheck shell=bash
|
||||
|
||||
# Local system administration
|
||||
|
||||
# Alias management
|
||||
alias 'editalias'='vim ~/.bash_aliases && . ~/.bash_aliases'
|
||||
alias 'otheralias'='vim ~/.other_aliases && . ~/.bash_aliases'
|
||||
alias 'viewalias'='view ~/.bash_aliases'
|
||||
alias 'refreshalias'='source ~/.bash_aliases'
|
||||
|
||||
# SSH management
|
||||
alias 'fssh'='ssh-add && ssh -A'
|
||||
alias 'editssh'='vim ~/.ssh/config'
|
||||
|
||||
# Edit hosts file
|
||||
alias 'edithosts'='sudo vim /etc/hosts'
|
||||
|
||||
# System packages using apt
|
||||
alias 'update'='sudo apt update'
|
||||
alias 'upgrade'='sudo apt update && sudo apt upgrade'
|
||||
alias 'install'='sudo apt update && sudo apt install'
|
||||
alias 'remove'='sudo apt remove'
|
||||
|
||||
# Restart display manager
|
||||
alias 'restartgui'='sudo service sddm restart'
|
||||
|
||||
# Power management
|
||||
alias 'reboot'='sudo reboot'
|
||||
alias 'shutdown'='sudo shutdown'
|
||||
|
||||
# Clean up df output
|
||||
alias df='df -x squashfs -x tmpfs -x devtmpfs'
|
||||
|
||||
# Vagrant shortcuts
|
||||
alias 'vdup'='vagrant destroy -f && vagrant up --no-destroy-on-error'
|
||||
alias 'vpro'='vagrant provision'
|
||||
alias 'vssh'='ssh-add && vagrant ssh'
|
||||
alias 'vsshr'='ssh-add && vagrant ssh -c "sudo -i"'
|
||||
alias 'vup'='vagrant up'
|
||||
alias 'vhalt'='vagrant halt'
|
||||
|
||||
# Change to project folder
|
||||
alias 'sw'='cd /home/$USER/software && clear'
|
||||
|
||||
# Git shortcuts
|
||||
alias 'gad'='git add . && git diff --cached'
|
||||
alias 'gdiff'='git diff'
|
||||
alias 'status'='git status'
|
||||
alias 'pull'='git pull --rebase'
|
||||
alias 'merge'='git merge --ff-only'
|
||||
alias 'upstream'='git push --set-upstream origin'
|
||||
alias 'push'='git push'
|
||||
alias 'branch'='git branch'
|
||||
alias 'list'='git branch -a'
|
||||
alias 'unstage'='git reset HEAD'
|
||||
alias 'discard'='git checkout --'
|
||||
alias 'log'='git log'
|
||||
alias 'oneline'='git log --oneline'
|
||||
alias 'logsig'='git log --show-signature'
|
||||
alias 'checkout'='git checkout'
|
||||
alias 'commit'='git commit -S'
|
||||
alias 'tcommit'='git commit -m "testing"'
|
||||
alias 'tamend'='git commit --amend --no-edit --date "`date -R`"'
|
||||
alias 'amend'='git commit -S --amend'
|
||||
alias 'amendnew'='git commit -S --amend --date "`date -R`"'
|
||||
alias 'giturl'='git remote set-url'
|
||||
alias 'setorigin'='git remote set-url origin'
|
||||
alias 'origin'='git remote show origin'
|
||||
alias 'remote'='git remote'
|
||||
alias 'fetch'='git fetch'
|
||||
alias 'stash'='git stash'
|
||||
alias 'resetb'='git reset --hard @{u}'
|
||||
alias 'signhist'='git rebase --exec "git commit -S --amend --no-edit -n"'
|
||||
alias 'signhistnew'='git rebase --exec "git commit -S --amend --date '\''`date -R`'\'' --no-edit -n"'
|
||||
|
||||
function gd() {
|
||||
git diff HEAD~$1
|
||||
}
|
||||
|
||||
function rebase() {
|
||||
git rebase -i HEAD~$1
|
||||
}
|
||||
|
||||
function delcommit() {
|
||||
git reset --hard HEAD~$1
|
||||
}
|
||||
|
||||
# Docker shortcuts
|
||||
function inspect() {
|
||||
docker inspect "$1" | less
|
||||
}
|
||||
|
||||
# Color shift
|
||||
alias 'night'='redshift -P -O 2500'
|
||||
alias 'day'='redshift -x'
|
||||
|
||||
# SOCKS proxy over SSH
|
||||
alias 'socks'='screen -dm ssh -D 1337 -q -C -N'
|
||||
|
||||
# sshuttle proxy
|
||||
#e.g. alias 'proxyhome'='proxy user hostdomain:22 192.168.1.0/24'
|
||||
function proxy() {
|
||||
screen -dm sshuttle -v -r $1@$2 -x $2 ${@:2}; screen -r;
|
||||
}
|
||||
|
||||
if [ -f ~/.other_aliases ]; then
|
||||
source ~/.other_aliases
|
||||
fi
|
125
pkgs/bash/.bashrc
Normal file
125
pkgs/bash/.bashrc
Normal file
@@ -0,0 +1,125 @@
|
||||
# SPDX-FileCopyrightText: 2019 Matthias Klose <doko@debian.org>
|
||||
# SPDX-FileCopyrightText: 2019, 2025 Kris Lamoureux <kris@lamoureux.io>
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
# shellcheck shell=bash disable=SC1090,SC1091
|
||||
|
||||
# ~/.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
|
||||
|
||||
# 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=1000
|
||||
HISTFILESIZE=2000
|
||||
|
||||
# check the window size after each command and, if necessary,
|
||||
# update the values of LINES and COLUMNS.
|
||||
shopt -s checkwinsize
|
||||
|
||||
# If set, the pattern "**" used in a pathname expansion context will
|
||||
# match all files and zero or more directories and subdirectories.
|
||||
#shopt -s globstar
|
||||
|
||||
# make less more friendly for non-text input files, see lesspipe(1)
|
||||
#[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
|
||||
|
||||
# set variable identifying the chroot you work in (used in the prompt below)
|
||||
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
|
||||
debian_chroot=$(cat /etc/debian_chroot)
|
||||
fi
|
||||
|
||||
# set a fancy prompt (non-color, unless we know we "want" color)
|
||||
case "$TERM" in
|
||||
xterm-color|*-256color) color_prompt=yes;;
|
||||
esac
|
||||
|
||||
# uncomment for a colored prompt, if the terminal has the capability; turned
|
||||
# off by default to not distract the user: the focus in a terminal window
|
||||
# should be on the output of commands, not on the prompt
|
||||
#force_color_prompt=yes
|
||||
|
||||
if [ -n "$force_color_prompt" ]; then
|
||||
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
|
||||
# We have color support; assume it's compliant with Ecma-48
|
||||
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
|
||||
# a case would tend to support setf rather than setaf.)
|
||||
color_prompt=yes
|
||||
else
|
||||
color_prompt=
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$color_prompt" = yes ]; then
|
||||
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
|
||||
else
|
||||
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
|
||||
fi
|
||||
unset color_prompt force_color_prompt
|
||||
|
||||
# If this is an xterm set the title to user@host:dir
|
||||
case "$TERM" in
|
||||
xterm*|rxvt*)
|
||||
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
# enable color support of ls and also add handy aliases
|
||||
if [ -x /usr/bin/dircolors ]; then
|
||||
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
||||
alias ls='ls --color=auto'
|
||||
#alias dir='dir --color=auto'
|
||||
#alias vdir='vdir --color=auto'
|
||||
|
||||
#alias grep='grep --color=auto'
|
||||
#alias fgrep='fgrep --color=auto'
|
||||
#alias egrep='egrep --color=auto'
|
||||
fi
|
||||
|
||||
# colored GCC warnings and errors
|
||||
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
|
||||
|
||||
# some more ls aliases
|
||||
alias ll='ls -l'
|
||||
#alias la='ls -A'
|
||||
#alias l='ls -CF'
|
||||
|
||||
# Alias definitions.
|
||||
# You may want to put all your additions into a separate file like
|
||||
# ~/.bash_aliases, instead of adding them here directly.
|
||||
# See /usr/share/doc/bash-doc/examples in the bash-doc package.
|
||||
|
||||
if [ -f ~/.bash_aliases ]; then
|
||||
. ~/.bash_aliases
|
||||
fi
|
||||
|
||||
# enable programmable completion features (you don't need to enable
|
||||
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
|
||||
# sources /etc/bash.bashrc).
|
||||
if ! shopt -oq posix; then
|
||||
if [ -f /usr/share/bash-completion/bash_completion ]; then
|
||||
. /usr/share/bash-completion/bash_completion
|
||||
elif [ -f /etc/bash_completion ]; then
|
||||
. /etc/bash_completion
|
||||
fi
|
||||
fi
|
||||
|
||||
# Add ~/.local/bin to PATH
|
||||
export PATH="$HOME/.local/bin:$PATH"
|
||||
|
||||
# Ask for decryption in terminal window
|
||||
export GPG_TTY=$(tty)
|
Reference in New Issue
Block a user