Skip to content

Instantly share code, notes, and snippets.

View hemanth22's full-sized avatar

Hemanth B hemanth22

View GitHub Profile
@hemanth22
hemanth22 / HOWTO_mailx.sh
Created January 18, 2023 06:41 — forked from ppdeassis/HOWTO_mailx.sh
Setting up mailx to send mail from command line using external server
# ref: https://coderwall.com/p/ez1x2w/send-mail-like-a-boss
# install mailx
yum -y install mailx
# create a directory with a certificate, to send mail using TLS
mkdir ~/.certs
certutil -N -d ~/.cert
# create a user ~/.mailrc, to use custom settings
@hemanth22
hemanth22 / trigger_jenkins_job.py
Created January 15, 2023 10:24 — forked from prasvats/trigger_jenkins_job.py
Python Script to trigger a Jenkins job remotely
import jenkins
import time
# It comes with pip module python-jenkins
# use pip to install python-jenkins
# Jenkins Authentication URL
JENKINS_URL = "https://xxxx"
JENKINS_USERNAME = "xxxxx"
JENKINS_PASSWORD = "xxxxxxx"
@hemanth22
hemanth22 / startstop.sh
Created December 18, 2022 14:04 — forked from justinemter/startstop.sh
Simple script to start / stop a python script in the background.
#!/bin/bash
# file: startstop.sh
#----
# Simple script to start / stop a python script in the background.
#----
#----
# To Use:
@hemanth22
hemanth22 / xavier-lxc-centos7.md
Created December 4, 2022 13:14 — forked from fwyzard/xavier-lxc-centos7.md
Install CentOS 7 in an LXC/LXD container on an NVIDIA Xavier

Install and configure LXD

Install LXD

sudo snap install lxd

Perform the initial configuration

sudo lxd init
@hemanth22
hemanth22 / ctr-commands.txt
Created October 12, 2022 10:28 — forked from rafzei/ctr-commands.txt
ctr commands
# List images in k8s
ctr --namespace k8s.io image list
# Create etcd snapshot
ctr --namespace k8s.io \
run \
--mount type=bind,src={{ backup_temp_dir.path }}/,dst=/backup/,options=rbind:rw \
--net-host \
--env ETCDCTL_API=3 \
--rm "{{ etcd_image_name.stdout | trim }}" \
@hemanth22
hemanth22 / crictl-commands.txt
Created October 12, 2022 10:28 — forked from rafzei/crictl-commands.txt
crictl commands
# crictl documentation: https://kubernetes.io/docs/tasks/debug-application-cluster/crictl/
# Runtime endpoints:
sudo crictl --runtime-endpoint unix:///run/containerd/containerd.sock
sudo crictl --runtime-endpoint unix:///var/run/dockershim.sock
sudo crictl --runtime-endpoint unix:///run/crio/crio.sock
## Containers
# Get all containers
name: AKS Deployment
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
AZURE_CONTAINER_REGISTRY: "repo.azurecr.io"
# Logs in to the Azure Container Registry
- uses: Azure/docker-login@v1
with:
login-server: ${{ env.AZURE_CONTAINER_REGISTRY }}
username: ${{ secrets.ACR_USERNAME }}
password: ${{ secrets.ACR_PASSWORD }}
# Build and push image to Azure Container Registry
- name: Build and push image to Azure Container Registry
run: |
#!/usr/bin/env bash
# Versoin one
oc get $(oc api-resources --namspaced=true | tail -n+2 | awk '{ print $1 }' | xargs | sed -e 's/\s/,/g')
# Version two (from https://access.redhat.com/solutions/4165791)
oc api-resources --verbs=list --namespaced -o name | xargs -n 1 oc get --show-kind --ignore-not-found -n $PROJECT_NAME
@hemanth22
hemanth22 / retrieved-deployment-basic-ocp-demo.yaml
Created July 16, 2022 13:07 — forked from FreedomBen/retrieved-deployment-basic-ocp-demo.yaml
Deployment read back from OpenShift API with `oc get deployment basic-ocp-demo -o yaml`
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: "1"
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"apps/v1","kind":"Deployment","metadata":{"annotations":{},"labels":{"app":"basic-ocp-demo"},"name":"basic-ocp-demo","namespace":"basic-ocp-demo-project"},"spec":{"replicas":1,"selector":{"matchLabels":{"app":"basic-ocp-demo"}},"template":{"metadata":{"labels":{"app":"basic-ocp-demo"}},"spec":{"containers":[{"env":[{"name":"BASIC_OCP_DEMO_ENV","value":"master"}],"image":"quay.io/freedomben/basic-ocp-demo:latest","imagePullPolicy":"Always","name":"basic-ocp-demo","ports":[{"containerPort":4567,"protocol":"TCP"}],"readinessProbe":{"httpGet":{"path":"/healthz","port":4567,"scheme":"HTTP"},"initialDelaySeconds":5,"periodSeconds":1}}]}}}}
creationTimestamp: "2021-01-08T02:09:21Z"
generation: 1
labels: