Skip to content

Instantly share code, notes, and snippets.

View suresh-sendinblue's full-sized avatar

Suresh Mahawar suresh-sendinblue

View GitHub Profile
kubectl run postgresql-client --image=jbergknoff/postgresql-client --command -- sleep infinity
#!/bin/bash
curl -L https://github.com/derailed/k9s/releases/download/v0.21.4/k9s_Linux_x86_64.tar.gz -o k9s
tar -xf k9s
chmod +x k9s
mv ./k9s /usr/local/bin/k9s
k9s
const dns = require('dns')
client_id=parseInt(process.argv[2] || 'xxxxxx')
function callMe() {
const strToExec = 'emailing.' + client_id + '.connectionstring.v2.production.cache.sib.';
dns.resolveTxt(strToExec, (error, stdout) => {
stdout = stdout && stdout[0] && stdout[0][0]
if (error || !stdout) {
#!/usr/bin/env bash
NS=$1
QUERIES=$2
CMD=$3
command -v bc > /dev/null || { echo "error: bc was not found. Please install bc."; exit 1; }
{ command -v drill > /dev/null && dig=drill; } || { command -v dig > /dev/null && dig=dig; } || { echo "error: dig was not found. Please install dnsutils."; exit 1; }
#!/bin/bash
set -x
kubeserver=$1
KUBECONFIG=$2
SA_TOKEN=$3
client_domain=$4
if (test -f $KUBECONFIG && ! test -f $SA_TOKEN); then
#!/bin/bash
set -x
kubeserver=$1
KUBECONFIG=$2
manifest_url=$3
if test -f $KUBECONFIG; then
if curl -s --insecure --connect-timeout 10 $kubeserver > /dev/null; then
echo "$KUBESERVER is able to connect";
#!/bin/bash
set -x
if [ -x "$(command -v kubectl)" ]; then
echo 'kubectl is already installed.';
else
curl -s -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl";
curl -s -LO "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl.sha256";
if [ -x "$(command -v sha256sum)"]; then

RKE2 commands

Install

curl -sL https://get.rke2.io | sh
systemctl daemon-reload
systemctl start rke2-server
#!/bin/bash
### Get ArgoCD token
curl -s --location -H "CF-Access-Client-Id: <xxxxxxxx>" -H "CF-Access-Client-Secret: <xxxxxxx>" -d $'{"username":"<xxxxx>","password":"<xxxxx>"}' https://argocd.example.com/api/v1/session
### Restart k8s resource
curl --location --request POST 'https://argocd.example.com/api/v1/applications/<application-name>/resource/actions?namespace=<app namespace>&resourceName=<resourse to restart>&version=v1&kind=<kind of the resource>&group=apps' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/x-www-form-urlencoded' \

Add alias command like below

alias my_info_command$argument1="bash $HOME/my_info_command.sh $argument1"

How to use command

my_info_command <argument1-value>