-
Notifications
You must be signed in to change notification settings - Fork 0
/
.profile-user
162 lines (131 loc) · 4.18 KB
/
.profile-user
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
#!/usr/bin/env bash
#ident "@(#)profile-user 0.9 01/07/08 FDS"
#
# This is the default standard profile provided to users.
# They are expected to edit it to meet their own needs.
#
if [ -e /var/cfengine/classes/nextgen ]
then
# shellcheck disable=1091
# 3rd party code
source /home/fonix/prd_progs/tools/engineering-login.sh
fi
# less resize bugs
shopt -s checkwinsize
# don't get booted for inactivity
unset autologout
ME=$(whoami)
export DISPLAY="${ME}pc.pc.factset.com:0.0"
# Load directory color maps
[[ -f "$HOME/.dir_colors" ]] && eval "$(dircolors "${HOME}/.dir_colors")"
# Better ssh interrupt support. Causes less hangs
stty -ixon -ixoff
# Use the unix standard editor
export EDITOR=nvim
export P4EDITOR=nvim
export P4MERGE='nvim -d'
# : user@hostname[$PWD] ;
# use : PS1 ; format so that it can be a no-op when pasted
export PS1=": \u@\h:[\W]; "
# set ps2 for easy mutiline pastes
export PS2=" "
# Retain bash history like zsh
#shopt -s histappend
export HISTSIZE=100000
export HISTCONTROL=ignoredups:erasedups:ignorespace
export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -c; history -r"
# fix linewrapping
shopt -s checkwinsize
# These two should be set already but I set them explicitly
# and I don't know why. Leaving them there for now
export LANG=en_US.UTF-8
export P4USER=bbatha
unset LD_LIBRARY_PATH
export PATH="$HOME/.linuxbrew/bin:$PATH"
# shellcheck disable=2155
export PATH="$(brew --prefix)/sbin:$PATH"
# shellcheck disable=2155
export MANPATH="$(brew --prefix)/share/man:$MANPATH"
# shellcheck disable=2155
export INFOPATH="$(brew --prefix)/share/info:$INFOPATH"
export PATH="$HOME/.local/bin:$PATH"
export XDG_CONFIG_HOME="$HOME/.config"
# Don't need latest ruby or node on scrn hosts
if [[ "$(hostname)" != "unixscrn"* ]]
then
# rbenv
eval "$(rbenv init -)"
# nvm
export NVM_DIR="$HOME/.nvm"
# shellcheck disable=1090
. "$(brew --prefix nvm)/nvm.sh"
# rustup
export PATH="$PATH:$HOME/.cargo/bin"
export RUST_SRC_PATH="$HOME/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src"
# Go
export GOPATH="$HOME/go"
export PATH="$PATH:$GOPATH/bin"
# homebrew go is busted use our own copy for now
export GOROOT="$HOME/.local/go"
export PATH="$PATH:$GOROOT/bin"
if [ -f "$(brew --prefix)/etc/bash_completion" ]; then
# shellcheck disable=1090
. "$(brew --prefix)/etc/bash_completion"
fi
export PGHOME="$HOME/.local/psql"
export PGDATA="$PGHOME/data"
fi
function pg_ctl {
case "$*" in
start* ) shift 1; command pg_ctl start -l "$PGHOME/log" ;;
*) command pg_ctl "$@" ;;
esac
}
# Scratch directory
export SCRATCH_HOME=/home/dev/scratch/developers/bbatha
# Make grep colorful
export GREP_OPTIONS='--color=auto'
# p4fds is an abomination. Nuke it from orbit
unalias p4 >/dev/null 2>/dev/null
# review board uploader
alias rb='/home/data/index/script/common/submit_review_board.pl'
# use ls colors and prefix symbols for executable, and folders
alias ls='ls -hF --color=auto'
# enable x forwarding
alias ssh='ssh -X'
# pub build tool
alias pub='/home/dev/build/pub/bin/pub'
# disable cores for tmux
alias tmux='ulimit -c 0; command tmux'
# typing in bundle exec all the time is annoying
alias be='bundle exec'
# render escaped color sequences
alias less='less -R'
# neovim
alias vim='nvim'
# p4view --check testing
alias p4view='/home/fonix/prd_progs/build/cross_platform/testing/p4view_check/p4view'
# syntax highlighting cat
alias ccat='pygmentize -g'
# grant some lima tokens
alias lima-curl='curl -H "$(/home/fds/svc_lima/bin/lima_token $USER FDS | tr -d '\''\r'\'')"'
# syntax highlighting less
function cless() {
pygmentize -g "${1}" | less
}
# this is how you hack aliases for subcommands
# for p4 we want to intercept vdiff and launch vimdiff instead
# of using the normal gdiff
function p4() {
# use command p4 when not using p4fds
case "$*" in
vdiff2* ) shift 1; P4DIFF="vim -d" command p4 diff2 "$@" ;;
vdiff* ) shift 1; P4DIFF="vim -d" command p4 diff "$@" ;;
diff2* ) shift 1; P4DIFF=colordiff command p4 diff2 -du "$@" ;;
diff* ) shift 1; P4DIFF=colordiff command p4 diff -du "$@" ;;
* ) command p4 "$@" ;;
esac
}
# secret tokens
# shellcheck disable=1090
. "$HOME/.tokens"