SlideShare a Scribd company logo
Tips and Tricks
Kellyn Gorman, Azure Data Platform Architect
Microsoft
Scripting for Success on
Linux
If you require assistance
during the session, type
your inquiry into the
question pane on the right
side.
Maximize your screen with
the zoom button on the
top of the presentation
window.
Please fill in the short
evaluation following the
session. It will appear in
your web browser.
Technical Assistance
PASS’ flagship event takes place in Seattle, Washington
November 5-8, 2019
PASSsummit.com
PASS Marathon: Career Development
October 8, 2019
Upcoming
Events
10
Kellyn Gorman
Azure Data Platform
Architect, Microsoft
Azure Data Platform Architect
Kellyn has been with Microsoft for over a year
now working in the Analytics and AI team in
Higher Education, but spends a percentage of
her time migrating large Oracle environments
over to Azure bare metal.
Blogger, Author, Speaker
Kellyn writes on two of the top 50 database
blogs in the world, known for Oracle and
Microsoft technical content, has written five
books, including one on Diversity and
Inclusion. She mentors, sponsors and speaks
in both the Oracle and Microsoft communities
as part of giving back to the community.
President, Denver SQL Server User
Group
Kellyn has been the president for over two
years now, continuing to support this
incredible user group while on the road in her
RV, traveling the US.
@DBAKevlar
https://www.linkedin.com/in/kellyngorman/
Kellyn.Gorman@Microsoft.com

Recommended for you

Coscup
CoscupCoscup
Coscup

This document summarizes how to use open source tools like Jenkins, Git, Ubuntu dpkg, node.js, and others to improve a node.js web application release process and ensure better release quality. Key aspects covered include continuous integration, automated testing, configuration management, and packaging and deploying code.

DrupalCon 2011 Highlight
DrupalCon 2011 HighlightDrupalCon 2011 Highlight
DrupalCon 2011 Highlight

Three keynotes were given at DrupalCon 2011 in Chicago by Dries Buytaert. Free and open source tools for integrating web accessibility into the design process were discussed, including Wave, Run Fae, and the Accessibility Inspector. A session on using HTML5 features with Drupal covered new input types, video, audio, and canvas elements. Webform 3, the survey module for Drupal, was presented along with its new API and features.

Perforce Helix Never Dies: DevOps at Bandai Namco Studios
Perforce Helix Never Dies: DevOps at Bandai Namco StudiosPerforce Helix Never Dies: DevOps at Bandai Namco Studios
Perforce Helix Never Dies: DevOps at Bandai Namco Studios

Traditionally at Bandai Namco Studios, there has been no unified version control system in place and teams could choose to use any VCS system for their game titles—Subversion, Git, AlienBrain, or none at all. I’ll talk about why Bandai Namco Studios chose to standardize on Perforce Helix, show how we develop LiveOps-type mobile applications using the Unity game engine, and the advantages we gain from centrally managing code and assets in Helix.

devopsperforce helixartifact management
Kellyn Pot'Vin-Gorman
Moderated By: Carlos Lopez
Scripting for Success on Linux-
Top Tips and Tricks
What This Session Is….
• Additional session to go with the Linux Scripting session at
PASS Summit
• Tips and Tricks to be used with Shell Scripting
• Best Practices for those already familiar with BASH Scripting
• This is NOT a session to teach you Linux Scripting, but the
valuable tips will help you once you learn BASH to be a better
script author.
Scripts are Representations of the Author:
They have patterns and styles that can be recognized as the
authors:
“To be or not to be…”
7
Choose Wisely How You Author Your
Scripts
• The difficult to navigate script
• The unsure of what is expected script
• The “did it actually run?” script
• The difficult to work with script
• The “everything and the kitchen sink” script
• The “I would rather pull my own teeth than have to update,
enhance, execute” script
8

Recommended for you

Cloudy with a Chance of Databases
Cloudy with a Chance of DatabasesCloudy with a Chance of Databases
Cloudy with a Chance of Databases

This document discusses trends related to databases and cloud computing. It notes that 85% of enterprises have a multi-cloud strategy and that workloads are increasingly being run in public and private clouds. It also discusses the growth of various cloud vendors and databases like PostgreSQL. The document emphasizes that organizations should optimize databases before migrating to the cloud in order to reduce costs related to things like data transfers and storage. It also stresses the importance of securing data during non-production usage by encrypting and masking sensitive information.

clouddatabasesoracle
Opinionated containers and the future of game servers by Brendan Fosberry
Opinionated containers and the future of game servers by Brendan FosberryOpinionated containers and the future of game servers by Brendan Fosberry
Opinionated containers and the future of game servers by Brendan Fosberry

The document discusses opinionated containers and containerizing game server applications. Containerizing simple applications like TeamSpeak is straightforward, but complex games like Team Fortress 2 pose unique challenges due to requirements for specific configuration files, port mappings, and handling of persisted state. While containerizing opinionated applications is becoming more common, the game server ecosystem presents difficulties around proprietary assets, obscured documentation, and hacker behavior that promote inflexible environments. Standardizing configuration methods and allowing external persisted state could help containerized game servers become more compatible and deployable at scale.

dockercondockergaming
Enterprise Docker Requires a Private Registry
Enterprise Docker Requires a Private RegistryEnterprise Docker Requires a Private Registry
Enterprise Docker Requires a Private Registry

From a webinar I did with Sonatype. In it I discuss the importance of a private registry to make sure Docker adoption is successful and sustainable in the Enterprise.

devopssoftware developmentdocker
Even if You Don’t Already Know How to
BASH…
• The following tips are good to consider in any scripting
language when available
• Are good practice to be a good coding team member
• May save your life some day, (or keep you from getting killed
by your team members…)
9
Set your choice in shell
• For many Linux machines, there may be more than one:
• Find out which shell is in use:
which bash
Setting it in your script is done at the very first line of your script:
#!/bin/bash
OR
#!/bin/sh -C Shell
#!/bin/ksh -Korn Shell
What Happens If You Don’t?
Normal Execution with the shell set in the script:
./<script name>/sh <arg1> <arg2>
Without shell set in script:
/bin/bash ./<script name>/sh <arg1> <arg2>
The script must state what shell is to be used with the script EVERY
TIME.
Set up Alias’ and Environment Variables
• Update the .bashrc with global alias’ and environment
variables that support anything that is used by the login
regularly.
• Create .profile with a unique extension, (.profile_sql19,
.profile_net) to support unique applications.
This cuts down on significant variable setting and coding,
requiring only one location to update/manage.

Recommended for you

Docker in a big company
Docker in a big companyDocker in a big company
Docker in a big company

Hey curious friend, let's play a game. How can we bring together two different companies, an established enterprise with traditional dev and ops having cultural differences when working together with a DevOps champion startup. In the middle exists a number of real use cases on how we are bringing DevOps culture with Docker to Atos Worldline. In my talk I will discuss the first use cases for Docker at Atos Worldline, where we are today, learnings and benefits until now, our future technology stack and how Docker is changing our human stack a.k.a. how we communicate and work together.

atosdockercondocker
Devoxx 2016 - Docker Nuts and Bolts
Devoxx 2016 - Docker Nuts and BoltsDevoxx 2016 - Docker Nuts and Bolts
Devoxx 2016 - Docker Nuts and Bolts

Docker is the developer-friendly container technology that enables creation of your application stack: OS, JVM, app server, app, database and all your custom configuration. So you are a Java developer but how comfortable are you and your team taking Docker from development to production? Are you hearing developers say, “But it works on my machine!” when code breaks in production? And if you are, how many hours are then spent standing up an accurate test environment to research and fix the bug that caused the problem? This workshop/session explains how to package, deploy, and scale Java applications using Docker.

developmentclouddocker
Alfresco spk-alfresco-day
Alfresco spk-alfresco-dayAlfresco spk-alfresco-day
Alfresco spk-alfresco-day

The document summarizes Alfresco's Software Provisioning Kit (SPK) which helps define, build, and integrate Alfresco stacks. SPK uses Chef to automate Alfresco installation and configuration. It provides reusable templates and stacks that can be run locally using Vagrant or built into immutable images using Packer. SPK aims to simplify Alfresco provisioning across cloud providers and orchestration tools through infrastructure as code.

alfrescochefprovisioning
Write a Header for your Script
• The # sign can help create a header and signal BASH that it’s for
informational purposes only:
####################################################
# Title: mk_sqlsrvrvm.sh #
# Purpose: Creates a VM from image supporting #
# SQL Server DB #
# Author: Kellyn Gorman #
# Notes: Requires 4 args as part of execution. #
####################################################
Don’t Leave Others in the Dark
• Comment in your scripts
• Write in ideas for enhancements
• Help explain the logic
• Use the # sign to signal your script that it’s a comment.
# This step builds out the database logical objects.
# If the variables aren’t entered, the script will exit.
Don’t Make Users Guess
If there is a step that requires interaction between your script
and the user, make it clear what is required to promote success:
This can be done using the ECHO command and placing the
statement inside quotes.
echo “Please enter the name of the user:”
15
Exit When Mistakes are Made
• Saves from clean up, easier to recover from.
• Added at the top of the script under the designation of shell
set –e
set –o errexit

Recommended for you

Gabriele Columbro - Maurizio Pillitu - Get your Alfresco project from Zero to...
Gabriele Columbro - Maurizio Pillitu - Get your Alfresco project from Zero to...Gabriele Columbro - Maurizio Pillitu - Get your Alfresco project from Zero to...
Gabriele Columbro - Maurizio Pillitu - Get your Alfresco project from Zero to...

Alfresco has gone a long way in providing best-of-breed tools to power the full spectrum of an ECM project, from inception to delivery. In this session, based on real business cases, we'll demostrate how, using tools like the Maven Alfresco SDK and Alfresco Boxes, you can deliver a fully working Alfresco customized project from scratch running in the Cloud, all of this using quality focused, reproducible, reliable, Enterprise ready processes.

mavenboxespacker
Chef vs Puppet vs Ansible vs Saltstack | Configuration Management Tools | Dev...
Chef vs Puppet vs Ansible vs Saltstack | Configuration Management Tools | Dev...Chef vs Puppet vs Ansible vs Saltstack | Configuration Management Tools | Dev...
Chef vs Puppet vs Ansible vs Saltstack | Configuration Management Tools | Dev...

This presentation "Chef vs Puppet vs Ansible vs Saltstack" will compare the DevOps configuration management tools Chef, Puppet, Ansible and Saltstack in terms of their capabilities, architecture, performance, ease of setup, language, scalability and pros and cons. The chef is a configuration management tool written in Ruby and Erlang. Puppet is an open-source software configuration management tool that runs on many Unix-like systems and also Windows. Ansible is yet another tool that automates software provisioning, configuration management, and application deployment. Saltstack is a Python-based open-source configuration management tool. Now, let us get started and get to know which is the best configuration management platform among Chef, Puppet, Ansible and Saltstack. Below are the contents of our "Chef vs Puppet vs Ansible vs Saltstack" configuration management tools comparison slides: 1) Need for Configuration Management Tools 2) Chef - Infrastructure, Architecture, Pros and Cons 3) Puppet- Infrastructure, Architecture, Pros and Cons 4) Ansible - Infrastructure, Architecture, Pros and Cons 5) Saltstack - Infrastructure, Architecture, Pros and Cons 6) Comparison on the basis of architecture, ease of setup, language, scalability, management and interoperability. Why learn DevOps? Simplilearn’s DevOps training course is designed to help you become a DevOps practitioner and apply the latest in DevOps methodology to automate your software development lifecycle right out of the class. You will master configuration management; continuous integration deployment, delivery and monitoring using DevOps tools such as Git, Docker, Jenkins, Puppet and Nagios in a practical, hands-on and interactive approach. The DevOps training course focuses heavily on the use of Docker containers, a technology that is revolutionizing the way apps are deployed in the cloud today and is a critical skillset to master in the cloud age. After completing the DevOps training course you will achieve hands-on expertise in various aspects of the DevOps delivery model. The practical learning outcomes of this Devops training course are: An understanding of DevOps and the modern DevOps toolsets The ability to automate all aspects of a modern code delivery and deployment pipeline using: 1. Source code management tools 2. Build tools 3. Test automation tools 4. Containerization through Docker 5. Configuration management tools 6. Monitoring tools Who should take this course? DevOps career opportunities are thriving worldwide. DevOps was featured as one of the 11 best jobs in America for 2017, according to CBS News, and data from Payscale.com shows that DevOps Managers earn as much as $122,234 per year, with DevOps engineers making as much as $151,461. Learn more at https://www.simplilearn.com/cloud-computing/devops-practitioner-certification-training

chef vs puppet vs ansible vs saltstackchef vs puppetchef vs ansible
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...

Kubernetes can run application containers on clusters of physical or virtual machines. It can also do much more than that. Kubernetes satisfies a number of common needs of applications running in production, such as co-locating helper processes, mounting storage systems, distributing secrets, application health checking, replicating application instances, horizontal auto-scaling, load balancing, rolling updates, and resource monitoring. However, even though Kubernetes provides a lot of functionality, there are always new scenarios that would benefit from new features. Ad hoc orchestration that is acceptable initially often requires robust automation at scale. Application-specific workflows can be streamlined to accelerate developer velocity. This is why Kubernetes was also designed to serve as a platform for building an ecosystem of components and tools to make it easier to deploy, scale, and manage applications. The Kubernetes control plane is built upon the same APIs that are available to developers and users, implementing resilient control loops that continuously drive the current state towards the desired state. This design has enabled Apache Stratos and a number of other Platform as a Service and Continuous Integration and Deployment systems to build atop Kubernetes. This presentation introduces Kubernetes’s core primitives, shows how some of its better known features are built on them, and introduces some of the new capabilities that are being added.

kubernetes docker containers cloud
Also Exit if Undeclared Variables, etc.
Blank answers for variables, (arguments) can leave a script to
execute incorrectly or worse. Require declarations to be set
completely or the script exits:
set -o nounset
OR
set –u
set -euo pipefail
Don’t throw away your other scripts
• Just as with .Net, Java, Perl, etc., you can run PowerShell
scripts from BASH:
pwsh <script name>
You worked hard on scripts or an existing example
already exists. Don’t recreate the wheel and consider
reusing them, calling them from your BASH script.
Azure Cloud Shell
• Supports both BASH and PowerShell
• Can be used with persistent cloud storage
https://docs.microsoft.com/en-us/azure/cloud-shell/overview
Add Debugging to Your Script
• Want to know what went wrong?
#!/bin/bash
set -vnx
Arguments, (any or all) to be used:
Argument What it Does
-v Verbose mode- shows all lines as they are parsed by the
execution.
-n For syntax checking. The script doesn’t actually execute.
-x Shell tracing mode- will step through each step and report
any errors

Recommended for you

What Big Data Folks Need to Know About DevOps
What Big Data Folks Need to Know About DevOpsWhat Big Data Folks Need to Know About DevOps
What Big Data Folks Need to Know About DevOps

The document discusses DevOps and how it relates to big data. It defines DevOps as combining tools and culture to enable automation, infrastructure as code, and collaboration between developers and system administrators. It promotes principles like idempotence, data-driven configuration, sane defaults, and hackability. The document argues that an API-driven approach with Chef can help implement DevOps practices for big data environments.

opscodebigdataopschef
Jenkins and Chef: Infrastructure CI and Automated Deployment
Jenkins and Chef: Infrastructure CI and Automated DeploymentJenkins and Chef: Infrastructure CI and Automated Deployment
Jenkins and Chef: Infrastructure CI and Automated Deployment

This presentation discusses two key components of our deployment pipeline: Continuous integration of Chef code and automated deployment of Java applications. CI jobs for Chef code run static analysis and then provision, configure and test EC2 instances. Release jobs publish new cookbook versions to the Chef server. Deployment jobs identify target EC2 and VMware nodes and orchestrate Chef client runs. The flexibility of Jenkins is essential to our overall delivery architecture.

jenkins chef ci cd devops
Nanog75, Network Device Property as Code
Nanog75, Network Device Property as CodeNanog75, Network Device Property as Code
Nanog75, Network Device Property as Code

Device configuration templates have simplified a lot of things for the network industry but ​many networks are still managing their device properties (aka variables) manually which is very tedious and error prone. This talk will present a new approach to generate and manage network device properties easily using infrastructure as code principles.​

networkingautomationiac
Enable BASH History on the Host
Allows you to monitor history of BASH commands on the host,
even when there are multiple sessions open:
shopt -s histappend
This is just a good idea to have enabled so that you can use
the arrow keys for history of commands.
Typing Less
• Hit the TAB key once to auto-complete commands
• Hit the TAB key twice to show all options for a command
Implement Command Correct
• Nothing worse than having to correct typos, so make the
host correct them for you by enabling cdspell:
$ /bin/bsah
/bin/bash
$
shopt -s cdspell
Setting Colors in Text in .bashrc
• # enable colors
eval "`dircolors -b`"
# make the dir command work similar to windows
alias dir='ls --color=auto --format=long'
# make grep highlight results using color
export GREP_OPTIONS='--color=auto’
*This is already turned on in the Azure Cloud Shell
24

Recommended for you

Transforming Application Delivery with PaaS and Linux Containers
Transforming Application Delivery with PaaS and Linux ContainersTransforming Application Delivery with PaaS and Linux Containers
Transforming Application Delivery with PaaS and Linux Containers

This document discusses Red Hat OpenShift Enterprise and how it helps with application delivery using Platform as a Service (PaaS) and Linux containers. It covers OpenShift's architecture using Linux containers, Docker, Kubernetes, and RHEL Atomic Host. It also discusses OpenShift's application deployment flow, adoption trends, and challenges with container adoption as well as Red Hat's strategy to address these challenges through container certification and simplifying adoption for partners.

devopscloudlinux
Finding and Organizing a Great Cloud Foundry User Group
Finding and Organizing a Great Cloud Foundry User GroupFinding and Organizing a Great Cloud Foundry User Group
Finding and Organizing a Great Cloud Foundry User Group

Slides from the 2015 Cloud Foundry Summit on May 12. http://sched.co/2tGc Virtualization and global distribution are great when it comes to cloud computing and open source. In both cases, physical location is irrelevant. But one of the best ways to join the Cloud Foundry community is to participate in a local meetup. The presenters will share their experience running user groups over the past decade and lessons learned from recent Cloud Foundry events. This session will teach you how to: 1. Find an active Cloud Foundry (or related cloud computing) user group 2. Contribute your own knowledge at an upcoming event 3. Organize - and sustain - a strong Cloud Foundry community After this presentation, you will: 1. Appreciate the professional (and social) benefits of attending a meetup 2. Know how to share your expertise and establish your eminence as a Cloud Foundry expert 3. Be prepared to effectively organize a sustainable Cloud Foundry user group

meetup usergroup cloud cloudfoundry
Pass Summit Linux Scripting for the Microsoft Professional
Pass Summit Linux Scripting for the Microsoft ProfessionalPass Summit Linux Scripting for the Microsoft Professional
Pass Summit Linux Scripting for the Microsoft Professional

This is the second session of the learning pathway at PASS Summit 2019, which is still a stand alone session to teach you how to write proper Linux BASH scripts

linuxbashscripting
Schedulers
• CRON is KING
• CRON is a table, containing a schedule of tasks to run on
intervals or a one-time execution
• -e argument is most common or –u, (user) to edit
• -l to list
crontab -e
25
https://www.computerhope.com/unix/ucrontab.htm
Scheduling in the Cron File
• Syntax is important
• Minute, Hour, Day, Month
• Intervals, multiple hours and other advance options can be
used.
15 18 * * * /home/mssql/msbackup.sh
• Script msbackup will run everyday at 6:15pm.
26
Guaranteeing Scripts Continue to Run
• NoHUP
Execute in one line, the script name, any arguments, send the
output to dev/null and the ampersand asks the script to be run
in the background.
<scriptname>.sh <arg1> <arg2> &>/dev/null &
Disown the Script
• Allows the system to own and run the process, run it in the
background, even if you are disconnected:
disown <scriptname>.sh <arg1> <arg2> &
• You can then check the script is running from the JOBS
command:
Jobs
[1]+ Running <scriptname>.sh
28

Recommended for you

Shell scrpting(payal harne)
Shell scrpting(payal harne)Shell scrpting(payal harne)
Shell scrpting(payal harne)

This document provides an overview of shell scripting in Linux. It discusses why shell scripts are used, defines what a Linux shell is, lists common shell types, and how to execute scripts. Basic shell script examples and applications are given. Advantages of shell scripts include quick development time and ability to automate tasks, while disadvantages are slower execution and error prone nature compared to other languages.

shell scriptbash programminglinux [rogramming
Smooth CoffeeScript
Smooth CoffeeScriptSmooth CoffeeScript
Smooth CoffeeScript

This document introduces the Smooth CoffeeScript book, which provides an introduction to CoffeeScript programming with an emphasis on clarity, abstraction and verification. The book is freely available and is based on Eloquent JavaScript by Marijn Haverbeke, with numerous changes made by the editor. The book includes chapters on CoffeeScript basics, functions, data structures, error handling, functional programming, searching, object orientation, regular expressions and modularity. It also includes appendices on language extras, binary heaps, performance and a command line utility.

coffeescriptdevelopment
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20

Presentation about open source tools to set up continuous integration and continuous deployment. Covers Git, Gitlab, Chef, Vagrant, Jenkins, Gatling, Dashing, TYPO3 Surf and some other tools. Shows some best practices for testing with Behat and Functional Testing.

continuous integrationgittypo3 surf
Utilities to Support Script Execution
• Screen
• screen -A -m -d -S <screenname> ./<scriptname>.sh &
• Rsync with SSH
• Rsync ssh user@hostb 'bash -s’ < <scriptname>.sh <arg1> <arg2>
• Nohup
• nohup ./<scriptname>.sh > log.out 2> log.err < /dev/null &
Always note the TIME ZONE of the host with the “date”
command!
29
Summary
• Comment and comment often.
• Make your scripts interactive when a user is the one
executing them.
• Set up environments with variables and alias’ to save on
typing.
• Use utilities to ensure that if you are disconnected, your script
won’t be!
• Don’t reinvent the wheel- if the script already exists, execute
it from inside your script, don’t rewrite it.
30
If You Want to Learn More:
Blog Posts, Writing Shell Scripts, Parts 1-4
PASS Summit Session, Empowering the SQL Server Professional
with Linux Scripting- Thursday, Nov. 7th, 1:30pm, RM 611-614
Web Tutorials, Linux Shell Scripting
Edx Class, Linux Command Line Basics
Linux Scripting Class, Linux Tutorials
31
Section break

Recommended for you

Crafting interactive troubleshooting guides and team documentation for your K...
Crafting interactive troubleshooting guides and team documentation for your K...Crafting interactive troubleshooting guides and team documentation for your K...
Crafting interactive troubleshooting guides and team documentation for your K...

This document introduces using Jupyter Notebooks or .NET Interactive Books to create interactive troubleshooting guides and documentation for Kubernetes deployments. Notebooks allow including executable code blocks alongside Markdown text in a way that supports collaboration and version control. They provide benefits over traditional static documentation formats by allowing readers to execute code and see output. Examples are given of using Notebooks to manage local and Azure Kubernetes Service clusters through demonstrations of common Kubernetes tasks like plotting metrics from kubectl. PowerShell is used as the shell language but other options like bash are also supported.

kubernetesdockerconference
Compliance Automation with InSpec - Chef NYC Meetup - April 2017
Compliance Automation with InSpec - Chef NYC Meetup - April 2017Compliance Automation with InSpec - Chef NYC Meetup - April 2017
Compliance Automation with InSpec - Chef NYC Meetup - April 2017

Presented at the Chef NYC meetup on April 20, 2017, this presentation reviews how to automate compliance scanning and reporting with InSpec by Chef and wrapped up with a hands-on workshop.

chef inspec compliance automation workshop nyc
Geecon 2019 - Taming Code Quality in the Worst Language I Know: Bash
Geecon 2019 - Taming Code Quality  in the Worst Language I Know: BashGeecon 2019 - Taming Code Quality  in the Worst Language I Know: Bash
Geecon 2019 - Taming Code Quality in the Worst Language I Know: Bash

I don't know any other languages with more pitfalls, perils and gotchas than Bash. Still, we use it in almost every larger project for deployment or maintenance scripts, because there is no better, more powerful and more universal choice on Unix platform. However, there is ridiculous amount of things that could go wrong if you don't have deep understanding of shell scripting. Your experience about typical issues with Java or other JVM languages is definitely not enough here. You need to deeply understand Linux ecosystem and its history in order to write correct script... or you don't? I will prove to you that Bash could be tamed and made easy if proper code quality standards and static analysis tools are applied and enforced in your delivery pipelines. I'll share my opinions and experiences from a large banking project and I'll tell you which tools and style guides we use.

bashshellquality
Questions?
Coming up next…
Why You Need Query Store
Erin Stellato
Thank you for attending
@sqlpass
#sqlpass
@PASScommunity
Learn more from Kellyn Gorman
@DBAKevlar kellyn.gorman@Microsoft.com
PASS 24HOP Linux Scripting Tips and Tricks

Recommended for you

Standardizing and Managing Your Infrastructure - MOSC 2011
Standardizing and Managing Your Infrastructure - MOSC 2011Standardizing and Managing Your Infrastructure - MOSC 2011
Standardizing and Managing Your Infrastructure - MOSC 2011

Introduction to some of the newer, available tools for use in standardizing and managing server infrastructures. Also includes simple ways on

information technologynagiossystem administration
PowerShellForDBDevelopers
PowerShellForDBDevelopersPowerShellForDBDevelopers
PowerShellForDBDevelopers

This document provides an introduction to PowerShell for database developers. It begins by stating the goals of the presentation which are to amaze with PowerShell capabilities, convince that PowerShell is needed, provide a basic understanding of PowerShell programming, and point to support resources. It then provides an overview of what PowerShell is, including its history and why Windows needed a shell. It discusses PowerShell concepts like cmdlets, variables, operators, loops, and functions. It also provides examples of PowerShell scripts and best practices. Throughout it emphasizes PowerShell's power and integration with Windows and databases.

Holy PowerShell, BATman! - dogfood edition
Holy PowerShell, BATman! - dogfood editionHoly PowerShell, BATman! - dogfood edition
Holy PowerShell, BATman! - dogfood edition

This is an end-to-end introduction to PowerShell, as an interactive shell but more as a scripting language. From the perspective of a full-stack developer, this presentation covers the basics and six of the common issues that occasional users run into.

powershelldogfoodconscripting

More Related Content

What's hot

Docker for the enterprise
Docker for the enterpriseDocker for the enterprise
Docker for the enterprise
Bert Poller
 
How bigtop leveraged docker for build automation and one click hadoop provis...
How bigtop leveraged docker for build automation and  one click hadoop provis...How bigtop leveraged docker for build automation and  one click hadoop provis...
How bigtop leveraged docker for build automation and one click hadoop provis...
Evans Ye
 
Automated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWS
Automated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWSAutomated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWS
Automated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWS
Bamdad Dashtban
 
Coscup
CoscupCoscup
Coscup
Giivee The
 
DrupalCon 2011 Highlight
DrupalCon 2011 HighlightDrupalCon 2011 Highlight
DrupalCon 2011 Highlight
Supakit Kiatrungrit
 
Perforce Helix Never Dies: DevOps at Bandai Namco Studios
Perforce Helix Never Dies: DevOps at Bandai Namco StudiosPerforce Helix Never Dies: DevOps at Bandai Namco Studios
Perforce Helix Never Dies: DevOps at Bandai Namco Studios
Perforce
 
Cloudy with a Chance of Databases
Cloudy with a Chance of DatabasesCloudy with a Chance of Databases
Cloudy with a Chance of Databases
Kellyn Pot'Vin-Gorman
 
Opinionated containers and the future of game servers by Brendan Fosberry
Opinionated containers and the future of game servers by Brendan FosberryOpinionated containers and the future of game servers by Brendan Fosberry
Opinionated containers and the future of game servers by Brendan Fosberry
Docker, Inc.
 
Enterprise Docker Requires a Private Registry
Enterprise Docker Requires a Private RegistryEnterprise Docker Requires a Private Registry
Enterprise Docker Requires a Private Registry
Chris Riley ☁
 
Docker in a big company
Docker in a big companyDocker in a big company
Docker in a big company
Docker, Inc.
 
Devoxx 2016 - Docker Nuts and Bolts
Devoxx 2016 - Docker Nuts and BoltsDevoxx 2016 - Docker Nuts and Bolts
Devoxx 2016 - Docker Nuts and Bolts
Patrick Chanezon
 
Alfresco spk-alfresco-day
Alfresco spk-alfresco-dayAlfresco spk-alfresco-day
Alfresco spk-alfresco-day
Maurizio Pillitu
 
Gabriele Columbro - Maurizio Pillitu - Get your Alfresco project from Zero to...
Gabriele Columbro - Maurizio Pillitu - Get your Alfresco project from Zero to...Gabriele Columbro - Maurizio Pillitu - Get your Alfresco project from Zero to...
Gabriele Columbro - Maurizio Pillitu - Get your Alfresco project from Zero to...
Symphony Software Foundation
 
Chef vs Puppet vs Ansible vs Saltstack | Configuration Management Tools | Dev...
Chef vs Puppet vs Ansible vs Saltstack | Configuration Management Tools | Dev...Chef vs Puppet vs Ansible vs Saltstack | Configuration Management Tools | Dev...
Chef vs Puppet vs Ansible vs Saltstack | Configuration Management Tools | Dev...
Simplilearn
 
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...
Brian Grant
 
What Big Data Folks Need to Know About DevOps
What Big Data Folks Need to Know About DevOpsWhat Big Data Folks Need to Know About DevOps
What Big Data Folks Need to Know About DevOps
Matt Ray
 
Jenkins and Chef: Infrastructure CI and Automated Deployment
Jenkins and Chef: Infrastructure CI and Automated DeploymentJenkins and Chef: Infrastructure CI and Automated Deployment
Jenkins and Chef: Infrastructure CI and Automated Deployment
Dan Stine
 
Nanog75, Network Device Property as Code
Nanog75, Network Device Property as CodeNanog75, Network Device Property as Code
Nanog75, Network Device Property as Code
Damien Garros
 
Transforming Application Delivery with PaaS and Linux Containers
Transforming Application Delivery with PaaS and Linux ContainersTransforming Application Delivery with PaaS and Linux Containers
Transforming Application Delivery with PaaS and Linux Containers
Giovanni Galloro
 
Finding and Organizing a Great Cloud Foundry User Group
Finding and Organizing a Great Cloud Foundry User GroupFinding and Organizing a Great Cloud Foundry User Group
Finding and Organizing a Great Cloud Foundry User Group
Daniel Krook
 

What's hot (20)

Docker for the enterprise
Docker for the enterpriseDocker for the enterprise
Docker for the enterprise
 
How bigtop leveraged docker for build automation and one click hadoop provis...
How bigtop leveraged docker for build automation and  one click hadoop provis...How bigtop leveraged docker for build automation and  one click hadoop provis...
How bigtop leveraged docker for build automation and one click hadoop provis...
 
Automated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWS
Automated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWSAutomated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWS
Automated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWS
 
Coscup
CoscupCoscup
Coscup
 
DrupalCon 2011 Highlight
DrupalCon 2011 HighlightDrupalCon 2011 Highlight
DrupalCon 2011 Highlight
 
Perforce Helix Never Dies: DevOps at Bandai Namco Studios
Perforce Helix Never Dies: DevOps at Bandai Namco StudiosPerforce Helix Never Dies: DevOps at Bandai Namco Studios
Perforce Helix Never Dies: DevOps at Bandai Namco Studios
 
Cloudy with a Chance of Databases
Cloudy with a Chance of DatabasesCloudy with a Chance of Databases
Cloudy with a Chance of Databases
 
Opinionated containers and the future of game servers by Brendan Fosberry
Opinionated containers and the future of game servers by Brendan FosberryOpinionated containers and the future of game servers by Brendan Fosberry
Opinionated containers and the future of game servers by Brendan Fosberry
 
Enterprise Docker Requires a Private Registry
Enterprise Docker Requires a Private RegistryEnterprise Docker Requires a Private Registry
Enterprise Docker Requires a Private Registry
 
Docker in a big company
Docker in a big companyDocker in a big company
Docker in a big company
 
Devoxx 2016 - Docker Nuts and Bolts
Devoxx 2016 - Docker Nuts and BoltsDevoxx 2016 - Docker Nuts and Bolts
Devoxx 2016 - Docker Nuts and Bolts
 
Alfresco spk-alfresco-day
Alfresco spk-alfresco-dayAlfresco spk-alfresco-day
Alfresco spk-alfresco-day
 
Gabriele Columbro - Maurizio Pillitu - Get your Alfresco project from Zero to...
Gabriele Columbro - Maurizio Pillitu - Get your Alfresco project from Zero to...Gabriele Columbro - Maurizio Pillitu - Get your Alfresco project from Zero to...
Gabriele Columbro - Maurizio Pillitu - Get your Alfresco project from Zero to...
 
Chef vs Puppet vs Ansible vs Saltstack | Configuration Management Tools | Dev...
Chef vs Puppet vs Ansible vs Saltstack | Configuration Management Tools | Dev...Chef vs Puppet vs Ansible vs Saltstack | Configuration Management Tools | Dev...
Chef vs Puppet vs Ansible vs Saltstack | Configuration Management Tools | Dev...
 
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...
WSO2Con US 2015 Kubernetes: a platform for automating deployment, scaling, an...
 
What Big Data Folks Need to Know About DevOps
What Big Data Folks Need to Know About DevOpsWhat Big Data Folks Need to Know About DevOps
What Big Data Folks Need to Know About DevOps
 
Jenkins and Chef: Infrastructure CI and Automated Deployment
Jenkins and Chef: Infrastructure CI and Automated DeploymentJenkins and Chef: Infrastructure CI and Automated Deployment
Jenkins and Chef: Infrastructure CI and Automated Deployment
 
Nanog75, Network Device Property as Code
Nanog75, Network Device Property as CodeNanog75, Network Device Property as Code
Nanog75, Network Device Property as Code
 
Transforming Application Delivery with PaaS and Linux Containers
Transforming Application Delivery with PaaS and Linux ContainersTransforming Application Delivery with PaaS and Linux Containers
Transforming Application Delivery with PaaS and Linux Containers
 
Finding and Organizing a Great Cloud Foundry User Group
Finding and Organizing a Great Cloud Foundry User GroupFinding and Organizing a Great Cloud Foundry User Group
Finding and Organizing a Great Cloud Foundry User Group
 

Similar to PASS 24HOP Linux Scripting Tips and Tricks

Pass Summit Linux Scripting for the Microsoft Professional
Pass Summit Linux Scripting for the Microsoft ProfessionalPass Summit Linux Scripting for the Microsoft Professional
Pass Summit Linux Scripting for the Microsoft Professional
Kellyn Pot'Vin-Gorman
 
Shell scrpting(payal harne)
Shell scrpting(payal harne)Shell scrpting(payal harne)
Shell scrpting(payal harne)
PayalHarne
 
Smooth CoffeeScript
Smooth CoffeeScriptSmooth CoffeeScript
Smooth CoffeeScript
Michael Scovetta
 
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Michael Lihs
 
Crafting interactive troubleshooting guides and team documentation for your K...
Crafting interactive troubleshooting guides and team documentation for your K...Crafting interactive troubleshooting guides and team documentation for your K...
Crafting interactive troubleshooting guides and team documentation for your K...
Manning Publications
 
Compliance Automation with InSpec - Chef NYC Meetup - April 2017
Compliance Automation with InSpec - Chef NYC Meetup - April 2017Compliance Automation with InSpec - Chef NYC Meetup - April 2017
Compliance Automation with InSpec - Chef NYC Meetup - April 2017
adamleff
 
Geecon 2019 - Taming Code Quality in the Worst Language I Know: Bash
Geecon 2019 - Taming Code Quality  in the Worst Language I Know: BashGeecon 2019 - Taming Code Quality  in the Worst Language I Know: Bash
Geecon 2019 - Taming Code Quality in the Worst Language I Know: Bash
Michał Kordas
 
Standardizing and Managing Your Infrastructure - MOSC 2011
Standardizing and Managing Your Infrastructure - MOSC 2011Standardizing and Managing Your Infrastructure - MOSC 2011
Standardizing and Managing Your Infrastructure - MOSC 2011
Brian Ritchie
 
PowerShellForDBDevelopers
PowerShellForDBDevelopersPowerShellForDBDevelopers
PowerShellForDBDevelopers
Bryan Cafferky
 
Holy PowerShell, BATman! - dogfood edition
Holy PowerShell, BATman! - dogfood editionHoly PowerShell, BATman! - dogfood edition
Holy PowerShell, BATman! - dogfood edition
Dave Diehl
 
Quality code in wordpress
Quality code in wordpressQuality code in wordpress
Quality code in wordpress
Ran Bar-Zik
 
Licão 05 scripts exemple
Licão 05 scripts exempleLicão 05 scripts exemple
Licão 05 scripts exemple
Acácio Oliveira
 
Modern Front-End Development
Modern Front-End DevelopmentModern Front-End Development
Modern Front-End Development
mwrather
 
DCRUG: Achieving Development-Production Parity
DCRUG: Achieving Development-Production ParityDCRUG: Achieving Development-Production Parity
DCRUG: Achieving Development-Production Parity
Geoff Harcourt
 
DevOps demystified
DevOps demystifiedDevOps demystified
DevOps demystified
Xebia IT Architects
 
Tested and Correct, How to Make Sure Your Documentation Keeps Working
Tested and Correct, How to Make Sure Your Documentation Keeps WorkingTested and Correct, How to Make Sure Your Documentation Keeps Working
Tested and Correct, How to Make Sure Your Documentation Keeps Working
Adam Dangoor
 
Front End Development Automation with Grunt
Front End Development Automation with GruntFront End Development Automation with Grunt
Front End Development Automation with Grunt
Ladies Who Code
 
Design Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best PracticesDesign Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best Practices
Inductive Automation
 
JavaScript Core fundamentals - Learn JavaScript Here
JavaScript Core fundamentals - Learn JavaScript HereJavaScript Core fundamentals - Learn JavaScript Here
JavaScript Core fundamentals - Learn JavaScript Here
Laurence Svekis ✔
 
Introduction to Chef
Introduction to ChefIntroduction to Chef
Introduction to Chef
kevsmith
 

Similar to PASS 24HOP Linux Scripting Tips and Tricks (20)

Pass Summit Linux Scripting for the Microsoft Professional
Pass Summit Linux Scripting for the Microsoft ProfessionalPass Summit Linux Scripting for the Microsoft Professional
Pass Summit Linux Scripting for the Microsoft Professional
 
Shell scrpting(payal harne)
Shell scrpting(payal harne)Shell scrpting(payal harne)
Shell scrpting(payal harne)
 
Smooth CoffeeScript
Smooth CoffeeScriptSmooth CoffeeScript
Smooth CoffeeScript
 
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
 
Crafting interactive troubleshooting guides and team documentation for your K...
Crafting interactive troubleshooting guides and team documentation for your K...Crafting interactive troubleshooting guides and team documentation for your K...
Crafting interactive troubleshooting guides and team documentation for your K...
 
Compliance Automation with InSpec - Chef NYC Meetup - April 2017
Compliance Automation with InSpec - Chef NYC Meetup - April 2017Compliance Automation with InSpec - Chef NYC Meetup - April 2017
Compliance Automation with InSpec - Chef NYC Meetup - April 2017
 
Geecon 2019 - Taming Code Quality in the Worst Language I Know: Bash
Geecon 2019 - Taming Code Quality  in the Worst Language I Know: BashGeecon 2019 - Taming Code Quality  in the Worst Language I Know: Bash
Geecon 2019 - Taming Code Quality in the Worst Language I Know: Bash
 
Standardizing and Managing Your Infrastructure - MOSC 2011
Standardizing and Managing Your Infrastructure - MOSC 2011Standardizing and Managing Your Infrastructure - MOSC 2011
Standardizing and Managing Your Infrastructure - MOSC 2011
 
PowerShellForDBDevelopers
PowerShellForDBDevelopersPowerShellForDBDevelopers
PowerShellForDBDevelopers
 
Holy PowerShell, BATman! - dogfood edition
Holy PowerShell, BATman! - dogfood editionHoly PowerShell, BATman! - dogfood edition
Holy PowerShell, BATman! - dogfood edition
 
Quality code in wordpress
Quality code in wordpressQuality code in wordpress
Quality code in wordpress
 
Licão 05 scripts exemple
Licão 05 scripts exempleLicão 05 scripts exemple
Licão 05 scripts exemple
 
Modern Front-End Development
Modern Front-End DevelopmentModern Front-End Development
Modern Front-End Development
 
DCRUG: Achieving Development-Production Parity
DCRUG: Achieving Development-Production ParityDCRUG: Achieving Development-Production Parity
DCRUG: Achieving Development-Production Parity
 
DevOps demystified
DevOps demystifiedDevOps demystified
DevOps demystified
 
Tested and Correct, How to Make Sure Your Documentation Keeps Working
Tested and Correct, How to Make Sure Your Documentation Keeps WorkingTested and Correct, How to Make Sure Your Documentation Keeps Working
Tested and Correct, How to Make Sure Your Documentation Keeps Working
 
Front End Development Automation with Grunt
Front End Development Automation with GruntFront End Development Automation with Grunt
Front End Development Automation with Grunt
 
Design Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best PracticesDesign Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best Practices
 
JavaScript Core fundamentals - Learn JavaScript Here
JavaScript Core fundamentals - Learn JavaScript HereJavaScript Core fundamentals - Learn JavaScript Here
JavaScript Core fundamentals - Learn JavaScript Here
 
Introduction to Chef
Introduction to ChefIntroduction to Chef
Introduction to Chef
 

More from Kellyn Pot'Vin-Gorman

Redgate_summit_atl_kgorman_intersection.pptx
Redgate_summit_atl_kgorman_intersection.pptxRedgate_summit_atl_kgorman_intersection.pptx
Redgate_summit_atl_kgorman_intersection.pptx
Kellyn Pot'Vin-Gorman
 
SQLSatOregon_kgorman_keynote_NIAIMLEC.pptx
SQLSatOregon_kgorman_keynote_NIAIMLEC.pptxSQLSatOregon_kgorman_keynote_NIAIMLEC.pptx
SQLSatOregon_kgorman_keynote_NIAIMLEC.pptx
Kellyn Pot'Vin-Gorman
 
Boston_sql_kegorman_highIO.pptx
Boston_sql_kegorman_highIO.pptxBoston_sql_kegorman_highIO.pptx
Boston_sql_kegorman_highIO.pptx
Kellyn Pot'Vin-Gorman
 
Oracle on Azure IaaS 2023 Update
Oracle on Azure IaaS 2023 UpdateOracle on Azure IaaS 2023 Update
Oracle on Azure IaaS 2023 Update
Kellyn Pot'Vin-Gorman
 
IaaS for DBAs in Azure
IaaS for DBAs in AzureIaaS for DBAs in Azure
IaaS for DBAs in Azure
Kellyn Pot'Vin-Gorman
 
Being Successful with ADHD
Being Successful with ADHDBeing Successful with ADHD
Being Successful with ADHD
Kellyn Pot'Vin-Gorman
 
Azure DBA with IaaS
Azure DBA with IaaSAzure DBA with IaaS
Azure DBA with IaaS
Kellyn Pot'Vin-Gorman
 
Turning ADHD into "Awesome Dynamic Highly Dependable"
Turning ADHD into "Awesome Dynamic Highly Dependable"Turning ADHD into "Awesome Dynamic Highly Dependable"
Turning ADHD into "Awesome Dynamic Highly Dependable"
Kellyn Pot'Vin-Gorman
 
PASS Summit 2020
PASS Summit 2020PASS Summit 2020
PASS Summit 2020
Kellyn Pot'Vin-Gorman
 
DevOps in Silos
DevOps in SilosDevOps in Silos
DevOps in Silos
Kellyn Pot'Vin-Gorman
 
Azure Databases with IaaS
Azure Databases with IaaSAzure Databases with IaaS
Azure Databases with IaaS
Kellyn Pot'Vin-Gorman
 
How to Win When Migrating to Azure
How to Win When Migrating to AzureHow to Win When Migrating to Azure
How to Win When Migrating to Azure
Kellyn Pot'Vin-Gorman
 
Securing Power BI Data
Securing Power BI DataSecuring Power BI Data
Securing Power BI Data
Kellyn Pot'Vin-Gorman
 
Cepta The Future of Data with Power BI
Cepta The Future of Data with Power BICepta The Future of Data with Power BI
Cepta The Future of Data with Power BI
Kellyn Pot'Vin-Gorman
 
Taming the shrew Power BI
Taming the shrew Power BITaming the shrew Power BI
Taming the shrew Power BI
Kellyn Pot'Vin-Gorman
 
Power BI with Essbase in the Oracle Cloud
Power BI with Essbase in the Oracle CloudPower BI with Essbase in the Oracle Cloud
Power BI with Essbase in the Oracle Cloud
Kellyn Pot'Vin-Gorman
 
ODTUG Leadership Talk- WIT and Sponsorship
ODTUG Leadership Talk-  WIT and SponsorshipODTUG Leadership Talk-  WIT and Sponsorship
ODTUG Leadership Talk- WIT and Sponsorship
Kellyn Pot'Vin-Gorman
 
DevOps and Decoys How to Build a Successful Microsoft DevOps Including the Data
DevOps and Decoys  How to Build a Successful Microsoft DevOps Including the DataDevOps and Decoys  How to Build a Successful Microsoft DevOps Including the Data
DevOps and Decoys How to Build a Successful Microsoft DevOps Including the Data
Kellyn Pot'Vin-Gorman
 
GDPR- The Buck Stops Here
GDPR-  The Buck Stops HereGDPR-  The Buck Stops Here
GDPR- The Buck Stops Here
Kellyn Pot'Vin-Gorman
 
Taming the shrew, Optimizing Power BI Options
Taming the shrew, Optimizing Power BI OptionsTaming the shrew, Optimizing Power BI Options
Taming the shrew, Optimizing Power BI Options
Kellyn Pot'Vin-Gorman
 

More from Kellyn Pot'Vin-Gorman (20)

Redgate_summit_atl_kgorman_intersection.pptx
Redgate_summit_atl_kgorman_intersection.pptxRedgate_summit_atl_kgorman_intersection.pptx
Redgate_summit_atl_kgorman_intersection.pptx
 
SQLSatOregon_kgorman_keynote_NIAIMLEC.pptx
SQLSatOregon_kgorman_keynote_NIAIMLEC.pptxSQLSatOregon_kgorman_keynote_NIAIMLEC.pptx
SQLSatOregon_kgorman_keynote_NIAIMLEC.pptx
 
Boston_sql_kegorman_highIO.pptx
Boston_sql_kegorman_highIO.pptxBoston_sql_kegorman_highIO.pptx
Boston_sql_kegorman_highIO.pptx
 
Oracle on Azure IaaS 2023 Update
Oracle on Azure IaaS 2023 UpdateOracle on Azure IaaS 2023 Update
Oracle on Azure IaaS 2023 Update
 
IaaS for DBAs in Azure
IaaS for DBAs in AzureIaaS for DBAs in Azure
IaaS for DBAs in Azure
 
Being Successful with ADHD
Being Successful with ADHDBeing Successful with ADHD
Being Successful with ADHD
 
Azure DBA with IaaS
Azure DBA with IaaSAzure DBA with IaaS
Azure DBA with IaaS
 
Turning ADHD into "Awesome Dynamic Highly Dependable"
Turning ADHD into "Awesome Dynamic Highly Dependable"Turning ADHD into "Awesome Dynamic Highly Dependable"
Turning ADHD into "Awesome Dynamic Highly Dependable"
 
PASS Summit 2020
PASS Summit 2020PASS Summit 2020
PASS Summit 2020
 
DevOps in Silos
DevOps in SilosDevOps in Silos
DevOps in Silos
 
Azure Databases with IaaS
Azure Databases with IaaSAzure Databases with IaaS
Azure Databases with IaaS
 
How to Win When Migrating to Azure
How to Win When Migrating to AzureHow to Win When Migrating to Azure
How to Win When Migrating to Azure
 
Securing Power BI Data
Securing Power BI DataSecuring Power BI Data
Securing Power BI Data
 
Cepta The Future of Data with Power BI
Cepta The Future of Data with Power BICepta The Future of Data with Power BI
Cepta The Future of Data with Power BI
 
Taming the shrew Power BI
Taming the shrew Power BITaming the shrew Power BI
Taming the shrew Power BI
 
Power BI with Essbase in the Oracle Cloud
Power BI with Essbase in the Oracle CloudPower BI with Essbase in the Oracle Cloud
Power BI with Essbase in the Oracle Cloud
 
ODTUG Leadership Talk- WIT and Sponsorship
ODTUG Leadership Talk-  WIT and SponsorshipODTUG Leadership Talk-  WIT and Sponsorship
ODTUG Leadership Talk- WIT and Sponsorship
 
DevOps and Decoys How to Build a Successful Microsoft DevOps Including the Data
DevOps and Decoys  How to Build a Successful Microsoft DevOps Including the DataDevOps and Decoys  How to Build a Successful Microsoft DevOps Including the Data
DevOps and Decoys How to Build a Successful Microsoft DevOps Including the Data
 
GDPR- The Buck Stops Here
GDPR-  The Buck Stops HereGDPR-  The Buck Stops Here
GDPR- The Buck Stops Here
 
Taming the shrew, Optimizing Power BI Options
Taming the shrew, Optimizing Power BI OptionsTaming the shrew, Optimizing Power BI Options
Taming the shrew, Optimizing Power BI Options
 

Recently uploaded

20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
Matthew Sinclair
 
The Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive ComputingThe Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive Computing
Larry Smarr
 
How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf
HackersList
 
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyyActive Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
RaminGhanbari2
 
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
jackson110191
 
Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM
Vijayananda Mohire
 
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
Toru Tamaki
 
Mitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing SystemsMitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing Systems
ScyllaDB
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
Safe Software
 
WPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide DeckWPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide Deck
Lidia A.
 
20240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 202420240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 2024
Matthew Sinclair
 
Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces
Mark Billinghurst
 
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - MydbopsScaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Mydbops
 
Implementations of Fused Deposition Modeling in real world
Implementations of Fused Deposition Modeling  in real worldImplementations of Fused Deposition Modeling  in real world
Implementations of Fused Deposition Modeling in real world
Emerging Tech
 
Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf
Tatiana Al-Chueyr
 
Observability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetryObservability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetry
Eric D. Schabell
 
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Chris Swan
 
Measuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at TwitterMeasuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at Twitter
ScyllaDB
 
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
Kief Morris
 
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptxRPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
SynapseIndia
 

Recently uploaded (20)

20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
 
The Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive ComputingThe Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive Computing
 
How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf
 
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyyActive Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
 
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
 
Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM
 
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
 
Mitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing SystemsMitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing Systems
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
 
WPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide DeckWPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide Deck
 
20240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 202420240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 2024
 
Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces
 
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - MydbopsScaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
 
Implementations of Fused Deposition Modeling in real world
Implementations of Fused Deposition Modeling  in real worldImplementations of Fused Deposition Modeling  in real world
Implementations of Fused Deposition Modeling in real world
 
Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf
 
Observability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetryObservability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetry
 
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
 
Measuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at TwitterMeasuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at Twitter
 
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
 
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptxRPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
 

PASS 24HOP Linux Scripting Tips and Tricks

  • 1. Tips and Tricks Kellyn Gorman, Azure Data Platform Architect Microsoft Scripting for Success on Linux
  • 2. If you require assistance during the session, type your inquiry into the question pane on the right side. Maximize your screen with the zoom button on the top of the presentation window. Please fill in the short evaluation following the session. It will appear in your web browser. Technical Assistance
  • 3. PASS’ flagship event takes place in Seattle, Washington November 5-8, 2019 PASSsummit.com PASS Marathon: Career Development October 8, 2019 Upcoming Events 10
  • 4. Kellyn Gorman Azure Data Platform Architect, Microsoft Azure Data Platform Architect Kellyn has been with Microsoft for over a year now working in the Analytics and AI team in Higher Education, but spends a percentage of her time migrating large Oracle environments over to Azure bare metal. Blogger, Author, Speaker Kellyn writes on two of the top 50 database blogs in the world, known for Oracle and Microsoft technical content, has written five books, including one on Diversity and Inclusion. She mentors, sponsors and speaks in both the Oracle and Microsoft communities as part of giving back to the community. President, Denver SQL Server User Group Kellyn has been the president for over two years now, continuing to support this incredible user group while on the road in her RV, traveling the US. @DBAKevlar https://www.linkedin.com/in/kellyngorman/ Kellyn.Gorman@Microsoft.com
  • 5. Kellyn Pot'Vin-Gorman Moderated By: Carlos Lopez Scripting for Success on Linux- Top Tips and Tricks
  • 6. What This Session Is…. • Additional session to go with the Linux Scripting session at PASS Summit • Tips and Tricks to be used with Shell Scripting • Best Practices for those already familiar with BASH Scripting • This is NOT a session to teach you Linux Scripting, but the valuable tips will help you once you learn BASH to be a better script author.
  • 7. Scripts are Representations of the Author: They have patterns and styles that can be recognized as the authors: “To be or not to be…” 7
  • 8. Choose Wisely How You Author Your Scripts • The difficult to navigate script • The unsure of what is expected script • The “did it actually run?” script • The difficult to work with script • The “everything and the kitchen sink” script • The “I would rather pull my own teeth than have to update, enhance, execute” script 8
  • 9. Even if You Don’t Already Know How to BASH… • The following tips are good to consider in any scripting language when available • Are good practice to be a good coding team member • May save your life some day, (or keep you from getting killed by your team members…) 9
  • 10. Set your choice in shell • For many Linux machines, there may be more than one: • Find out which shell is in use: which bash Setting it in your script is done at the very first line of your script: #!/bin/bash OR #!/bin/sh -C Shell #!/bin/ksh -Korn Shell
  • 11. What Happens If You Don’t? Normal Execution with the shell set in the script: ./<script name>/sh <arg1> <arg2> Without shell set in script: /bin/bash ./<script name>/sh <arg1> <arg2> The script must state what shell is to be used with the script EVERY TIME.
  • 12. Set up Alias’ and Environment Variables • Update the .bashrc with global alias’ and environment variables that support anything that is used by the login regularly. • Create .profile with a unique extension, (.profile_sql19, .profile_net) to support unique applications. This cuts down on significant variable setting and coding, requiring only one location to update/manage.
  • 13. Write a Header for your Script • The # sign can help create a header and signal BASH that it’s for informational purposes only: #################################################### # Title: mk_sqlsrvrvm.sh # # Purpose: Creates a VM from image supporting # # SQL Server DB # # Author: Kellyn Gorman # # Notes: Requires 4 args as part of execution. # ####################################################
  • 14. Don’t Leave Others in the Dark • Comment in your scripts • Write in ideas for enhancements • Help explain the logic • Use the # sign to signal your script that it’s a comment. # This step builds out the database logical objects. # If the variables aren’t entered, the script will exit.
  • 15. Don’t Make Users Guess If there is a step that requires interaction between your script and the user, make it clear what is required to promote success: This can be done using the ECHO command and placing the statement inside quotes. echo “Please enter the name of the user:” 15
  • 16. Exit When Mistakes are Made • Saves from clean up, easier to recover from. • Added at the top of the script under the designation of shell set –e set –o errexit
  • 17. Also Exit if Undeclared Variables, etc. Blank answers for variables, (arguments) can leave a script to execute incorrectly or worse. Require declarations to be set completely or the script exits: set -o nounset OR set –u set -euo pipefail
  • 18. Don’t throw away your other scripts • Just as with .Net, Java, Perl, etc., you can run PowerShell scripts from BASH: pwsh <script name> You worked hard on scripts or an existing example already exists. Don’t recreate the wheel and consider reusing them, calling them from your BASH script.
  • 19. Azure Cloud Shell • Supports both BASH and PowerShell • Can be used with persistent cloud storage https://docs.microsoft.com/en-us/azure/cloud-shell/overview
  • 20. Add Debugging to Your Script • Want to know what went wrong? #!/bin/bash set -vnx Arguments, (any or all) to be used: Argument What it Does -v Verbose mode- shows all lines as they are parsed by the execution. -n For syntax checking. The script doesn’t actually execute. -x Shell tracing mode- will step through each step and report any errors
  • 21. Enable BASH History on the Host Allows you to monitor history of BASH commands on the host, even when there are multiple sessions open: shopt -s histappend This is just a good idea to have enabled so that you can use the arrow keys for history of commands.
  • 22. Typing Less • Hit the TAB key once to auto-complete commands • Hit the TAB key twice to show all options for a command
  • 23. Implement Command Correct • Nothing worse than having to correct typos, so make the host correct them for you by enabling cdspell: $ /bin/bsah /bin/bash $ shopt -s cdspell
  • 24. Setting Colors in Text in .bashrc • # enable colors eval "`dircolors -b`" # make the dir command work similar to windows alias dir='ls --color=auto --format=long' # make grep highlight results using color export GREP_OPTIONS='--color=auto’ *This is already turned on in the Azure Cloud Shell 24
  • 25. Schedulers • CRON is KING • CRON is a table, containing a schedule of tasks to run on intervals or a one-time execution • -e argument is most common or –u, (user) to edit • -l to list crontab -e 25 https://www.computerhope.com/unix/ucrontab.htm
  • 26. Scheduling in the Cron File • Syntax is important • Minute, Hour, Day, Month • Intervals, multiple hours and other advance options can be used. 15 18 * * * /home/mssql/msbackup.sh • Script msbackup will run everyday at 6:15pm. 26
  • 27. Guaranteeing Scripts Continue to Run • NoHUP Execute in one line, the script name, any arguments, send the output to dev/null and the ampersand asks the script to be run in the background. <scriptname>.sh <arg1> <arg2> &>/dev/null &
  • 28. Disown the Script • Allows the system to own and run the process, run it in the background, even if you are disconnected: disown <scriptname>.sh <arg1> <arg2> & • You can then check the script is running from the JOBS command: Jobs [1]+ Running <scriptname>.sh 28
  • 29. Utilities to Support Script Execution • Screen • screen -A -m -d -S <screenname> ./<scriptname>.sh & • Rsync with SSH • Rsync ssh user@hostb 'bash -s’ < <scriptname>.sh <arg1> <arg2> • Nohup • nohup ./<scriptname>.sh > log.out 2> log.err < /dev/null & Always note the TIME ZONE of the host with the “date” command! 29
  • 30. Summary • Comment and comment often. • Make your scripts interactive when a user is the one executing them. • Set up environments with variables and alias’ to save on typing. • Use utilities to ensure that if you are disconnected, your script won’t be! • Don’t reinvent the wheel- if the script already exists, execute it from inside your script, don’t rewrite it. 30
  • 31. If You Want to Learn More: Blog Posts, Writing Shell Scripts, Parts 1-4 PASS Summit Session, Empowering the SQL Server Professional with Linux Scripting- Thursday, Nov. 7th, 1:30pm, RM 611-614 Web Tutorials, Linux Shell Scripting Edx Class, Linux Command Line Basics Linux Scripting Class, Linux Tutorials 31
  • 34. Coming up next… Why You Need Query Store Erin Stellato
  • 35. Thank you for attending @sqlpass #sqlpass @PASScommunity Learn more from Kellyn Gorman @DBAKevlar kellyn.gorman@Microsoft.com

Editor's Notes

  1. [Moderator Part] Hello and welcome everyone to this 24 Hours of PASS: Summit Preview 2019! We’re excited you could join us today for Kellyn Pot'Vin-Gorman’s session, Scripting for Success on Linux- Top Tips and Tricks. This 24 Hours of PASSconsists of 24 consecutive live webinars, delivered by expert speakers from the PASS community. The sessions will be recorded and posted online after the event. You will receive an email letting you know when these become available. My name is Carlos Lopez [you can say a bit about yourself here if you’d like] I have a few introductory slides before I hand over the reins to Kellyn. [move to next slide]
  2. [Moderator Part] If you require technical assistance please type your request into the question pane located on the right side of your screen and someone will assist you. This question pane is also where you may ask any questions throughout the presentation. Feel free to enter your questions at any time and once we get to the Q&A portion of the session, I’ll read your questions aloud to Kellyn. You are able to zoom in on the presentation content by using the zoom button located on the top of the presentation window. Please note that there will be a short evaluation at the end of the session, which will pop-up after the webinar ends in your web browser. Your feedback is really important to us for future events, so please take a moment to complete this. [Note to Carlos Lopez: You need to determine which questions are the most relevant and ask them out loud to the presenter]. [move to next slide]
  3. [Moderator Part] Our next scheduled PASS Marathon event is focused on Career Development and will take place on October 8th. Watch your inbox for an email when registration opens. Also, PASS Summit 2019 will be happening on November 5th in Seattle Washington. Head over to PASSsummit.com and register today!   [move to next slide]
  4. [Moderator Part] This 24 Hours of PASS session is presented by Kellyn Pot'Vin-Gorman. Kellyn is a member of the Oak Table Network and an Idera ACE and Oracle ACE Director alumnus. She is a Data Platform Architect in Power BI with AI in the EdTech group at Microsoft. Kellyn is known for her extensive work with multi-database platforms, DevOps, cloud migrations, virtualization, visualizations, scripting, environment optimization tuning, automation, and architecture design. Kellyn has spoken at numerous technical conferences for Oracle, Big Data, DevOps, testing, and SQL Server. Her blog (http://dbakevlar.com) and social media activity under her handle, DBAKevlar, is well respected for her insight and content. [move to next slide]
  5. And without further ado, here is Kellyn with Scripting for Success on Linux- Top Tips and Tricks. {speaker begins} **[Speaker takes over]**
  6. You an kill the job by typing in Kill and the job number shown at the left of “Running”
  7. [Moderator Part] The moderator’s script will be added in this section after deck submission.
  8. Stay tuned for our next session, Why You Need Query Store with Erin Stellato. [move to next slide]
  9. [Moderator Part] The moderator’s script will be added in this section after deck submission.
  10. [Moderator Part] The moderator’s script will be added in this section after deck submission.