Skip to content
Browse files

Spring 2013 updates; HW#3 and HW#4

  • Loading branch information...
1 parent 2a54687 commit 82c30a8e566a6a42c983559d0359256a3bce78bf @jschauma committed
View
4 06-automation-backup/Makefile
@@ -47,7 +47,9 @@ PICTURES= pics/Time_Machine.eps \
pics/wafl0.eps \
pics/wafl1.eps \
pics/wafl2.eps \
- pics/waste.eps
+ pics/waste.eps \
+ pics/WrongProgramming.eps \
+ pics/20th-and-C.eps
MANPAGES= ec2-backup.txt ec2-start-instance.txt
View
BIN 06-automation-backup/pics/20th-and-C.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN 06-automation-backup/pics/WrongProgramming.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
481 06-automation-backup/slides.tex
@@ -47,6 +47,163 @@
\end{center}
\vspace*{\fill}
+\subsection{Regular Expressions}
+A regular expression is a pattern that describes a set of strings. \\
+
+\begin{itemize}
+ \item patterns can be a combination of
+ \begin{itemize}
+ \item a fixed string (\verb+abc+)
+ \end{itemize}
+\end{itemize}
+\vspace{.5in}
+\begin{verbatim}
+$ ifconfig -a | egrep "inet"
+\end{verbatim}
+
+\subsection{Regular Expressions}
+A regular expression is a pattern that describes a set of strings. \\
+
+\begin{itemize}
+ \item patterns can be a combination of
+ \begin{itemize}
+ \item a fixed string (\verb+abc+)
+ \item a bracket expression, such as
+ \begin{itemize}
+ \item a number of characters -- \verb+[aK2l,]+
+ \end{itemize}
+ \end{itemize}
+\end{itemize}
+\vspace{.5in}
+\begin{verbatim}
+$ ifconfig -a | egrep "[UBS]"
+\end{verbatim}
+
+\subsection{Regular Expressions}
+A regular expression is a pattern that describes a set of strings. \\
+
+\begin{itemize}
+ \item patterns can be a combination of
+ \begin{itemize}
+ \item a fixed string (\verb+abc+)
+ \item a bracket expression, such as
+ \begin{itemize}
+ \item a number of characters -- \verb+[aK2l,]+
+ \item a range expression -- \verb+[a-z]+
+ \end{itemize}
+ \end{itemize}
+\end{itemize}
+\vspace{.5in}
+\begin{verbatim}
+$ ifconfig -a | egrep "[A-Z]"
+\end{verbatim}
+
+
+
+\subsection{Regular Expressions}
+A regular expression is a pattern that describes a set of strings. \\
+
+\begin{itemize}
+ \item patterns can be a combination of
+ \begin{itemize}
+ \item a fixed string (\verb+abc+)
+ \item a bracket expression, such as
+ \begin{itemize}
+ \item a number of characters -- \verb+[aK2l,]+
+ \item a range expression -- \verb+[a-z]+
+ \item a negated bracket expression -- \verb+[^0-9]+
+ \end{itemize}
+ \end{itemize}
+\end{itemize}
+\vspace{.5in}
+\begin{verbatim}
+$ ifconfig -a | egrep "[^a-zA-Z0-9 <>%,:.()]"
+\end{verbatim}
+
+
+
+\subsection{Regular Expressions}
+A regular expression is a pattern that describes a set of strings. \\
+
+\begin{itemize}
+ \item patterns can be a combination of
+ \begin{itemize}
+ \item a fixed string (\verb+abc+)
+ \item a bracket expression, such as
+ \begin{itemize}
+ \item a number of characters -- \verb+[aK2l,]+
+ \item a range expression -- \verb+[a-z]+
+ \item a negated bracket expression -- \verb+[^0-9]+
+ \end{itemize}
+ \item a character with a special meaning, such as
+ \begin{itemize}
+ \item \verb+.+ -- any single character
+ \end{itemize}
+ \end{itemize}
+\end{itemize}
+\vspace{.5in}
+\begin{verbatim}
+$ ifconfig -a | egrep "flags."
+\end{verbatim}
+
+
+
+\subsection{Regular Expressions}
+A regular expression is a pattern that describes a set of strings. \\
+
+\begin{itemize}
+ \item patterns can be a combination of
+ \begin{itemize}
+ \item a fixed string (\verb+abc+)
+ \item a bracket expression, such as
+ \begin{itemize}
+ \item a number of characters -- \verb+[aK2l,]+
+ \item a range expression -- \verb+[a-z]+
+ \item a negated bracket expression -- \verb+[^0-9]+
+ \end{itemize}
+ \item a character with a special meaning, such as
+ \begin{itemize}
+ \item \verb+.+ -- any single character
+ \item \verb+^+ -- beginning of line
+ \item \verb+$+ -- end of line
+ \end{itemize}
+ \end{itemize}
+\end{itemize}
+\vspace{.5in}
+\begin{verbatim}
+$ ifconfig -a | egrep "[0-9]$"
+\end{verbatim}
+
+\subsection{Regular Expressions}
+\begin{itemize}
+ \item patterns can be followed by qualifiers and quantifiers
+ \begin{itemize}
+ \item \verb+?+ -- the pattern is optional and matched at most once
+ \item \verb+*+ -- the pattern will be matched zero or more times
+ \item \verb|+| -- the pattern will be matched one or more times
+ \item \verb+{n}+ -- the pattern is matched exactly \verb+n+ times
+ \item \verb+{n,}+ -- the pattern is matched \verb+n+ or more times
+ \item \verb+{n,m}+ -- the pattern is matched at least \verb+n+,
+ but no more than \verb+m+ times
+ \end{itemize}
+ \item patterns can be logically grouped together \verb+(1[a-z]2|a[0-9]z)+
+ \item matched patterns can be remembered and referenced lateron
+\end{itemize}
+
+\subsection{Regular Expressions}
+Identify all network interfaces:
+\begin{verbatim}
+$ ifconfig -a | sed -n -E 's/^([a-z]+[0-9]).*/\1/p'
+$ ifconfig -a | sed -n -E 's/^([a-z]+(([0-9]+)|:[0-9]+)?).*/\1/p'
+\end{verbatim}
+\vspace{.5in}
+Now you:
+\begin{itemize}
+ \item extract all IP addresses
+ \item extract all MAC addresses
+ \item extract all netmasks
+\end{itemize}
+
\subsection{Remember to use the right tool for the job}
Bourne shell ({\tt /bin/sh}):
\begin{itemize}
@@ -65,7 +222,7 @@ \subsection{Remember to use the right tool for the job}
\end{itemize}
\subsection{Remember to use the right tool for the job}
-Perl, Python, Ruby
+Perl, Python, Ruby, ...
\begin{itemize}
\item suitable for moderately complex tasks
\item move to these when {\tt sed(1)}, {\tt awk(1)} and friends
@@ -85,19 +242,18 @@ \subsection{Remember to use the right tool for the job}
\end{itemize}
\subsection{Remember to use the right tool for the job}
-Perl, PHP, Tcl, JavaScript, CoffeeScript, ...
+Perl, Python, PHP, Ruby, JavaScript, ...
\begin{itemize}
\item http/web server interfaces
\item CGI ``scripts''
- \item server-side execution (via, for example, NodeJS in the case
- of JavaScript)
+ \item server-side execution
\item interface with/utilize APIs in a specific domain/vendor products
\item frequent cause of all sorts of security problems due to
interface with user data / exposure on the internet
\end{itemize}
\subsection{Remember to use the right tool for the job}
-Java, Scala, Clojure, Rhino...
+Java, Scala, Clojure, ...
\begin{itemize}
\item know your primary applications
\item interface with / extend / tie into JVM
@@ -112,12 +268,10 @@ \subsection{Remember to use the right tool for the job}
\item fix/patch your tools
\end{itemize}
-\subsection{Scripting / interpreted Languages}
+\subsection{Of course...}
\vspace*{\fill}
\begin{center}
- \includegraphics[scale=0.9]{pics/compiling.eps}
- \\
- \small \verb+http://xkcd.com/303/+
+ \includegraphics[scale=0.65]{pics/WrongProgramming.eps}
\end{center}
\vspace*{\fill}
@@ -142,7 +296,7 @@ \subsection{Scripting / interpreted Languages}
available $\rightarrow$ lots of duplication, stale code,
questionable quality
\item security features frequently neglected or circumvented ("too
- hard" or more precisely "inconvenient")
+ hard" / "inconvenient")
\item everybody has their particular favorite (and dislikes one or
the other)
\item interpreter not (necessarily) universally available /
@@ -159,17 +313,13 @@ \subsection{User Interface}
\subsection{Unix Philosophy}
\\
-\vspace*{\fill}
-\begin{center}
- \includegraphics[scale=1.5]{pics/pipe.eps}
-\end{center}
-\vspace*{\fill}
-
-\subsection{Unix Philosophy}
-\\
\Huge
\begin{center}
- Do one thing and do it well.
+ Write programs that do one thing and do it well.\\
+ \vspace{.5in}
+ Write programs to work together. \\
+ \vspace{.5in}
+ Write programs to handle text streams, because that is a universal interface.
\end{center}
\Normalsize
@@ -197,201 +347,6 @@ \subsection{Test Driven}
\end{center}
\vspace*{\fill}
-
-\subsection{The Zen of Python}
-\Huge
-\begin{center}
-Beautiful is better than ugly.
-\end{center}
-
-\subsection{The Zen of Python}
-\begin{center}
-Explicit is better than implicit.
-\end{center}
-
-\subsection{The Zen of Python}
-\begin{center}
- Simple is better than complex.
-\vspace*{\fill}
- \includegraphics[scale=0.8]{pics/complexity.eps}
- \\
- \small \verb+http://xkcd.com/399/+
-\end{center}
-\vspace*{\fill}
-\Huge
-
-\subsection{The Zen of Python}
-\begin{center}
- Complex is better than complicated.
-\end{center}
-
-\subsection{The Zen of Python}
-\begin{center}
- Flat is better than nested.
-\end{center}
-
-\subsection{The Zen of Python}
-\begin{center}
- Sparse is better than dense.
-\end{center}
-
-\subsection{The Zen of Python}
-\begin{center}
- Readability counts.
-\end{center}
-
-\subsection{The Zen of Python}
-\begin{center}
- Special cases aren't special enough to break the rules.
-\end{center}
-
-\subsection{The Zen of Python}
-\begin{center}
- Special cases aren't special enough to break the rules. \\
-\addvspace{.5in}
- Although practicality beats purity.
-\end{center}
-
-\subsection{The Zen of Python}
-\\
-\begin{center}
- Errors should never pass silently.
-\end{center}
-
-\subsection{The Zen of Python}
-\\
-\begin{center}
- Errors should never pass silently. \\
-\addvspace{.2in}
- \small
- (That would be implicitly accepted failure.)
-\end{center}
-\Huge
-
-\subsection{The Zen of Python}
-\\
-\begin{center}
- Errors should never pass silently. \\
-\addvspace{.2in}
- \small
- (That would be implicitly accepted failure.) \\
-\addvspace{.2in}
- (You know what would be better than something {\em implicit}?)
-\end{center}
-
-\subsection{The Zen of Python}
-\\
-\begin{center}
- Errors should never pass silently. \\
-\addvspace{.2in}
- \small
- (That would be implicitly accepted failure.) \\
-\addvspace{.2in}
- (You know what would be better than something {\em implicit}?) \\
-\addvspace{.2in}
- (Why, of course, something {\em explicit}!)
-\end{center}
-
-\subsection{The Zen of Python}
-\\
-\begin{center}
- Errors should never pass silently. \\
-\addvspace{.5in}
- Unless explicitly silenced.
-\end{center}
-
-\subsection{The Zen of Python}
-\begin{center}
- In the face of ambiguity, refuse the temptation to guess.
-\end{center}
-
-\subsection{The Zen of Python}
-\begin{center}
- There should be one -- and preferably only one -- obvious way to do it.
-\end{center}
-
-\subsection{The Zen of Python}
-\begin{center}
- There should be one -- and preferably only one -- obvious way to do it.
-
-\addvspace{.5in}
-
- Although that way may not be obvious at first unless you're Dutch. \\
-\vspace*{\fill}
- \includegraphics[scale=0.5]{pics/sign.eps}
-\end{center}
-
-
-\subsection{The Zen of Python}
-\begin{center}
- Now is better than never.
-\end{center}
-
-\subsection{The Zen of Python}
-\begin{center}
- Now is better than never. \\
-
-\addvspace{.5in}
-
- Although never is often better than *right* now.
-\end{center}
-
-\subsection{The Zen of Python}
-\begin{center}
- If the implementation is hard to explain, it's a bad idea.
-\end{center}
-
-\subsection{The Zen of Python}
-\begin{center}
- If the implementation is easy to explain, \\
- it {\em may} be a good idea.
-\end{center}
-
-\subsection{A simple interface, easy to explain. Yet...}
-\\
-\vspace*{\fill}
-\begin{center}
- \includegraphics[scale=1.1]{pics/elevator_buttons-reverse.eps}
-\end{center}
-\vspace*{\fill}
-
-
-\subsection{The Zen of Python}
-\begin{center}
- Namespaces are one honking great idea -- let's do more of those!
-\end{center}
-\Normalsize
-
-\subsection{Documentation}
-\vspace*{\fill}
-\begin{center}
- \includegraphics[scale=0.9]{pics/manual.eps}
- \hspace{.5in}
- \includegraphics[scale=0.9]{pics/manual2.eps}
- \\
- \vspace{.2in}
- \Huge
- {\bf WTFM}
- \Normalsize
-\end{center}
-\vspace*{\fill}
-
-
-\subsection{Consistency}
-\vspace*{\fill}
-\begin{center}
- \includegraphics[scale=1.0]{pics/consistency.eps}
-\end{center}
-\vspace*{\fill}
-
-\subsection{Robustness Principle or Postel's Law}
-\\
-\Huge
-\begin{center}
- Be conservative in what you do; be liberal in what you accept from others.
-\end{center}
-\Normalsize
-
\subsection{Avoid the Quick Fix}
\\
\Huge
@@ -582,19 +537,6 @@ \subsection{Backups and Restore Basics}
\end{itemize}
\vspace*{\fill}
\begin{center}
- \includegraphics[scale=0.4]{pics/headcrash.eps}
-\end{center}
-\vspace*{\fill}
-
-\subsection{Backups and Restore Basics}
-Why are backups needed?
-\begin{itemize}
- \item off-site storage of sensitive data
- \item long-term data storage
- \item data loss due to
-\end{itemize}
-\vspace*{\fill}
-\begin{center}
\includegraphics[scale=1.0]{pics/headcrash-closeup.eps}
\end{center}
\vspace*{\fill}
@@ -621,20 +563,7 @@ \subsection{Backups and Restore Basics}
\end{itemize}
\vspace*{\fill}
\begin{center}
- \includegraphics[scale=2.2]{pics/disaster1.eps}
-\end{center}
-\vspace*{\fill}
-
-\subsection{Backups and Restore Basics}
-Why are backups needed?
-\begin{itemize}
- \item off-site storage of sensitive data
- \item long-term data storage
- \item data loss due to
-\end{itemize}
-\vspace*{\fill}
-\begin{center}
- \includegraphics[scale=0.7]{pics/disaster2.eps}
+ \includegraphics[scale=0.4]{pics/20th-and-C.eps}
\end{center}
\vspace*{\fill}
@@ -698,22 +627,6 @@ \subsection{Backups and Restore Basics}
you will never need it.
-
-\subsection{Backup and Restore Basics}
-Simply adding disks to a system is easy -- determining an efficient backup and
-restore system for these disks is {\em hard}.
-\\
-
-Terminology:
-\begin{itemize}
- \item the {\em backup of a file system} is often called a {\bf dump}
- \item a {\em full backup} is referred to as a {\bf level 0 dump}
- \item subsequent {\em partial dumps} are referred to as {\bf incremental dumps}
- \item filesystem {\em snapshots} use the same concept, but frequently implement
- it with {\em hardlinks} to provide a full snapshot instead of an {\em
- overlay}
-\end{itemize}
-
\subsection{Key Reasons for Restores}
Three key reasons for restores: {\em Accidental File Deletion}, {\em Disk
Failure} and {\em Archival}.
@@ -748,36 +661,6 @@ \subsection{Key Reasons for Restores}
\item store for long time
\end{itemize}
-\subsection{Developing a Backup and Restore System}
-Determine the desired end-result:
-\begin{itemize}
- \item minimum set of data considered absolutely crucial
-\end{itemize}
-
-\subsection{Developing a Backup and Restore System}
-Determine the desired end-result:
-\begin{itemize}
- \item minimum set of data considered absolutely crucial
- \item time frames and downtime
-\end{itemize}
-
-\subsection{Developing a Backup and Restore System}
-Determine the desired end-result:
-\begin{itemize}
- \item minimum set of data considered absolutely crucial
- \item time frames and downtime
- \item length of archival
-\end{itemize}
-
-\subsection{Developing a Backup and Restore System}
-Determine the desired end-result:
-\begin{itemize}
- \item minimum set of data considered absolutely crucial
- \item time frames and downtime
- \item length of archival
- \item how are files restored
-\end{itemize}
-
\subsection{Filesystem backup}
\vspace*{\fill}
\begin{center}
@@ -975,14 +858,17 @@ \subsection{ZFS Snapshots}
\Normalsize
\subsection{HW \#3}
-Data backup to the cloud \\
-
-Detailed homework assignment posted at
-\verb+http://www.cs.stevens.edu/~jschauma/615A/s12-hw3.html+
+{\tt ifconfig} output parsing:
+\verb+http://www.cs.stevens.edu/~jschauma/615/s13-hw3.html+
\\
-\verb+http://www.cs.stevens.edu/~jschauma/615A/ec2-start-instance.txt+
+\verb+http://www.cs.stevens.edu/~jschauma/615/ifcfg-data.txt+
\\
-\verb+http://www.cs.stevens.edu/~jschauma/615A/ec2-backup.txt+
+\vspace{.5in}
+
+Data backup to the cloud \\
+\verb+http://www.cs.stevens.edu/~jschauma/615/s13-hw4.html+
+\\
+\verb+http://www.cs.stevens.edu/~jschauma/615/ec2-backup.txt+
\subsection{Reading}
Perl:
@@ -998,6 +884,7 @@ \subsection{Reading}
\item \verb+http://shop.oreilly.com/product/9780596515829.do+
\item \verb+http://is.gd/zmxB4V+
\item pydoc
+ \item \verb+echo "import this" | python+
\end{itemize}
\subsection{Reading}
@@ -1008,6 +895,14 @@ \subsection{Reading}
\item \verb+http://is.gd/DR4aNU+
\end{itemize}
+\subsection{Reading}
+Hurricane Sandy
+\begin{itemize}
+ \item \verb+https://blog.squarespace.com/blog/?month=october-2012+
+ \item \verb+http://is.gd/Y75pEA+
+ \item \verb+http://is.gd/32Az7y+
+ \item \verb+http://is.gd/FhAuFZ+
+\end{itemize}
\subsection{Reading}
Manual Pages:
View
43 html/ifcfg-data.1
@@ -0,0 +1,43 @@
+.Dd February 24, 2013
+.Dt IFCFG-DATA 1
+.Os
+.Sh NAME
+.Nm ifcfg-data
+.Nd extract data from ifconfig output
+.Sh SYNOPSIS
+.Nm
+.Op Fl imn
+.Sh DESCRIPTION
+The
+.Nm
+tool extract data from the output of the
+.Xr ifconfig 8
+command.
+.Pp
+.Nm
+reads data from stdin and prints output to stdout.
+.Sh OPTIONS
+.Nm
+accepts the following command-line flags:
+.Bl -tag -width _f
+.It Fl i
+Print all IP addresses.
+.It Fl m
+Print all MAC addresses.
+.It Fl n
+Print all netmasks.
+.El
+.Sh EXIT STATUS
+.Ex -std
+.Sh SEE ALSO
+.Xr awk 1 ,
+.Xr grep 1 ,
+.Xr sed 1 ,
+.Xr ifconfig 8
+.Sh HISTORY
+.Nm
+was originally assigned by
+.An Jan Schaumann
+.Aq jschauma@stevens.edu
+as a homework assignment for the class "Aspects of System Administration" at
+Stevens Institute of Technology in the Spring of 2013.
View
46 html/index.html
@@ -217,8 +217,6 @@
<H3><A name="grading">Grading</A>:</H3>There will (probably) be:<BR>
<UL>
- <LI>a few pop quizzes</LI>
-
<LI>a number of homework assignments of varying complexity,
including, but not limited to: programming, OS installation, OS
security, capture-the-flag-style cracking, security
@@ -271,8 +269,9 @@
<li><a href="hw.txt">General Homework Submission Guidelines</a></li>
<li><a href="s13-hw1.html">Homework #1: Setup your environment for EC2 and create an instance</a></li>
<li><a href="s13-hw2.html">Homework #2: Package Management on different OS</a></li>
+ <li><a href="s12-hw3.html">Homework #3: ifconfig output parsing</a></li>
+ <li><a href="s12-hw4.html">Homework #4: EC2 Backup</a></li>
<!--
- <li><a href="s12-hw3.html">Homework #3: EC2 Backup</a></li>
<li><a href="s12-hw4.html">Homework #4: Use tcpdump to observe traffic flow</a></li>
<li><a href="s12-hw5.html">Homework #5: Syslog over IPv6</a></li>
<li><a href="s11-hw6.html">Homework #6: Encrypted EC2 Backup</a></li>
@@ -365,14 +364,10 @@
<TD><em>Frisch</em>: Chap. 6<br>
<em>Burgess</em>: Chap. 5<br>
<em>Nemeth et al</em>: Chap. 3, 6, 27</TD>
- <TD>&nbsp;<!-- <a href="slides/lecture04.pdf">Lecture 04 slides</a><br>
- <a href="http://www.cs.stevens.edu/~jschauma/usenix/sage/policy.pdf">SAGE
- Booklet: A Guide to Developing Computing Policy Documents</a><br>
- <a href="quiz1.txt">Quiz#1</a>
- <a
-href="http://www.cs.stevens.edu/~jschauma/615A/s10-hw3-sample-solution.html">HW#3
-sample solution</a> --></td>
-
+ <TD><a href="slides/lecture04.pdf">Lecture 04 slides</a><br>
+ <a href="http://www.cs.stevens.edu/~jschauma/usenix/sage/policy.pdf">SAGE
+ Booklet: A Guide to Developing Computing Policy Documents</a><br>
+ <a href="https://www.usenix.org/sites/default/files/code_of_ethics_diploma.pdf">System Administrators' Code of Ethics</a></TD>
</TR>
<TR>
@@ -380,11 +375,8 @@
<TD>Automating Administrative Tasks I / Shell Essentials</TD>
<TD><em>Frisch</em>: Chap. 14, Append. A<br>
<em>Nemeth et al</em>: Chap. 9</TD>
- <TD><em>NOTE: Tuesday class</em>
- <!-- <a href="slides/lecture05.pdf">Lecture 05 slides</a><br>
- <a href="examples/ip">IPv4 matching regex</a><br>
- <a href="examples/shexamples">shell basics</a><br>
- <a href="examples/">Misc Examples</a> --></TD>
+ <TD><a href="slides/lecture05.pdf">Lecture 05 slides</a><br>
+ <a href="examples/shexamples">shell basics</a></TD>
</TR>
<TR>
<TD>2013-02-25</TD>
@@ -399,8 +391,9 @@
<em>Nemeth et al</em>: Chap. 4, 25<br>
<em>Burgess</em>: Chap. 5</TD>
- <TD>&nbsp;<!-- <a href="slides/lecture06.pdf">Lecture 06 slides</a><br>
- <a href="s12-hw3.html">HW#3</a> --></TD>
+ <TD><a href="slides/lecture06.pdf">Lecture 06 slides</a><br>
+ <a href="s13-hw3.html">HW#3</a><br>
+ <a href="s13-hw4.html">HW#4</a></TD>
</TR>
<TR>
@@ -439,6 +432,15 @@
<TR>
<TD>2013-03-25</TD>
+ <TD>Configuration Management</TD>
+ <TD>&nbsp;</TD>
+ <TD>Guest Lecturer: <a href="https://en.wikipedia.org/wiki/James_Turnbull">James Turnbull</a>
+ </TD>
+ </TR>
+
+
+ <TR>
+ <TD>2013-04-01</TD>
<TD>Popular services: HTTP, SSH</TD>
<TD><em>Frisch</em>: Chap. 9<BR>
<em>Nemeth et al</em>: Chap. 16, 19, 22<br>
@@ -450,7 +452,7 @@
</TR>
<TR>
- <TD>2013-04-01</TD>
+ <TD>2013-04-08</TD>
<TD>System Security</TD>
<TD><em>Frisch</em>: Chap. 7<BR>
<em>Nemeth et al</em>: Chap. 21<br>
@@ -460,12 +462,6 @@
<a href="qibenx2djregl.html">extra credit</a>--></TD>
</TR>
- <TR>
- <TD>2013-04-08</TD>
- <TD>AMA / Misc. Topics / Presentations</TD>
- <TD>&nbsp;</TD>
- <TD>&nbsp;</TD>
- </TR>
</TR>
<TR>
View
148 html/s13-hw3.html
@@ -0,0 +1,148 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<HTML>
+<HEAD>
+
+ <TITLE>CS615A -- Aspects of System Administration</TITLE>
+ <STYLE type="text/css">
+ body {
+ background-color: #FFFFFf;
+ }
+ </STYLE>
+ <STYLE type="text/css">
+ li.c1 {list-style: none}
+ </STYLE>
+
+
+</HEAD>
+
+<BODY>
+ <TABLE border="1" align="center" cellpadding="15">
+ <TR>
+ <TD valign="top">
+ <H2>CS615A -- Aspects of System Administration - Spring 2013 - HW#3</H2>
+
+ <H3>HW#3: ifconfig output parsing</H3>
+
+ <H4>Summary:</H4>
+ <p>
+ Every System Administrator sooner or later has to write a
+ program that needs to extract information from the output of the
+ <tt>ifconfig(8)</tt> command. In class, we practiced doing just
+ this via a few simple shell commands. Your assignment is to
+ determine the correct commands to extract the following
+ information from the output of the <tt>ifconfig -a</tt> command on
+ the various platforms we use.
+ </p>
+ <p>
+ In particular, you should submit a shell script that will reliably
+ extract:
+ <ul>
+ <li>all IP addresses</li>
+ <li>all MAC addresses</li>
+ <li>all netmasks</li>
+ </ul>
+ </p>
+ <p>
+ This assignment is worth 25 points.
+ </p>
+ <H4>Details:</H4>
+ <p>Your script will behave exactly as outlined in the manual page <a href="ifcfg-data.txt">ifcfg-data(1)</a>.
+ </p>
+ <p>
+ Example input and output:
+ <blockquote><tt><pre><code>
+$ ifconfig -a
+lo0: flags=8049&lt;UP,LOOPBACK,RUNNING,MULTICAST&gt; mtu 16384
+ options=3&lt;RXCSUM,TXCSUM&gt;
+ inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
+ inet 127.0.0.1 netmask 0xff000000
+ inet6 ::1 prefixlen 128
+gif0: flags=8010&lt;POINTOPOINT,MULTICAST&gt; mtu 1280
+stf0: flags=0&lt;&gt; mtu 1280
+en0: flags=8863&lt;UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500
+ ether 98:fe:94:46:f4:44
+ inet6 fe80::9afe:94ff:fe46:f444%en0 prefixlen 64 scopeid 0x4
+ inet 192.168.1.2 netmask 0xffffff00 broadcast 192.168.1.255
+ inet6 2001:470:1f07:2c0:9afe:94ff:fe46:f444 prefixlen 64 autoconf
+ inet6 2001:470:1f07:2c0:1834:f67:2271:a5eb prefixlen 64 autoconf temporary
+ media: autoselect
+ status: active
+p2p0: flags=8843&lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&gt; mtu 2304
+ ether 0a:fe:94:46:f4:44
+ media: autoselect
+ status: inactive
+$ ifconfig -a | ifcfg-data -i
+fe80::1
+127.0.0.1
+::1
+fe80::9afe:94ff:fe46:f444
+192.168.1.2
+2001:470:1f07:2c0:9afe:94ff:fe46:f444
+2001:470:1f07:2c0:1834:f67:2271:a5eb
+$ ifconfig -a | ifcfg-data -m
+98:fe:94:46:f4:44
+0a:fe:94:46:f4:44
+$ ifconfig -a | ifcfg-data -n
+0xff000000
+0xffffff00
+$
+</code></pre></tt></blockquote>
+ </p>
+
+ <h4>Target platform</h4>
+ <p>
+ The tool you write will need to work correctly on the following
+ platforms:
+ <ul>
+ <li><tt>linux-lab.cs.stevens.edu</tt></li>
+ <li>OmniOS stable r151004 (AMI Id: ami-4e2c9727)</strike></li>
+ <li>a FreeBSD instance (AMI Id: ami-9d38baf4, or see <a href="http://www.daemonology.net/freebsd-on-ec2/">this page</a>)</li>
+ <li>a NetBSD instance (AMI Id: ami-5d0f8034, or see <a href="http://wiki.netbsd.org/amazon_ec2/amis/">this page</a>)</li>
+ </ul>
+ </p>
+
+ <H4>Programming language</h4>
+ <p>
+ This assignment requires you to write a bourne shell script. As such,
+ you can use any of the common commands found on the systems in
+ questions, but it should not be written in a higher level
+ language.
+ </p>
+ <H4>Deliverables and Due Date</H4>
+ <p>
+ You will submit a single <tt>tar(1)</tt> archive. The file to submit
+ will be called "<tt>$USER-hw3.tar</tt>" (where "$USER" is your
+ username). The archive will extract all files and subdirectories into
+ a directory named <tt>$USER</tt>.
+ </p>
+ <p>
+ You will only submit a single shell source file.
+ You may additionally include a single file called
+ <tt>README</tt> in which you may provide commentary on your program.
+ Commentary elaborating on the scalability of the tool in general and
+ your implementation in particular is welcome.
+ </p>
+ <p>
+ The folllowing is an example sequence of commands to create a valid
+ homework submission:
+<pre>
+mkdir $USER
+cd $USER
+vi README
+vi ifcfg-data
+[code code code]
+cd ..
+tar cf $USER-hw3.tar $USER
+</pre>
+ <p>
+ The due date for this assignment is 2013-03-04 18:00. Please
+ attach the file to an email sent from your <tt>@stevens.edu</tt>
+ email address to <a
+ href="mailto:jschauma@stevens.edu?subject=[CS615] HW3">jschauma@stevens.edu</a>
+ with a subject of "[CS615] HW3".
+ </p>
+ <hr>
+ [<a href="index.html">Course Website</a>]
+</BODY>
+</HTML>
View
126 html/s13-hw4.html
@@ -0,0 +1,126 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<HTML>
+<HEAD>
+
+ <TITLE>CS615A -- Aspects of System Administration</TITLE>
+ <STYLE type="text/css">
+ body {
+ background-color: #FFFFFf;
+ }
+ </STYLE>
+ <STYLE type="text/css">
+ li.c1 {list-style: none}
+ </STYLE>
+
+
+</HEAD>
+
+<BODY>
+ <TABLE border="1" align="center" cellpadding="15">
+ <TR>
+ <TD valign="top">
+ <H2>CS615A -- Aspects of System Administration - Spring 2013 - HW#4</H2>
+
+ <H3>HW#4: EC2 Backup</H3>
+
+ <H4>Summary:</H4>
+ <p>
+ The objective of this assignment is for you to create a tool
+ able to perform a backup of a given directory to a data storage
+ device in the cloud. In the process, you will (hopefully) learn
+ a few things about writing modular system tools, about the use
+ of some filesystem level helpers and gain some insights into a
+ cloud-based storage model.
+ </p>
+ <p>
+ The detailed specification of the program can be found in <a
+ href="ec2-backup.txt">this manual page</a>.
+ </p>
+ <p>
+ This assignment is worth 75 points.
+ </p>
+
+ <h4>Target platform</h4>
+ <p>
+ The tool you write will be executed (and graded) on
+ <tt>lab.cs.stevens.edu</tt>. You are free to develop it
+ in some other environment, but please make sure to test it on
+ <tt>linux-lab.cs.stevens.edu</tt> before submitting it. If it does
+ not work on these hosts, you will not get any points. See also:
+ <a href="hw.txt">general homework guidelines</a>.
+ </p>
+
+ <H4>Programming language</h4>
+ <p>
+ You are free to choose any programming language you like to implement
+ this tool. Obviously, the program needs to be executed/run on
+ <tt>linux-lab.cs.stevens.edu</tt> and must not require the additional
+ installation of any tools, libraries etc. besides what is already
+ installed there.
+ </p>
+
+ <h4>Program behaviour</h4>
+ <p>
+ Your program will not require any modification of the environment
+ (ie, you can assume the user has his/her environment set up for EC2),
+ and exection of the program will be exactly as outlined in the
+ manual page <a href="ec2-backup.txt">ec2-backup(1)</a>.
+ </p>
+ <h4>Notes</h4>
+ <p>You may choose to implement the programs in any way you like,
+ including breaking it down into smaller individual components.</p>
+ <p>You probably want to make sure that your program exhibits the
+ various features of good software engineering practices we discussed.
+ Please make sure to consider these and have your submission
+ reflect wherever possible.</p>
+ <p>It is probably in your interest to accompany your sibmission
+ with some commentary on why you chose the programming language,
+ the approach you took, any considerations you might have. The
+ more thought I see you put into the assignment, the better.</p>
+ <p>You may collaborate loosely with other students, but each
+ submission must be your own. This is not a group assignment.</p>
+ <p>You may use code you find on the internet <em>if and only
+ if</em> you explicitly note which parts are not your own
+ <em>and</em> the code in question is licensed such that you can
+ use it in this manner.</p>
+ <p>This is not a trivial assignment. Please do not delay starting
+ to work on it.</p>
+
+ <H4>Deliverables and Due Date</H4>
+ <p>
+ You will submit a single <tt>tar(1)</tt> archive. The file to submit
+ will be called "<tt>$USER-hw4.tar</tt>" (where "$USER" is your
+ username). The archive will extract all files and subdirectories into
+ a directory named <tt>$USER</tt>.
+ </p>
+ <p>
+ You will only submit source files -- no binaries or executables of
+ any kind. You may additionally include a single file called
+ <tt>README</tt> in which you may provide commentary on your program.
+ Commentary elaborating on the scalability of the tool in general and
+ your implementation in particular is welcome.
+ </p>
+ <p>
+ The folllowing is an example sequence of commands to create a valid
+ homework submission:
+<pre>
+mkdir $USER
+cd $USER
+vi README
+vi ec2-backup
+[code code code]
+cd ..
+tar cf $USER-hw4.tar $USER
+</pre>
+ <p>
+ The due date for this assignment is 2013-03-25 18:00. Please
+ attach the file to an email sent from your <tt>@stevens.edu</tt>
+ email address to <a
+ href="mailto:jschauma@stevens.edu?subject=[CS615] HW4">jschauma@stevens.edu</a>
+ with a subject of "[CS615] HW4".
+ </p>
+ <hr>
+ [<a href="index.html">Course Website</a>]
+</BODY>
+</HTML>

0 comments on commit 82c30a8

Please sign in to comment.
Something went wrong with that request. Please try again.