Hoffman2:Profile: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(29 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
[[Hoffman2|Back to all things Hoffman2]] | [[Hoffman2|Back to all things Hoffman2]] | ||
In UNIX systems, there are certain configuration files that get executed every time you login. If you are using the Bash shell (default), you have a file called <code>.bash_profile</code> which is processed when you log in. In order to make the FMRI toolset available to you on Hoffman2 and so you can work well with others, we recommend that you follow the instructions in the [[Hoffman2:Profile#Basics|Basics | <blockquote style="border: solid red 2px; font-weight: bold; padding: 2px; background-color: lightgray;">This page is deprecated. Please see [[Hoffman2:Modules]] for more information about CCN-supported software on Hoffman2.</blockquote> | ||
<!-- In UNIX systems, there are certain configuration files that get executed every time you login. If you are using the Bash shell (default), you have a file called <code>.bash_profile</code> which is processed when you log in. In order to make the FMRI toolset available to you on Hoffman2 and so you can work well with others, we recommend that you follow the instructions in the [[Hoffman2:Profile#Basics|Basics]] section. Read [[Hoffman2:Profile#Extras|Extras]] for some bells and whistles. | |||
==Basics== | ==Basics== | ||
Your account has one last thing that needs to be edited before being usable. | |||
# [[Hoffman2:Accessing the Cluster#SSH - Command Line|SSH into Hoffman2]] | # [[Hoffman2:Accessing the Cluster#SSH - Command Line|SSH into Hoffman2]] | ||
# Use your favorite [[Text Editors|text editor]] to edit the file <code>~/.bash_profile</code> | # Use your favorite [[Text Editors|text editor]] to edit the file <code>~/.bash_profile</code> | ||
=====vim===== | |||
#: [[Text Editors#Vim (H2) (OSX)|VIM]] | #: [[Text Editors#Vim (H2) (OSX)|VIM]] | ||
#:* <pre>$ vim ~/.bash_profile</pre> | #:* <pre>$ vim ~/.bash_profile</pre> | ||
# Insert these lines at the '''bottom''' of the file | |||
#:* Type <code>G</code> - (capital G) to go to the end of the file | |||
#:* Type <code>A</code> - (capital A) to go to the end of the line and enter insert mode | |||
#:* Type <code>ENTER</code> - to insert a newline | |||
#:* Type or paste in the lines below. | |||
#:* <pre>source /u/project/FMRI/apps/etc/profile umask 007</pre> | |||
# Save the file by typing | |||
#:* <code>ESC + ":wq" + ENTER</code> | |||
# Log out of Hoffman2 and the next time you log in, everything will be set for you to start working. | |||
=====emacs===== | |||
#: [[Text Editors#Emacs (H2) (OSX)|Emacs]] | #: [[Text Editors#Emacs (H2) (OSX)|Emacs]] | ||
#:* <pre>$ emacs ~/.bash_profile</pre> | #:* <pre>$ emacs ~/.bash_profile</pre> | ||
# Insert these lines at the '''bottom''' of the file | # Insert these lines at the '''bottom''' of the file | ||
#:* Use the arrow keys to scroll the cursor down to the bottom of the document and add a newline. | #:* Use the arrow keys to scroll the cursor down to the bottom of the document and add a newline. | ||
#:* Type or paste in the specified lines. | #:* Type or paste in the specified lines below. | ||
#:* <pre>source /u/project/FMRI/apps/etc/profile umask 007</pre> | |||
# Save the File by typing: | |||
#:* < | |||
#: | |||
#:* <code>CTRL+x, CTRL+c</code> | #:* <code>CTRL+x, CTRL+c</code> | ||
#: [[Text Editors# | # Log out of Hoffman2 and the next time you log in, everything will be set for you to start working. | ||
#:* < | |||
# | =====nedit/gedit===== | ||
#: | #: [[Text Editors#NEdit (H2) (OSX)|NEdit]] | ||
#: | #:* <pre>$ nedit ~/.bash_profile</pre> | ||
# Use the menu and Insert these lines at the '''bottom''' of the file | |||
#:* <pre>source /u/project/FMRI/apps/etc/profile umask 007</pre> | |||
#: Click the Save menu button. | |||
# Log out of Hoffman2 and the next time you log in, everything will be set for you to start working. | # Log out of Hoffman2 and the next time you log in, everything will be set for you to start working. | ||
===Curious?=== | |||
For those that care, what you are doing is asking the computer to execute the file | For those that care, what you are doing is asking the computer to execute the file | ||
/u/ | /u/project/FMRI/apps/etc/profile | ||
every time you login. This file modifies your PATH variable so you have access to the FMRI toolset. | every time you login. This file modifies your PATH variable so you have access to the FMRI toolset. | ||
The last line | The last line | ||
umask 007 | umask 007 | ||
makes it so that any files you create will | makes it so that any files you create will not allow "anyone" outside your group to read, write, or execute files and directories you make. This does not automatically grant read, write, and execute privileges to you and your group though. | ||
==Extras== | ==Extras== | ||
===Collaboration=== | |||
By default, any files and directories you create will not necessarily have permissions that allow your group to write on them. This can be a problem if other people are supposed to build on data you processed. We have a script ([[Hoffman2:Scripts:fix_perms.sh |fix_perms.sh]]) that will kindly find any files you own in a specified directory that don't have read/write/execute permissions for the group and make it so they do. | |||
You can build this script into your bash profile so that every time you log into Hoffman2, it will run in the background. It is also recommended that you run this script at the end of jobs to make results immediately available to collaborators. | |||
Adding the line | |||
fix_perms.sh -q /u/project/[GROUP]/data & | |||
to the end of your bash profile will run the permission fixer on your group's common data directory in the background quietly each time you log in. '''Make sure to replace [GROUP] with the name of your Hoffman2 group (e.g. mscohen, sbook, cbearden, laltshul, jfeusner or mgreen).''' | |||
===Colors=== | |||
You can change the content and color of your command prompt by editing your bash_profile. There is a great explanation of how to do this [http://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html here]. | You can change the content and color of your command prompt by editing your bash_profile. There is a great explanation of how to do this [http://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html here]. | ||
Line 65: | Line 79: | ||
: The name of the computer you are logged into. This also helps you know where you are at all times. | : The name of the computer you are logged into. This also helps you know where you are at all times. | ||
Line to add to your bash profile | Line to add to your bash profile | ||
export PS1="\[\e[0;31m\]\h\[\e[1;37m\]:\[\e[1;34m\]\w\n\[\e[1;37m\]\D{%Y-%m-%d-%H-%M-%S} \[\e[22;32m\]\u \$ " | export PS1="\[\e[0;31m\]\h\[\e[1;37m\]:\[\e[1;34m\]\w\n\[\e[1;37m\]\D{%Y-%m-%d-%H-%M-%S} \[\e[22;32m\]\u \$ " | ||
Line 73: | Line 86: | ||
==Example Bash Profile== | |||
<nowiki>#.bash_profile | |||
# Get the aliases and functions | |||
if [ -f ~/.bashrc ]; then | |||
. ~/.bashrc | |||
fi | |||
# Source to use FMRI Apps | |||
source /u/project/FMRI/apps/etc/profile | |||
# Umask (Revoke Permissions) | |||
umask 007 | |||
# Collaborative permissions (Replace collabDirectory with your project Directory and Uncomment | |||
#fix_perms.sh -q /u/project/sbook/data/collabDirectory & | |||
# Happy Colors | |||
export PS1="\[\e[0;31m\]\h\[\e[1;37m\]:\[\e[1;34m\]\w\n\[\e[1;37m\]\D{%Y-%m-%d-%H-%M-%S} \[\e[22;32m\]\u \$ " | |||
# Fix for QRSH when consolidating job output files | |||
alias qrsh='qrsh -o /dev/null' | |||
</nowiki> | |||
== Changing Passwords == | |||
How to change your Hoffman2 password. | |||
: [[Hoffman2:Changing Passwords]]. | |||
== Password-less Logins == | |||
Log in to Hoffman2 without typing your password every time. | |||
: [[Hoffman2:Password-less Logins]]. | |||
==External Links== | ==External Links== | ||
Line 79: | Line 125: | ||
*[http://www.cyberciti.biz/tips/understanding-linux-unix-umask-value-usage.html Better explanation of umask] | *[http://www.cyberciti.biz/tips/understanding-linux-unix-umask-value-usage.html Better explanation of umask] | ||
*[http://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html Coloration] | *[http://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html Coloration] | ||
*[http://en.wikipedia.org/wiki/ISO_8601 ISO 8601 Datetime format] | *[http://en.wikipedia.org/wiki/ISO_8601 ISO 8601 Datetime format] --> |
Latest revision as of 17:57, 26 June 2017
This page is deprecated. Please see Hoffman2:Modules for more information about CCN-supported software on Hoffman2.