Skip to content

Instantly share code, notes, and snippets.

@githubfoam
githubfoam / ansible cheat sheet
Last active August 14, 2025 10:56
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 / 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 / git command cheat sheet
Last active July 7, 2023 07:59
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 / 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 / Linux_Administrator_Daily_Tasks
Last active July 25, 2025 14:15
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 / 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 / docker command cheat sheet
Last active August 15, 2025 13:41
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 / ubuntu debian experience
Last active September 12, 2025 07:55
ubuntu experience
----------------------------------------------------------------------------------------------------
#shortcuts ubuntu desktop mate
type to search - keyboard shortcuts
ctrl+alt+d minimize/maximize all windows
alt+F9 - minimize windows
ctrl+alt+l - lock screen
--------------------------------------------------------------------------------------------------------------------
#vmware workstation user authentication easy install bug, skip it
--------------------------------------------------------------------------------------------------------------------
@githubfoam
githubfoam / Mellanox OFED cheat sheet
Last active September 4, 2025 21:49
Mellanox OFED cheat sheet
--------------------------------------------------------------------------
# ofed_info -s
--------------------------------------------------------------------------
Find Mellanox Adapter Type and Firmware/Driver version
ConnectX-4 card
# lspci | grep Mellanox
0a:00.0 Network controller: Mellanox Technologies MT27500 Family [ConnectX-3]
# lspci -vv -s 0a:00.0 | grep "Part number" -A 3
# lspci | grep Mellanox | awk '{print $1}' | xargs -i -r mstvpd {}
@githubfoam
githubfoam / centos, centos stream, fedora experience
Last active September 11, 2025 06:09
centos, centos stream, fedora experience
--------------------------------------------------------------------------------------------------------------------
you are root and you allow existing user to connect passwordless
passwordless ssh
sudo su - alice
mkdir -p ~/.ssh && chmod 700 ~/.ssh
nano ~/.ssh/authorized_keys # paste the single public-key line, save/exit
chmod 600 ~/.ssh/authorized_keys
exit