Skip to content

Instantly share code, notes, and snippets.

@k-sriram
Last active November 5, 2021 19:15
Show Gist options
  • Save k-sriram/08d681da9dcad71fe8b0397baf803564 to your computer and use it in GitHub Desktop.
Save k-sriram/08d681da9dcad71fe8b0397baf803564 to your computer and use it in GitHub Desktop.
Linux configuration files
#
# ~/.bashrc
#
[ -f "$HOME/.shrc" ] && . $HOME/.shrc
red=31
lightred=91
green=32
lightgreen=92
yellow=33
fgc=39
astrodow(){
local adow_symb=(☉ ☾ ♂ ☿ ♃ ♀ ♄)
echo -e ${adow_symb[$(command date +%w)]}
}
userhostname_ps1(){
[[ $(who | awk '{ print $5 }') != '(:0)' ]] && echo -e [$(whoami)@$(hostname -s)]" "
}
git_ps1() {
gps1=''
if [[ $(git rev-parse --is-inside-work-tree 2>/dev/null) == 'true' ]]; then
if [[ -z $(git status --porcelain) ]]; then
gps1="\033[01;${lightgreen}m"
else
if [[ -z $(git status --porcelain | grep '^.[^ ]') ]]; then
gps1="\033[01;${yellow}m"
else
gps1="\033[01;${lightred}m"
fi
fi
gps1=$gps1$(git branch 2>/dev/null | grep '^*' | colrm 1 1)
fi
echo -e $gps1
}
alias weather='curl -s "wttr.in/Bengaluru?1n"'
export VISUAL="vim"
if [ $TERM = "xterm" ]
then
export PS1="\A [\u@\h \W] \$ "
else
export PS1="\[\033[${red}m\]\$(adow) \A \[\033[01;${green}m\]$(userhostname_ps1)\[\033[01;${fgc}m\]\W\$(git_ps1)\[\033[01;${green}m\] \$\[\033[00m\] "
fi
import numpy as np
from matplotlib import pyplot as plt
from astropy.io import fits
export PATH=$HOME/.local/bin:$PATH
export PYTHONSTARTUP=$HOME/.pythonstartup.py
alias ⋊=code #^U22ca
alias weather='curl -s "wttr.in/Bengaluru?1n"'
# Settinge XDG Base Directories
XDG_CONFIG_HOME="$HOME/.config"
XDG_DATA_HOME="$HOME/.local/share"
XDG_CACHE_HOME="$HOME/.cache"
XDG_STATE_HOME="$HOME/.local/state"
source /usr/share/vim/vim*/defaults.vim
set mouse=
colo jellybeans
#!/usr/bin/env sh
cd ~/iraf
xgterm -sbr -fn 10x20 -bg gray10 -fg gray75 -title "Image Reduction and Analysis Facility (IRAF)" -e "ecl" &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment