Skip to content

Instantly share code, notes, and snippets.

@ikurni
ikurni / list-cf-source
Created January 28, 2021 10:22
Red Hat Cloudforms Source of Guidance
https://github.com/rhtconsulting/cfme-rhconsulting-scripts
https://pemcg.gitbooks.io/mastering-automation-in-cloudforms-4-2-and-manage/content/
https://www.manageiq.org/blog/
@ikurni
ikurni / debug-failed-to-run-pods
Created January 28, 2021 10:19
Debug Failed to run Pods
#To Debug/run pods without interrupted by Kubernetes Health check process, do :
oc debug dc/dc-name
#or
oc debug deplyoment/deployment-name
@ikurni
ikurni / run_container_as_root
Created January 11, 2021 14:51
Run Openshift Container as root
### To run Openshift container as root, need to do below command :
oc adm policy add-scc-to-user privileged -z default -n my-project-namespace
oc edit deployment/my-apps-deploy
### Find the securityContext line, and edit :
### securityContext:
### runAsUser: 0
@ikurni
ikurni / install-snx-checkpoint
Last active February 19, 2025 06:34
How to install SNX Checkpoint VPN client in Fedora 33
### Install few required packages to run SNX
sudo dnf install -y java-1.8.0-openjdk.x86_64 icedtea-web.x86_64 libstdc++.i686 libX11.i686 libpamtest.i686 libnsl.i686
### Download compat-libstdc++ driver and install it
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/compat-libstdc++-33-3.2.3-72.el7.i686.rpm
sudo dnf -y install compat-libstdc++-33-3.2.3-72.el7.i686.rpm
### Install snx_linux.sh
### Download snx_linux_30.sh file from Checkpoint
### Active URL : https://supportcenter.checkpoint.com/supportcenter/portal/user/anon/page/default.psml/media-type/html?action=portlets.DCFileAction&eventSubmit_doGetdcdetails&fileid=22824
@ikurni
ikurni / force-mcp-ocp-update
Created October 5, 2020 14:43
How to force openshift MCP to update machine config
### Create file called machine-config-daemon-force in /run ###
ssh [email protected] sudo touch /run/machine-config-daemon-force
### Edit node annotations ###
oc edit node <node-name>
### Check Annotations, change like below sample ###
machineconfiguration.openshift.io/currentConfig: rendered-worker-ab4a1e7216bf3da2a5203f09c871b456
machineconfiguration.openshift.io/desiredConfig: rendered-worker-ab4a1e7216bf3da2a5203f09c871b456
machineconfiguration.openshift.io/reason: ""
@ikurni
ikurni / deploy-minio-velero-for-migration
Last active September 30, 2020 14:26
Deploy Minio and Velero for Kubernetes Based Migration
### Get velero images ###
wget https://github.com/vmware-tanzu/velero/releases/download/v1.2.0/velero-v1.2.0-linux-amd64.tar.gz
tar -xvzf velero-v1.2.0-linux-amd64.tar.gz
cp velero-v1.2.0-linux-amd64/velero /usr/local/bin/
### Deploy Minio ###
oc apply -f /root/velero-v1.2.0-linux-amd64/examples/minio/00-minio-deployment.yaml
docker run -it --entrypoint=/bin/sh minio/mc
mc config host add s3 http://minio-service-ip:9000 (minio url) minio minio123
@ikurni
ikurni / Force-Project-Deletion-OCP
Created September 22, 2020 06:39
Force OCP Project Deletion if Stuck in Terminating
## Get namespace information on json format ###
oc get namespace <namespacename> -o json > tmp.json
### Edit file tmp.json, remove "kubernetes" on the finalizer section, left [] behind ###
vi tmp.json
### Save and Exit ###
### Run below command to hit API via proxy ###
oc proxy
@ikurni
ikurni / wget-gdrive
Created September 10, 2020 01:50
Use wget to download file from Google Drive
# First need to create share link from the file, and get the FILE ID from the sharing URL, example :
# https://drive.google.com/file/d/1xlsJtCx7EJXoxGn5SjCUIQ0DGJHsDs61/view?usp=sharing, then the FILE ID will be 1xlsJtCx7EJXoxGn5SjCUIQ0DGJHsDs61
# Run below command to download file, replace FILEID and FILENAME
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILEID' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=FILEID" -O FILENAME && rm -rf /tmp/cookies.txt
@ikurni
ikurni / EFK-mount-host-path
Created August 6, 2020 16:28
EFK mount host path
oc label node host1 logging-es-node=1
oc label node host2 logging-es-node=2
oc label node host3 logging-es-node=3
for dc in $(oc get deploymentconfig --selector component=es -o name); do \
oc scale $dc --replicas=0; \
done
@ikurni
ikurni / podman-issue-overlay
Created July 7, 2020 17:07
Podman Issue Overlay fs does not supported
##Got podman issue when run podman command :
##Error: could not get runtime: kernel does not support overlay fs: overlay: the backing xfs filesystem is formatted without d_type support, which leads to incorrect behavior. Reformat the filesystem with ftype=1 to enable d_type support. Running without d_type is not supported.: driver not supported
##Reinstall podman and containers-common does not work
##Edit /etc/containers/storage.conf
vi /etc/containers/storage.conf
##Find storage.options and make sure below line is in there
[storage.options]
mount_program = "/usr/bin/fuse-overlayfs"