Automation & Scripting Flashcards
What is shorthand for ‘then’ ?
&&
What is shorthand for ‘else’?
||
What is libvirt
VM management software: API library, daemon and commands virt-install, virsh
How do you run multiple commands in the same line
Use a semi colon between each one
command ; command
What signal does CTRL-C send
SIGINT
(-2)
What signal does CTRL-Z send
SIGTSTOP
(-17)
(Stop -pauses)
How to start a shell process and let it continue even if you exit the shell
nohup
Will write output ~/nohup.out
How to restart a stopped job?
bg JOB#
or
fg JOB#
What does ‘atq’ do?
Displays a list of the pending ‘at’ jobs
Where is the Git configuration?
(2 places)
Global is in ~/.gitconfig
Locally /WORKDIR/.git/config
View ‘git config —list’
Configure your Git remote repository …
git remote add origin URL
Then check status with ‘git remote v’
Push your project to the remote repository
git push -u origin main
What’s the difference between ‘git pull’ and ‘git clone’?
‘pull’ just fetches the most recent files
‘clone’ copied the entire project.
How do you ‘pull’ down new project files from the remote repository?
git remote add origin URL
git pull -u origin main
Create a lightweight Git tag
git tag TAGNAME
Create an annotated Git tag
git tag -a TAGNAME -m “COMMENT”
Transfer project files from working to staging
git add FILE/S
Add all files with “git add . “
Transfer files from staging to repository
git commit FILES
3 bootstrapping tools
anaconda-ks.cfg (rhel)
system-config-kickstart (Ub)
AutoYaST (Suse)
What does ksvalidator do?
Helps to find syntax issues in kickstart files (still recommend a team review too tho)
Define “build automation”
Config management and policy as code is used to automatically deploy or create containers
What is “automated config management?”
The process of entering the config management and policy as code into an orchestration utility’s API.
What “syntax markers “ do each of terraform, Ansible, Puppet and Chef use
Terraform - open{ and = and “ , messy
Ansible - : And tabbed indent yaml
Puppet - =>=>=> nice and tidy
Chef - similar to Ansible less: some =>
Discard changes in Working directory
git checkout HEAD filename
Unstage changes in staging area
git reset HEAD filename
Reset to a previous commit
git reset FIRST7ofSha
Temporarily ‘stash’ your current code
git stash
Get it back with
git stash pop
Update commit with some minor changes, but want to keep the log tidy so doesn’t need a while fresh commit:
git commit —amend
If you don’t need to change the message than as —no-edit