How to write a bash script like the python? Lloyd Huang. KaLUG - Kaohsiung Linux User Group COSCUP Aug

Size: px
Start display at page:

Download "How to write a bash script like the python? Lloyd Huang. KaLUG - Kaohsiung Linux User Group COSCUP Aug 18 2012"

Transcription

1 How to write a bash script like the python? Lloyd Huang KaLUG - Kaohsiung Linux User Group COSCUP Aug

2 Before the start Before the start About Bash Python and me. The ipython and lpython.py. A trick, but it touches my heart. Examples of lpython.py : cat /etc/passwd lpython.py \ 'for i in stdin:\n s=i.split(":"); print s[0],s[5],s[6],' uname -a lpython.py 'print stdin.read().split()[0:3]' 2

3 Bash: Questions and answers Bash: Questions and answers Q: How to be more logic and reuse? A: Function. Q: How to do unit testing? A: Function. Q: How different is between Bash function and Python module? A:... 3

4 Bash source VS Python import Bash source VS Python import Python A module allows you to logically organize your Python code. Grouping related code into a module makes the code easier to understand and use. Python modules are easy to create; they're just files of Python program code. if name == ' main ': 4

5 Bash source VS Python import How Bash do it? 5

6 Bash source VS Python import #!/bin/bash #!/usr/bin/python funtest() { def funtest(): echo "" print "" } funfake() { def funfake(): echo "func for fake" print "func for fake" } # main if name == ' main ': funtest funtest() funfake funfake() $> source samp00.sh $> python >>> import samp00 func for fake $> bash samp00.sh $> python samp00.py func for fake func for fake 6

7 Bash source VS Python import #!/bin/bash #!/usr/bin/python funtest() { def funtest(): echo "" print "" } funfake() { def funfake(): echo "func for fake" print "func for fake" } return 2> /dev/null if name == ' main ': funtest funtest() funfake funfake() $> source samp00.sh $> python >>> import samp00 $> bash samp00.sh $> python samp00.py func for fake func for fake 7

8 Bash source VS Python import #!/bin/bash funtest() { echo "" } funfake() { echo "func for fake" } if [ "$0" == "$BASH_SOURCE" ]; then funtest funfake fi 8

9 From xkcd

10 Python module and docstring Python module and docstring import, from import module as someone Import module del Delete object docstring Python Documentation Strings 10

11 Python module and docstring #!/usr/bin/python def funtest(): """ Here is python docstring for funtest. Here is python docstring for funtest. """ print "" def funfake(): "Here is python docstring for funcfake." print "func for fake" if name == ' main ': funtest() funfake() 11

12 Python module and docstring $> python >>> import samp02 >>> samp02. samp02. doc ( samp02.funtest( samp02.funfake( >>> samp02.funtest() >>> help (samp02.funtest) >>> Help on function funtest in module samp02: funtest() Here is python docstring for funtest. Here is python docstring for funtest. 12

13 Python module and docstring >>> samp02.funfake. doc 'Here is python docstring for funcfake.' >>> print samp02.funfake. doc Here is python docstring for funcfake. >>> import samp02 as new_samp02 >>> new_samp02.funtest() >>> del new_samp02 >>> new_samp02.funtest() Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'new_samp' is not defined 13

14 Bash import and docstring? Bash import and docstring? Usage: source import.sh import, from import module as someone Import module del module Delete module help module.function Documentation Strings 14

15 Bash import and docstring? #!/bin/bash funtest() { doc =" Here is bash import.sh docstring for funtest Here is bash import.sh docstring for funtest " echo "" } funfake() { doc ="Here is bash import.sh docstring for funfake" echo "func for fake" } if [ "$0" == "$BASH_SOURCE" ]; then funtest funfake fi 15

16 Bash import and docstring? $> source import.sh $> import samp02.sh $> samp02 samp02.funfake samp02.funtest $> samp02.funtest $> import samp02.sh as new_samp $> new_samp.funtest $> help new_samp.funtest Here is bash import.sh docstring for funtest Here is bash import.sh docstring for funtest $> del new_samp $> new_samp.funtest bash: new_samp.funtest command not found 16

17 uid, gid = split(``1000:100'',``:'')? uid, gid = split(``1000:100'',``:'')? Python : split name, passwd, uid, gid, note, homedir, shell = string.split("www-data:x:33:33:www-data:/var/www:/bin/sh",":") Bash : read LDread () { doc ="LDread '.' 'V KH ' c1 c2 c3 c4 c5 c6 c7" } local ifs con ifs="$1"; shift con="$1"; shift IFS="$ifs" read $@ < <(echo $con) 17

18 阿 宅 圖 片 來 源 : 公 立 怪 咖 國 民 小 學

19 Hook Hook #!/bin/bash funtest() { doc ="Hook test - Part I PreHook=\"echo This is PreHook\" PostHook=\"echo This is PostHook\"" } test -n "$PreHook" && $PreHook echo "" test -n "$PostHook" && $PostHook 19

20 Hook $> import hook00.sh $> hook00.funtest $> help hook00.funtest Hook test - Part I PreHook="echo This is PreHook" PostHook="echo This is PostHook" $> PreHook="echo This is PreHook" $> PostHook="echo This is PostHook" $> hook00.funtest This is PreHook This is PostHook 20

21 Hook #!/bin/bash funtestprehook () { return } funtestposthook () { return } funtest() { doc ="Hook test - Part II funtestprehook () { echo \"This is funtestprehook\"; } funtestposthook () { echo \"This is funtestposthook\"; } " } funtestprehook echo "" funtestposthook 21

22 Hook $> import hook01.sh $> hook01.funtest $> help hook01.funtest Hook test - Part II hook01.funtestprehook () { echo "This is funtestprehook"; } hook01.funtestposthook () { echo "This is funtestposthook"; } $> hook01.funtestprehook () { echo "This is funtestprehook"; } $> hook01.funtestposthook () { echo "This is funtestposthook"; } $> hook01.funtest This is funtestprehook This is funtestposthook 22

23 Demo Demo 23

24 Advantages VS Problems Advantages VS Problems Advantages Function reuse Unit testing Name space Documentation strings Grouping up commands Problems To Conflict with ImageMagick Can't work with busybox ash 24

How to extend Puppet using Ruby

How to extend Puppet using Ruby How to ext Puppet using Ruby Miguel Di Ciurcio Filho miguel@instruct.com.br http://localhost:9090/onepage 1/43 What is Puppet? Puppet Architecture Facts Functions Resource Types Hiera, Faces and Reports

More information

Computational Mathematics with Python

Computational Mathematics with Python Boolean Arrays Classes Computational Mathematics with Python Basics Olivier Verdier and Claus Führer 2009-03-24 Olivier Verdier and Claus Führer Computational Mathematics with Python 2009-03-24 1 / 40

More information

DevKey Documentation. Release 0.1. Colm O Connor

DevKey Documentation. Release 0.1. Colm O Connor DevKey Documentation Release 0.1 Colm O Connor March 23, 2015 Contents 1 Quickstart 3 2 FAQ 5 3 Release Notes 7 i ii DevKey Documentation, Release 0.1 Github PyPI Contents 1 DevKey Documentation, Release

More information

Computational Mathematics with Python

Computational Mathematics with Python Computational Mathematics with Python Basics Claus Führer, Jan Erik Solem, Olivier Verdier Spring 2010 Claus Führer, Jan Erik Solem, Olivier Verdier Computational Mathematics with Python Spring 2010 1

More information

Pen Test Tips 2. Shell vs. Terminal

Pen Test Tips 2. Shell vs. Terminal Pen Test Tips 2 Shell vs. Terminal Once you have successfully exploited a target machine you may be faced with a common dilemma that many penetration testers have, do I have shell access or terminal access?

More information

Intro to scientific programming (with Python) Pietro Berkes, Brandeis University

Intro to scientific programming (with Python) Pietro Berkes, Brandeis University Intro to scientific programming (with Python) Pietro Berkes, Brandeis University Next 4 lessons: Outline Scientific programming: best practices Classical learning (Hoepfield network) Probabilistic learning

More information

Computational Mathematics with Python

Computational Mathematics with Python Numerical Analysis, Lund University, 2011 1 Computational Mathematics with Python Chapter 1: Basics Numerical Analysis, Lund University Claus Führer, Jan Erik Solem, Olivier Verdier, Tony Stillfjord Spring

More information

Linux Shell Script To Monitor Ftp Server Connection

Linux Shell Script To Monitor Ftp Server Connection Linux Shell Script To Monitor Ftp Server Connection Main goal of this script is to monitor ftp server. This script is example of how to use ftp command in bash shell. System administrator can use this

More information

Network Security In Linux: Scanning and Hacking

Network Security In Linux: Scanning and Hacking Network Security In Linux: Scanning and Hacking Review Lex A lexical analyzer that tokenizes an input text. Yacc A parser that parses and acts based on defined grammar rules involving tokens. How to compile

More information

Shellshock. Oz Elisyan & Maxim Zavodchik

Shellshock. Oz Elisyan & Maxim Zavodchik Shellshock By Oz Elisyan & Maxim Zavodchik INTRODUCTION Once a high profile vulnerability is released to the public, there will be a lot of people who will use the opportunity to take advantage on vulnerable

More information

Test Driven Deployment with (i)python and nosetest

Test Driven Deployment with (i)python and nosetest Test Driven Deployment with (i)python and nosetest Roberto Polli, Solutions Architect 18.04.2015 headquarters / operating unit via campanini 6 20124 milano tel: +39 02/66.732.1 fax: +39 02/66.732.300 operating

More information

Advanced Bash Scripting. Joshua Malone (jmalone@ubergeeks.com)

Advanced Bash Scripting. Joshua Malone (jmalone@ubergeeks.com) Advanced Bash Scripting Joshua Malone (jmalone@ubergeeks.com) Why script in bash? You re probably already using it Great at managing external programs Powerful scripting language Portable and version-stable

More information

Hadoop Hands-On Exercises

Hadoop Hands-On Exercises Hadoop Hands-On Exercises Lawrence Berkeley National Lab Oct 2011 We will Training accounts/user Agreement forms Test access to carver HDFS commands Monitoring Run the word count example Simple streaming

More information

Bash shell programming Part II Control statements

Bash shell programming Part II Control statements Bash shell programming Part II Control statements Deniz Savas and Michael Griffiths 2005-2011 Corporate Information and Computing Services The University of Sheffield Email M.Griffiths@sheffield.ac.uk

More information

Automatic Script Generation Based on User-System Interactions

Automatic Script Generation Based on User-System Interactions Automatic Script Generation Based on User-System Interactions M. Golik, M. Bubak, and T. Szepieniec ACC Cyfronet AGH CGW'4, Kraków, 28.0.204 Background 2 User wants to conduct a simulation: Opens terminal,

More information

Advanced Topics: Biopython

Advanced Topics: Biopython Advanced Topics: Biopython Day Three Testing Peter J. A. Cock The James Hutton Institute, Invergowrie, Dundee, DD2 5DA, Scotland, UK 23rd 25th January 2012, Workshop on Genomics, Český Krumlov, Czech Republic

More information

Profiling, debugging and testing with Python. Jonathan Bollback, Georg Rieckh and Jose Guzman

Profiling, debugging and testing with Python. Jonathan Bollback, Georg Rieckh and Jose Guzman Profiling, debugging and testing with Python Jonathan Bollback, Georg Rieckh and Jose Guzman Overview 1.- Profiling 4 Profiling: timeit 5 Profiling: exercise 6 2.- Debugging 7 Debugging: pdb 8 Debugging:

More information

CS2720 Practical Software Development

CS2720 Practical Software Development Page 1 Rex Forsyth CS2720 Practical Software Development CS2720 Practical Software Development Scripting Tutorial Srping 2011 Instructor: Rex Forsyth Office: C-558 E-mail: forsyth@cs.uleth.ca Tel: 329-2496

More information

SGE Roll: Users Guide. Version @VERSION@ Edition

SGE Roll: Users Guide. Version @VERSION@ Edition SGE Roll: Users Guide Version @VERSION@ Edition SGE Roll: Users Guide : Version @VERSION@ Edition Published Aug 2006 Copyright 2006 UC Regents, Scalable Systems Table of Contents Preface...i 1. Requirements...1

More information

Epics_On_RPi Documentation

Epics_On_RPi Documentation Epics_On_RPi Documentation Release 2014.0317.2 Pete Jemian May 30, 2015 Contents 1 Raspberry Pi Distribution 3 2 Preparing for EPICS 5 3 EPICS Base 7 3.1 Downloading...............................................

More information

RHEL Clients to AD Integrating RHEL clients to Active Directory

RHEL Clients to AD Integrating RHEL clients to Active Directory RHEL Clients to AD Integrating RHEL clients to Active Directory Presenter Dave Sullivan Sr. TAM, Red Hat 2013-09-03 Agenda Review Dmitri Pal and Simo Sorce Preso Legacy RHEL hook to AD RHEL Direct--->sssd--->AD

More information

SAS Hints. data _null_; infile testit pad missover lrecl=3; input answer $3.; put answer=; run; May 30, 2008

SAS Hints. data _null_; infile testit pad missover lrecl=3; input answer $3.; put answer=; run; May 30, 2008 SAS Hints Delete tempary files Determine if a file exists Direct output to different directy Errs (specify # of errs f SAS to put into log) Execute Unix command from SAS Generate delimited file with no

More information

24 ottobre 2013.openerp.it XML-RPC vs Psycopg2 Dr. Piero Cecchi. OpenERP Analisi Prestazionale Python script XML-RPC vs Psycopg2

24 ottobre 2013.openerp.it XML-RPC vs Psycopg2 Dr. Piero Cecchi. OpenERP Analisi Prestazionale Python script XML-RPC vs Psycopg2 24 ottobre 2013.openerp.it XML-RPC vs Psycopg2 Dr. Piero Cecchi OpenERP Analisi Prestazionale Python script XML-RPC vs Psycopg2 PROBLEMA REALE In un database nella Tabella: account_move il Campo: id_partner

More information

FILE-HOSTING SERVICE COMPARISON: FASTER SYNCING WITH DROPBOX FOR BUSINESS

FILE-HOSTING SERVICE COMPARISON: FASTER SYNCING WITH DROPBOX FOR BUSINESS FILE-HOSTING SERVICE COMPARISON: FASTER SYNCING WITH DROPBOX FOR BUSINESS SUMMARY Productive employees are what your business needs to succeed. Your employees need great tools, such as a fast file-hosting

More information

PostgreSQL administration using Puppet. Miguel Di Ciurcio Filho

PostgreSQL administration using Puppet. Miguel Di Ciurcio Filho PostgreSQL administration using Puppet Miguel Di Ciurcio Filho miguel@instruct.com.br http://localhost:9090/onepage 1/25 What is Puppet? Puppet Architecture Managing PostgreSQL Installation Databases Roles

More information

Introduction. dnotify

Introduction. dnotify Introduction In a multi-user, multi-process operating system, files are continually being created, modified and deleted, often by apparently unrelated processes. This means that any software that needs

More information

TOPICS IN COMPUTER SECURITY

TOPICS IN COMPUTER SECURITY TOPICS IN COMPUTER SECURITY for the undergraduate student Jim Griffin Cabrillo College Abstract: Key words: Cabrillo College has just adopted a new program in Computer Network and System Administration

More information

Objects and classes. Objects and classes. Jarkko Toivonen (CS Department) Programming in Python 1

Objects and classes. Objects and classes. Jarkko Toivonen (CS Department) Programming in Python 1 Objects and classes Jarkko Toivonen (CS Department) Programming in Python 1 Programming paradigms of Python Python is an object-oriented programming language like Java and C++ But unlike Java, Python doesn

More information

Scientific Programming, Analysis, and Visualization with Python. Mteor 227 Fall 2015

Scientific Programming, Analysis, and Visualization with Python. Mteor 227 Fall 2015 Scientific Programming, Analysis, and Visualization with Python Mteor 227 Fall 2015 Python The Big Picture Interpreted General purpose, high-level Dynamically type Multi-paradigm Object-oriented Functional

More information

CIS 551 / TCOM 401 Computer and Network Security

CIS 551 / TCOM 401 Computer and Network Security CIS 551 / TCOM 401 Computer and Network Security Spring 2007 Lecture 3 1/18/07 CIS/TCOM 551 1 Announcements Email project groups to Jeff (vaughan2 AT seas.upenn.edu) by Jan. 25 Start your projects early!

More information

Programmation Systèmes Cours 4 Runtime user management

Programmation Systèmes Cours 4 Runtime user management Programmation Systèmes Cours 4 Runtime user management Stefano Zacchiroli zack@pps.jussieu.fr Laboratoire PPS, Université Paris Diderot - Paris 7 20 Octobre 2011 URL http://upsilon.cc/zack/teaching/1112/progsyst/

More information

grep, awk and sed three VERY useful command-line utilities Matt Probert, Uni of York grep = global regular expression print

grep, awk and sed three VERY useful command-line utilities Matt Probert, Uni of York grep = global regular expression print grep, awk and sed three VERY useful command-line utilities Matt Probert, Uni of York grep = global regular expression print In the simplest terms, grep (global regular expression print) will search input

More information

Extreme computing lab exercises Session one

Extreme computing lab exercises Session one Extreme computing lab exercises Session one Michail Basios (m.basios@sms.ed.ac.uk) Stratis Viglas (sviglas@inf.ed.ac.uk) 1 Getting started First you need to access the machine where you will be doing all

More information

Chained Enforceable Re-authentication Barrier Ensures Really Unbreakable Security

Chained Enforceable Re-authentication Barrier Ensures Really Unbreakable Security Chained Enforceable Re-authentication Barrier Ensures Really Unbreakable Security Toshiharu Harada Takaaki Matsumoto NTT DATA CORPORATION Abstract: Keywords: Mandatory Access Control (MAC) is a powerful

More information

Useless Use of * Slide 1. Useless Use of * Jan Schaumann jschauma@netmeister.org PGP: 136D 027F DC29 8402 7B42 47D6 7C5B 64AF AF22 6A4C

Useless Use of * Slide 1. Useless Use of * Jan Schaumann jschauma@netmeister.org PGP: 136D 027F DC29 8402 7B42 47D6 7C5B 64AF AF22 6A4C Useless Use of * Slide 1 Useless Use of * jschauma@netmeister.org PGP: 136D 027F DC29 8402 7B42 47D6 7C5B 64AF AF22 6A4C whoami Useless Use of * Slide 2 $ ME=$(id -un) $ grep ${ME} /etc/passwd cut -d:

More information

Rake Task Management Essentials

Rake Task Management Essentials Rake Task Management Essentials Andrey Koleshko Chapter No. 8 "Testing Rake Tasks" In this package, you will find: A Biography of the author of the book A preview chapter from the book, Chapter NO.8 "Testing

More information

An Introduction to High Performance Computing in the Department

An Introduction to High Performance Computing in the Department An Introduction to High Performance Computing in the Department Ashley Ford & Chris Jewell Department of Statistics University of Warwick October 30, 2012 1 Some Background 2 How is Buster used? 3 Software

More information

Job Scheduler Daemon Configuration Guide

Job Scheduler Daemon Configuration Guide Job Scheduler Daemon Configuration Guide A component of Mark Dickinsons Unix Job Scheduler This manual covers the server daemon component of Mark Dickinsons unix Job Scheduler. This manual is for version

More information

University of Hull Department of Computer Science. Wrestling with Python Week 01 Playing with Python

University of Hull Department of Computer Science. Wrestling with Python Week 01 Playing with Python Introduction Welcome to our Python sessions. University of Hull Department of Computer Science Wrestling with Python Week 01 Playing with Python Vsn. 1.0 Rob Miles 2013 Please follow the instructions carefully.

More information

INASP: Effective Network Management Workshops

INASP: Effective Network Management Workshops INASP: Effective Network Management Workshops Linux Familiarization and Commands (Exercises) Based on the materials developed by NSRC for AfNOG 2013, and reused with thanks. Adapted for the INASP Network

More information

mitmproxy.org How MITMproxy has been slaying SSL Dragons OWASP The OWASP Foundation

mitmproxy.org How MITMproxy has been slaying SSL Dragons OWASP The OWASP Foundation mitmproxy.org How MITMproxy has been slaying SSL Dragons April 14 2012 Jim Cheetham University of Otago Information Security Office jim.cheetham@otago.ac.nz Copyright The University of Otago Permission

More information

Intel Do-It-Yourself Challenge Lab 2: Intel Galileo s Linux side Nicolas Vailliet

Intel Do-It-Yourself Challenge Lab 2: Intel Galileo s Linux side Nicolas Vailliet Intel Do-It-Yourself Challenge Lab 2: Intel Galileo s Linux side Nicolas Vailliet www.intel-software-academic-program.com paul.guermonprez@intel.com Intel Software 2014-02-01 Prerequisites and objectives

More information

Troubleshooting Mac OS X Server Tips and tricks

Troubleshooting Mac OS X Server Tips and tricks Troubleshooting Mac OS X Server Tips and tricks Zack Smith Consulting Engineer - 318 @acidprime January 28th, 2011 A few words on the future of Mac OS X Server... Troubleshooting a Service tail -f

More information

About This Document 3. Integration and Automation Capabilities 4. Command-Line Interface (CLI) 8. API RPC Protocol 9.

About This Document 3. Integration and Automation Capabilities 4. Command-Line Interface (CLI) 8. API RPC Protocol 9. Parallels Panel Contents About This Document 3 Integration and Automation Capabilities 4 Command-Line Interface (CLI) 8 API RPC Protocol 9 Event Handlers 11 Panel Notifications 13 APS Packages 14 C H A

More information

SELinux Policy Editor RBAC(Role Based Access Control) guide (for Ver 2.0))

SELinux Policy Editor RBAC(Role Based Access Control) guide (for Ver 2.0)) SELinux Policy Editor RBAC(Role Based Access Control) guide (for Ver 2.0)) Yuichi Nakamura July 3, 2006 Contents 1 What is RBAC 2 1.1 Overview............................... 2 1.2 How RBAC works in SELinux....................

More information

Windmill. Automated Testing for Web Applications

Windmill. Automated Testing for Web Applications Windmill Automated Testing for Web Applications Demo! Requirements Quickly build regression tests Easily debug tests Run single test on all target browsers Easily fit in to continuous integration Other

More information

VDCF - Virtual Datacenter Control Framework for the Solaris TM Operating System

VDCF - Virtual Datacenter Control Framework for the Solaris TM Operating System VDCF - Virtual Datacenter Control Framework for the Solaris TM Operating System VDCF Blueprint Software Deployment Version 1.1 August 2014 Copyright 2005-2014 JomaSoft GmbH All rights reserved. support@jomasoft.ch

More information

Command Line Crash Course For Unix

Command Line Crash Course For Unix Command Line Crash Course For Unix Controlling Your Computer From The Terminal Zed A. Shaw December 2011 Introduction How To Use This Course You cannot learn to do this from videos alone. You can learn

More information

Use Cases for Docker in Enterprise Linux Environment CloudOpen North America, 2014 Linda Wang Sr. Software Engineering Manager Red Hat, Inc.

Use Cases for Docker in Enterprise Linux Environment CloudOpen North America, 2014 Linda Wang Sr. Software Engineering Manager Red Hat, Inc. Use Cases for Docker in Enterprise Linux Environment CloudOpen North America, 2014 Linda Wang Sr. Software Engineering Manager Red Hat, Inc. 1 2 Containerize! 3 Use Cases for Docker in the Enterprise Linux

More information

Penetration Testing Ninjitsu 2: Crouching Netcat, Hidden Vulnerabilities. By Ed Skoudis

Penetration Testing Ninjitsu 2: Crouching Netcat, Hidden Vulnerabilities. By Ed Skoudis Penetration Testing Ninjitsu 2: Crouching Netcat, Hidden Vulnerabilities By Ed Skoudis Copyright 2008, SANS Version 2Q08 Network Pen Testing & Ethical Hacking - 2008, Ed Skoudis 1 This Webcast and the

More information

B&K Precision 1785B, 1786B, 1787B, 1788 Power supply Python Library

B&K Precision 1785B, 1786B, 1787B, 1788 Power supply Python Library B&K Precision 1785B, 1786B, 1787B, 1788 Power supply Python Library Table of Contents Introduction 2 Prerequisites 2 Why a Library is Useful 3 Using the Library from Python 6 Conventions 6 Return values

More information

Submitting batch jobs Slurm on ecgate. Xavi Abellan xavier.abellan@ecmwf.int User Support Section

Submitting batch jobs Slurm on ecgate. Xavi Abellan xavier.abellan@ecmwf.int User Support Section Submitting batch jobs Slurm on ecgate Xavi Abellan xavier.abellan@ecmwf.int User Support Section Slide 1 Outline Interactive mode versus Batch mode Overview of the Slurm batch system on ecgate Batch basic

More information

Systems Programming & Scripting

Systems Programming & Scripting Systems Programming & Scripting Lecture 14 - Shell Scripting: Control Structures, Functions Syst Prog & Scripting - Heriot Watt University 1 Control Structures Shell scripting supports creating more complex

More information

Writing MySQL Scripts With Python's DB-API Interface

Writing MySQL Scripts With Python's DB-API Interface Writing MySQL Scripts With Python's DB-API Interface By Paul DuBois, NuSphere Corporation (October 2001) TABLE OF CONTENTS MySQLdb Installation A Short DB-API Script Writing the Script Running the Script

More information

How to Set Up pgagent for Postgres Plus. A Postgres Evaluation Quick Tutorial From EnterpriseDB

How to Set Up pgagent for Postgres Plus. A Postgres Evaluation Quick Tutorial From EnterpriseDB How to Set Up pgagent for Postgres Plus A Postgres Evaluation Quick Tutorial From EnterpriseDB February 19, 2010 EnterpriseDB Corporation, 235 Littleton Road, Westford, MA 01866, USA T +1 978 589 5700

More information

Automating Linux Malware Analysis Using Limon Sandbox Monnappa K A monnappa22@gmail.com

Automating Linux Malware Analysis Using Limon Sandbox Monnappa K A monnappa22@gmail.com Automating Linux Malware Analysis Using Limon Sandbox Monnappa K A monnappa22@gmail.com A number of devices are running Linux due to its flexibility and open source nature. This has made Linux platform

More information

General Overview. Slurm Training15. Alfred Gil & Jordi Blasco (HPCNow!)

General Overview. Slurm Training15. Alfred Gil & Jordi Blasco (HPCNow!) Slurm Training15 Agenda 1 2 3 About Slurm Key Features of Slurm Extending Slurm Resource Management Daemons Job/step allocation 4 5 SMP MPI Parametric Job monitoring Accounting Scheduling Administration

More information

netflow-indexer Documentation

netflow-indexer Documentation netflow-indexer Documentation Release 0.1.28 Justin Azoff May 02, 2012 CONTENTS 1 Installation 2 1.1 Install prerequisites............................................ 2 1.2 Install netflow-indexer..........................................

More information

Penetration Testing Report Client: Business Solutions June 15 th 2015

Penetration Testing Report Client: Business Solutions June 15 th 2015 Penetration Testing Report Client: Business Solutions June 15 th 2015 Acumen Innovations 80 S.W 8 th St Suite 2000 Miami, FL 33130 United States of America Tel: 1-888-995-7803 Email: info@acumen-innovations.com

More information

Tor Exit Node Block Scripts

Tor Exit Node Block Scripts 1 Ryan MacNeille [ ryan.macneille@gmail.com ] Tor Exit Node Block Scripts The Tor Browser is an Open Source project that allows its users to browse the internet using highly encrypted connections with

More information

Integrating Lustre with User Security Administration. LAD 15 // Chris Gouge // 2015 Sep

Integrating Lustre with User Security Administration. LAD 15 // Chris Gouge // 2015 Sep Integrating Lustre with User Security Administration LAD 15 // Chris Gouge // 2015 Sep Topics User Security in Linux POSIX Permissions The Requirement for Upcall in Lustre Upcall Utilities Overview Upcall

More information

Windows Security and Directory Services for UNIX using Centrify DirectControl

Windows Security and Directory Services for UNIX using Centrify DirectControl SOLUTION GUIDE CENTRIFY CORP. SEPTEMBER 2005 Windows Security and Directory Services for UNIX using Centrify DirectControl With Centrify, you can now fully leverage your investment in Active Directory

More information

Introduction to Python

Introduction to Python Introduction to Python Sophia Bethany Coban Problem Solving By Computer March 26, 2014 Introduction to Python Python is a general-purpose, high-level programming language. It offers readable codes, and

More information

Introduction to Scientific Computing

Introduction to Scientific Computing Introduction to Scientific Computing what you need to learn now to decide what you need to learn next Bob Dowling University Computing Service rjd4@cam.ac.uk 1. Why this course exists 2. Common concepts

More information

Subversion Integration

Subversion Integration Subversion Integration With the popular Subversion Source Control Management tool, users will find a flexible interface to integrate with their ExtraView bug-tracking system. Copyright 2008 ExtraView Corporation

More information

Using the Radmind Command Line Tools to. Maintain Multiple Mac OS X Machines

Using the Radmind Command Line Tools to. Maintain Multiple Mac OS X Machines Using the Radmind Command Line Tools to Maintain Multiple Mac OS X Machines Version 0.8.1 This document describes how to install, configure and use the radmind client and server tools to maintain a small

More information

Web Hosting: Pipeline Program Technical Self Study Guide

Web Hosting: Pipeline Program Technical Self Study Guide Pipeline Program Technical Self Study Guide Thank you for your interest in InMotion Hosting and our Technical Support positions. Our technical support associates operate in a call center environment, assisting

More information

Creating an LDAP Directory

Creating an LDAP Directory Systems and Network Management 1 Background Creating an LDAP Directory The ldap protocol is a standard for network directories. Some proprietary directory servers have been based on ldap, for example,

More information

Outline. Unix shells Bourne-again Shell (bash) Interacting with bash Basic scripting References

Outline. Unix shells Bourne-again Shell (bash) Interacting with bash Basic scripting References Ryan Hulguin Outline Unix shells Bourne-again Shell (bash) Interacting with bash Basic scripting References Unix shells This lets users issue commands to the Unix operating system Users can interact with

More information

Grid Engine Users Guide. 2011.11p1 Edition

Grid Engine Users Guide. 2011.11p1 Edition Grid Engine Users Guide 2011.11p1 Edition Grid Engine Users Guide : 2011.11p1 Edition Published Nov 01 2012 Copyright 2012 University of California and Scalable Systems This document is subject to the

More information

Chapter 7: Unix Security. Chapter 7: 1

Chapter 7: Unix Security. Chapter 7: 1 Chapter 7: Unix Security Chapter 7: 1 Objectives Understand the security features provided by a typical operating system. Introduce the basic Unix security model. See how general security principles are

More information

Module Google Rich Snippets + Product Ratings and Reviews

Module Google Rich Snippets + Product Ratings and Reviews Module Google Rich Snippets + Product Ratings and Reviews Date : June 3 th, 2014 Business Tech Installation Service If you need help installing and configuring your module, we can offer you an installation

More information

Wind River. Intelligent Device Platform XT EMS Profile EMS DEVICE MANAGEMENT USER'S GUIDE WIND RIVER 1.0

Wind River. Intelligent Device Platform XT EMS Profile EMS DEVICE MANAGEMENT USER'S GUIDE WIND RIVER 1.0 Wind River Intelligent Device Platform XT EMS Profile WIND RIVER EMS DEVICE MANAGEMENT USER'S GUIDE 1.0 Copyright Notice Copyright 2014 Wind River Systems, Inc. All rights reserved. No part of this publication

More information

How to build secure Apache Tomcat deployments with RPM.

How to build secure Apache Tomcat deployments with RPM. How to build secure Apache Tomcat deployments with RPM. My security experiences really tie into everyday work. A colleague called me from my last gig and asked how to build a RedHat Package Manager (RPM)

More information

Extending Remote Desktop for Large Installations. Distributed Package Installs

Extending Remote Desktop for Large Installations. Distributed Package Installs Extending Remote Desktop for Large Installations This article describes four ways Remote Desktop can be extended for large installations. The four ways are: Distributed Package Installs, List Sharing,

More information

mruby extension module for monitoring system Takanori Suzuki

mruby extension module for monitoring system Takanori Suzuki mruby extension module for monitoring system Takanori Suzuki Agenda - Introduction of MIRACLE ZBX - What is mruby extension module - Why mruby module is needed - Structure of mruby extension module - How

More information

Using Single Sign-on with Samba. Appendices. Glossary. Using Single Sign-on with Samba. SonicOS Enhanced

Using Single Sign-on with Samba. Appendices. Glossary. Using Single Sign-on with Samba. SonicOS Enhanced SonicOS Enhanced Using Single Sign-on with Samba Using Single Sign-on with Samba Introduction Recommended Versions Caveats SonicWALL Single Sign-on in Windows SonicWALL Single Sign-on with Samba Checking

More information

GR A universal framework for visualization applications

GR A universal framework for visualization applications Mitglied der Helmholtz-Gemeinschaft GR A universal framework for visualization applications 26. April 2012 73. Koordinierungstreffen J. Heinen GR Layer Structure Fortran C / C++ Objective-C Python Ruby...

More information

Extreme computing lab exercises Session one

Extreme computing lab exercises Session one Extreme computing lab exercises Session one Miles Osborne (original: Sasa Petrovic) October 23, 2012 1 Getting started First you need to access the machine where you will be doing all the work. Do this

More information

Simulation Tools. Python for MATLAB Users I. Claus Führer. Automn 2009. Claus Führer Simulation Tools Automn 2009 1 / 65

Simulation Tools. Python for MATLAB Users I. Claus Führer. Automn 2009. Claus Führer Simulation Tools Automn 2009 1 / 65 Simulation Tools Python for MATLAB Users I Claus Führer Automn 2009 Claus Führer Simulation Tools Automn 2009 1 / 65 1 Preface 2 Python vs Other Languages 3 Examples and Demo 4 Python Basics Basic Operations

More information

Open source framework for interactive data exploration in server based architecture

Open source framework for interactive data exploration in server based architecture Open source framework for interactive data exploration in server based architecture D5.5 v1.0 WP5 Visual Analytics: D5.5 Open source framework for interactive data exploration in server based architecture

More information

CS 2112 Lab: Version Control

CS 2112 Lab: Version Control 29 September 1 October, 2014 Version Control What is Version Control? You re emailing your project back and forth with your partner. An hour before the deadline, you and your partner both find different

More information

Advanced Tornado TWENTYONE. 21.1 Advanced Tornado. 21.2 Accessing MySQL from Python LAB

Advanced Tornado TWENTYONE. 21.1 Advanced Tornado. 21.2 Accessing MySQL from Python LAB 21.1 Advanced Tornado Advanced Tornado One of the main reasons we might want to use a web framework like Tornado is that they hide a lot of the boilerplate stuff that we don t really care about, like escaping

More information

A Dude probing SNMP! Building custom probes and configuring equipment using SNMP with The Dude. Andrea Coppini AIR Wireless - Malta andrea@air.com.

A Dude probing SNMP! Building custom probes and configuring equipment using SNMP with The Dude. Andrea Coppini AIR Wireless - Malta andrea@air.com. A! Building custom probes and configuring equipment using SNMP with The Dude. Andrea Coppini AIR Wireless - Malta andrea@air.com.mt Agenda Background Overview of SNMP Creating custom probes Demo Using

More information

CS 1133, LAB 2: FUNCTIONS AND TESTING http://www.cs.cornell.edu/courses/cs1133/2015fa/labs/lab02.pdf

CS 1133, LAB 2: FUNCTIONS AND TESTING http://www.cs.cornell.edu/courses/cs1133/2015fa/labs/lab02.pdf CS 1133, LAB 2: FUNCTIONS AND TESTING http://www.cs.cornell.edu/courses/cs1133/2015fa/labs/lab02.pdf First Name: Last Name: NetID: The purpose of this lab is to help you to better understand functions:

More information

Continuous Integration In challenging environments w/ Ansible. PyCon5 Italy, Cesare Placanica

Continuous Integration In challenging environments w/ Ansible. PyCon5 Italy, Cesare Placanica Continuous Integration In challenging environments w/ Ansible. PyCon5 Italy, Cesare Placanica Who am I Work for Cisco Photonics Italy Network Management Technology Group keobox@gmail.com Cisco Prime

More information

Hadoop Hands-On Exercises

Hadoop Hands-On Exercises Hadoop Hands-On Exercises Lawrence Berkeley National Lab July 2011 We will Training accounts/user Agreement forms Test access to carver HDFS commands Monitoring Run the word count example Simple streaming

More information

Module Google Rich Snippets + Product Ratings and Reviews

Module Google Rich Snippets + Product Ratings and Reviews Module Google Rich Snippets + Product Ratings and Reviews Date : September 11 th, 2012 Business Tech Installation Service If you need help installing and configuring your module, we can offer you an installation

More information

Module Title: Advanced Systems Administration 2

Module Title: Advanced Systems Administration 2 CORK INSTITUTE OF TECHNOLOGY INSTITIÚID TEICNEOLAÍOCHTA CHORCAÍ Semester 1 Examinations 2012/13 Module Title: Advanced Systems Administration 2 Module Code: COMP 7021 School: Mathematics & Computing Programme

More information

Cluster synchronization with Csync 2

Cluster synchronization with Csync 2 Cluster synchronization with Csync 2 Original Author: Clifford Wolf for LINBIT Developed and maintained by LINBIT, http://www.linbit.com/ May 2, 2013 1 Introduction Csync 2 [1] is a tool for asynchronous

More information

Module Google Rich Snippets + Product Ratings and Reviews

Module Google Rich Snippets + Product Ratings and Reviews Module Google Rich Snippets + Product Ratings and Reviews Date : May 13 th, 2013 Business Tech Installation Service If you need help installing and configuring your module, we can offer you an installation

More information

Introduction to Linux (Authentication Systems, User Accounts, LDAP and NIS) Süha TUNA Res. Assist.

Introduction to Linux (Authentication Systems, User Accounts, LDAP and NIS) Süha TUNA Res. Assist. Introduction to Linux (Authentication Systems, User Accounts, LDAP and NIS) Süha TUNA Res. Assist. Outline 1. What is authentication? a. General Informations 2. Authentication Systems in Linux a. Local

More information

SLURM Workload Manager

SLURM Workload Manager SLURM Workload Manager What is SLURM? SLURM (Simple Linux Utility for Resource Management) is the native scheduler software that runs on ASTI's HPC cluster. Free and open-source job scheduler for the Linux

More information

Lecture 4: Writing shell scripts

Lecture 4: Writing shell scripts Handout 5 06/03/03 1 Your rst shell script Lecture 4: Writing shell scripts Shell scripts are nothing other than les that contain shell commands that are run when you type the le at the command line. That

More information

Beginners Shell Scripting for Batch Jobs

Beginners Shell Scripting for Batch Jobs Beginners Shell Scripting for Batch Jobs Evan Bollig and Geoffrey Womeldorff Before we begin... Everyone please visit this page for example scripts and grab a crib sheet from the front http://www.scs.fsu.edu/~bollig/techseries

More information

Monitoring a Linux Mail Server

Monitoring a Linux Mail Server Monitoring a Linux Mail Server Mike Weber mweber@spidertools.com] Various Methods to Monitor Mail Server Public Ports SMTP on Port 25 POPS on Port 995 IMAPS on Port 993 SNMP Amavis on Port 10024 Reinjection

More information

Our Puppet Story. Martin Schütte. May 5 2014

Our Puppet Story. Martin Schütte. May 5 2014 Our Puppet Story Martin Schütte May 5 2014 About DECK36 Small team of 7 engineers Longstanding expertise in designing, implementing and operating complex web systems Developing own data intelligence-focused

More information

AUTOMATIC EVALUATION OF COMPUTER PROGRAMS USING MOODLE S VIRTUAL PROGRAMMING LAB (VPL) PLUG- IN

AUTOMATIC EVALUATION OF COMPUTER PROGRAMS USING MOODLE S VIRTUAL PROGRAMMING LAB (VPL) PLUG- IN AUTOMATIC EVALUATION OF COMPUTER PROGRAMS USING MOODLE S VIRTUAL PROGRAMMING LAB (VPL) PLUG- IN Dominique Thiébaut Department of Computer Science Smith College Northampton, MA 01060 dthiebaut@smith.edu

More information

The Puppet Show Managing Servers with Puppet

The Puppet Show Managing Servers with Puppet The Puppet Show Managing Servers with Puppet A gentle introduction to Puppet; How it works, What its benefits are And how to use it Robert Harker harker@harker.com whoami UNIX/Linux sysadmin for over 25

More information

Basic C Shell. helpdesk@stat.rice.edu. 11th August 2003

Basic C Shell. helpdesk@stat.rice.edu. 11th August 2003 Basic C Shell helpdesk@stat.rice.edu 11th August 2003 This is a very brief guide to how to use cshell to speed up your use of Unix commands. Googling C Shell Tutorial can lead you to more detailed information.

More information