CS6 Practical System Skills Fall 9 edition Leonhard Spiegelerg - - PowerPoint PPT Presentation

cs6
SMART_READER_LITE
LIVE PREVIEW

CS6 Practical System Skills Fall 9 edition Leonhard Spiegelerg - - PowerPoint PPT Presentation

CS6 Practical System Skills Fall 9 edition Leonhard Spiegelerg lspiegel@s.rown.edu grep/sed/awk 2 / 65 Regex task Examples should not match #123456 123456 match hexadecimal RGB colors #abDE87 #XYabcd #001200


slide-1
SLIDE 1

CS6

Practical System Skills

Fall 9 edition

Leonhard Spiegelerg lspiegel@s.rown.edu

slide-2
SLIDE 2

grep/sed/awk

2 / 65

slide-3
SLIDE 3

3 / 65

Regex task Examples should not match match hexadecimal RGB colors #123456 #abDE87 #001200 123456 #XYabcd #ghabcd match non-negative integers 0-999 without leading zeros 1 98 999 1000 02 003

slide-4
SLIDE 4

4 / 65

Regex task Solution (not unique per se) match hexademical RGB colors #[0-9a-fA-F]{6} integers 0-999 without leading zeros

^([0-9]|[1-9][0-9]{0,2})$ or ^0$|^[1-9][0-9]{0,2}$

⇒ ⇒

slide-5
SLIDE 5

^([0-9]|[1-9][0-9]|1[0-9]{0,2}|25[0-5]|2[0-4][0-9])$ ⇒

5 / 65

slide-6
SLIDE 6

6 / 65

curl -s https://cs.brown.edu/courses/csci0060/lectures.html | grep -Eo 'href=".*\.pdf' | sed 's/href="\.//' | sed 's|^|https://cs.brown.edu/courses/csci0060|' | xargs -n1 curl -O

slide-7
SLIDE 7
  • CS6 Pratial System Skills

Fall 9

Leonhard Spiegelerg lspiegel@s.rown.edu

slide-8
SLIDE 8

⇒ ⇒ → → →

8 / 65

slide-9
SLIDE 9

9 / 65

Web browser DNS Server Web server hosting website

slide-10
SLIDE 10

https://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html

⇒ ⇒

10 / 65

slide-11
SLIDE 11

11 / 65

HTTP GET request for course website

slide-12
SLIDE 12

GET / HTTP/1.1 ⇒ →

12 / 65

slide-13
SLIDE 13

⇒ HTTP/1.1. 200 OK

13 / 65

HTTP/1.1 200 OK Server: nginx/1.10.3 Date: Thu, 10 Oct 2019 13:04:41 GMT Content-Type: text/html Content-Length: 2084 Connection: keep-alive Last-Modified: Tue, 08 Oct 2019 20:41:58 GMT ETag: "15fa-5946c3317148d-gzip" Accept-Ranges: bytes Vary: Accept-Encoding Content-Encoding: gzip

Example response message

slide-14
SLIDE 14

14 / 65

slide-15
SLIDE 15

⇒ → → → ⇒ →

15 / 65

slide-16
SLIDE 16

⇒ →

⇒ → ⇒ →

16 / 65

slide-17
SLIDE 17

→ →

  • v
  • -trace-ascii logfile.txt

17 / 65

  • I
  • -head

performs HEAD request

  • d data
  • -data data

performs POST request with data as message body

  • L
  • -location

sometimes servers redirect pages (i.e. you'll receive a 3XX response), use this option to let curl follow the redirect.

slide-18
SLIDE 18

curl --data "" --header "Accept: text/html" --request GET cs.brown.edu

⇒ ⇒

18 / 65

https://developers.whatismybrowser.com/useragents/explore/

slide-19
SLIDE 19

⇒ → ⇒

  • s

  • O

  • o -

curl -L cs.brown.edu/courses/csci0060/assets/slides/slides9.pdf -o lecture09.pdf

19 / 65

slide-20
SLIDE 20
slide-21
SLIDE 21

⇒ ⇒ ⇒

21 / 65

slide-22
SLIDE 22

⇒ ⇒ ⇒ ⇒ <tag> </tag> <p>Some text here…</p>

22 / 65

slide-23
SLIDE 23

<tag> ⇒ </tag> ⇒ <tag attribute="value"></tag> <div class="blue" id="main" width="100px"></div>

23 / 65

slide-24
SLIDE 24

⇒ → <p>some text</p> <P>some text</P> <p>SOME text</p> <p>some text</p> <div class="HELLO"></div> <DIV CLass="HELLO"></DiV> <div class="hello"></div>

24 / 65

slide-25
SLIDE 25

⇒ <outerTag> <innerTag> text </innerTag> </outerTag> ⇒ <!-- comment goes here -->

25 / 65

slide-26
SLIDE 26

<!DOCTYPE html> <html> <head> <title>This is the title of the webpage</title> </head> <body> <h1>This is the body of the page</h1> <p>Some content here…</p> </body> </html>

26 / 65

⇒ html htm

slide-27
SLIDE 27

⇒ ⇒ brackets.io, Sublime Text, Atom.io, WebStorm, Adobe Dreamweaver, ... ⇒ codepen.io, playcode.io, scratchpad.io, ...

27 / 65

slide-28
SLIDE 28
slide-29
SLIDE 29
slide-30
SLIDE 30

⇒ h1, …, h6 <h1>Heading</h1> ⇒ p></p> p ⇒

<b>bold text</b> <!-- bold text --> <i>italic text</i> <!-- italic text --> E=MC<sup>2</sup> <!-- superscript --> H<sub>2<sub>O <!-- subscript -->

30 / 65

slide-31
SLIDE 31

⇒ <br> ⇒ <hr> ⇒ <br /> <hr /> <br> <hr>

31 / 65

slide-32
SLIDE 32

⇒ strong em ⇒ blockquote q ⇒ abbr

<abbr title="National Aeonautics and Space Administration">NASA</abbr>

32 / 65

slide-33
SLIDE 33
slide-34
SLIDE 34

34 / 65

  • l

ul

<ul> <li>Item 1</li> <li>Item 2</li> </ul>

slide-35
SLIDE 35
slide-36
SLIDE 36

36 / 65

⇒ ⇒

<a href="http://cs.brown.edu">CS Department@Brown</a>

slide-37
SLIDE 37

⇒ ⇒ → ⇒

<a href="../music/top50.html>Billboard Top50</a>

../music

37 / 65

slide-38
SLIDE 38

<h1 id="first-main-heading">Heading</h1>

<a href="#first-main-heading">go to first heading</a>

38 / 65

slide-39
SLIDE 39

⇒ <a href="mailto:lspiegel@cs.brown.edu:>Email Leonhard</a> ⇒ _blank _self _parent

39 / 65

slide-40
SLIDE 40
slide-41
SLIDE 41

41 / 65

⇒ <img> ⇒ img/ images/ ⇒ <img src="images/tux.png" alt="mascot of linux">

slide-42
SLIDE 42

⇒ → width="100" width="100px" width="20%" ⇒ <p></p>

→ align="left" align="right" → align="top" align="middle" align="bottom"

42 / 65

slide-43
SLIDE 43
slide-44
SLIDE 44

44 / 65

⇒ ⇒ → ⇒ ⇒

slide-45
SLIDE 45

⇒ ⇒ ⇒ ⇒ ⇒

45 / 65

slide-46
SLIDE 46

<table> <thead> <tr> <th>country</th> <th>capital</th> </tr> </thead> <tbody> <tr> <td>U.S.A</td><td>Washington, D.C.</td> </tr> <tr> <td>Canada</td><td>Ottawa</td> </tr> </tbody> </table>

46 / 65

country capital U.S.A Washington, D.C. Canada Ottawa

slide-47
SLIDE 47
slide-48
SLIDE 48

48 / 65

⇒ ⇒ nav ul ⇒ section ⇒ header footer

slide-49
SLIDE 49
slide-50
SLIDE 50

⇒ ⇒ <style type="text/css"></style> <link href="css/style.css" type="text/css" rel="stylesheet"> <p style="color: #ccc; background-color: #000;">...</p>

50 / 65

slide-51
SLIDE 51

p { font-family: Arial; color: blue; }

51 / 65

⇒ property: value ⇒

slide-52
SLIDE 52

⇒ → →

tag{ …} #name {...} .name {...}

52 / 65

slide-53
SLIDE 53

h1, h2, h3 {...} p a {...} <a> <p> p>a {...} <a> <p> <p><a></a><p> <p><div><a></a></div></p> p.note p

53 / 65

slide-54
SLIDE 54

p#name p name ⇒ <p class="text text-justify">...</p>

54 / 65

slide-55
SLIDE 55

⇒ ⇒

55 / 65

slide-56
SLIDE 56

⇒ ⇒

56 / 65

slide-57
SLIDE 57
  • CS6 Pratial System Skills

Fall 9

Leonhard Spiegelerg lspiegel@s.rown.edu

slide-58
SLIDE 58

⇒ → ⇒ ⇒ ⇒ ⇒ →

58 / 65

slide-59
SLIDE 59

59 / 65

slide-60
SLIDE 60

⇒ ⇒ ⇒

60 / 65

slide-61
SLIDE 61

⇒ ⇒ ⇒ ⇒ ⇒

61 / 65

slide-62
SLIDE 62

62 / 65

slide-63
SLIDE 63

63 / 65

curl cs.brown.edu/cs1951g

slide-64
SLIDE 64

→ 64 / 65

curl cs.brown.edu/cs1951g | grep -Eo "slides/.*\.pdf" | sed 's|^|cs.brown.edu/cs1951g/|' | xargs -n1 curl -O

slide-65
SLIDE 65