Skip to content

Instantly share code, notes, and snippets.

@githubfoam
githubfoam / iSER - iscsi Cheat Sheet
Last active October 14, 2022 14:09
iSER - iscsi Cheat Sheet
--------------------------------------------------------------------------
iscsi troubleshooting
--------------------------------------------------------------------------
View discovered targets
# iscsiadm -m node
12.212.84.7:3260,1 iqn.tgt-1
Identify the target transport is configured as iSER
# iscsiadm -m node -T iqn.tgt-1 | grep -i trans
iface.transport_name = iser
@githubfoam
githubfoam / freebsd cheat sheet
Last active February 28, 2019 12:33
freebsd cheat sheet
$ freebsd-version -k
11.1-RELEASE-p9
pkg update -y
pkg upgrade -y
pkg install -y wget bmake
Display the network traffic going through active interfaces on the system.
$ systat -ifstat
The iostat utility displays kernel I/O statistics on terminal, device and cpu operations.
@githubfoam
githubfoam / opensuse experience
Last active May 22, 2018 10:49
opensuse experience
zypper se --installed-only -> list all packages
zypper se -si virtualbox vbox kernel
sudo zypper pa -i --installed-only | grep nginx ->#check whether or not nginx is installed
zypper search mpv
zypper remove mpv -> remove package
zypper info cdcat
zypper info --requires cdcat
@githubfoam
githubfoam / kubernetes cheat sheet
Last active August 26, 2022 13:45
kubernetes cheat sheet
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#CIS_Kubernetes_V1.20_Benchmark_v1.0.0_PDF
#1.1.1 Ensure that the API server pod specification file permissions are set to 644 or more restrictive
Audit:
controlplane $ stat -c %a /etc/kubernetes/manifests/kube-apiserver.yaml
600
controlplane $ ls -lai /etc/kubernetes/manifests/kube-apiserver.yaml
788143 -rw------- 1 root root 3219 Feb 3 06:52 /etc/kubernetes/manifests/kube-apiserver.yaml
@githubfoam
githubfoam / test-kitchen cheat sheet
Last active December 30, 2018 21:37
test-kitchen cheat sheet
#1st method Install bundler,ruby,rbenv
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update -y
sudo apt-get install -y git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev
sudo apt-get install -y libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev nodejs yarn
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
@githubfoam
githubfoam / Dockerfile cheat sheet
Last active April 1, 2025 23:34
Dockerfile cheat sheet
#=====================================================================
To Apply the Cron Job in Docker:
1️⃣ Edit the cron file:
echo "10 * * * * root ansible-playbook -i /ansible/inventory-switches.ini /ansible/switch-version.yml >> /var/log/ansible-cron.log 2>&1" > /etc/cron.d/ansible-cron
2️⃣ Set permissions and reload cron:
chmod 0644 /etc/cron.d/ansible-cron
@githubfoam
githubfoam / SELinux cheat sheet
Last active August 12, 2021 23:05
SELinux cheat sheet
$ rpm -qa | grep selinux
libselinux-2.5-11.el7.x86_64
libselinux-python-2.5-11.el7.x86_64
selinux-policy-targeted-3.13.1-166.el7_4.9.noarch
libselinux-utils-2.5-11.el7.x86_64
selinux-policy-3.13.1-166.el7_4.9.noarch
yum install policycoreutils policycoreutils-python selinux-policy selinux-policy-targeted libselinux-utils setroubleshoot-server setools setools-console mcstrans
$ getenforce
@githubfoam
githubfoam / OpenStack experience
Created May 22, 2018 12:50
OpenStack experience
--------------------------------------------------------------------------
# All-in-one openstack run on single ubuntu-16.04 vagrant VM guest. min 6GB ram required.
vagrant up
E:\PURR\openstack3>vagrant ssh-config 33b9056
Host default
HostName 127.0.0.1
User vagrant
Port 2222
UserKnownHostsFile /dev/null
@githubfoam
githubfoam / python cheat sheet
Last active February 18, 2025 10:15
python cheat sheet
============================================================================
To create a Python virtual environment on Ubuntu 24.04 and ensure you can use pip3 and python3 commands inside it, follow these steps:
🐍 1. Install Python and Virtual Environment Tools
Open a terminal and run:
sudo apt update
sudo apt install -y python3 python3-venv python3-pip
🛠️ 2. Create a Virtual Environment
@githubfoam
githubfoam / atom cheat sheet
Last active August 12, 2021 23:05
atom cheat sheet
------------------------------------------------------------------------------------------
Problem:
The tip of your current branch is behind its remote counterpart. Try pulling before pushing again. Or, to force push, hold cmd or ctrl while clicking.
Fix:
C:\Users\verona\github\PROBLEMPROJECT>git status
C:\Users\verona\github\PROBLEMPROJECT>git pull
C:\Users\verona\github\PROBLEMPROJECT>git push (github login required)
------------------------------------------------------------------------------------------
AtomLinter