Updated file-structure and transfered data out of local bashrc
This commit is contained in:
50
bash/bashcolors.rc
Normal file
50
bash/bashcolors.rc
Normal file
@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
# Regular
|
||||
txtblk="$(tput setaf 0 2>/dev/null || echo '\e[0;30m')" # Black
|
||||
txtred="$(tput setaf 1 2>/dev/null || echo '\e[0;31m')" # Red
|
||||
txtgrn="$(tput setaf 2 2>/dev/null || echo '\e[0;32m')" # Green
|
||||
txtylw="$(tput setaf 3 2>/dev/null || echo '\e[0;33m')" # Yellow
|
||||
txtblu="$(tput setaf 4 2>/dev/null || echo '\e[0;34m')" # Blue
|
||||
txtpur="$(tput setaf 5 2>/dev/null || echo '\e[0;35m')" # Purple
|
||||
txtcyn="$(tput setaf 6 2>/dev/null || echo '\e[0;36m')" # Cyan
|
||||
txtwht="$(tput setaf 7 2>/dev/null || echo '\e[0;37m')" # White
|
||||
|
||||
# Bold
|
||||
bldblk="$(tput setaf 0 2>/dev/null)$(tput bold 2>/dev/null || echo '\e[1;30m')" # Black
|
||||
bldred="$(tput setaf 1 2>/dev/null)$(tput bold 2>/dev/null || echo '\e[1;31m')" # Red
|
||||
bldgrn="$(tput setaf 2 2>/dev/null)$(tput bold 2>/dev/null || echo '\e[1;32m')" # Green
|
||||
bldylw="$(tput setaf 3 2>/dev/null)$(tput bold 2>/dev/null || echo '\e[1;33m')" # Yellow
|
||||
bldblu="$(tput setaf 4 2>/dev/null)$(tput bold 2>/dev/null || echo '\e[1;34m')" # Blue
|
||||
bldpur="$(tput setaf 5 2>/dev/null)$(tput bold 2>/dev/null || echo '\e[1;35m')" # Purple
|
||||
bldcyn="$(tput setaf 6 2>/dev/null)$(tput bold 2>/dev/null || echo '\e[1;36m')" # Cyan
|
||||
bldwht="$(tput setaf 7 2>/dev/null)$(tput bold 2>/dev/null || echo '\e[1;37m')" # White
|
||||
|
||||
# Underline
|
||||
undblk="$(tput setaf 0 2>/dev/null)$(tput smul 2>/dev/null || echo '\e[4;30m')" # Black
|
||||
undred="$(tput setaf 1 2>/dev/null)$(tput smul 2>/dev/null || echo '\e[4;31m')" # Red
|
||||
undgrn="$(tput setaf 2 2>/dev/null)$(tput smul 2>/dev/null || echo '\e[4;32m')" # Green
|
||||
undylw="$(tput setaf 3 2>/dev/null)$(tput smul 2>/dev/null || echo '\e[4;33m')" # Yellow
|
||||
undblu="$(tput setaf 4 2>/dev/null)$(tput smul 2>/dev/null || echo '\e[4;34m')" # Blue
|
||||
undpur="$(tput setaf 5 2>/dev/null)$(tput smul 2>/dev/null || echo '\e[4;35m')" # Purple
|
||||
undcyn="$(tput setaf 6 2>/dev/null)$(tput smul 2>/dev/null || echo '\e[4;36m')" # Cyan
|
||||
undwht="$(tput setaf 7 2>/dev/null)$(tput smul 2>/dev/null || echo '\e[4;37m')" # White
|
||||
|
||||
# Background
|
||||
bakblk="$(tput setab 0 2>/dev/null || echo '\e[40m')" # Black
|
||||
bakred="$(tput setab 1 2>/dev/null || echo '\e[41m')" # Red
|
||||
bakgrn="$(tput setab 2 2>/dev/null || echo '\e[42m')" # Green
|
||||
bakylw="$(tput setab 3 2>/dev/null || echo '\e[43m')" # Yellow
|
||||
bakblu="$(tput setab 4 2>/dev/null || echo '\e[44m')" # Blue
|
||||
bakpur="$(tput setab 5 2>/dev/null || echo '\e[45m')" # Purple
|
||||
bakcyn="$(tput setab 6 2>/dev/null || echo '\e[46m')" # Cyan
|
||||
bakwht="$(tput setab 7 2>/dev/null || echo '\e[47m')" # White
|
||||
|
||||
# Reset
|
||||
txtrst="$(tput sgr 0 2>/dev/null || echo '\e[0m')" # Text Reset
|
||||
|
||||
parse_git_branch(){
|
||||
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \[\1\]/'
|
||||
}
|
||||
|
||||
# bash prompt
|
||||
PS1="\[$bldylw\] ☕ \[$txtblu\]\u\[$txtred\] :: \[$txtgrn\]\[$txtylw\]\w\[$bldcyn\]\$(parse_git_branch)\[$txtgrn\]$DEFAULT \n \$ \[$txtrst\]"
|
20
bash/fun.rc
Normal file
20
bash/fun.rc
Normal file
@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
alias cheerup="clear; echo; fortune | cowsay -f stegosaurus | lolcat; echo;"
|
||||
|
||||
function pika {
|
||||
local DIRECTORY="$HOME/Pictures/pika";
|
||||
|
||||
[ ! -d $DIRECTORY ] && echo "Pikachu directory required." && exit 1;
|
||||
|
||||
# count the pikas
|
||||
IMAGE_COUNT=$(ls -l $DIRECTORY | wc -l);
|
||||
let "IMAGE_COUNT=IMAGE_COUNT-1";
|
||||
|
||||
# pick a random gif from the pikachu directory
|
||||
IMAGE="$DIRECTORY/$((RANDOM % $IMAGE_COUNT)).gif";
|
||||
|
||||
echo;
|
||||
imgcat $IMAGE
|
||||
echo;
|
||||
}
|
||||
alias pikabox='while true; do clear; pika; sleep 120; done'
|
36
bash/osx/color-ls.rc
Normal file
36
bash/osx/color-ls.rc
Normal file
@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
# Colors are organized into (Foreground)(Background) bits as seen below:
|
||||
# ========
|
||||
# 1 - Directory
|
||||
# 2 - Symbolic link
|
||||
# 3 - Socket
|
||||
# 4 - Pipe
|
||||
# 5 - Executable
|
||||
# 6 - Block special
|
||||
# 7 - Character special
|
||||
# 8 - Executable with setgid bit set
|
||||
# 9 - Executable with setgid bit set
|
||||
# 10- Directory writable to others, with sticky bit
|
||||
# 11- Directory writable to others, without sticky bit
|
||||
# ========
|
||||
# a black
|
||||
# b red
|
||||
# c green
|
||||
# d brown
|
||||
# e blue
|
||||
# f magenta
|
||||
# g cyan
|
||||
# h light grey
|
||||
# CAPITAL (BOLD)
|
||||
# x default
|
||||
|
||||
# actual colorscheme
|
||||
export LSCOLORS="ExxxxxDxBxxxxxxxxxxxxx"
|
||||
|
||||
# for OSX, fixes spacing issues
|
||||
f_notabs=0
|
||||
|
||||
# default ls to use defined colorscheme
|
||||
alias ls='ls -G'
|
||||
|
||||
|
14
bash/osx/fun.rc
Normal file
14
bash/osx/fun.rc
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
function planktimer() {
|
||||
# dependencies: 'say' 'termdown'
|
||||
while true;
|
||||
do
|
||||
termdown 1h30m;
|
||||
clear;
|
||||
figlet "Plank Time" | lolcat;
|
||||
say -v $(say -v ? | sed -n "/en_/p" | sed "s/ .*//" | shuf -n 1) "plank time";
|
||||
read -n 1;
|
||||
termdown 65;
|
||||
say -v $(say -v ? | sed -n "/en_/p" | sed "s/ .*//" | shuf -n 1) "done";
|
||||
done
|
||||
}
|
42
bash/rentdynamics.rc
Normal file
42
bash/rentdynamics.rc
Normal file
@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
RD_PATH='/Users/w0ryn/Documents/RentDynamics';
|
||||
|
||||
alias rdvmail='VMAIL_HOME=~/.vmail/business1 vmail';
|
||||
|
||||
|
||||
function rnt() {
|
||||
# filestructure needed:
|
||||
# RD_PATH/project-name
|
||||
# > /code (git clone)
|
||||
# > /env (virtualenv)
|
||||
deactivate >/dev/null 2>/dev/null || deactivate_node >/dev/null 2>/dev/null;
|
||||
cd $RD_PATH;
|
||||
|
||||
local cont=0;
|
||||
[ $1 ] \
|
||||
&& [ -d $RD_PATH/$1 ] \
|
||||
&& cd $1 >/dev/null 2>/dev/null \
|
||||
|| cont=1;
|
||||
|
||||
if [ $cont -eq 0 ]; then
|
||||
[ -f ./env/bin/activate ] \
|
||||
&& source ./env/bin/activate \
|
||||
|| echo No environment here, boss!;
|
||||
[ -d ./code ] \
|
||||
&& cd code \
|
||||
|| echo No source folder here!;
|
||||
fi
|
||||
}
|
||||
_rnt () { # autocompletion
|
||||
# Set
|
||||
local cur=${COMP_WORDS[COMP_CWORD]}
|
||||
COMPREPLY=( $(compgen -W "$(ls $RD_PATH)" -- $cur) )
|
||||
}
|
||||
complete -F _rnt rnt;
|
||||
|
||||
function refresh_rd_db() {
|
||||
psql postgres -c "DROP DATABASE rentdynamics;"
|
||||
psql postgres -c "CREATE DATABASE rentdynamics with owner rd;"
|
||||
psql postgres -c "DROP DATABASE rdrentplus;"
|
||||
psql postgres -c "CREATE DATABASE rdrentplus with owner rd;"
|
||||
}
|
28
bash/school.rc
Normal file
28
bash/school.rc
Normal file
@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
SCHOOL_DIR="$HOME/Documents/School";
|
||||
|
||||
# -------------------------------------
|
||||
# -- School (Spring 2019) -------------
|
||||
# -------------------------------------
|
||||
alias school="cd $SCHOOL_DIR";
|
||||
alias classes='cat ~/Documents/School/.classes' #'echo \* \(cs2810\) comparch; echo \* \(cs3100\) opsys; echo \* \(cs3450\) softeng; echo \* \(cs5050\) advalgos; echo \* hackusu; echo \* gamenight; echo'
|
||||
alias comparch='school; cd cs2810-comparch;'
|
||||
alias cs2810='comparch'
|
||||
alias opsys='school; cd cs3100-opsys'
|
||||
alias cs3100='opsys'
|
||||
alias softeng='school; cd cs3450-softeng'
|
||||
alias cs3450='softeng'
|
||||
alias advalgos='school; cd cs5050-advalgos'
|
||||
alias cs5050='advalgos'
|
||||
|
||||
|
||||
HW_TEMPLATE="$DOTWRYN/latex/homework_template.tex"
|
||||
function hw() {
|
||||
# Make new homework .tex from default template
|
||||
[ ! $1 ] && echo "Homework filename required" && exit 1;
|
||||
|
||||
NEW_HW="./$1.tex";
|
||||
[ ! -f $NEW_HW ] && cp $HW_TEMPLATE $NEW_HW;
|
||||
vim $NEW_HW;
|
||||
}
|
6
bash/time.rc
Normal file
6
bash/time.rc
Normal file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
alias datereadable='date +"%A %B %d, %Y"'
|
||||
|
||||
function clock() {
|
||||
watch -t -n1 "date +'%H : %M : %S' | figlet";
|
||||
}
|
Reference in New Issue
Block a user