Unix System Administration

Slides:



Advertisements
Similar presentations
Widhy Hayuhardhika NP, S.Kom. Overview of database structure Connecting to MySQL database Selecting the database to use Using the require_once statement.
Advertisements

CS 202 Computer Science II Lab Fall 2009 September 24.
PHP (2) – Functions, Arrays, Databases, and sessions.
CS Lecture 03 Outline Sed and awk from previous lecture Writing simple bash script Assignment 1 discussion 1CS 311 Operating SystemsLecture 03.
CSEE W4140 Networking Laboratory Lecture 11: SNMP Jong Yul Kim
Introduction to Perl Learning Objectives: 1. To introduce the features provided by Perl 2. To learn the basic Syntax & simple Input/Output control in Perl.
Introduction to Perl Software Tools. Slide 2 Introduction to Perl l Perl is a scripting language that makes manipulation of text, files, and processes.
 2004 Prentice Hall, Inc. All rights reserved. Chapter 25 – Perl and CGI (Common Gateway Interface) Outline 25.1 Introduction 25.2 Perl 25.3 String Processing.
. If the PHP server is an server or is aware of which server is the server, then one can write code that s information. –For example,
Lecture Note 3: ASP Syntax.  ASP Syntax  ASP Syntax ASP Code is Browser-Independent. You cannot view the ASP source code by selecting "View source"
Session 5: Working with MySQL iNET Academy Open Source Web Development.
Programming Perl in UNIX Course Number : CIT 370 Week 4 Prof. Daniel Chen.
A little PHP. Enter the simple HTML code seen below.
Computer Programming for Biologists Oct 30 th – Dec 11 th, 2014 Karsten Hokamp  Fill out.
Attacking Applications: SQL Injection & Buffer Overflows.
Ways to manage DB in MySQL cs346. Six ways to CREATE and INSERT INTO tables Modelocalremotelocalremotewindow WhereMysql console Putty; Mysql console Mysql.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
(Chapter 10 continued) Our examples feature MySQL as the database engine. It's open source and free. It's fully featured. And it's platform independent.
Final Project Implementation of Basic Authentication.
Accessing Your MySQL Database from the Web with PHP (Ch 11) 1.
Web-Based Database Programming with PHP. Dept. of Computing Science, University of Aberdeen2 In this lecture you will learn PHP Basics PHP functions –To.
Prof Frankl, Spring 2008CS Polytechnic University 1 Overview of Web database applications with PHP.
Copyright © 2010 Certification Partners, LLC -- All Rights Reserved Perl Specialist.
7 1 User-Defined Functions CGI/Perl Programming By Diane Zak.
Week Six Agenda Announcements Link of the week Review week four lab assignment This week’s expected outcomes Next lab assignment Break-out problems Upcoming.
Introduction to Unix – CS 21
Computer Science 101 Spring 2000 Section E8TBA Registration Code 1693 Dr. Christopher Vickery.
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.
1 CS 430 Database Theory Winter 2005 Lecture 14: Additional SQL Topics.
Copyright © 2003 ProsoftTraining. All rights reserved. Perl Fundamentals.
Copyright 2007 Byrne Reese. Distributed under Creative Commons, share and share alike with attribution. Intermediate Perl Programming Class Four Instructor:
Department of Electrical and Computer Engineering Introduction to Perl By Hector M Lugo-Cordero August 26, 2008.
Copyright 2007 Byrne Reese. Distributed under Creative Commons, share and share alike with attribution. Intermediate Perl Programming Class Three Instructor:
PHP Programming. Topics Database Handling (MySQL, MSSQL, ODBC)
Week Four Agenda Link of the week Review week three lab assignment This week’s expected outcomes Next lab assignment Break-out problems Upcoming deadlines.
COP2800 – Computer Programming Using JAVA University of Florida Department of CISE Spring 2013 Lecture 39 – Command Line Args & Recursion Webpage:
-Joseph Beberman *Some slides are inspired by a PowerPoint presentation used by professor Seikyung Jung, which was derived from Charlie Wiseman.
Dept. of Animal Breeding and Genetics Programming basics & introduction to PERL Mats Pettersson.
Introduction to Programming the WWW I CMSC Winter 2003 Lecture 17.
Aaron Corso COSC Spring What is LAMP?  A ‘solution stack’, or package of an OS and software consisting of:  Linux  Apache  MySQL  PHP.
1. Writing a Java program to connect to SQL Server 2008 and Create a table Populate the table (insert data) Perform queries to retrieve information from.
COM621: Advanced Interactive Web Development Lecture 10 PHP and MySQL.
A little PHP. Enter the simple HTML code seen below.
PDO Database Connections MIS 3501, Fall 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 3/8/2016.
PDO Database Connections
A little PHP.
CS 330 Class 7 Comments on Exam Programming plan for today:
Introduction to Dynamic Web Programming
Unix System Administration
Unix System Administration
Unix System Administration
Unix System Administration
© 2016, Mike Murach & Associates, Inc.
SPRING 2017 ASL LAB ORIENTATION.
PDO Database Connections
LING/C SC/PSYC 438/538 Lecture 7 Sandiway Fong.
Perl Database – Just Enough
ISC440: Web Programming 2 Server-side Scripting PHP 3
PDO Database Connections
Subroutines Web Programming.
Hands-On Ethical Hacking and Network Defense
PDO Database Connections
Perl Functions.
Computer Programming 1 introduction to JAVA Lecture 1 Instructor: Ruba A. Salamah Islamic University of Gaza.
Intro to PHP.
Tutorial 6 PHP & MySQL Li Xu
Concepts of programming languages Credit hours : 3 hours
The Selection Structure
Introduction to Perl Learning Objectives:
Presentation transcript:

Unix System Administration Chris Schenk Lecture 24 – Tuesday Apr 15 Tax Day. Woo. CSCI 4113, Spring 2008

Administrivia Guest lecture by Matthew Woitaszek This Thursday April 17 High performance super-computing and clustering Quiz02 is available Due in a week One more required lab – Perl One extra credit lab – LDAP Final Exam released last week of classes Due at 10:00am Tuesday of finals week via email

Perl Basics Variables @var – array, $var – scalar, %var – hashmap Special variables @_ and $_ Default variables for many functions Reading a file puts each line into $_ Calling 'print' without a variable prints $_ Subroutines put arguments into array @_ Open and read file syntax open(HANDLE, “</path/to/file_to_read.txt”); while(<HANDLE>) { .... }

Perl Regular Expressions Are the bomb Can match on variables or on $_ if(/some regex/) { ... } -- uses $_ if($var =~ /regex/) { ... } -- uses $var Can capture parts of the regex into variables if($var =~ /re(ge)x/ { print $1; } -- prints 'ge' Can also ignore case with options at the end /another ReGeX/i -- 'i' ignores case Do straight substitution 's/shit to replace/new shit to replace it with/'

Perl + MACs Message Authentication Codes Used to authenticate plain-text data 'emailreport' has no authentication Actually a security hole, information leak MACs allow us to send plain text and a tag Tag is verified at the other end MACs use a shared key on both ends 'rndc' for BIND uses this exact concept

Perl + MACs (cont) Use the Digest::HMAC_SHA1 module (after installing libdigest-hmac-perl) Use Digest::HMAC_SHA1; Create a new HMAC object to create a tag my $hmac = Digest::HMAC_SHA1->new("shared key"); Add data to be digested $hmac->add(“just another perl hacker,”); my $digest = $hmac->b64digest(); Now, on the other end, verify tag before performing any tasks (such as sending email)!

Perl + MySQL Use the DBI module (after installing libdbd- mysql-perl package in Ubuntu) use DBI; use DBD::mysql; Define and set your variables My $user = “monitor”; my $pass = “wearewatchingyou”; my $db = “login_monitor”; my $host = “localhost”; Create a connect string and connect $cs = “dbi:mysql:$db:$host:3306”; $conn = DBI->connect($cs, $user, $pass);

Perl + MySQL (cont) Prepare a statement and execute $stmt = $conn->prepare(“SELECT * from logins”); $stmt->execute(); Bind columns (results) and print them out $stmt->bind_columns(undef, \$id, \$username, \$ip, \$time); while($stmt->fetch()) { print "$username, $ip, $time\n"; } Close the connection $conn->disconnect();