Skip to content

Instantly share code, notes, and snippets.

View amaddio's full-sized avatar

Antonio amaddio

View GitHub Profile
---
- 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
@amaddio
amaddio / fetch.sh
Created October 19, 2023 09:15
Rebase the (currently checked out) feature branch on top of the latest tip of the remote main branch
# 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
# 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 git@bitbucket.org 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 git@bitbucket.org host_key_info | grep -c ybgmFkzwOSotHTHLJgHO0QN8L0xErw6vd0VhFA9m3SM) -eq 1 ]]; then
@amaddio
amaddio / write_file_blob_to_disk.py
Created October 15, 2022 19:58
Write encoded byte string to disk
file_blob = "0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAAAAAAAAAABAAAAJwAAAAAAAAAAEAAAKQAAAAEAAAD+////AAAAACYAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////spcEAkwAJBAAA8BK/AAAAAAABEAAAAAAACAAACwgAAA4AYmpiapJ7knsAAAAAAAAAAAAAAAAAAAAAAAAJCBYALg4AAPAR6V/wEelfCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//w8AAAAAAAAAAAD//w8AAAAAAAAAAAD//w8AAAAAAAAAAAAAAAAAAAAAALcAAAAAADwHAAAAAAAAPAcAAM4UAAAAAAAAzhQAAAAAAADOFAAAAAAAAM4UAAAAAAAAzhQAABQAAAAAAAAAAAAAAP////8AAAAA4hQAAAAAAADiFAAAAAAAAOIUAAA