Skip to content

Commit 5500535

Browse files
committed
update block type
1 parent dcc88cd commit 5500535

File tree

2 files changed

+37
-37
lines changed

2 files changed

+37
-37
lines changed

_episodes/01-connecting.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ From within the NYU network, that is, from an on-campus location, or after you V
3434

3535
To log in to the HPC cluster (Greene), simply use:
3636

37-
```
37+
```bash
3838
ssh <NYUNetID>@greene.hpc.nyu.edu
3939
```
4040

@@ -255,13 +255,13 @@ that you will log in to.
255255

256256
Once you have opened a terminal check for existing SSH keys and filenames
257257
since existing SSH keys are overwritten,
258-
```
258+
```bash
259259
$ ls ~/.ssh/
260260
```
261261
{: .language-bash}
262262

263263
then generate a new public-private key pair,
264-
```
264+
```bash
265265
$ ssh-keygen -t ed25519 -a 100 -f ~/.ssh/id_{{ site.workshop_host }}_ed25519
266266
```
267267
{: .language-bash}
@@ -281,7 +281,7 @@ $ ssh-keygen -t ed25519 -a 100 -f ~/.ssh/id_{{ site.workshop_host }}_ed25519
281281
If ed25519 is not available, use the older (but strong and trusted)
282282
[RSA](https://en.wikipedia.org/wiki/RSA_(cryptosystem)) cryptography:
283283

284-
```
284+
```bash
285285
$ ls ~/.ssh/
286286
$ ssh-keygen -o -a 100 -t rsa -b 4096 -f ~/.ssh/id_{{ site.workshop_host }}_rsa
287287
```
@@ -337,27 +337,27 @@ when using SSH keys and `ssh [email protected]` if only
337337
password access is available. Let's attempt to connect to the HPC system
338338
now:
339339

340-
```
340+
```bash
341341
ssh -i ~/.ssh/key_{{ site.workshop_host }}_ed25519 yourUsername@{{ site.workshop_host_login }}
342342
```
343343
{: .language-bash}
344344

345345
or
346346

347-
```
347+
```bash
348348
ssh -i ~/.ssh/key_{{ site.workshop_host }}_rsa yourUsername@{{ site.workshop_host_login }}
349349
```
350350
{: .language-bash}
351351

352352
or if SSH keys have not been enabled
353353

354-
```
354+
```bash
355355
ssh yourUsername@{{ site.workshop_host_login }}
356356
```
357357
{: .language-bash}
358358

359359

360-
```
360+
```bash
361361
{% include /snippets/01/login_output.{{ site.workshop_host_id }} %}
362362
```
363363
{: .output}
@@ -367,7 +367,7 @@ This prompt is informative, and lets you grasp certain information at a glance.
367367
(If you don't understand what these things are, don't worry! We will cover
368368
things in depth as we explore the system further.)
369369

370-
```
370+
```bash
371371
{{ site.workshop_host_prompt }}
372372
```
373373
{: .output}

_episodes/05-scripts.md

+28-28
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ To set a variable, simply type in a name containing only letters, numbers, and
224224
underscores, followed by an `=` and whatever you want to put in the variable.
225225
Shell variable names are often uppercase by convention (but do not have to be).
226226

227-
```
227+
```bash
228228
$ VAR="This is our variable"
229229
```
230230
{: .language-bash}
@@ -233,11 +233,11 @@ To use a variable, prefix its name with a `$` sign. Note that if we want to
233233
simply check what a variable is, we should use echo (or else the shell will try
234234
to run the contents of a variable).
235235

236-
```
236+
```bash
237237
$ echo $VAR
238238
```
239239
{: .language-bash}
240-
```
240+
```bash
241241
This is our variable
242242
```
243243
{: .output}
@@ -248,7 +248,7 @@ file we specify with `FILE`.
248248

249249
Our script:
250250

251-
```
251+
```bash
252252
#!/bin/bash
253253

254254
# set our variable to the name of our GTF file
@@ -259,12 +259,12 @@ wc -l $FILE
259259
```
260260
{: .language-bash}
261261

262-
```
262+
```bash
263263
$ ./demo.sh
264264
```
265265
{: .language-bash}
266266

267-
```
267+
```bash
268268
542048 dmel-all-r6.19.gtf
269269
```
270270
{: .output}
@@ -282,19 +282,19 @@ in this lesson, but it's something to be aware of).
282282

283283
Our script:
284284

285-
```
285+
```bash
286286
#!/bin/bash
287287

288288
# call wc -l on our first argument
289289
wc -l $1
290290
```
291291
{: .language-bash}
292292

293-
```
293+
```bash
294294
$ ./demo.sh dmel_unique_protein_isoforms_fb_2016_01.tsv
295295
```
296296
{: .language-bash}
297-
```
297+
```bash
298298
22129 dmel_unique_protein_isoforms_fb_2016_01.tsv
299299
```
300300
{: .output}
@@ -304,23 +304,23 @@ pure text. How do we save the output of an actual command like `ls -l`?
304304

305305
A demonstration of what doesn't work:
306306

307-
```
307+
```bash
308308
$ TEST=ls -l
309309
```
310310
{: .language-bash}
311311

312-
```
312+
```bash
313313
-bash: -l: command not found
314314
```
315315
{: .error}
316316

317317
What does work (we need to surround any command with `$(command)`):
318-
```
318+
```bash
319319
$ TEST=$(ls -l)
320320
$ echo $TEST
321321
```
322322
{: .language-bash}
323-
```
323+
```bash
324324
total 90372 -rw-rw-r-- 1 jeff jeff 12534006 Jan 16 18:50 bash-lesson.tar.gz -rwxrwxr-x. 1 jeff jeff 40 Jan 1619:41 demo.sh -rw-rw-r-- 1 jeff jeff 77426528 Jan 16 18:50 dmel-all-r6.19.gtf -rw-r--r-- 1 jeff jeff 721242 Jan 25 2016 dmel_unique_protein_isoforms_fb_2016_01.tsv drwxrwxr-x. 2 jeff jeff 4096 Jan 16 19:16 fastq -rw-r--r-- 1 jeff jeff 1830516 Jan 25 2016 gene_association.fb.gz -rw-rw-r-- 1 jeff jeff 15 Jan 16 19:17 test.txt -rw-rw-r-- 1 jeff jeff 245 Jan 16 19:24 word_counts.txt
325325
```
326326
{: .output}
@@ -338,7 +338,7 @@ commands on every file in a directory (or other stuff of that nature).
338338

339339
for-loops generally have the following syntax:
340340

341-
```
341+
```bash
342342
#!/bin/bash
343343

344344
for VAR in first second third
@@ -356,12 +356,12 @@ between `do` and `done` is performed.
356356

357357
Let's run the script we just wrote (I saved mine as `loop.sh`).
358358

359-
```
359+
```bash
360360
$ chmod +x loop.sh
361361
$ ./loop.sh
362362
```
363363
{: .language-bash}
364-
```
364+
```bash
365365
first
366366
second
367367
third
@@ -372,7 +372,7 @@ What if we wanted to loop over a shell variable, such as every file in the
372372
current directory? Shell variables work perfectly in for-loops. In this
373373
example, we'll save the result of `ls` and loop over each file:
374374

375-
```
375+
```bash
376376
#!/bin/bash
377377

378378
FILES=$(ls)
@@ -383,11 +383,11 @@ done
383383
```
384384
{: .language-bash}
385385

386-
```
386+
```bash
387387
$ ./loop.sh
388388
```
389389
{: .language-bash}
390-
```
390+
```bash
391391
bash-lesson.tar.gz
392392
demo.sh
393393
dmel_unique_protein_isoforms_fb_2016_01.tsv
@@ -403,7 +403,7 @@ word_counts.txt
403403
There's a shortcut to run on all files of a particular type, say all `.gz`
404404
files:
405405

406-
```
406+
```bash
407407
#!/bin/bash
408408

409409
for VAR in *.gz
@@ -412,7 +412,7 @@ do
412412
done
413413
```
414414
{: .language-bash}
415-
```
415+
```bash
416416
bash-lesson.tar.gz
417417
gene_association.fb.gz
418418
```
@@ -428,7 +428,7 @@ gene_association.fb.gz
428428
> > ## Solution
429429
> >
430430
> > Create the following script in a file called `head_all.sh`
431-
> > ```
431+
> > ```bash
432432
> > #!/bin/bash
433433
> >
434434
> > for FILE in *.fastq
@@ -450,12 +450,12 @@ gene_association.fb.gz
450450
> whatever you want to concatenate to the beginning or end of the shell
451451
> variable after enclosing it in `{}` characters.
452452
>
453-
> ```
453+
> ```bash
454454
> FILE=stuff.txt
455455
> echo ${FILE}.example
456456
> ```
457457
> {: .language-bash}
458-
> ```
458+
> ```bash
459459
> stuff.txt.example
460460
> ```
461461
> {: .output}
@@ -466,7 +466,7 @@ gene_association.fb.gz
466466
> > ## Solution
467467
> >
468468
> > Create the following script in a file called `process.sh`
469-
> > ```
469+
> > ```bash
470470
> > #!/bin/bash
471471
> >
472472
> > for FILE in *
@@ -480,7 +480,7 @@ gene_association.fb.gz
480480
> > truly only get files and not directories, we need to modify this to use the
481481
> > `find` command to give us only files in the current directory:
482482
> >
483-
> > ```
483+
> > ```bash
484484
> > #!/bin/bash
485485
> >
486486
> > for FILE in $(find . -max-depth 1 -type f)
@@ -506,7 +506,7 @@ gene_association.fb.gz
506506
> Let's make an example file and give everyone permission to do everything with
507507
> it.
508508
>
509-
> ```
509+
> ```bash
510510
> touch example
511511
> ls -l example
512512
> chmod 777 example
@@ -519,7 +519,7 @@ gene_association.fb.gz
519519
>
520520
> > ## Solution
521521
> >
522-
> > ```
522+
> > ```bash
523523
> > chmod 700 example
524524
> > ```
525525
> > {: .language-bash}

0 commit comments

Comments
 (0)