Skip to content

Instantly share code, notes, and snippets.

@ikurni
ikurni / install-snx-checkpoint
Last active December 12, 2023 14:42
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 core@hostname.local 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"
@ikurni
ikurni / velero-openshift-migration
Last active July 7, 2020 15:59
Use Velero for Openshift 3 to Openshift 4 Migration
##Download Velero from Source repo :
wget https://github.com/vmware-tanzu/velero/releases/download/v1.4.0/velero-v1.4.0-linux-amd64.tar.gz
##Pull required image from docker.io
podman pull docker.io/minio/mc
podman pull docker.io/minio/minio
podman pull docker.io/velero/velero:v1.4.0
podman pull docker.io/velero/velero-plugin-for-aws:v1.0.0
##Push all images to docker-registry.default.svc:5000 (internal docker registry)
@ikurni
ikurni / ntp-local-server
Last active July 7, 2020 15:41
Configure NTP server without access to internet
##Edit /etc/ntp.conf
vi /etc/ntp.conf
##Add below line to set local server as the NTP server in the server section
---
restrict 10.10.10.0 mask 255.255.255.0 nomodify notrap
server 127.127.1.0
fudge 127.127.1.0 stratum 10
---
@ikurni
ikurni / govc-test-create-vmdk
Last active July 7, 2020 15:46
GOVC Command to Test Create Disk
##Environment variable
export GOVC_URL=vcenter01.example.com
export GOVC_USERNAME=admnin01@test.example.com
export GOVC_PASSWORD=password
export GOVC_INSECURE=true
##Govc command to create vmdk file in datastore
govc datastore.disk.create -size 1G -ds=DatastoreName folder/disk1.vmdk