cs6
play

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


  1. CS6 Practical System Skills Fall ���9 edition Leonhard Spiegel�erg lspiegel@�s.�rown.edu

  2. grep/sed/awk 2 / 65

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

  4. Regex task Solution (not unique per se) match hexademical RGB colors #[0-9a-fA-F]{6} integers 0-999 without leading ^([0-9]|[1-9][0-9]{0,2})$ or ^0$|^[1-9][0-9]{0,2}$ zeros ⇒ ⇒ 4 / 65

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

  6. 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 6 / 65

  7. �� CS6 Pra�ti�al System Skills Fall ���9 Leonhard Spiegel�erg lspiegel@�s.�rown.edu

  8. ⇒ ⇒ → → → 8 / 65

  9. DNS Server Web browser Web server hosting website 9 / 65

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

  11. HTTP GET request for course website 11 / 65

  12. GET / HTTP/1.1 ⇒ → 12 / 65

  13. ⇒ HTTP/1.1. 200 OK Example response message 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 13 / 65

  14. 14 / 65

  15. → → → ⇒ ⇒ → 15 / 65

  16. ⇒ → ⇒ → ⇒ → 16 / 65

  17. → → -v --trace-ascii logfile.txt performs HEAD request -I --head performs POST request with data as message body -d data --data data sometimes servers redirect pages (i.e. you'll receive a 3XX -L --location response), use this option to let curl follow the redirect. 17 / 65

  18. ⇒ curl --data "" --header "Accept: text/html" --request GET cs.brown.edu ⇒ ⇒ https://developers.whatismybrowser.com/useragents/explore/ 18 / 65

  19. ⇒ → ⇒ -s ⇒ -O ⇒ -o -o - curl -L cs.brown.edu/courses/csci0060/assets/slides/slides9.pdf -o lecture09.pdf 19 / 65

  20. ⇒ ⇒ ⇒ 21 / 65

  21. ⇒ ⇒ ⇒ ⇒ <tag> </tag> <p>Some text here…</p> 22 / 65

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

  23. ⇒ → <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

  24. ⇒ <outerTag> <innerTag> text </innerTag> </outerTag> ⇒ <!-- comment goes here --> 25 / 65

  25. <!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> ⇒ html htm 26 / 65

  26. ⇒ ⇒ brackets.io, Sublime Text, Atom.io, WebStorm, Adobe Dreamweaver, ... ⇒ codepen.io, playcode.io, scratchpad.io, ... 27 / 65

  27. ⇒ 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

  28. ⇒ <br> ⇒ <hr> ⇒ <br /> <hr /> <br> <hr> 31 / 65

  29. ⇒ strong em ⇒ blockquote q ⇒ abbr <abbr title="National Aeonautics and Space Administration">NASA</abbr> ⇒ 32 / 65

  30. ⇒ ol ul <ul> <li>Item 1</li> <li>Item 2</li> </ul> 34 / 65

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

  32. ⇒ ⇒ → ⇒ <a href="../music/top50.html>Billboard Top50</a> ../music 37 / 65

  33. ⇒ <h1 id="first-main-heading">Heading</h1> ⇒ <a href="#first-main-heading">go to first heading</a> 38 / 65

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

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

  36. ⇒ → width="100" width="100px" width="20%" ⇒ <p></p> → align="left" align="right" → align="top" align="middle" align="bottom" 42 / 65

  37. ⇒ ⇒ → ⇒ ⇒ 44 / 65

  38. ⇒ ⇒ ⇒ ⇒ ⇒ 45 / 65

  39. <table> <thead> country capital <tr> <th>country</th> U.S.A Washington, D.C. <th>capital</th> Canada Ottawa </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

  40. ⇒ ⇒ nav ul ⇒ section ⇒ header footer 48 / 65

  41. ⇒ ⇒ <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

  42. p { font-family: Arial; color: blue; } ⇒ property: value ⇒ 51 / 65

  43. ⇒ → → tag{ …} #name {...} .name {...} 52 / 65

  44. ⇒ 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

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

  46. ⇒ ⇒ 55 / 65

  47. ⇒ ⇒ 56 / 65

  48. �� CS6 Pra�ti�al System Skills Fall ���9 Leonhard Spiegel�erg lspiegel@�s.�rown.edu

  49. → ⇒ ⇒ ⇒ ⇒ ⇒ → 58 / 65

  50. 59 / 65

  51. ⇒ ⇒ ⇒ 60 / 65

  52. ⇒ ⇒ ⇒ ⇒ ⇒ 61 / 65

  53. 62 / 65

  54. curl cs.brown.edu/cs1951g → 63 / 65

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

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend