This function is based on sfate's gist and has been extended to dump the json string into a file instead to the stdout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: all:!localhost | |
gather_facts: no | |
tasks: | |
- name: run vulnerabilty check script | |
ansible.builtin.script: CVE-2024-3094_check.sh | |
register: cmd_result | |
- name: get version of | |
ansible.builtin.shell: apt-cache policy liblzma5 | |
register: version_of_liblzma5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# git fetch: get the latest reference pointer of the remote | |
# --all: all branches | |
# --prune: delete local branches that were deleted on the remote | |
# git branch -vvv | grep main: show the offset of commits between local and remote's `main` branch | |
# git branch -vvv | grep $(git branch --show-current): show the offset of commits between local and remote's branch, that is checked-out. | |
# git rebase --autostash origin/main: rebase the (commits of the) current branch on top of the `main` branch | |
git fetch --all --prune && git branch -vvv | grep main && git branch -vvv | grep $(git branch --show-current) && git rebase --autostash origin/main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# bitbucket changes keys on 20. Juni 2023. See: https://bitbucket.org/blog/ssh-host-key-changes | |
# check if the bitbucket ssh key is already in place | |
if [[ $(ssh [email protected] host_key_info | grep -c ybgmFkzwOSotHTHLJgHO0QN8L0xErw6vd0VhFA9m3SM) -eq 1 ]]; then | |
printf 'key is already correctly in place'; | |
else | |
# if the bitbucket ssh key is not in place, then add it | |
ssh-keygen -R bitbucket.org && curl https://bitbucket.org/site/ssh >> ~/.ssh/known_hosts | |
if [[ $(ssh [email protected] host_key_info | grep -c ybgmFkzwOSotHTHLJgHO0QN8L0xErw6vd0VhFA9m3SM) -eq 1 ]]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
file_blob = "0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAAAAAAAAAABAAAAJwAAAAAAAAAAEAAAKQAAAAEAAAD+////AAAAACYAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////spcEAkwAJBAAA8BK/AAAAAAABEAAAAAAACAAACwgAAA4AYmpiapJ7knsAAAAAAAAAAAAAAAAAAAAAAAAJCBYALg4AAPAR6V/wEelfCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//w8AAAAAAAAAAAD//w8AAAAAAAAAAAD//w8AAAAAAAAAAAAAAAAAAAAAALcAAAAAADwHAAAAAAAAPAcAAM4UAAAAAAAAzhQAAAAAAADOFAAAAAAAAM4UAAAAAAAAzhQAABQAAAAAAAAAAAAAAP////8AAAAA4hQAAAAAAADiFAAAAAAAAOIUAAA |