Languages
9,960 gist results
9,960 gist results
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # style | |
| light_red="\033[1;31m" | |
| yellow="\033[1;33m" | |
| light_blue="\033[1;34m" | |
| light_purple="\033[1;35m" | |
| bold="\033[1m" | |
| end="\033[0m" | |
| # setup ps1 | |
| update_ps1() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #from unix.stackexchange - https://unix.stackexchange.com/questions/124407/what-color-codes-can-i-use-in-my-bash-ps1-prompt | |
| black_txt='\e[0;30m' # Black | |
| red_txt='\e[0;31m' # Red | |
| green_txt='\e[0;32m' # Green | |
| yellow_txt='\e[0;33m' # Yellow | |
| blue_txt='\e[0;34m' # Blue | |
| purple_txt='\e[0;35m' # Purple | |
| cyan_txt='\e[0;36m' # Cyan | |
| white_txt='\e[0;37m' # White | |
| PS1="$cyan_txt"'\w:'$yellow_txt$(kubectl config current-context)":$white_txt " |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| . "$HOME/.cargo/env" | |
| . "$HOME/.rye/env" | |
| export NVM_DIR="$HOME/.nvm" | |
| [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | |
| [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion | |
| # pnpm | |
| export PNPM_HOME="/home/entropybender/.local/share/pnpm" | |
| case ":$PATH:" in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export LD_LIBRARY_PATH=/usr/lib/wsl/lib:$LD_LIBRARY_PATH | |
| export PATH=$PATH:/usr/local/cuda/bin | |
| export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64 | |
| export BROWSER=wslview | |
| function switch_cuda { | |
| if [[ $1 =~ ^[0-9]+\.[0-9]+$ ]]; then | |
| sudo rm /usr/local/cuda |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Your existing configs ... | |
| # Aliases | |
| alias c="clear" | |
| alias ga="git add ." | |
| alias gs="git status" | |
| alias gc="git commit -m" | |
| alias r1="git reset --soft HEAD@{1}" | |
| alias gp="git push" | |
| alias gpl="git pull" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # .bashrc | |
| # | |
| # Author: Blazej Kaczmarek | |
| # GH profile: github.com/MasterDisaster | |
| # email: fajny.masz.tornister@gmail.com | |
| # ORCID: https://orcid.org/0009-0003-1070-8870 | |
| # PEN OID: 1.3.6.1.4.1.53685 | |
| # PEN ASN.1: {iso(1) identified-organization(3) dod(6) internet(1) private(4) enterprise(1) 53685} | |
| # PEN OID url: http://oid-info.com/get/1.3.6.1.4.1.53685 | |
| # Description: It's kind of a rc starting script that simply does a LINTING on dirs in PATH env |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| bind 'set show-all-if-ambiguous on' | |
| # --- Aliases --- | |
| alias pbcopy='xclip -selection clipboard' | |
| alias pbpaste='xclip -selection clipboard -o' | |
| alias please='sudo $(fc -ln -1)' # Rerun last command with sudo | |
| alias top10cpu='ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%cpu | head -n 10' | |
| alias top10mem='ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head -n 10' | |
| alias ports='ss -tuln' | |
| alias listening='lsof -i -P -n | grep LISTEN' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function timestamp_output() { | |
| { "$@"; } 2>&1 | perl -MTime::HiRes=time -MPOSIX=strftime -ne ' | |
| BEGIN { $prev = time(); } | |
| $now = time(); | |
| $delta = sprintf("%.3f", $now - $prev); | |
| $prev = $now; | |
| printf "%ss %s %s", $delta, strftime("%Y-%m-%d %H:%M:%S", localtime($now)), $_; | |
| ' | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # .bashrc | |
| # If not running interactively, don't do anything | |
| [[ $- != *i* ]] && return | |
| export PROMPT_COMMAND='branch=$(git branch --show-current 2>/dev/null); PS1="\[$(tput setaf 28)\]${branch:+($branch) }\[$(tput setaf 226)\]\u\[$(tput setaf 220)\]@\[$(tput setaf 214)\]\h \[$(tput setaf 33)\]\w \[$(tput sgr0)\]$ "' | |
| # Aliases | |
| alias grep="grep --color=auto" | |
| alias gg="lazygit" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # #!/bin/bash | |
| # ~/.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 |