Hoffman2:Profile: Difference between revisions

From Center for Cognitive Neuroscience
Jump to navigation Jump to search
No edit summary
No edit summary
 
(31 intermediate revisions by 5 users not shown)
Line 1: Line 1:
[[Hoffman2|Back to all things Hoffman2]]
[[Hoffman2|Back to all things Hoffman2]]
<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==
You account has one last thing that needs to be edited before being usable.
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>, e.g.
# Use your favorite [[Text Editors|text editor]] to edit the file <code>~/.bash_profile</code>
#: <pre>$ vim ~/.bash_profile</pre>
=====vim=====
#: or
#: [[Text Editors#Vim (H2) (OSX)|VIM]]
#: <pre>$ emacs ~/.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&#10;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]]
#:* <pre>$ emacs ~/.bash_profile</pre>
# Insert these lines at the '''bottom''' of the file
# Insert these lines at the '''bottom''' of the file
#: <pre>source /u/home/FMRI/apps/etc/profile&#10;umask 007</pre>
#:* Use the arrow keys to scroll the cursor down to the bottom of the document and add a newline.
# Save the file
#:* Type or paste in the specified lines below.
#: With [[Text Editors#Vim|VIM]] you would type
#:* <pre>source /u/project/FMRI/apps/etc/profile&#10;umask 007</pre>
#:: <pre>ESC + ":wq" + ENTER</pre>
# Save the File by typing:
#: With [[Text Editors#Emacs|Emacs]] you would type
#:* <code>CTRL+x, CTRL+c</code>
#:: <pre>CTRL+x, CTRL+c</pre>
# 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&#10;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?====
===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/home/FMRI/apps/etc/profile
  /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 have a default permission of about 770 so that other people in your group have write permissions.
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 43: 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
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 \$ "
Resulting prompt (on a black background)<br/>
<code style="background:#000000; padding:5pt"><span style="color:#FF0000">HOST</span><span style="color:#000000">:</span><span style="color:#0000FF">CURRENT WORKING DIRECTORY</span><br/>
<span style="color:#FFFFFF"> DATETIME IN ISO8601 FORMAT</span> <span style="color:#00FF00">USERNAME $</span></code>
==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 50: 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] -->

Latest revision as of 17:57, 26 June 2017

Back to all things Hoffman2

This page is deprecated. Please see Hoffman2:Modules for more information about CCN-supported software on Hoffman2.