This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #===================================================================== | |
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | |
| #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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -------------------------------------------------------------------------- | |
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -------------------------------------------------------------------------------------------------------------------- | |
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -------------------------------------------------------------------------- | |
| # 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 {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ---------------------------------------------------------------------------------------------------- | |
| #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 | |
| -------------------------------------------------------------------------------------------------------------------- |