Skip to content

Instantly share code, notes, and snippets.

@githubfoam
githubfoam / docker command cheat sheet
Last active March 23, 2026 03:33
docker command cheat sheet
#=====================================================================
Docker Playground
https://www.katacoda.com/courses/docker/playground
Play with Docker
https://labs.play-with-docker.com/
#=====================================================================
/var/lib/docker/volumes/ #docker volumes stored in Docker host filesystem
/var/lib/docker #Docker daemon directory on Linux.
C:\ProgramData\docker #Docker daemon directory on Windows.
#=====================================================================
@githubfoam
githubfoam / packer command cheat sheet
Last active April 20, 2024 21:50
packer command cheat sheet
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
The ".hcl" file extension is used for HashiCorp Configuration Language (HCL) files, which are used to define infrastructure as code using HashiCorp tools such as Vagrant and Packer.
In the context of Vagrant, the "pkr.hcl" file is used to define how Packer builds machine images that can be used as base boxes for Vagrant. The "pkr.hcl" file specifies the builders (e.g. virtualization providers like VirtualBox, VMware), provisioners (e.g. shell scripts, Ansible, Chef), and post-processors (e.g. compressing the image, uploading to a cloud provider) that Packer should use to create the machine image
The "pkr.hcl" file can also include variables, which allow for more dynamic and flexible configuration. These variables can be set via the command line, a separate variables file, or even environment variables.
--------------------------
@githubfoam
githubfoam / Linux_Administrator_Daily_Tasks
Last active August 24, 2026 23:53
Linux_Administrator_Daily_Tasks
------------------------------------------------------------------------------------------
#CLI shortcut keystrokes(linux&MAC)
Ctrl+L: Clear the screen. This is similar to running the “clear” command.
Ctrl+C: Interrupt (kill) the current foreground process running in in the terminal. This sends the SIGINT signal to the process
Ctrl+Z: Suspend the current foreground process running in bash. This sends the SIGTSTP signal to the process. To return the process to the foreground later, use the fg process_name command.
Ctrl+D: Close the bash shell.This is similar to running the exit command
Ctrl+L: Clear the screen. This is similar to running the “clear” command.
Ctrl+S: Stop all output to the screen. This is particularly useful when running commands with a lot of long, verbose output, but you don’t want to stop the command itself with Ctrl+C.
Ctrl+Q: Resume output to the screen after stopping it with Ctrl+S.
@githubfoam
githubfoam / saltstack cheat sheet
Last active May 22, 2018 12:33
saltstack cheat sheet
SaltStack master operations
salt-key -L -> Showing all minions
salt-key -a <minion_id> -> Accepting an unaccepted minion
salt-key -A -> Accepting all unaccepted minions
salt-key -d <minion_id> -> Removing a minion
salt '*' state.sls nginx -> Running formula
salt '*' cmd.run 'ls -l /etc'
salt '*' pkg.install vim
@githubfoam
githubfoam / git command cheat sheet
Last active March 23, 2026 03:33
git command cheat sheet
---------------------------------------------------------------------------------------------------
#vscode 1.63.2
#remove deleted branches on github that still exist on vscode
Vscode-File-Preferences-Settings-Git-Git:Prune On Fetch #make VS Code run git fetch --prune when fetching remote refs
Vscode-Terminal
git fetch --prune #update/delete remote branch references
git fetch -p #update/delete remote branch references
git branch <branch-name> -D #delete the local branch (-D to force)
@githubfoam
githubfoam / singularity cheat sheet
Last active October 9, 2023 08:57
singularity cheat sheet
singularity selftest -> run a selftest
singularity --version -> verify installation
which singularity -> verify installation
sudo singularity build --sandbox /tmp/debian docker://debian:latest -> Build a base sandbox from DockerHub
sudo singularity exec /tmp/debian apt-get update -y -> Make changes to it
sudo singularity exec --writable /tmp/debian apt-get install git-> Make changes to it
sudo singularity build /tmp/mondebian.simg /tmp/debian -> Build your custom image
sudo singularity exec /tmp/mondebian.simg ls -> Browse your custom image
@githubfoam
githubfoam / ansible cheat sheet
Last active March 23, 2026 03:33
ansible cheat sheet
----------------------------------------------------------------------------------------------------------------------
Option 1 — Use full path in run_backup.sh
Find where Ansible is installed:
docker exec -it ansible-netops which ansible-playbook
----------------------------------------------------------------------------------------------------------------------
$ ansible --version
ansible 2.9.27
@githubfoam
githubfoam / VirtualBox Cheat Sheet
Last active March 23, 2026 03:31
VirtualBox Cheat Sheet
==========================================================================================================
# 8. VBoxManage
https://www.virtualbox.org/manual/
==========================================================================================================
# Networking Modes
https://www.virtualbox.org/manual/ch06.html#network_bridged
==========================================================================================================
Windows Host
>vboxmanage --version
============================================================================
$ ansible-galaxy --version
ansible-galaxy 2.4.2.0
============================================================================
ansible-galaxy install --roles-path . -r requirements.yml
ansible-galaxy --offline init role_name
============================================================================
ansible-galaxy install -r requirements.yml
ansible-playbook playbook.yml -i inventory
============================================================================
gpg --version
gpg (GnuPG) 2.0.22
eval $(gpg-agent --daemon) -> make sure gpg-agent is running
gpg-agent -> Check if gpg-agent is running
gpg --gen-key -> generate a GPG key pair
gpg --list-secret-keys --keyid-format LONG -> List public and private key GPG keys.
A private key is required for signing commits or tags.
gpg --delete-secret-keys 3AA5C34371567BD2 -> delete secret keys