System Administration HW3 - Shell Script hchung. Computer Center, CS, NCTU 2 Requirements  User connect time statistic script (10%) Use one-line command.

Slides:



Advertisements
Similar presentations
The Way to Success … Sta rt Sta rt Ak Technologies Mo | Visit.
Advertisements

Pasewark & Pasewark 1 Word Lesson 8 Increasing Efficiency Using Word Microsoft Office 2007: Introductory.
System Administration Final Project - Micro Computer Center hchung, hwchiu.
Fundamentals, Design, and Implementation, 9/e Chapter 11 Managing Databases with SQL Server 2000.
Microsoft Access Exporting Access Data and Mail Merging.
Perl Programming – Appendix There ’ s more than one way to do it Keep easy things easy and the hard possible.
Introduction to Unix – CS 21 Lecture 13. Lecture Overview Finding files and programs which whereis find xargs Putting it all together for some complex.
Guide To UNIX Using Linux Third Edition
Pro Exchange SPAM Filter An Exchange 2000 based spam filtering solution.
Pasewark & Pasewark 1 Access Lesson 6 Integrating Access Microsoft Office 2007: Introductory.
Shell Scripting Basics Arun Sethuraman. What’s a shell? Command line interpreter for Unix Bourne (sh), Bourne-again (bash), C shell (csh, tcsh), etc Handful.
Guide to MCSE , Enhanced 1 Activity 10-1: Restarting Windows Server 2003 Objective: to restart Windows Server 2003 Start  Shut Down  Restart Configure.
System Administration HW1-1 changlp. Computer Center, CS, NCTU 2 Requirements  Basic Install up-to-date –RELEASE of FreeBSD  8.2-R Add a user and a.
Microsoft Word 2000: Mail Merge Basics Peggy Serfazo Marple Molly Calvello Support Professionals Business Applications - Desktop Microsoft Corporation.
System Administration HW2 - FTP, Samba, BT, ZFS jwbai.
Final Project – NFS and NIS jwbai. Computer Center, CS, NCTU 2 Goal master.passwd passwd group netgroup amd.conf userA, /nis/home/userA userB, /nis/home/userB.
Chapter Four UNIX File Processing. 2 Lesson A Extracting Information from Files.
Unix Shells Based on Glass & Abels’ Book CS240 Computer Science II.
3.01 – Understand Business Documents Mail Merge. Administration Congratulations in order! Objective 3.01 Business Documents Test –Test Wednesday –Review.
Microsoft Word: Mail Merge Basics Presenter: Jolanta Soltis.
Mail merge I: Use mail merge for mass mailings Perform a complete mail merge Now you’ll walk through the process of performing a mail merge by using the.
Copyright © 2008 Pearson Prentice Hall. All rights reserved Copyright © 2008 Prentice-Hall. All rights reserved. Committed to Shaping the Next.
Chapter 13 Users, Groups Profiles and Policies. Learning Objectives Understand Windows XP Professional user accounts Understand the different types of.
Maintain Installed Applications. Computer Center, CS, NCTU 2 In Ports Tree  / Makefile  COMMENT pkg-descr  WWW pkg-message  Shown after installed.
MAIL MERGE IN WORD 2010 Created by: Jennifer Tyndall, Spring Creek High School.
System Administration HW3 Shell Script changlp. Computer Center, CS, NCTU 2 Requirements  User socket statistic (20%) Use one-line command to show per-user.
Module 4 : Installation Jong S. Bok
Lesson 12: Creating a Manual and Using Mail Merge.
Oracle Data Integrator Procedures, Advanced Workflows.
Get to know Live Meeting 2007 Schedule a Live Meeting with Outlook After you have participated in a Live Meeting, you’ll probably want to schedule Live.
System Administration HW2 Shell Script xclin. Computer Center, CS, NCTU 2 Requirements  Xferlog statistics (15%) use one-line command to show FTP transfer.
System Administration Practice Homework 1-2 : X Window System lctseng.
Homework 03 - Hint DNS. Computer Center, CS, NCTU 2 Architecture ns.a.nctucs.net a.a /24 ns.b.nctucs.net b.b /24.
12 steps for Mail Merge Setup Mpact Magic. Step 1 Open Your MS Outlook program and put it an offline mode. Go to Main Menu >> File >> Work Offline.
General rules 1. Rule: 2. Rule: 3. Rule: 10. Rule: Ask questions ……………………. 11. Rule: I do not know your skill. If I tell you things you know, please stop.
Homework 03 DNS. Computer Center, CS, NCTU 2 Architecture ns.a.nctucs.net a.a /24 ns.b.nctucs.net b.b /24 slave.
System Administration HW2 - File System Server ylin.
System Administration HW2 - File System Server. Computer Center, CS, NCTU 2 FTP  Install a FTP server for FreeBSD Pure-FTPd: /usr/ports/ftp/pure-ftpd.
Lesson 3-Touring Utilities and System Features. Overview Employing fundamental utilities. Linux terminal sessions. Managing input and output. Using special.
System Administration HW5 - Micro Computer Center yihshih / lctseng.
System Administration Practice Homework6 - LDAP login + Puppet + Jail yench / lctseng / chchang2222.
System Administration HW3 - Shell Script chenyp. Computer Center, CS, NCTU 2 Requirements  File statistics (20%+10%) use one-line command to show files.
Module 5: Managing Addresses and Address Lists.
Installing Applications in FreeBSD lctseng. Computer Center, CS, NCTU 2 Before we start  Permission issue root: the super user Like administrator in.
Merger By Dave Doulton University of Southampton.
CS 403: Programming Languages Lecture 20 Fall 2003 Department of Computer Science University of Alabama Joel Jones.
Batch Files More flow of control Copyright © by Curt Hill.
System Administration Practice Homework 1-3 : Chinese World lctseng.
INTERNET APPLICATIONS CPIT405 Install a web server and analyze packets.
Your File System LIBS100 January 26, Word of the Day Network Administrator An information technology professional responsible for setting up, maintaining,
Lesson 17 Mail Merge. Overview Create a main document. Create a data source. Insert merge fields into a main document. Perform a mail merge. Use data.
درس مهندسی اینترنت – مهدی عمادی مهندسی اینترنت برنامه‌نویسی در اینترنت 1 SMTP, FTP.
UNIX Epi Dakai Zhu January 5th, 2005.
How to convert a Demo to Multi-user
System Administration Practice Homework 2: Shell Programming
Step 1: Prepare data in Excel for mail merge
Homework 3 frank.
Mail Merge in Word 2010.
For Letters, Labels or s Mail Merge For Letters, Labels or s.
Chapter 6 Filters.
Performing Mail Merges
System Administration Practice Homework 1-1 : FreeBSD Base
Download LX0-104 Exam Dumps Questions & Answers - LX0-104 Braindumps Dumps4download
forgot laptop password Windows 10 with no reset disk
Chapter Four UNIX File Processing.
Final Project– NFS and NIS
More advanced BASH usage
System Administration HW3 - File System Server
Chapter 11 Managing Databases with SQL Server 2000
System Administration HW2 - File System Server
Presentation transcript:

System Administration HW3 - Shell Script hchung

Computer Center, CS, NCTU 2 Requirements  User connect time statistic script (10%) Use one-line command to show user connect time statistic.  Spamming system (40%) Send massive mails with customized template and database.  GUI port manager (50%) Manage your ports with dialog boxes.

Computer Center, CS, NCTU 3 User Connect Time Statistic Script – Requirements (1/2)  Use one-line command  The following lines should NOT be counted User still logged in shutdown, reboot or other msgs not associated with accounting  log file location Use environment variable ‘LOG_FILE’ Default to /var/log/utx.log Results should be sorted by time  Output format USER TIME (in seconds)

Computer Center, CS, NCTU 4 User Connect Time Statistic Script – Requirements (2/2)  Only pipes (cmd | cmd) and backquotes (`cmd`) are allowed  No temporary files or shell variables (except LOG_FILE)  No “&&” “||” “>” “>>” “<“ “;” “&”

Computer Center, CS, NCTU 5 User Connect Time Statistic - DEMO  Hint: $ man last

Computer Center, CS, NCTU 6 Spamming System – Sendmail  $ sendmail –t < letter  Sample letter  sendmail(8), base64(1) From: =?UTF-8?B?6auY5omLCg==?= To: =?UTF-8?B?5Y6y5a6zCg==?= Subject: =?UTF-8?B?6auY5omL5Y6y5a6z5LiN57Ch5ZauCg==?= Content-Transfer-Encoding: base64 Content-Type: text/plain; charset=utf-8 5L2g5piv6auY5omL5L2g5Y6y5a6zCuaIkeaYr+mCsea4o+S4jeewoeWWrgo=

Computer Center, CS, NCTU 7 Spamming System – Requirements (1/3)  $ hw2 [-hv] [-f from_address] [-F from_name] [-s subject] [- c content_file] -t table_file  If neither –f nor –F is provided, use default sender.  Show usage and exit if running with invalid or –h option.  Use –c option to read content from “file” instead of “stdin”.  In –v mode, print out letter instead of sending.  UTF-8 should be supported.  There will be escaped characters in subject and content_file. %i should be replaced by elements in the table_file  Do NOT need to implement fool-proof.

Computer Center, CS, NCTU 8 Spamming System – Requirements (2/3)  Table file %1 is recipient’s address %2 is recipient’s name Use “\t” to split columns No specific table size %3 %2 同學您好, 您的 計算機系統管理 學期成績為 %4 分, %5 及格。 若對成績有疑問請直接回信到 。 SA助教關心您! %1 %2 %3 %4 %5 鍾 翔 有 邱宏瑋 沒有 %3 %2 計算機系統管理學期成績 Content file and subject (contains escaped characters %i) Table file (uses “\t” as delimiter)

Computer Center, CS, NCTU 9  hw2.sh -f -F " 計算機系統管理助教 “ -s "%3 %2 計算機系統管理學期成績 " -c demo_c -t demo_t    Spamming System – Requirements (3/3) Sample result Example options

Computer Center, CS, NCTU 10 Spamming System – DEMO  Hint  getopt(1)

Computer Center, CS, NCTU 11 My Ports Manager – DEMO

Computer Center, CS, NCTU 12 My Ports Manager – DEMO (List)

Computer Center, CS, NCTU 13 My Ports Manager – DEMO (Manage)

Computer Center, CS, NCTU 14 My Ports Manager – DEMO (Manage)

Computer Center, CS, NCTU 15 My Ports Manager – DEMO (Manage)

Computer Center, CS, NCTU 16 My Ports Manager – DEMO (Manage)

Computer Center, CS, NCTU 17 My Ports Manager – DEMO (Manage)

Computer Center, CS, NCTU 18 My Ports Manager – DEMO (Install)

Computer Center, CS, NCTU 19 My Ports Manager – DEMO (Install)

Computer Center, CS, NCTU 20 My Ports Manager – DEMO (Install)

Computer Center, CS, NCTU 21 My Ports Manager – DEMO (Install)

Computer Center, CS, NCTU 22 My Ports Manager – Requirement (1/2)  Use sudo to add/delete ports  Clean all temp files  Use dialog on Freebsd 9  Fool-proof

Computer Center, CS, NCTU 23 My Ports Manager – Requirement (2/2)  Flow List Manage  Choose SEVERAL ports –Show dependency –Required by who –Remove –Exit Install  Prefix –Choose ONE port »By binary »By source »Exit Exit

Computer Center, CS, NCTU 24 My Ports Manager – Hint  dialog(1)  ports-mgmt/pkg_tree  pkg_info, pkg_delete, pkg_add  make install clean BATCH=yes  /usr/ports/INDEX-9  xargs

Computer Center, CS, NCTU 25 Hand-in  Due & Demo 2012/11/20

Computer Center, CS, NCTU 26 Help  IRC channel #nctuNASA on freenode  Newsgroup cs.course.sysadmin  BBS bs2.to board CS-SysAdmin   Goto CSCC to ask professional 3F!