diff --git a/labguide/computing/sherlock/access-and-resources.md b/labguide/computing/sherlock/access-and-resources.md index 8f64ffa..04b1532 100644 --- a/labguide/computing/sherlock/access-and-resources.md +++ b/labguide/computing/sherlock/access-and-resources.md @@ -8,7 +8,7 @@ If you are a new member of a lab at stanford, you will need to have your PI emai Once you have an account set up with your SUNet ID ``, you can access Sherlock via any SSH client client. If you are using a UNIX-like system (e.g., MacOS) and you are using terminal to connect to sherlock, a useful resource is to set up an ssh config file. You can do this by editing or creating the file `~/.ssh/config`, and adding the following lines: -``` +```{.default filename="~/.ssh/config"} Host sherlock HostName login.sherlock.stanford.edu User @@ -16,7 +16,8 @@ Host sherlock ``` Navigating to terminal, you can login to Sherlock using: -``` + +```bash $ ssh sherlock ``` @@ -32,10 +33,10 @@ Sherlock has fixed allocations for the storage of individuals and groups. As suc To check your quotas for your group ``, you can use the `sh_quota` command: -``` +```default $ sh_quota +---------------------------------------------------------------------------+ -| Disk usage for user (group: ) | +| Disk usage for user (group: ) | +---------------------------------------------------------------------------+ | Filesystem | volume / limit | inodes / limit | +---------------------------------------------------------------------------+ @@ -51,13 +52,13 @@ When your home directory begins to get filled, it may be valuable to consider mo Another useful tool is the disk usage command `du`. A useful and more interacrtive version of this command is `ncdu`. To use `ncdu`, add the following line to the bottom of your `~/.bash_profile`, which will load the `ncdu` module each time you log in to Sherlock: -``` -ml system ncdu +```bash +$ ml system ncdu ``` Next, re log-in and access the `ncdu` command: -``` +```bash $ ncdu ``` @@ -70,7 +71,7 @@ which will launch an interactive window for monitoring directory sizes from the Some data resources cannot be shared across the lab and instead need to be restricted to lab members with Data Usage Agreement (DUA) access. The following can be adapted to restrict ACLs (access control list) to only the appropriate subset of lab members: -``` +```{.bash filename="protect_access.sh"} #!/bin/bash echo "Using ACLs to restrict folder access on oak for russpold folders" @@ -87,10 +88,10 @@ fi read -p "Enter the username: " user_name # set restrictions -echo -e "Setting restrictions for ${user_name} as rxw for folder: /n ${dir_name" +echo -e "Setting restrictions for ${user_name} as rxw for folder: /n ${dir_name}" setfacl -R -m u:$user_name:rwx $dir_name setfacl -R -d -m u:$user_name:rwx $dir_name # rm default permissions for the group -- oak_russpold setfacl -m d::group:oak_russpold:--- $dir_name -``` \ No newline at end of file +``` diff --git a/labguide/computing/sherlock/data-management.md b/labguide/computing/sherlock/data-management.md index d889560..002c9f2 100644 --- a/labguide/computing/sherlock/data-management.md +++ b/labguide/computing/sherlock/data-management.md @@ -6,7 +6,7 @@ Once the dataset is finalized, it should be moved into the “data” directory. Once a dataset has been installed in the data directory, it should be changed to be read-only for owner and group, using the following commands: -``` +```bash find -type d -exec chmod 550 find -type f -exec chmod 440 ``` diff --git a/labguide/computing/sherlock/job-submission.md b/labguide/computing/sherlock/job-submission.md index f001787..7f318c7 100644 --- a/labguide/computing/sherlock/job-submission.md +++ b/labguide/computing/sherlock/job-submission.md @@ -9,7 +9,7 @@ Those should be submitted to the scheduler which will dispatch them on compute n You can check available resources with the `sh_part` command: -``` +```default $ sh_part QUEUE STA FREE TOTAL FREE TOTAL RESORC OTHER MAXJOBTIME CORES NODE GRES PARTITION TUS CORES CORES NODES NODES PENDNG PENDNG DAY-HR:MN /NODE MEM-GB (COUNT) @@ -103,7 +103,7 @@ Since lab members will often submit many fMRIPrep jobs at the same time, it is b We provide an example fMRIPrep array job script below for running 5 individual subjects. -``` +```{.bash filename="submit_fmriprep_array.sh"} #!/bin/bash # #SBATCH --job-name=fMRIPrep