Note

The Funtoo Linux project has transitioned to "Hobby Mode" and this wiki is now read-only.

Difference between revisions of "User:Siris"

From Funtoo
Jump to navigation Jump to search
(converting to form)
Line 1: Line 1:
== About ==
{{Person
 
|Bio=I am an enthusiastic Container Infrastructure Engineer, Site Reliability Engineer, Systems Engineer, Penguin Wrangler, Pythonist, Rubyist, GNU Herder, Midgardian, Westerosi, and Child of Ilúvatar.
[[File:Hello There Obi-Wan.webp|thumb|alt=Hello There|Hello There]]
 
I am an enthusiastic Container Infrastructure Engineer, Site Reliability Engineer, Systems Engineer, Penguin Wrangler, Pythonist, Rubyist, GNU Herder, Midgardian, Westerosi, and Child of Ilúvatar.


My passion with Funtoo Linux runs deep as I have been using Gentoo continuously since 2005 and then shortly there after switching to Funtoo Linux.
My passion with Funtoo Linux runs deep as I have been using Gentoo continuously since 2005 and then shortly there after switching to Funtoo Linux.


The expansive and world changing engineering efforts of the Linux Kernel as the largest globally developed software project has and continues to provide daily inspiration to keep hacking, tinkering, and having fun.
The expansive and world changing engineering efforts of the Linux Kernel as the largest globally developed software project has and continues to provide daily inspiration to keep hacking, tinkering, and having fun.
}}
[[File:Hello There Obi-Wan.webp|thumb|alt=Hello There|Hello There]]


== Current Projects ==
== Current Projects ==

Revision as of 05:37, March 4, 2022



File:Hello There Obi-Wan.webp

Current Projects

Current System

Here are my current Funtoo system's specifications:

pibox #  OS: Funtoo Linux 1.4 x86_64
pibox #  Kernel: 5.16.10_p1-debian-sources
pibox #  Packages: 1259 (emerge)
pibox #  Shell: bash 5.0.18
pibox #  Resolution: 3840x2160
pibox #  WM: Enlightenment
pibox #  Theme: Adwaita [GTK2/3]
pibox #  Icons: Adwaita [GTK2/3]
pibox #  Terminal: terminology
pibox #  Terminal Font: Hack Nerd Font Mono
pibox #  CPU: AMD Ryzen 9 3900X (24) @ 3.800GHz
pibox #  GPU: NVIDIA GeForce RTX 2080 Ti Rev. A
pibox #  Memory: 32101MiB

Current Shell

There are so many fun ways to customize your shell on Funtoo Linux.

Here are some Bash customization that I use on my Funtoo system that have evolved over many years and continue to do so. Have fun with them and customizing them even further.

Aliases

Shell aliases are a great way to supercharge your general workflow and navigation when working in a shell

   .bashrc (Shell source code) - Bash aliases
# Aliases
# General
alias cat='bat -f --paging=never --theme ansi'
alias dsk='df -ahTP'
alias dski='df -ahTPi'
alias e='exit'
alias fxs='declare -f'
alias less='bat  --theme ansi'
alias ll='lsd -alh --group-dirs first'
alias la='lsd -A --group-dirs first'
alias l='lsd -CF --group-dirs first'
alias l1='lsd -1 --group-dirs first'
alias psx='ps auwx

Font

I current use a modified version of the Hack font from the Nerd Fonts project. This is primarily to support rendering of glyphs (icons) natively within your terminal emulator. More specifically to support glyph rendering with the drop in replacement for ls called lsd, that I use in my shell.

Functions

Some useful Bash functions used in and out of my shell prompt:

   .bashrc (Shell source code) - Bash functions
# Functions
# Simple alphanumeric password generator
genalpha() {
  local l=$1
  [ "$l" == "" ] && l=20
  tr -dc 'A-Za-z0-9' < /dev/urandom | head -c ${l} | xargs
}

# Simple random password generator
genrandom() {
  local l=$1
  [ "$l" == "" ] && l=20
  tr -dc 'A-Za-z0-9_!@#$%^&*(),.;[]{}|=+-' < /dev/urandom | head -c ${l} | xargs
}

# Keychain wrapper
key(){
  eval `keychain --eval --agents ssh $1`
}

# Git Prompt
git_prompt ()
{
  c_reset='\[\e[0m\]'
  c_git_clean='\[\e[36;1m\]'
  c_git_dirty='\[\e[31;1m\]'
  if ! git rev-parse --git-dir > /dev/null 2>&1; then
    return 0
  fi

  git_branch=$(git branch 2>/dev/null | sed -n '/^\*/s/^\* //p')

  if git diff --quiet 2>/dev/null >&2; then
    git_color="$c_git_clean"
  else
    git_color="$c_git_dirty"
  fi

  echo "$git_color[$git_branch]${c_reset}"


# kubectl Kubernetes cluster and namespace context
kube_context(){
  context=$(kubectl config get-contexts 2>/dev/null | grep '*' | awk '{print $3,$5}')
  echo "$context"
}

Prompt

The shell prompt is arguably one of the most important aspects of the shell as it quickly and concisely display critical information. Here is a custom one that I use:

   .bashrc (Shell source code) - Bash prompt
# Colors
BLACK=$'\033[30;01m'
RED=$'\033[31;01m'
GREEN=$'\033[32;01m'
YELW=$'\033[33;01m'
BLUE=$'\033[34;01m'
PURP=$'\033[35;01m'
CYAN=$'\033[36;01m'
WHITE=$'\033[37;01m'
OFF=$'\033[0m'

# Prompt
OS_ICON=PROMPT_COMMAND='PS1="\n \[\033[1;34m\]╭─\[\033[0;36m\]\[\033[0;37m\]\[\033[46m\] $OS_ICON \[\033[0;37m\]\[\033[46m\]\u\[\033[0;33m\]\[\033[46m\]@\h \[\033[0m\]\[\033[0;36m\]\[\033[41m\]\[\033[0;31m\]\[\033[41m\]\[\033[0;30m\]\[\033[41m\] \s \V \[\033[0m\]\[\033[0;31m\]\[\033[43m\]\[\033[0;33m\]\[\033[43m\]\[\033[0;30m\]\[\033[43m\]  \t \[\033[0m\]\[\033[0;33m\]\[\033[44m\]\[\033[0;34m\]\[\033[44m\]\[\033[0;30m\]\[\033[44m\]  \W \[\033[0m\]\[\033[0;34m\]\[\033[40m\]\[\033[0;30m\]\[\033[40m\]\[\033[0;37m\]\[\033[40m\]  $(git_prompt) \[\033[0m\]\[\033[0;30m\]\[\033[42m\]\[\033[0;32m\]\[\033[42m\]\[\033[0;30m\]\[\033[42m\]  $(kube_context) \[\033[0m\]\[\033[0;32m\]\[\033[41m\]\[\033[0;31m\]\[\033[41m\]\[\033[0;30m\]\[\033[41m\] \# \[\033[0m\]\[\033[0;31m\]\n \[\033[1;34m\]╰ \[\033[1;36m\]\$ \[\033[0m\]"'
#eval "$(starship init bash)"
   Note

Make sure to always put PROMPT_COMMAND at the very end or bottom of your .bashrc configuration so that it evaluates last

Contact

More information and contact details can be found at my personal site. Happy Hacking.