Skip to content

Instantly share code, notes, and snippets.

@githubfoam
githubfoam / RDMA Cheat Sheet
Last active November 16, 2022 20:01
RDMA Cheat Sheet
RDMA verification
This work assumes there are two nodes to run iscsi target/initiator environment.
--------------------------------------------------------------------------------------------------------
Load the RDMA drivers using the following command line
/etc/init.d/openibd start
If one is using the InfiniBand transport and he doesn't have a managed switch in the subnet, he has to start the Subnet Manager (SM). Doing this in one of the machines in the subnet is enough, this can be done with the following command line
/etc/init.d/opensmd start
--------------------------------------------------------------------------------------------------------
Verify that traffic is working
@githubfoam
githubfoam / vagrant command Cheat Sheet
Last active October 25, 2023 07:00
vagrant command Cheat Sheet
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
# change Vagrant's default directory where it creates VMs, Windows 11
Set the VAGRANT_HOME environment variable: This is the recommended way to change the default directory, as it is supported by all Vagrant providers. To set the VAGRANT_HOME environment variable, open a terminal and enter the following command
PowerShell
> Set-Item -Path Env:VAGRANT_HOME -Value "D:\tempo"
> Get-ChildItem Env:
VAGRANT_HOME D:\tempo
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
vagrant up vg-mrtg-03 --debug-timestamp #debug vagrant
@githubfoam
githubfoam / Gluster Cheat Sheet
Last active January 15, 2024 20:23
Gluster Cheat Sheet
Brick –> is basic storage (directory) on a server in the trusted storage pool.
Volume –> is a logical collection of bricks.
Cluster –> is a group of linked computers, working together as a single computer.
Distributed File System –> A filesystem in which the data is spread across the multiple storage nodes and allows the clients to access it over a network.
Client –> is a machine which mounts the volume.
Server –> is a machine where the actual file system is hosted in which the data will be stored.
Replicate –> Making multiple copies of data to achieve high redundancy.
Fuse –> is a loadable kernel module that lets non-privileged users create their own file systems without editing kernel code.
glusterd –> is a daemon that runs on all servers in the trusted storage pool.
RAID –> Redundant Array of Inexpensive Disks (RAID) is a technology that provides increased storage reliability through redundancy
@githubfoam
githubfoam / Vi Vim Cheat Sheet
Last active June 7, 2023 08:45
Vi Cheat Sheet
----------------------------------------------------------------------------------------------------
Vi stands for Visual,Vim stands for Vi IMproved.
----------------------------------------------------------------------------------------------------
Type o (lower case) to insert, or open, a blank line below the current line.
Type O (upper case) to insert a blank line above the current line
----------------------------------------------------------------------------------------------------
copy is called yank (y)
cut is called delete (d)
paste is called put (p)
----------------------------------------------------------------------------------------------------
@githubfoam
githubfoam / VagrantFile Cheat Sheet
Last active March 31, 2023 07:16
VagrantFile Cheat Sheet
------------------------------------------------------------------------------------------
# Use VBoxManage to customize the VM.
openstack.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--ioapic", "on"] # turn on I/O APIC
vb.customize ["modifyvm", :id, "--cpus", "#{$cpus}"] # set number of vcpus
vb.customize ["modifyvm", :id, "--memory", "#{$memory}"] # set amount of memory allocated vm memory
vb.customize ["modifyvm", :id, "--ostype", "Ubuntu_64"] # set guest OS type
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] # enables DNS resolution from guest using host's DNS
vb.customize ["modifyvm", :id, "--nicpromisc3", "allow-all"] # turn on promiscuous mode on nic 3
@githubfoam
githubfoam / main.yml Cheat Sheet
Last active June 15, 2022 11:44
main.yml Cheat Sheet
--------------------------------------------------------------------------------------------------------------------
# =====LOCAL NOT REMOTE SSH==== ansible_connection=local
# operations center to remote control other hosts
[clients]
remotecontrol01 ansible_host=10.217.50.13 ansible_connection=local
[masters]
k8s-master01 ansible_host=10.217.50.10 ansible_connection=ssh ansible_ssh_private_key_file=/home/vagrant/.ssh/id_rsa ansible_user=vagrant
[workers]
-----------------------------------------------------------------------------------------------------
#disable public key authentication, connect as user root via ssh
sshuser@vg-ubuntu-01:~$ ssh root@vg-ubuntu-02 -o PubkeyAuthentication=no
-----------------------------------------------------------------------------------------------------
#connect with one private key
#access ec2-23-22-230-24.compute-1.amazonaws.com with a private key located in ~/.ssh/alice.pem
$ ssh -i ~/.ssh/alice.pem alice@ec2-23-22-230-24.compute-1.amazonaws.com
-----------------------------------------------------------------------------------------------------
$ cat ~/.ssh/config
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
============================================================================
$ 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
============================================================================
@githubfoam
githubfoam / VirtualBox Cheat Sheet
Last active April 24, 2024 10:11
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