Automation & Scripting Flashcards

1
Q

What is shorthand for ‘then’ ?

A

&&

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is shorthand for ‘else’?

A

||

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is libvirt

A

VM management software: API library, daemon and commands virt-install, virsh

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you run multiple commands in the same line

A

Use a semi colon between each one
command ; command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What signal does CTRL-C send

A

SIGINT
(-2)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What signal does CTRL-Z send

A

SIGTSTOP
(-17)
(Stop -pauses)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How to start a shell process and let it continue even if you exit the shell

A

nohup
Will write output ~/nohup.out

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How to restart a stopped job?

A

bg JOB#
or
fg JOB#

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does ‘atq’ do?

A

Displays a list of the pending ‘at’ jobs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Where is the Git configuration?
(2 places)

A

Global is in ~/.gitconfig
Locally /WORKDIR/.git/config

View ‘git config —list’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Configure your Git remote repository …

A

git remote add origin URL

Then check status with ‘git remote v’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Push your project to the remote repository

A

git push -u origin main

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What’s the difference between ‘git pull’ and ‘git clone’?

A

‘pull’ just fetches the most recent files
‘clone’ copied the entire project.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How do you ‘pull’ down new project files from the remote repository?

A

git remote add origin URL
git pull -u origin main

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Create a lightweight Git tag

A

git tag TAGNAME

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Create an annotated Git tag

A

git tag -a TAGNAME -m “COMMENT”

17
Q

Transfer project files from working to staging

A

git add FILE/S
Add all files with “git add . “

18
Q

Transfer files from staging to repository

A

git commit FILES

19
Q

3 bootstrapping tools

A

anaconda-ks.cfg (rhel)
system-config-kickstart (Ub)
AutoYaST (Suse)

20
Q

What does ksvalidator do?

A

Helps to find syntax issues in kickstart files (still recommend a team review too tho)

21
Q

Define “build automation”

A

Config management and policy as code is used to automatically deploy or create containers

22
Q

What is “automated config management?”

A

The process of entering the config management and policy as code into an orchestration utility’s API.

23
Q

What “syntax markers “ do each of terraform, Ansible, Puppet and Chef use

A

Terraform - open{ and = and “ , messy
Ansible - : And tabbed indent yaml
Puppet - =>=>=> nice and tidy
Chef - similar to Ansible less: some =>

24
Q

Discard changes in Working directory

A

git checkout HEAD filename

25
Q

Unstage changes in staging area

A

git reset HEAD filename

26
Q

Reset to a previous commit

A

git reset FIRST7ofSha

27
Q

Temporarily ‘stash’ your current code

A

git stash
Get it back with
git stash pop

28
Q

Update commit with some minor changes, but want to keep the log tidy so doesn’t need a while fresh commit:

A

git commit —amend
If you don’t need to change the message than as —no-edit