-
Notifications
You must be signed in to change notification settings - Fork 0
/
profile
122 lines (102 loc) · 3.83 KB
/
profile
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
#!/usr/bin/bash
# ###############
# $HOME/.profile
# ###############
# This file is immediately parsed and sourced by GDM's login manager upon GUI login.
# When login is through an interactive login shell, it is parsed after `/etc/profile`,
# provided the files `~/.bash_profile`, `.bash_login` do NOT exist.
#
# Our PATH segments are defined here, because `~/.bash_profile` actually sources this
# `~/.profile`. This is recommended because when defining environmental variables only
# in `~/.bash_profile` only the `bash` shell has access to them.
# ###############
# Readline startup file
# ###############
# Handle reading input when in interactive shell
INPUTRC="$HOME"/.inputrc; export INPUTRC # default: ~/.inputrc
# #########
# LANG
# #########
# Probably already set globally for the system
LANG=en_US.UTF-8; export LANG
# #########
# LC_ALL
# #########
# Set local environment variable for locale
# In other locales the ERE [a-d] is typically not equivalent to [abcd];
# interpretation of bracket expressions, use the C locale
#LC_ALL=C; export LC_ALL
# #########
# POSIXLY_CORRECT
# #########
# Enforce a POSIX compliant env.
# This may break things (e.g. Unity desktop on Ubuntu 14.04)
#POSIXLY_CORRECT=1; export POSIXLY_CORRECT
# #########
# VISUAL, EDITOR, SUDO_EDITOR, SYSTEMD_EDITOR
# #########
# Set default text editor to make sure that 'vim' is used with 'visudo'
VISUAL=/usr/bin/vim ; export VISUAL
# When set, VISUAL prevails on env-var EDITOR
#set EDITOR=vim; export EDITOR
SUDO_EDITOR=/usr/bin/vim; export SUDO_EDITOR
SYSTEMD_EDITOR=/usr/bin/vim; export SYSTEMD_EDITOR
# #########
# HADOOP
# #########
HADOOP_HOME=/opt/hadoop; export HADOOP_HOME
# #########
# JAVA
# #########
JAVA_HOME=/usr/lib/jvm/java-8-openjdk; export JAVA_HOME
# #########
# SPARK
# #########
SPARK_HOME=${HOME}/spark/spark; export SPARK_HOME
# #########
# PYTHON
# #########
PYTHONSTARTUP="${HOME}/.pyrc"; export PYTHONSTARTUP
if [ -n "$PYTHONPATH" ]; then
# env-var is not null-string
PYTHONPATH=${PYTHONPATH}:"${HOME}/Documents/Work/Projects"
else
# env-var is null-string
PYTHONPATH="${HOME}/Documents/Work/Projects"
fi
#PYTHONBREAKPOINT=pdb.set_trace; export PYTHONBREAKPOINT # for debugging with 'pdb'
PYTHONBREAKPOINT=pudb.set_trace; export PYTHONBREAKPOINT # for debugging with 'pudb'
# PYENV virtual environment
PYENV_ROOT="${HOME}"/.pyenv; export PYENV_ROOT
# VIRTUALENV's virtualenvwrapper plugin
WORKON_HOME="${HOME}"/.virtualenvs; export WORKON_HOME
mkdir -p "$WORKON_HOME"
PROJECT_HOME="${HOME}"/Documents/Work/Projects/BSC/Sgoab/Src; export PROJECT_HOME
NLTK_DATA="/var/data/nltk_data/"; export NLTK_DATA
# #########
# PATH
# #########
# Notes of caution:
# Do not add path segments in front of PATH as the order of priority for sourcing
# executable files in PATH is from left to right. Misplacing new PATH segments at
# the beginning of PATH would radically modify the picking order when looking for
# executable files.
# This is also meant as a good practice as an attacker could potentially replace
# an innocuous looking cmd by something else in front of the PATH env var.
# Use $HOME/ instead of ~/ in PATH for portability
PATH=$PATH:/opt/bin:/opt/scripts
PATH=$PATH:${HOME}/Documents/Scripts # use $HOME/ instead of ~/ for portability
PATH=$PATH:${HOME}/.local/bin
PATH=$PATH:${HADOOP_HOME}/bin
PATH=$PATH:${SPARK_HOME}/bin
PATH=${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:$PATH # note that PATH is pre-pended
# #########
# PATH CLEANING
# #########
PATH=$(/opt/scripts/pathclean PATH "$PATH")
export PATH # only necessary for the old Bourne shell.
PYTHONPATH=$(/opt/scripts/pathclean PYTHONPATH "$PYTHONPATH")
export PYTHONPATH # only necessary for the old Bourne shell.
# Make sure that systemd is made aware of custom PATHs.
# This does NOT affect services started before `.bash_profile` is sourced.
systemctl --user import-environment PATH