Create sysadmin's home directory and update .gitignore files.

This commit is contained in:
Darren 'Tadgy' Austin 2025-09-13 11:16:22 +00:00
commit 374e0818c0
13 changed files with 265 additions and 3 deletions

2
home/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
/*/
!/sysadmin/

View file

@ -0,0 +1,14 @@
#!/bin/bash - not strictly necessary, but helps nano with syntax highlighting.
# Clear the screen/console on logout.
if (( SHLVL == 1 )); then
if [[ -x /usr/bin/clear_console ]]; then
/usr/bin/clear_console -q
elif [[ -x /usr/bin/clear ]]; then
/usr/bin/clear
elif [[ -x /usr/bin/tput ]]; then
/usr/bin/tput clear
else
echo -ne "\e[2J"
fi
fi

View file

@ -0,0 +1,19 @@
#!/bin/bash - not strictly necessary, but helps nano with syntax highlighting.
# Bash shell environmental set up.
export LANG="en_GB.UTF-8"
export LC_COLLATE="POSIX" # 'C' causes issues with some applications
export PATH="/opt/sbin:/opt/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
hash less >/dev/null 2>&1 && export PAGER="less"
hash nano >/dev/null 2>&1 && export EDITOR="nano" && export VISUAL="$EDITOR"
[[ -d "$HOME/files/bin" ]] && export PATH="$HOME/files/bin:$PATH"
[[ -d "$HOME/.local/bin" ]] && export PATH="$HOME/.local/bin:$PATH"
[[ -d "$HOME/bin" ]] && export PATH="$HOME/bin:$PATH"
for FILE in "$HOME"/.bash_profile.d/*; do
[[ -x "$FILE" ]] && source "$FILE"
done
unset FILE
[[ -f "$HOME/.bashrc" ]] && . "$HOME/.bashrc"

52
home/sysadmin/.bashrc Normal file
View file

@ -0,0 +1,52 @@
#!/bin/bash - not strictly necessary, but helps nano with syntax highlighting.
# Bash specific configuration.
prompt_user_colour() {
# Determine the colour of the username in the prompt.
if [[ "$(whoami)" == "root" ]]; then
printf "%s" "1;31m" # Bright Red.
elif [[ "$(whoami)" == "tadgy" ]]; then
printf "%s" "1;32m" # Bright Green.
else
printf "%s" "1;36m" # Bright Cyan.
fi
return 0
}
shopt -s cdspell checkhash checkjobs checkwinsize cmdhist dirspell histappend no_empty_cmd_completion
HISTCONTROL="ignoredups"
HISTFILE="$HOME/.bash_history-${HOSTNAME%%.*}"
HISTFILESIZE=1000000
HISTIGNORE="bg:bg *:fg:fg *:jobs:exit:clear:history"
HISTSIZE=1000000
HISTTIMEFORMAT="%d/%m/%y %H:%M:%S "
IGNOREEOF=0
PROMPT_DIRTRIM=2
PS1='[\[\033[$(__prompt_user_colour)\]\u\[\033[0m\]@\[\033[1;33m\]\h\[\033[0m\]] \[\033[1;34m\]\w\[\033[0m\] ->'
history -a
history -r
hash grep >/dev/null 2>&1 && { alias egrep='grep -E'; alias fgrep='grep -F'; }
hash ps grep >/dev/null 2>&1 && psgrep() {
if [[ -n "$1" ]]; then
# shellcheck disable=SC2009
ps | command grep -E -- "(.*RSS.*|$1)" | command grep -F -v '(.*RSS.*|'
else
printf "%s: %s\\n" "Usage" "${FUNCNAME[0]} <something>" >&2
return 1
fi
}
hash ls >/dev/null 2>&1 && alias ls='ls -Fv --color=always'
hash nc >/dev/null 2>&1 && alias pastebin='nc termbin.com 9999'
echo -ne "\e[2q"
echo -ne "\e]12;#00FF00"
for FILE in "$HOME"/.bashrc.d/*; do
[[ -x "$FILE" ]] && source "$FILE"
done
unset FILE

27
home/sysadmin/.gitconfig Normal file
View file

@ -0,0 +1,27 @@
[user]
name = Darren 'Tadgy' Austin
email = darren@afterdark.org.uk
[color]
branch = auto
diff = auto
grep = auto
interactive = auto
showBranch = auto
status = auto
ui = auto
[credential]
username = tadgy
helper = cache --timeout 2592000
[commit]
verbose = 1
[push]
autoSetupRemote = true
[alias]
c = commit
co = checkout
d = diff
lsut = ls-files --others --exclude-standard --directory --error-unmatch -- ':/*'
p = push
s = status
[init]
defaultBranch = master

8
home/sysadmin/.gitignore vendored Normal file
View file

@ -0,0 +1,8 @@
/*
!/.*
!/.*/
!/.*/**
/.bash_history*
/.gnupg/
/.nano_history

View file

@ -0,0 +1 @@
/search_history

125
home/sysadmin/.nanorc Normal file
View file

@ -0,0 +1,125 @@
## When soft line wrapping is enabled, make it wrap lines at blank characters.
set atblanks
## Use auto-indentation.
set autoindent
## When saving a file, create a backup file by adding a tilde (~).
# set backup
## Automatically hard-wrap the current line when it becomes overlong.
# set breaklonglines
## Do case-sensitive searches by default.
# set casesensitive
## Do not use the line below the title bar.
# set emptyline
## Set the line length for wrapping text and justifying paragraphs.
set fill -2
## Draw a vertical stripe at the given column
#set guidestripe 190
## Remember the used search/replace strings for the next session.
set historylog
## Display a "scrollbar" on the righthand side of the edit window.
# set indicator
## Scroll the buffer contents per half-screen instead of per line.
# set jumpyscrolling
## Display line numbers to the left of the text area.
set linenumbers
## Enable vim-style lock-files.
set locking
## Use libmagic for syntax highlighting suggestions.
# set magic
## Don't display the helpful shortcut lists at the bottom of the screen.
set nohelp
## Don't add newlines to the ends of files.
# set nonewlines
## Save the cursor position of files between editing sessions.
# set positionlog
## Do quick statusbar blanking.
set quickblank
## Do extended regular expression searches by default.
# set regexp
## Make the Home key smarter.
set smarthome
## Enable soft line wrapping (AKA full-line display).
set softwrap
## Use this spelling checker instead of the internal one.
# set speller "aspell -x -c"
## Show flags in the title bar.
set stateflags
## When justifying text, trailing whitespace will automatically be removed.
set trimblanks
## The two characters used to indicate the presence of tabs and spaces.
set whitespace »·
## Detect word boundaries more accurately by treating punctuation
## characters as parts of words.
set wordbounds
## Let an unmodified Backspace or Delete erase the marked region, without
## affecting the cut-buffer.
# set zap
## Paint the interface elements of nano.
set errorcolor brightwhite,red
set functioncolor magenta
set keycolor brightwhite
set numbercolor brightwhite,magenta
set promptcolor brightwhite,magenta
set scrollercolor brightwhite,magenta
set selectedcolor brightwhite,blue
set spotlightcolor black,yellow
set statuscolor brightwhite,magenta
set stripecolor ,magenta
set titlecolor brightwhite,magenta
## Include all existing syntax highlight definitions.
# include "/usr/share/nano/*.nanorc"
## Key bindings.
## The following five functions are not bound to any key by default.
## You may wish to choose different keys than the ones suggested here.
# bind ^S savefile main
# bind M-Q findprevious main
# bind M-W findnext main
# bind M-B cutwordleft main
# bind M-N cutwordright main
## Set this if your Backspace key sends Del most of the time.
# bind Del backspace all
# Unbind the ^J (justification) shortcut as it's annoying.
unbind ^J main
# Allow ^Z to suspend nano.
bind ^Z suspend main
# Allow marking using ^Space.
bind ^Space mark main
# Select buffers.
bind M-9 nextbuf main
bind M-0 prevbuf main
# Use anchors.
bind Ins anchor main
bind M-, prevanchor main
bind M-. nextanchor main

2
home/sysadmin/.ssh/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
/known_hosts
/known_hosts.old

View file

@ -0,0 +1 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICsx4EY4vbDt0TXGZsW9UjOxj+s/mVeytJ7lW5rAu0gS Darren 'Tadgy' Austin <darren@afterdark.org.uk>