Skip to content

Instantly share code, notes, and snippets.

@githubfoam
githubfoam / ansible cheat sheet
Last active June 2, 2023 13:15
ansible cheat sheet
----------------------------------------------------------------------------------------------------------------------
$ ansible --version
ansible 2.9.27
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/home/ansiadm/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/dist-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.17 (default, Mar 18 2022, 13:21:42) [GCC 7.5.0]
----------------------------------------------------------------------------------------------------------------------
#specify a different inventory file using the -i <path> option on the command line
@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 March 11, 2025 09:23
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 December 20, 2023 07:18
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 February 23, 2024 06:57
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 April 16, 2025 02:44
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 August 16, 2023 12:59
centos, centos stream, fedora experience
--------------------------------------------------------------------------------------------------------------------
#Bard, how to import a CA certificate on centos streams 8
Here are the steps on how to import a CA certificate on CentOS Streams 8 with examples:
Example 1: Importing a CA certificate from the Let's Encrypt website.
The Let's Encrypt website provides free CA certificates that can be used to secure websites. To import a CA certificate from the Let's Encrypt website, you can use the following steps:
Go to the Let's Encrypt website: https://letsencrypt.org/ and click on the "Download" button.